﻿function Orion(){
    this.requestHandler = '/tpv4/orion/RequestHandler.ashx';
    this.xPathPluginML = 'ORIONML/REQUEST/PLUGINML';
    this.holderContent = '#pluginContent';
    this.holderName = '#pluginName';
    this.template = '<?xml version="1.0" encoding="UTF-8"?><ORIONML version="1.0"><REQUEST plugin="' + this.holderName + '"><PLUGINML>' + this.holderContent + '</PLUGINML></REQUEST></ORIONML>'    
    
}

Orion.prototype.reqStr = function(pluginName, keepHolderContent){    
    var xml;
    if (keepHolderContent){
        xml = this.template;
    }else{
        xml = this.template.replace(this.holderContent, '', 'g');
    }    
    return xml.replace(this.holderName, pluginName);
}


//REGION the plugins used in the portal 
//TODO: (list not complete...)
Orion.prototype.reqStrAdressPlugin = function(keepHolderContent){
    return this.reqStr('AddressPlugin', keepHolderContent);
}
Orion.prototype.reqStrRoutePlugin = function(keepHolderContent){
    return this.reqStr('RoutePlugin', keepHolderContent);
}
//ENDREGION 










