if(!window.SelectionRightClickOptForView_1){window.SelectionRightClickOptForView_1=1;HierarchyStepRClickEditor=function(b,a,c,d){this.eid=b;this.report=a;this.criteriaElement=a.getCriteria().getXML();this.selectionsModel=new SelectionsModel(this.criteriaElement,this.report);this.currentColumn=c;this.viewID=d};HierarchyStepRClickEditor.prototype.prepareStep=function(e,b){this.currentSelection=this.currentColumn.selectSingleNode("saw:dimensionSelection");if(!this.currentSelection){this.selectionsModel.getInfoAndCreateSelection(this.currentColumn);this.currentSelection=this.currentColumn.selectSingleNode("saw:dimensionSelection");this.isInitial=true}this.selection=this.currentSelection;var a=this.currentSelection.selectNodes("saw:selectionStep");var d=this.selectedStep;if(!d){d=XUIAppendNewElement(this.selection,saw.xml.kSawNamespace,"selectionStep");var c=SelectionsModel.generateNextStepId(this.selection);d.setAttribute("stepID",c)}if(e=="add"){d.setAttribute("type","add")}else{if(e=="keep"){d.setAttribute("type","keep")}else{if(e=="remove"){d.setAttribute("type","remove")}else{d.setAttribute("type","replace")}}}d.setAttribute("category","hierarchyRelation");this.column=this.selection.parentNode;this.columnInfo=obips.ReportMetadata.GetInstance().getColumnInfoByID(this.column.getAttribute("columnID"));return d};HierarchyStepRClickEditor.prototype.notifyView=function(){var a=new obips.SelectionsEvent.EventContext(this.currentColumn,null,null);obips.AnalysisEventManager.raiseEvent(new obips.SelectionsEvent(obips.SelectionsEvent.ADD_STEP_EVENT,a,true,this.viewID))};HierarchyStepRClickEditor.prototype.applyFamilyRelation=function(c,e,o,g,l,a){var k=this.prepareStep(c,g);var h=XUICreateElement(saw.xml.kSawNamespace,"relationship");h.setAttribute("type",l);if(a){h.setAttribute("includeSelectedMembers","true")}for(var f=0;f<e.length;++f){var n=e[f];var b=XUIAppendNewElement(k,saw.xml.kSawNamespace,"stepMembers");XUISetXsiType(b,saw.xml.kSawNamespace,"staticMemberGroupDef");var m=XUIAppendNewElement(b,saw.xml.kSawNamespace,"staticMemberGroup");m.appendChild(h.cloneNode(true));b=XUIAppendNewElement(m,saw.xml.kSawNamespace,"hierarchyMembers");for(var d in n){SelectionsModel.createStepMemberNode(this.column,b,o,n[d],false,this.columnInfo)}}this.updateColumnInfoFromStep(k,e);this.notifyView()};HierarchyStepRClickEditor.prototype.updateColumnInfoFromStep=function(a,c){var b=this.column.getAttribute("subjectArea");b=b?b:SelectionsModel.instance.criteriaElement.getAttribute("subjectArea");SelectionsModel.updateColumnInfoFromHierarchyStep(a,c,b,this.column.getAttribute("dimensionID"),this.column.getAttribute("tableName"),this.column.getAttribute("hierarchyID"))};HierarchyStepRClickEditor.prototype.applyLevelRelation=function(b,d,f,m){var h=this.prepareStep(b,f);var g=XUICreateElement(saw.xml.kSawNamespace,"relationship");var l=XUIAppendNewElement(g,saw.xml.kSawNamespace,"hierarchyLevels");for(var e=0;e<m.length;++e){var k=XUIAppendNewElement(l,saw.xml.kSawNamespace,"hierarchyLevel");k.setAttribute("levelID",m[e].name)}var p=true;for(var e=0;e<d.length;++e){var o=d[e];var a=XUIAppendNewElement(h,saw.xml.kSawNamespace,"stepMembers");XUISetXsiType(a,saw.xml.kSawNamespace,"staticMemberGroupDef");var n=XUIAppendNewElement(a,saw.xml.kSawNamespace,"staticMemberGroup");n.appendChild(g.cloneNode(true));a=XUIAppendNewElement(n,saw.xml.kSawNamespace,"hierarchyMembers");for(var c in o){SelectionsModel.createStepMemberNode(this.column,a,p,o[c],false,this.columnInfo)}}this.updateColumnInfoFromStep(h,d);this.notifyView()};HierarchyStepRClickEditor.prototype.applySelectAllMembersAtLevels=function(c,e,k){var f=this.prepareStep(c,e);var b=XUIAppendNewElement(f,saw.xml.kSawNamespace,"stepMembers");XUISetXsiType(b,saw.xml.kSawNamespace,"staticMemberGroupDef");var m=XUIAppendNewElement(b,saw.xml.kSawNamespace,"staticMemberGroup");var h=XUIAppendNewElement(m,saw.xml.kSawNamespace,"hierarchyMembers");for(var d=0;d<k.length;++d){var a=k[d];var j=XUIAppendNewElement(h,saw.xml.kSawNamespace,"hierarchyLevelMembers");var g=XUIAppendNewElement(j,saw.xml.kSawNamespace,"hierarchyLevel");g.setAttribute("levelID",a.name);var l=XUIAppendNewElement(j,saw.xml.kSawNamespace,"members");XUISetXsiType(l,saw.xml.kSawNamespace,SelectionsModel.getXSITypeForDataType("special"));var n=XUIAppendNewElement(l,saw.xml.kSawNamespace,"value");if(SelectionsModel.isSkippedHierarchy(this.columnInfo)||SelectionsModel.isSkippedAndRaggedHierarchy(this.columnInfo)){n.setAttribute("specialValue",SelectionsModel.SEL_STEP_WITH_EVERY_MEMBERS)}else{n.setAttribute("specialValue",SelectionsModel.SEL_STEP_WITH_ALL_MEMBERS)}}this.updateColumnInfoFromStep(f);this.notifyView()}};