obide.Subscription=function(a){this.parseXML(a)};obide.Subscription.prototype.parseXML=function(p){var m=p;this.version=m.getAttribute("version");this.ibotRef=m.getAttribute("ibotRef");var o=obips.XMLDOM.selectSingleNode(p,"//saw:contentsource",saw.delivers.namespaceMap);var f=null;if(o){f=o.getAttribute("path")}if(obids.Utils.objectExists(f)){var g=obips.catalog.Catalog.getSingleton();var d=g.readObject(f,true,null,null);this.reportXML=obips.XMLDOM.parseXML(d.data)}var a=obips.XMLDOM.selectSingleNode(m,"saw:conditionsubscription",saw.delivers.namespaceMap);var j=obips.XMLDOM.selectSingleNode(a,"saw:conditionsource",saw.delivers.namespaceMap);if(j){this.conditionSource=j.getAttribute("path");this.conditionName=j.getAttribute("conditionname");var l=obips.XMLDOM.selectSingleNode(a,"saw:filterOverrides",saw.delivers.namespaceMap);if(l){var c=new Array();this.conditionFilters=new obids.PromptedFiltersEditor.Model(c);this.conditionFilters.parseXML(l,this.reportXML)}}var e=new Array();var k=new Array();var n=obips.XMLDOM.selectSingleNode(m,"saw:contentsubscription",saw.delivers.namespaceMap);var b=obips.XMLDOM.selectSingleNode(n,"saw:useconditionsubscription",saw.delivers.namespaceMap);this.contentUseSameValuesAsCondition=b!=null;var h=obips.XMLDOM.selectSingleNode(n,"saw:contentsource",saw.delivers.namespaceMap);if(h){this.contentSource=h.getAttribute("path");var i=obips.XMLDOM.selectSingleNode(n,"saw:filterOverrides",saw.delivers.namespaceMap);if(i){var c=new Array();this.contentFilters=new obids.PromptedFiltersEditor.Model(c);this.contentFilters.parseXML(i,this.reportXML)}}};obide.Subscription.prototype.toXML=function(){xmlStr='<?xml version="1.0" encoding="UTF-8"?>'+obips.XMLDOM.getXMLString(this.toDOM());return xmlStr};obide.Subscription.prototype.toDOM=function(){var h=obips.XMLDOM.createXMLDom();var a=XUICreateElement(saw.xml.kSawNamespace,"subscription");XUISetAttributeString(a,"version",this.version);XUISetAttributeString(a,"ibotRef",this.ibotRef);h.appendChild(a);var f=XUICreateElement(saw.xml.kSawNamespace,"conditionsubscription");a.appendChild(f);if(this.conditionSource){var e=XUICreateElement(saw.xml.kSawNamespace,"conditionsource");f.appendChild(e);XUISetAttributeString(e,"path",this.conditionSource);XUISetAttributeString(e,"conditionname",this.conditionName)}if(this.conditionParameters){f.appendChild(this.conditionParameters.getXMLForParameters())}else{if(this.conditionFilters){f.appendChild(this.conditionFilters.toDOM())}}var d=XUICreateElement(saw.xml.kSawNamespace,"contentsubscription");a.appendChild(d);if(this.contentUseSameValuesAsCondition){var c=XUICreateElement(saw.xml.kSawNamespace,"useconditionsubscription");d.appendChild(c)}if(this.contentSource){var b=XUICreateElement(saw.xml.kSawNamespace,"contentsource");d.appendChild(b);XUISetAttributeString(b,"path",this.contentSource)}if(this.contentUseSameValuesAsCondition){if(this.conditionParameters){var g=this.conditionParameters.getXMLForAssign();if(g){d.appendChild(g)}}else{if(this.conditionFilters){d.appendChild(this.conditionFilters.toDOM())}}}else{if(this.contentParameters){var g=this.contentParameters.getXMLForAssign();if(g){d.appendChild(g)}}else{if(this.contentFilters){d.appendChild(this.contentFilters.toDOM())}}}return h};obide.Subscription.prototype.hasCustomizableElements=function(){return this.hasCustomizableConditionElements()||this.hasCustomizableContentElements()};obide.Subscription.prototype.hasCustomizableConditionElements=function(){return(this.conditionParameters&&this.conditionParameters.ParameterDocuments.length>0)||(this.conditionFilters&&this.conditionFilters.ParameterDocuments.length>0)};obide.Subscription.prototype.hasCustomizableContentElements=function(){return(this.contentParameters&&this.contentParameters.ParameterDocuments.length>0)||(this.contentFilters&&this.contentFilters.ParameterDocuments.length>0)};