obids.PromptedFilterDocument=function(e,c,h,a,g,f,d,b){obids.PromptedFilterDocument.baseConstructor.call(this,e,c,h,a,g,f,d);this.operator=b};extend(obids.PromptedFilterDocument,obids.ParameterDocument);obids.PromptedFilterDocument.prototype.parseReportXML=function(e,d){this.operator=e.getAttribute("op");this.valueFixed="false";this.hide="false";this.parentFixed="false";this.parentHidden="false";this.order=-1;var c=obips.XMLDOM.selectNodes(e,"sawx:expr",saw.delivers.namespaceMap);var b=obips.MetadataUtil.getFilterColumnExpr(e);var a=XUIGetElementText(b);this.parseFilterExpressionXML(c,d,a)};obids.PromptedFilterDocument.prototype.parseXML=function(d,f){this.valueFixed=d.getAttribute("fixed")||"false";this.hide=d.getAttribute("hidden")||"false";this.operator=d.getAttribute("op");this.name=d.getAttribute("column");this.parameterType=d.getAttribute("datatype");this.order=-1;this.prompt=this.name;this.parentFixed=d.getAttribute("parentFixed")||"false";this.parentHidden=d.getAttribute("parentHidden")||"false";for(var b=0;b<saw.getChildElementsLength(d);b++){var a=saw.getChildElementByIndex(d,b);var e=XUIGetElementText(a);var c=null;switch(a.nodeName){case"saw:value":c=new obids.ParameterValue(e,obids.ParameterDocument.ParameterType.VALUE);break;case"saw:session":c=new obids.ParameterValue(e,obids.ParameterDocument.ParameterType.SESSION);break;case"saw:repository":c=new obids.ParameterValue(e,obids.ParameterDocument.ParameterType.REPOSITORY);break}this.parameterValues.push(c)}};obids.PromptedFilterDocument.prototype.parseFilterExpressionXML=function(k,n,c){var l=new Array();if(n){l=obips.XMLDOM.selectNodes(n,"//saw:columnHeading",saw.delivers.namespaceMap)}var a=new Array();for(var g=0;g<l.length;g++){var s=l[g];var p=obips.XMLDOM.selectSingleNode(s,"saw:caption/saw:text",saw.delivers.namespaceMap);var r=XUIGetElementText(p);var f=s.parentNode;var m=obips.XMLDOM.selectSingleNode(f,"saw:columnFormula/sawx:expr",saw.delivers.namespaceMap);if(m){var b=XUIGetElementText(m);if(r.length==0){r=b}a[b]=r}}this.name=c;this.prompt=a[this.name];if(this.prompt==null){this.prompt=this.name}for(var h=0;h<k.length;h++){var d=k[h];if((d.getAttribute("xsi:type")!="sawx:sqlExpression")&&(d.getAttribute("xsi:type")!="sawx:columnExpression")){this.xsdType=d.getAttribute("xsi:type");this.parameterType=this.xsdType;if(this.parameterType.indexOf(":")!=-1){this.parameterType=this.parameterType.split(":").pop()}var o=saw.xml.getInnerText(d);var e=obids.ParameterDocument.ParameterType.VALUE;if(this.parameterType==obids.ParameterDataType.DATE){e=obids.ParameterDocument.ParameterType.DATE}else{if(this.parameterType==obids.ParameterDataType.DATETIME){e=obids.ParameterDocument.ParameterType.DATETIME}else{if(this.parameterType==obids.ParameterDataType.TIME){e=obids.ParameterDocument.ParameterType.TIME}}}var q=new obids.ParameterValue(o,e);this.parameterValues.push(q)}}};obids.PromptedFilterDocument.prototype.toDOM=function(){var b=XUICreateElement(saw.xml.kSawNamespace,"filterOverride");XUISetAttributeString(b,"fixed",this.valueFixed);XUISetAttributeString(b,"hidden",this.hide);XUISetAttributeString(b,"parentFixed",this.parentFixed);XUISetAttributeString(b,"parentHidden",this.parentHidden);XUISetAttributeString(b,"op",this.operator);XUISetAttributeString(b,"column",this.name);XUISetAttributeString(b,"datatype",this.parameterType);for(var c=0;c<this.parameterValues.length;c++){var d=this.parameterValues[c];if(d!=null){var a;if((d.valueMapping==obids.ParameterDocument.ParameterType.SESSION)||(d.valueMapping==obids.ParameterDocument.ParameterType.REPOSITORY)){a=XUICreateElement(saw.xml.kSawNamespace,d.valueMapping)}else{a=XUICreateElement(saw.xml.kSawNamespace,obids.ParameterDocument.ParameterType.VALUE)}if(this.operator=="top"||this.operator=="bottom"){XUISetAttributeString(a,"type",obids.ParameterDataType.BIGINT)}else{XUISetAttributeString(a,"type",this.parameterType)}XUISetElementText(a,d.value);b.appendChild(a)}}return b};obids.PromptedFilterDocument.prototype.getOpType=function(a){if(a=="in"||a=="notIn"||a=="containsAny"||a=="containsAll"||a=="notContains"||a=="like"||a=="notLike"||a=="beginsWith"||a=="endsWith"){return"sawx:list"}else{if(a=="equal"||a=="notEqual"||a=="between"||a=="null"||a=="notNull"||a=="less"||a=="greater"||a=="lessOrEqual"||a=="greaterOrEqual"){return"sawx:comparison"}else{if(a=="top"||a=="bottom"){return"sawx:rank"}else{if(a=="prompted"){return"sawx:special"}else{alert("PromptedFilterDocument: unknown op-"+a)}}}}};