if(typeof(gaugeviewXMLmodel_js)=="undefined"){gaugeviewXMLmodel_js=true;var ksChartTypeGauge="gauge";var ksGaugeSubTypeDefault="default";var ksGaugeTypeDial="dial";var ksGaugeTypeVertStatusMeter="filledBar";var ksGaugeTypeHorizStatusMeter="ledBar";var ksGaugeTypeBulb="bulb";var ksGaugeRows="rows";var ksGaugeColumns="columns";var ksGaugeData="data";var ksGaugeValueSelectors="valueSelectors";var ksGaugeSections="sections";var ksGaugeExcluded="excluded";DVTGaugeViewXMLModel=function(a,b){DVTGaugeViewXMLModel.baseConstructor.call(this,a,b)};saw.extend(DVTGaugeViewXMLModel,DVTBaseViewXMLModel);DVTGaugeViewXMLModel.prototype.addMeasureColumn=function(e,c){var d=obips.ResourceManager.getSingleton();var b="views/dvtchart/obips.dvtchart.xml";var f=this.getAxisForMeasureColumn(c);if(f!=null){if(!(this.getSubType()==ksGaugeSubTypeDefault||this.getSubType()==ksGaugeTypeDial)){var a=d.getResource(b,"kmsgDVTGaugeReplaceMeasure").getString();alert(a)}this.addColumnToEdgeForGauge(e,f)}return true};DVTGaugeViewXMLModel.prototype.getAxisForMeasureColumn=function(b){var a=ksGaugeData;return(a)};DVTGaugeViewXMLModel.prototype.addColumn=function(b,a){this.addColumnToEdgeForGauge(b,ksGaugeRows)};DVTGaugeViewXMLModel.prototype.addColumnToEdgeForGauge=function(b,j,h,c){var f=new Array();var a=null;if(c){switch(c){case ksGaugeColumns:a=this.getSeriesGeneratorInfos();break;case ksGaugeRows:a=this.getCategoryColumnInfos();break;case ksGaugeValueSelectors:a=this.getValueSelectorInfos();break;case ksGaugeSections:a=this.getSectionInfos();break;case ksGaugeExcluded:a=this.getExcludedColumnInfos();break;case ksGaugeData:a=this.getMeasureColumnInfos();break}if(a){var d="";for(var e=0;e<a.length;e++){if(a[e].id==b){d=a[e].table}if(d!=""){if(d==a[e].table){f.push(a[e].id)}else{break}}}}}else{f.push(b)}var g=false;for(var e=f.length-1;e>=0;e--){switch(j){case ksGaugeColumns:g=this.addLegendColumn(f[e],h)||g;break;case ksGaugeRows:g=this.addCategoryColumn(f[e],h)||g;break;case ksGaugeValueSelectors:g=this.addValueSelectorColumn(f[e],h)||g;break;case ksGaugeSections:g=this.addSectionColumn(f[e],h)||g;break;case ksGaugeExcluded:g=this.excludeColumn(f[e])||g;break;case ksGaugeData:g=this.addMeasureColumnGauge(f[e],h)||g;break}if(g){if(j!=ksGaugeData){this.removeGaugePointer(f[e])}}}return g};DVTGaugeViewXMLModel.prototype.removeGaugePointer=function(b){var d="saw:gaugeProperties/saw:gaugePointers/saw:gaugePointer/saw:columnRef[@columnID='"+b+"']";var a=this.reportElement.selectSingleNode(d);if(a){var c=a.parentNode;if(c){c.parentNode.removeChild(c)}}};DVTGaugeViewXMLModel.prototype.addMeasureColumnGauge=function(b,a){return this.addColumnToEdge(b,a,"measures","column")};DVTGaugeViewXMLModel.prototype.addColumnToEdge=function(a,w,u,r){var h=saw.xml.kSawNamespace.prefix+":"+u;var v=saw.xml.kSawNamespace.prefix+":"+r;var b=this.chartViewNode.selectSingleNode("saw:selections");if(u=="measures"){if(this.getType()==ksChartTypeGauge&&this.getSubType()!=ksGaugeSubTypeDefault&&this.getSubType()!=ksGaugeTypeDial){var k=this.chartViewNode.selectSingleNode("saw:selections/saw:measures");XUIRemoveAllChildren(k);w=-1}}var s=XUIForceSingleNode(b,saw.xml.kSawNamespace,u);var c=XUICreateElement(saw.xml.kSawNamespace,r);var x=XUIForceSingleNode(c,saw.xml.kSawNamespace,"columnRef");x.setAttribute("columnID",a);var e=this.getDrillStateElem(a);var j=this.getCustomMembersElem(a);var t=this.getSubType();if(u=="measures"&&t==ksGaugeTypeBulb){k=this.chartViewNode.selectSingleNode("saw:selections/saw:measures");XUIRemoveAllChildren(k)}var n=s.selectNodes(v);if((w!=null)&&(n!=null)&&(w<n.length)&&(w>=0)){var g=n[w];this.excludeColumn(a);if(g.firstChild.getAttribute("columnID")!=a){s.insertBefore(c,g)}else{s.appendChild(c)}}else{this.excludeColumn(a);var m=this.chartViewNode.selectSingleNode("saw:selections/"+h+"/"+saw.xml.kSawNamespace.prefix+":measureLabels");if(m){s.insertBefore(c,m)}else{s.appendChild(c)}}if(e!=null){c.appendChild(e)}if(j!=null){c.appendChild(j)}var f=this.chartViewNode.selectSingleNode("saw:gaugeProperties/saw:gaugePointers/saw:gaugePointer/saw:columnRef[@columnID='"+a+"']");if(f){var l=f.parentNode;l.parentNode.removeChild(l)}var d=this.getColumn(a);if(d&&d.isMeasure){var p=XUICreateElement(saw.xml.kSawNamespace,"gaugePointer");var q=XUIAppendNewElement(p,saw.xml.kSawNamespace,"pointerFormat");q.setAttribute("needleStyle","needle");var o=XUIAppendNewElement(p,saw.xml.kSawNamespace,"columnRef");o.setAttribute("columnID",a);var i=this.chartViewNode.selectSingleNode("saw:gaugeProperties/saw:gaugePointers");i.appendChild(p)}return true};DVTGaugeViewXMLModel.prototype.excludeColumn=function(b){var c=this.chartViewNode.selectSingleNode("saw:selections/*/*/saw:columnRef[@columnID='"+b+"']");if(!c){return false}var a=c.parentNode;a.parentNode.removeChild(a);return true};DVTGaugeViewXMLModel.prototype.isTooltipsEnabled=function(){return true}};