obids.FilterDocument=function(a){this.subjectArea=a};obids.FilterDocument.prototype.parseReportXML=function(c,a,e){this.promptedFilters=new Array();this.subjectArea=c.getAttribute("subjectArea");var b=obips.XMLDOM.selectNodes(c,"sawx:expr",saw.delivers.namespaceMap);for(ii=0;ii<b.length;ii++){var f=b[ii];var d=new obids.PromptedFilterDocument();d.subjectArea=this.subjectArea;d.parseReportXML(f,e);if(d.order==-1){d.order=a++}this.promptedFilters.push(d)}if(this.promptedFilters.length>0){this.checkColumnInfo()}return a};obids.FilterDocument.prototype.parseXML=function(c,a,e){this.promptedFilters=new Array();this.subjectArea=c.getAttribute("subjectArea");var b=obips.XMLDOM.selectNodes(c,"saw:filterOverride",saw.delivers.namespaceMap);for(ii=0;ii<b.length;ii++){var f=b[ii];var d=new obids.PromptedFilterDocument();d.subjectArea=this.subjectArea;d.parseXML(f,e);if(d.order==-1){d.order=a++}this.promptedFilters.push(d)}if(this.promptedFilters.length>0){this.checkColumnInfo()}return a};obids.FilterDocument.prototype.checkColumnInfo=function(){var e=XUICreateElement(saw.xml.kSawNamespace,"report");e.setAttribute("xmlns:xsi",saw.xml.kXsiNamespace.uri);e.setAttribute("xmlns:xsd",saw.xml.kXsdNamespace.uri);e.setAttribute("xmlns:sawx",saw.xml.kSawxNamespace.uri);var m=XUIAppendNewElement(e,saw.xml.kSawNamespace,"criteria");XUISetXsiType(m,saw.xml.kSawNamespace,"simpleCriteria");XUISetAttributeString(m,"subjectArea",this.subjectArea);var l=XUIAppendNewElement(m,saw.xml.kSawNamespace,"columns");for(var r=0;r<this.promptedFilters.length;r++){var d=XUIAppendNewElement(l,saw.xml.kSawNamespace,"column");d.setAttribute("xsi:type","saw:regularColumn");XUISetAttributeString(d,"columnID","c"+r);XUISetFormula(d,this.promptedFilters[r].name)}var t=new Array();t.formula=this.name;t.ReportXML=saw.getXmlText(e);var a=new obids.AjaxRequest("GetColumnInfoXML");a.getRequest().addArg("formula","lovCheck");a.getRequest().addArg("ReportXML",saw.getXmlText(e));var f=a.post();if(f){var c=obips.ReportMetadata.GetInstance(false);c.initFromObjects(f.selectSingleNode(".//sawmd:reportMetadata"));var h=c.getColumnInfos();for(var r=0;r<h.length;r++){var p=h[r];var b=p.getBaseFormula?p.getBaseFormula():"";var k=p.getSQLInfo?p.getSQLInfo().getAggRule():"none";bLOVRequired=(k=="none");var o=new XUICaptionParent(p.getDefaultTableHeading()).getCaptionText();var g=new XUICaptionParent(p.getDefaultColumnHeading()).getCaptionText();for(var q=0;q<this.promptedFilters.length;q++){if(this.promptedFilters[q].name==b){if(this.promptedFilters[q].parameterType==obids.ParameterDataType.DATE||this.promptedFilters[q].parameterType==obids.ParameterDataType.TIME||this.promptedFilters[q].parameterType==obids.ParameterDataType.DATETIME){this.promptedFilters[q].showLOV=false}else{this.promptedFilters[q].showLOV=bLOVRequired}if(this.promptedFilters[q].prompt==this.promptedFilters[q].name){var s="";var n="";if((this.promptedFilters[q].name.indexOf('"')==0)&&(this.promptedFilters[q].name.indexOf('".')>0)){s='"'+o+'"'}else{s=o}if((this.promptedFilters[q].name.indexOf('."')>0)&&(this.promptedFilters[q].name.lastIndexOf('"')==this.promptedFilters[q].name.length-1)){n='"'+g+'"'}else{n=g}this.promptedFilters[q].prompt=s+"."+n}}}}}};obids.FilterDocument.prototype.toDOM=function(){var a=XUICreateElement(saw.xml.kSawNamespace,"subjectArea");XUISetAttributeString(a,"xmlns:"+saw.xml.kSawNamespace.prefix,saw.xml.kSawNamespace.uri);XUISetAttributeString(a,"subjectArea",this.subjectArea);for(var b=0;b<this.promptedFilters.length;b++){var c=this.promptedFilters[b];a.appendChild(c.toDOM())}return a};