C_ModelTree.js 27 KB

123456
  1. // Licensed Materials - Property of IBM
  2. // IBM Cognos Products: cchl
  3. // (C) Copyright IBM Corp. 2003, 2016.
  4. // US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  5. function C_ModelTree(_c221, _cFX, _cCB1, _cGX, _c97, _cY2, _cES, _cMJ, _cH71){this._c621=_c221;this._c621.F_AddModelLoadedListener(this);this._cDB1=_cCB1;this._cHX=Boolean(_cGX);this._cFS=Boolean(_cES);this._cNJ=_cMJ||false;this._cF71=_cH71;this._c5=null;var _c5B1=G_ResManager.F_GetResource(_cGX?"CCHL_PackageTree_MultiSelect":"CCHL_PackageTree_SingleSelect");this._cQ71=new C_TreeView(_cFX, _c5B1, _cCB1);this._cQ71.F_ShowMessage(G_ResManager.F_GetString("IDS_CCHL_METADATA_NOT_AVAILABLE"));this._cA7=_c97;this._cX2=_cY2;C_ModelTree._cR71.push(this);if(!this._cFS){this.F_DrawModelTree();}};C_ModelTree._cR71=[];C_ModelTree.prototype.F_Detach=function(){C_ModelTree._cR71.F_RemoveItem(this);this._cQ71.F_Detach();this._c621.F_RemoveModelLoadedListener(this);};C_ModelTree.prototype.F_ModelCache_OnCacheCleared=function(_c221){this._cQ71.F_ShowMessage(G_ResManager.F_GetString("IDS_CCHL_METADATA_NOT_AVAILABLE"));};C_ModelTree.prototype.F_ModelCache_OnModelRootLoaded=function(_c221){if(this._cFS){this._cQ71.F_Clear();this._cQ71.F_Draw();}else{this.F_DrawModelTreeAsync();}if(this._cDB1.F_ModelTree_OnModelLoaded){this._cDB1.F_ModelTree_OnModelLoaded(this);}};C_ModelTree.prototype.F_ModelCache_OnSharedSetsChanged=function(_c221){var _c5B1=this._cQ71.F_GetTreeViewNode();var _c01=_c5B1.selectSingleNode("//treeNode[@nodeName='sharedSetsFolder']");if(!_c01){_c01=this._c03();if(_c01){this.F_DrawModelTree();}return;}var _cIX=(_c01.getAttribute( "expanded" )=="true"); if(_cIX){this._cQ71.F_CollapseNode(_c01);this._cQ71.F_DrawNode(_c01);this._cQ71.F_ExpandNode(_c01);}else{this._cQ71.F_DrawNode(_c01);}};C_ModelTree.prototype.F_SetPackageTreeSettings=function(_c97){this._cA7=_c97;this.F_DrawModelTreeAsync();};C_ModelTree.prototype.F_SetMemberDisplayCountLimit=function(_cSO1){this._cX2=_cSO1;};C_ModelTree.prototype._cOJ=function(){return this._cA7 ||(this._c621.F_IsMultiDimensionalSource()?C_ModelTree._cK:C_ModelTree._cB);};C_ModelTree.prototype.F_DrawModelTreeAsync=function(){setTimeout(this.F_DrawModelTree.bind(this), 0);};C_ModelTree.prototype.F_DrawModelTree=function(){this._cKH1(true, null, null, null, false);};C_ModelTree.prototype.F_SetModelPath=function(_cH71){this._cF71=_cH71;};C_ModelTree.F_SetTreeSettings=function(_cC,_cL){if(_cC){this._cB=_cC;}if(_cL){this._cK=_cL;}this.F_DrawAllModelTreesAsync();};C_ModelTree.F_DrawAllModelTreesAsync=function(){var _cFK1=this._cR71.length;for(var i=0;i<_cFK1;i++){var _cS71=this._cR71[i];if(!_cS71._cFS){_cS71.F_DrawModelTreeAsync();}}};C_ModelTree.prototype.F_Search=function(_cOC1,_cQQ1,_c1X,_c0X){this._cKH1(false, _cOC1, _cQQ1, _c1X, _c0X);};C_ModelTree.prototype.F_IsMembersTree=function(){return this._cOJ().F_GetValue(C_PackageTreeSettings.K_iMembersTree);};C_ModelTree.prototype.F_ExpandNode=function(_c4B1){this.F_AbortRequest();this._cQ71.F_ExpandNode(_c4B1);};C_ModelTree.prototype.F_FetchChildren=function(_c6B1,_c4B1){var _cGS=this._cOJ();var _cOC1=_c4B1.getAttribute("nodeName");if((_cOC1=="hierarchy")&&_cGS.F_GetValue(C_PackageTreeSettings.K_iGenericTree)&&!_cGS.F_GetValue(C_PackageTreeSettings.K_iLevels)&&_cGS.F_GetValue(C_PackageTreeSettings.K_iMembers)){return this._c09(_c4B1);}else if(_cGS.F_GetValue(C_PackageTreeSettings.K_iMembersTree)&&(_cOC1=="hierarchy")&&( _c4B1.getAttribute( "multiRoot" )=="1" ||_c4B1.getAttribute( "rootMUN" )==="" ) ){return this._c09(_c4B1);}else if((_cOC1=="level")&&_cGS.F_GetValue(C_PackageTreeSettings.K_iGenericTree)&&!_cGS.F_GetValue(C_PackageTreeSettings.K_iMemberProperties)&&_cGS.F_GetValue(C_PackageTreeSettings.K_iLevelMembers)){return this._c09(_c4B1);}else if ((_c4B1.getAttribute( "idsLabel" )=="IDS_LBL_MEMBERS" ) ||(_cOC1=="member")){return this._c09(_c4B1);}else if(_cOC1=="sharedSetsFolder"){return this._cR4(_c4B1);}else if(_cOC1=="sharedSetsReport"){return this._c11(_c4B1);}else{return this._cHS(_c4B1);}};C_ModelTree.prototype.F_GetTreeView=function(){return this._cQ71;};C_ModelTree.prototype.F_GetPackageRef=function(){var n=this._cQ71.F_GetTreeViewNode().selectSingleNode("treeNode[@nodeName='modelPackage']/@_ref");return n?n.value:null;};C_ModelTree.prototype.F_AbortRequest=function(){if(!this._cHG){this._cHG=true;if(this._cLH1){this._cLH1.F_Abort();delete this._cLH1;}this._cQ71.F_EndAsyncLoad(false);if(!this._cPC1){this._cQ71.F_ShowMessage(G_ResManager.F_GetString("IDS_CCHL_REQUEST_CANCELLED"));}}};C_ModelTree.prototype._cKH1=function(_cT71,_cOC1,_c921,_cZA,_c0X){this.F_AbortRequest();var _cFX=this._cQ71.F_GetContainer();_cFX.scrollTop=0;this._cQ71.F_Clear();if(this._c621.F_IsCacheDrawable()){if(_cT71){this._cQC1();}else{this._cQ71.F_StartAsyncLoad();this._cQ71.F_GetTreeViewNode().setAttribute("_path", _c921);this._cQ71.F_GetTreeViewNode().setAttribute("nodeName", _cOC1);if(_cOC1=="dimension_measure"){this._cFN(_c921, _c0X, _cZA);}else{this._cPC1=null;this._cIS(_c921, _c0X, _cZA);}}if(this._cDB1&&this._cDB1.F_SetupSourceToolbar){this._cDB1.F_SetupSourceToolbar();}}};C_ModelTree.prototype._cQC1=function(){this._cPC1=null;var _cIG=this._c621.F_GetModelRootResponses();if(!_cIG){this._cQ71.F_ShowMessage(G_ResManager.F_GetString("IDS_CCHL_METADATA_NOT_AVAILABLE"));return;}var _cGS=this._cOJ();if(_cGS.F_GetValue(C_PackageTreeSettings.K_iGenericTree)){var _cFK1=_cIG.length;for(var i=0;i<_cFK1;i++){var _cPJ=null;if (typeof this._cF71==="undefined"||this._cF71===null||this._c621.F_ExtractPackagePathFromModelPath( this._cF71 )===this._c621.F_ExtractPackagePathFromModelPath( _cIG[i].getAttribute("modelPath") )) {_cPJ=_cIG[i];}if(_cPJ){var _cP5=this._c621.F_ExtractDataFromResponses(_cPJ, C_ModelRootRequest.K_eResponse_MetadataRoot);this._cQJ(_cP5, "*");if(this._cB7(_cP5, _cPJ.getAttribute('modelPath'))){this._c03();this._cQ71.F_Draw();if(!G_CCHL.M_bAllowRelationalDataSources){this._cS();}}else{this._cQ71.F_ShowMessage(G_ResManager.F_GetString("IDS_METADATA_INVALID"));}}}}else{var _cFK1=_cIG.length;for(var i=0;i<_cFK1;i++){var _cPJ=null;if (typeof this._cF71==="undefined"||this._cF71===null||this._c621.F_ExtractPackagePathFromModelPath( this._cF71 )===this._c621.F_ExtractPackagePathFromModelPath( _cIG[i].getAttribute("modelPath") )) {_cPJ=_cIG[i];} if(_cPJ){var _cP5=this._c621.F_ExtractDataFromResponses(_cIG[i], C_ModelRootRequest.K_eResponse_MemberTreeMetadata);if(!_cPJ.getAttribute("failed")){this._c19(_cP5);this._c03();}else{this._cB7(_cP5, _cPJ.getAttribute('modelPath'));}this._cQ71.F_Draw();this._cS(); }}}};C_ModelTree.prototype._c03=function(){if(this._cNJ&&this.F_IsMultiDimensionalSource()&&this._c621.F_CurrentModelHasSharedSetReports()){var _cRJ=this._cQ71.F_GetTreeViewNode();var _cSJ=this._c621.F_GetSharedSetsReportRootForCurrentPackage();return this._cP3(_cSJ, _cRJ);}else{return null;}};C_ModelTree.prototype._cR4=function(_c4B1){var _cHR1=this._c621.F_GetSharedSetsReportRootForCurrentPackage();this._c13(_cHR1, _c4B1);return false;};C_ModelTree.prototype._c13=function(_cHR1,_cRJ){var nl=_cHR1.selectNodes( "sharedSetsReports | sharedSetsReport | sharedSet" );var _cFK1=nl.length;for(var i=0;i<_cFK1;i++){var n=nl.item(i);var _c4B1=this._cP3(n, _cRJ);this._c13(n, _c4B1);}if(_cHR1.nodeName=="sharedSets"&&_cRJ.getAttribute("nodeName")=="sharedSetsReport"){var _cAD=_cHR1.parentNode;if(_cAD&&_cAD.nodeName=="sharedSetsReport"){var _c29=U_XML.F_GetNodeText(_cAD.selectSingleNode("reportPath"));if(_c29&&_cRJ.getAttribute("reportPath")!=_c29){_cRJ.setAttribute("reportPath", _c29);_cRJ.setAttribute("tooltip", _c29);}var _cFH1=_cAD.getAttribute("storeID");if(_cFH1&&_cRJ.getAttribute("storeID")!=_cFH1){_cRJ.setAttribute("_cFH1", _cFH1);}var _c39=U_XML.F_GetNodeText(_cAD.selectSingleNode("reportName"));if(_c39&&_cRJ.getAttribute("name")!=_c39){_cRJ.setAttribute("name", _c39);_cRJ.setAttribute( "label", _cRJ.getAttribute( "name" ) );}}}return _cFK1;}; C_ModelTree.prototype._cP3=function(_cFL1,_cRJ){var n=U_XML.F_AppendChild(_cRJ, "treeNode");var _cOC1=_cFL1.nodeName;switch(_cOC1){case "sharedSetsReports":n.setAttribute( "nodeName", "sharedSetsFolder");n.setAttribute( "name", "sharedSetsFolder" );n.setAttribute( "idsLabel", "IDS_LBL_SHAREDSETS_FOLDER");n.setAttribute( "smallIcon", "hal/images/tv_folder.gif" ); n.setAttribute( "expandable", "true" );n.setAttribute( "tooltip", n.getAttribute( "name" ) );break;case "sharedSetsReport":n.setAttribute( "name", U_XML.F_GetNodeText( _cFL1.selectSingleNode( "reportName" ) ) );n.setAttribute( "label", n.getAttribute( "name" ) );n.setAttribute( "expandable", "true" );n.setAttribute( "smallIcon", "reportSharedSets.gif" );n.setAttribute( "reportPath", U_XML.F_GetNodeText( _cFL1.selectSingleNode( "reportPath" ) ) );n.setAttribute( "nodeName", "sharedSetsReport");n.setAttribute( "tooltip", n.getAttribute( "reportPath" ) );n.setAttribute( "storeID", _cFL1.getAttribute( "storeID" )||"");break;case "sharedSet":n.setAttribute( "name", _cFL1.getAttribute( "name" ) );n.setAttribute( "label", n.getAttribute( "name" ) );n.setAttribute( "expandable", "false" );n.setAttribute( "nodeName", "sharedSet");n.setAttribute( "smallIcon", "sharedSet.gif" );n.setAttribute( "description", _cFL1.getAttribute("description") );n.setAttribute( "tooltip", n.getAttribute( "description" ) );break;}return n; };C_ModelTree.prototype._cHS=function(_c4B1){this._cPC1=_c4B1;var _cQQ1=_c4B1.getAttribute("_path");var _cHR1=this._c621.F_GetChildren(_cQQ1);var _cJS=this._cJG(_c4B1);if(_cHR1){this._cB7(_cHR1, _cJS);return false;}var fn=( _c4B1.getAttribute( "nodeName" )=="level" )?C_LevelMetadataRequest:C_ChildrenMetadataRequest;var _cFG1=new fn(this._c621, this, _cQQ1, _cJS);this._cA21(_cFG1);return true;};C_ModelTree.prototype._c11=function(_c4B1){this._cPC1=_c4B1;var _cQQ1=_c4B1.getAttribute("reportPath");var _cFH1=_c4B1.getAttribute("storeID");var _cHR1=this._c621.F_GetSharedSetsForReport(_cQQ1, _cFH1); if(_cHR1){this._c13(_cHR1, _c4B1);return false; }var _cFG1=this._c621.F_CreateSharedSetsReportRequest(this, _cQQ1, _cFH1, this._c621);this._c5=_cFG1.constructor;this._cA21(_cFG1);return true;};C_ModelTree.prototype._cFN=function(_c921,_c0X,_cZA){this._cPC1=this._cQ71.F_GetTreeViewNode();var _cFG1=new C_MeasuresSearchRequest(this._c621, this, _c921, this._cX2+1, _c0X, _cZA);this._cA21(_cFG1);};C_ModelTree.prototype._c0B=function(_c4B1){var _cRT1=_c4B1.getAttribute("_ref");var _cJS=this._cJG(_c4B1);var _cHR1=this._c621.F_GetMembers(_cRT1, this._cX2+1);if(_cHR1){var _cTO1=this._cQ5(_cHR1);this._cQ71.F_EndAsyncLoad(_cTO1);this._cPC1=null;return false;}var _cFG1=new C_MembersRequest(this._c621, this, _cRT1, this._cX2+1, _cJS);this._cA21(_cFG1);return true;};C_ModelTree.prototype._cIS=function(_c921,_c0X,_cZA){var _cHR1=this._c621.F_GetSearchMembers(_c921, this._cX2+1, _c0X, _cZA);if(_cHR1){var _cTO1=this._cQ5(_cHR1);this._cQ71.F_EndAsyncLoad(_cTO1);if(!this._cQ71.F_GetTreeViewNode().selectSingleNode("treeNode")){this._cQ71.F_ShowMessage(G_ResManager.F_GetString("IDS_NO_MATCH_FOUND"));}this._cPC1=null;return false;}var _cFG1=new C_MembersSearchRequest(this._c621, this, _c921, this._cX2+1, _c0X, _cZA);this._cA21(_cFG1);};C_ModelTree.prototype._c09=function(_c4B1){this._cPC1=_c4B1;return this._c0B(_c4B1);};C_ModelTree.prototype._cA21=function(_cFG1){this._cHG=false;this._cLH1=_cFG1;this._cLH1.F_Send();};C_ModelTree.prototype.F_Request_OnComplete=function(_cFG1){this._cHG=true;var _cPN1=_cFG1.F_GetError();if(_cPN1){F_ShowError(_cPN1);this._cQ71.F_EndAsyncLoad(false);if(!this._cPC1){this._cQ71.F_ShowMessage(G_ResManager.F_GetString("IDS_METADATA_INVALID"));}}else{var _cTO1=false;switch(_cFG1.constructor){case C_MembersRequest:_cTO1=this._cQ5(_cFG1.F_GetMembersResponse());break;case C_MembersSearchRequest:_cTO1=this._cQ5(_cFG1.F_GetSearchResponse());break;case C_MeasuresSearchRequest:_cTO1=this._cB7(_cFG1.F_GetSearchResponse(), this._cJG(this._cPC1));break;default:if(this._c5&&_cFG1.constructor==this._c5){this._c13(_cFG1.F_GetSharedSetsResponse(), this._cPC1);this._c5=null;_cTO1=true;}else{_cTO1=this._cB7(_cFG1.F_GetMetadataResponse(), this._cJG(this._cPC1));}break;}this._cQ71.F_EndAsyncLoad(_cTO1);if(!_cTO1){this._cQ71.F_ShowMessage(G_ResManager.F_GetString("IDS_METADATA_INVALID"));}else{if((_cFG1.constructor==C_MembersSearchRequest)||(_cFG1.constructor==C_MeasuresSearchRequest)){if(!this._cQ71.F_GetTreeViewNode().selectSingleNode("treeNode")){this._cQ71.F_ShowMessage(G_ResManager.F_GetString("IDS_NO_MATCH_FOUND"));}}if((_cFG1.constructor==C_ModelRootRequest)&&this._cOJ().F_GetValue(C_PackageTreeSettings.K_iMembersTree)){this._cS();}}}if(this._cDB1.F_ModelTree_OnFetchChildrenComplete){this._cDB1.F_ModelTree_OnFetchChildrenComplete(this._cQ71, this._cPC1);}this._cPC1=null;};C_ModelTree.prototype.F_IsMultiDimensionalSource=function(){return this._c621.F_IsMultiDimensionalSource();};C_ModelTree.prototype._cS=function(){if(!this.F_IsMultiDimensionalSource()){this._cQ71.F_ShowMessage(G_ResManager.F_GetString("IDS_CCHL_METADATA_NOT_MULTI_DIM"));}};C_ModelTree.prototype._c19=function(_cW8){var _cTO1=false;var _cHR1=_cW8;var _cGS=this._cOJ();if(_cGS.F_GetValue(C_PackageTreeSettings.K_iMembersTree)){var nl=_cHR1.selectNodes( ".//dimension[hierarchy and not(hierarchy[2]) and not(hierarchyFolder)]" );var _cFK1=nl.length;for(var i=0;i<_cFK1;i++){var _cL71=nl.item(i);var _cGL1=_cL71.parentNode;var _cU71=U_XML.F_RemoveNodes(_cL71, "*");for(var j=0;j<_cU71.length;j++){_cGL1.insertBefore(_cU71.item(j), _cL71);}_cGL1.removeChild(_cL71);}}if(_cGS.F_GetValue(C_PackageTreeSettings.K_iMembersTree)){var d=_cHR1.ownerDocument;var nl=_cHR1.selectNodes(".//hierarchy[@multiRoot='0']");var _cFK1=nl.length;for(var i=0;i<_cFK1;i++){var _cJ71=nl.item(i);var _cKG=_cJ71.parentNode;var _c49=this._c621.F_GetMembers(_cJ71.getAttribute("_ref"), Number.POSITIVE_INFINITY);var _cB21=_c49?_c49.selectSingleNode("member"):null;if(_cB21){_cB21=U_XML.F_ImportNode(d, _cB21, false);_cB21.setAttribute( "name", _cJ71.getAttribute( "name" ) );_cKG.replaceChild(_cB21, _cJ71);}}}this._cQJ( _cHR1, ".//*[self::dimension[@type!='measure'] | self::hierarchy[@multiRoot='0'][not(@rootMUN='')] | self::hierarchyFolder | self::package | self::folder]" );_cTO1=this._cB7(_cHR1, _cHR1.selectSingleNode('modelSearchPath').getAttribute('value'));if(_cGS.F_GetValue(C_PackageTreeSettings.K_iMembersTree)){var _c5B1=this._cQ71.F_GetTreeViewNode();var nl=_c5B1.selectNodes( ".//treeNode[@nodeName='hierarchy' and (@multiRoot='1' or (@multiRoot='0' and @rootMUN=''))]" );var _cFK1=nl.length;for(var i=0;i<_cFK1;i++){var _c4B1=nl.item(i);_c4B1.setAttribute( "smallIcon", "hal/images/tv_folder.gif" );_c4B1.setAttribute( "expandedSmallIcon", "hal/images/tv_folder_expanded.gif" );_c4B1.setAttribute( "idsExtraAriaLabel", "IDS_HAL_AC_TYPE_FOLDER" );this._cQ71.F_UpdateNode(_c4B1);}var nl=_c5B1.selectNodes(".//treeNode[@nodeName='member']");var _cFK1=nl.length;for(var i=0;i<_cFK1;i++){var _c4B1=nl.item(i);_c4B1.setAttribute( "smallIcon", "member_root.gif" );_c4B1.setAttribute( "idsExtraAriaLabel", "IDS_CCHL_AC_TYPE_ROOT_MEMBER" );this._cQ71.F_UpdateNode(_c4B1);}}return _cTO1;};C_ModelTree.prototype._cQJ=function(n,_cUO1){U_XML.F_SetNodeAttributeValues( n.selectNodes( _cUO1 ), "MetadataPopulated", "true" );};C_ModelTree.prototype._cS4=function(d,_cRJ,_cFL1,_cLG){var _cGS=this._cOJ();var n=_cRJ.appendChild(d.createElement("treeNode"));n.setAttribute("modelPath", _cLG);var _cYQ1=_cFL1.getAttribute("name");if(_cYQ1){n.setAttribute("name", _cYQ1);n.setAttribute("label", _cYQ1);}U_XML.F_CopyAttributes( n, _cFL1, [ "_ref", "_path", "description" ] );var _cV71=_cFL1.getAttribute("screenTip");if(_cV71||_cYQ1){n.setAttribute( "tooltip", _cV71?( _cYQ1 + " - " + _cV71 ):_cYQ1 );}var _cOC1=_cFL1.nodeName;switch(_cOC1){case "member":U_XML.F_CopyAttributes( n, _cFL1, [ "dimensionUniqueName", "hierarchyUniqueName", "levelUniqueName", "levelNumber", "levelLabel", "memberCaption", "memberUniqueName", "parentUniqueName", "currencyCode" ] );if(!_cYQ1){var _cGN=_cFL1.getAttribute("memberCaption");var _cND=_cFL1.getAttribute("memberUniqueName");n.setAttribute("label", _cGN?_cGN:_cND);n.setAttribute("name", _cGN?_cGN:_cND);n.setAttribute("tooltip", _cND);}n.setAttribute("nodeName", _cOC1);n.setAttribute( "smallIcon", "member.gif" );n.setAttribute( "idsExtraAriaLabel", "IDS_CCHL_AC_TYPE_MEMBER" );n.setAttribute( "expandable", ( _cFL1.getAttribute( "hasChildren")=="false" )?"false":"true" );break;case "folder":case "measureFolder":case "queryItemFolder":case "hierarchyFolder":var _cJX=( _cFL1.getAttribute( "isNamespace" )=="1" )&&_cGS.F_GetValue( C_PackageTreeSettings.K_iGenericTree );n.setAttribute( "nodeName", "modelFolder" );var _cC21=_cFL1.getAttribute("datatype")=="multiset";var _c271="hal/images/tv_folder.gif";if(_cJX){_c271="namespace.gif";}if(_cC21){_c271="multiset.gif";}n.setAttribute("smallIcon", _c271);n.setAttribute( "idsExtraAriaLabel", _cJX?"IDS_CCHL_AC_TYPE_NAMESPACE":"IDS_HAL_AC_TYPE_FOLDER" );if(!_cJX&&!_cC21){n.setAttribute( "expandedSmallIcon", "hal/images/tv_folder_expanded.gif" );}n.setAttribute( "expandable", "true" );break;case "querySubject":U_XML.F_SetAttributeString( n, 'nodeName="modelSubject" smallIcon="metadata_entity.gif" idsExtraAriaLabel="IDS_CCHL_AC_TYPE_QUERY_SUBJECT" expandable="true"' );break;case "level":if(!_cGS.F_GetValue(C_PackageTreeSettings.K_iGenericTree)||!_cGS.F_GetValue(C_PackageTreeSettings.K_iLevels)){n.parentNode.removeChild(n);break;}n.setAttribute( "nodeName", "level" );n.setAttribute( "smallIcon", "level.gif" );n.setAttribute( "idsExtraAriaLabel", "IDS_CCHL_AC_TYPE_LEVEL" );if(_cGS.F_GetValue(C_PackageTreeSettings.K_iMemberProperties)||_cGS.F_GetValue(C_PackageTreeSettings.K_iLevelMembers)){n.setAttribute( "expandable", "true" );}if(_cGS.F_GetValue(C_PackageTreeSettings.K_iLevelMembers)&&_cGS.F_GetValue(C_PackageTreeSettings.K_iMemberProperties)){var _cMG=n.appendChild(d.createElement("treeNode"));U_XML.F_SetAttributeString( _cMG, 'idsLabel="IDS_LBL_MEMBERS" smallIcon="hal/images/tv_folder.gif" expandedSmallIcon="hal/images/tv_folder_expanded.gif" idsExtraAriaLabel="IDS_HAL_AC_TYPE_FOLDER" expandable="true" nodeName="levelMembersFolder"' );U_XML.F_CopyAttribute(_cMG, _cFL1, "_ref");U_XML.F_CopyAttribute(_cMG, _cFL1, "_path");if(_cYQ1){_cMG.setAttribute("name", _cYQ1);_cMG.setAttribute("label", _cYQ1);}U_XML.F_CopyAttribute(_cMG, _cFL1, "description");}break;case "dimension":var _cC7=( _cFL1.getAttribute( "type" )=="measure" );var _cIR1=_cC7?"dimension_measure":"dimension";n.setAttribute("nodeName", _cIR1);if(_cC7||_cGS.F_GetValue(C_PackageTreeSettings.K_iGenericTree)){n.setAttribute( "smallIcon", _cIR1 + ".gif" );n.setAttribute( "idsExtraAriaLabel", _cC7?"IDS_CCHL_AC_TYPE_MEASURE_DIM":"IDS_CCHL_AC_TYPE_DIMENSION" );}else{n.setAttribute( "smallIcon", "hal/images/tv_folder.gif" );n.setAttribute( "expandedSmallIcon", "hal/images/tv_folder_expanded.gif" );n.setAttribute( "idsExtraAriaLabel", "IDS_HAL_AC_TYPE_FOLDER" );}n.setAttribute( "expandable", "true" );break;case "hierarchy":n.setAttribute( "nodeName", "hierarchy" );n.setAttribute( "smallIcon", _cOC1 + ".gif" );n.setAttribute( "expandable", "true" );n.setAttribute( "idsExtraAriaLabel", "IDS_CCHL_AC_TYPE_HIERARCHY" );U_XML.F_CopyAttribute(n, _cFL1, "parentChild");U_XML.F_CopyAttribute(n, _cFL1, "multiRoot");U_XML.F_CopyAttribute(n, _cFL1, "rootMUN");if(_cGS.F_GetValue(C_PackageTreeSettings.K_iMembers)&&_cGS.F_GetValue(C_PackageTreeSettings.K_iLevels)){var _cMG=n.appendChild(d.createElement("treeNode"));_cMG.setAttribute("name", _cYQ1);_cMG.setAttribute("label", _cYQ1);_cMG.setAttribute( "_ref", _cFL1.getAttribute( "_ref" ) );_cMG.setAttribute( "_path", _cFL1.getAttribute( "_path" ) );U_XML.F_SetAttributeString( _cMG, 'idsLabel="IDS_LBL_MEMBERS" smallIcon="hal/images/tv_folder.gif" expandedSmallIcon="hal/images/tv_folder_expanded.gif" idsExtraAriaLabel="IDS_HAL_AC_TYPE_FOLDER" expandable="true" nodeName="membersFolder"' );U_XML.F_CopyAttribute(_cMG, _cFL1, "parentChild");U_XML.F_CopyAttribute(_cMG, _cFL1, "description");}break;case "measure":U_XML.F_SetAttributeString( n, 'nodeName="modelItem" smallIcon="fact.gif" isMeasure="true" isOLAPMeasure="true" idsExtraAriaLabel="IDS_CCHL_AC_TYPE_FACT"' );if(_cFL1.getAttribute( "isHierarchical" )=="1" ){n.setAttribute( "expandable", "true" );}U_XML.F_CopyAttribute(n, _cFL1, "currency");U_XML.F_CopyAttribute(n, _cFL1, "datatype");U_XML.F_CopyAttribute(n, _cFL1, "regularAggregate");var _cST1=n.parentNode;while (_cST1&&_cST1.getAttribute( "nodeName" ) != "dimension_measure"&&_cST1.nodeName != "treeView"){_cST1=_cST1.parentNode;}var _cZT1=_cST1.getAttribute("_ref");if(_cST1.nodeName=="treeView"){var _cYV1=_cFL1.selectSingleNode("ancestor::dimension");_cZT1=_cYV1?_cYV1.getAttribute( "_ref" ):_cST1.getAttribute("_path");}n.setAttribute("DUN", _cZT1);break;case "queryItem":case "calculation":var _cGL1=n.parentNode;var _cTJ=_cGL1.getAttribute("nodeName");var _cQ3=this._c6(n);var _cR3=_cQ3&&_cQ3.getAttribute("nodeName"); if(_cR3=="level"&&!_cGS.F_GetValue(C_PackageTreeSettings.K_iMemberProperties)){n.parentNode.removeChild(n);break;}var _cHN=(_cOC1=="calculation");n.setAttribute( "nodeName", "modelItem" );if(_cQ3){n.setAttribute( "nodeName", "memberProperty" );var _cD21=_cQ3.getAttribute("name");n.setAttribute("parentName", _cD21);n.setAttribute("parentLabel", _cD21);if(_cR3=="level"){n.setAttribute( "LUN", _cQ3.getAttribute( "_ref" ) );n.setAttribute( "HUN", _cQ3.parentNode.getAttribute( "_ref" ) );}else{n.setAttribute( "HUN", _cQ3.getAttribute( "_ref" ) );}}switch(_cFL1.getAttribute("usage")){case "identifier":n.setAttribute( "smallIcon", _cHN?"calculation_identifier.gif":"queryItem_identifier.gif" );n.setAttribute( "idsExtraAriaLabel", _cHN?"IDS_CCHL_AC_TYPE_CALC":"IDS_CCHL_AC_TYPE_QUERY_ITEM" );break;case "fact":n.setAttribute( "smallIcon", _cHN?"calculation_fact.gif":"queryItem_fact.gif" );n.setAttribute( "idsExtraAriaLabel", _cHN?"IDS_CCHL_AC_TYPE_CALC_FACT":"IDS_CCHL_AC_TYPE_FACT" );n.setAttribute( "isMeasure", "true" );n.setAttribute( "isOLAPMeasure", "false" );var _cJR1=_cFL1.getAttribute("regularAggregate");switch(_cJR1){case "sum":_cJR1="total";break;case "min":_cJR1="minimum";break;case "max":_cJR1="maximum";break;case "avg":_cJR1="average";break;case "count":case "calculated":case "countDistinct":case "standardDeviation":case "variance":case "median":case "automatic":break;default:_cJR1="";break;}if(_cJR1){n.setAttribute("modelAggregate", _cJR1);}break;default:n.setAttribute( "smallIcon", _cHN?"calculation_attribute.gif":"metadata_attribute.gif" );n.setAttribute( "idsExtraAriaLabel", _cHN?"IDS_CCHL_AC_TYPE_CALC_ATTR":"IDS_CCHL_AC_TYPE_ATTR" );break;}if(_cHN){var _cRC1=_cFL1.getAttribute("calcType");switch(_cRC1){case "namedSet":n.setAttribute( "nodeName", "namedSet" );n.setAttribute( "smallIcon", "calcType_" + _cRC1 + ".gif" );n.setAttribute( "idsExtraAriaLabel", "IDS_CCHL_AC_TYPE_NAMEDSET" );U_XML.F_CopyAttributes( n, _cFL1, [ "hierarchies", "dimensions" ] );break;case "macros":n.setAttribute( "smallIcon", "calcType_" + _cRC1 + ".gif" );n.setAttribute( "idsExtraAriaLabel", "IDS_CCHL_AC_TYPE_MACROS" );break;}}U_XML.F_CopyAttributes( n, _cFL1, [ "currency", "usage", "datatype", "displayType", "unSortable", "promptType", "promptDisplayItemRef", "promptUseItemRef", "promptFilterItemRef", "promptCascadeOnRef", "regularAggregate", "calcType" ] );break;case "filter":U_XML.F_SetAttributeString( n, 'nodeName="modelFilter" smallIcon="filter.gif" idsExtraAriaLabel="IDS_CCHL_AC_TYPE_FILTER"' );break;case "package":if(_cFL1.getAttribute('failed')){n.setAttribute( "modelPath", _cFL1.getAttribute("modelPath") );n.setAttribute( "label", _cFL1.getAttribute("modelName") );n.setAttribute( "smallIcon", "hal/images/icon_warning.gif" ); n.setAttribute( "expandable", "false" );n.setAttribute( "failed", "true");n.setAttribute("tooltip", _cFL1.getAttribute('msg'));break;}var _cHL1=_cFL1.parentNode.selectSingleNode("folder");n.setAttribute( "_path", _cHL1.getAttribute( "_path" ) );n.setAttribute( "_ref", _cHL1.getAttribute( "_ref" ) );n.removeAttribute("tooltip");U_XML.F_SetAttributeString( n, 'nodeName="modelPackage" smallIcon="modelConnection.gif" expandedSmallIcon="modelConnection.gif" idsExtraAriaLabel="IDS_CCHL_AC_TYPE_PACKAGE" expandable="true" expanded="true"' );break;}return n;};C_ModelTree.prototype._c6=function(_c4B1){return _c4B1.selectSingleNode("ancestor::treeNode[@nodeName='level' or @nodeName='hierarchy'][1]");};C_ModelTree.prototype._cB7=function(_c7B1,_cH71){var _cRJ=this._cPC1;if(!_cRJ){var _cFL1=_c7B1.selectSingleNode("package");var _cSC1=_c7B1.selectNodes("folder");if(!_cFL1||(_cSC1.length!=1)){return false;}var _c5B1=this._cQ71.F_GetTreeViewNode();_cRJ=this._cS4(_c5B1.ownerDocument, _c5B1, _cFL1, _cH71);}var _cHR1=_c7B1.selectSingleNode( "folder | hierarchyFolder | measureFolder | measure | querySubject | queryItemFolder | dimension | hierarchy | level" );if(!_cHR1){return false;}this._cS3(_cHR1, _cRJ);return true;};C_ModelTree.prototype._cS3=function(_cFL1,_cRJ){var nl=_cFL1.selectNodes( "folder | hierarchyFolder | measureFolder | measure | queryItemFolder | querySubject | queryItem | filter | calculation | dimension | hierarchy | level | member" );var d=_cRJ.ownerDocument;var _cFK1=nl.length;for(var i=0;i<_cFK1;i++){var n=nl.item(i);var _c4B1=this._cS4(d, _cRJ, n, this._cJG(_cRJ));this._cS3(n, _c4B1, true);}if(_cFL1.getAttribute( "MetadataPopulated" )=="true" ){_cRJ.setAttribute( "static", "true" );}return _cFK1;};C_ModelTree.prototype._cJG=function(_c4B1){if(_c4B1.getAttribute('modelPath')){return _c4B1.getAttribute('modelPath');}else if(_c4B1.selectSingleNode("ancestor-or-self::node()[@modelPath]")){return _c4B1.selectSingleNode("ancestor-or-self::node()[@modelPath]").getAttribute('modelPath');}return this._c621.F_GetModelPath();};C_ModelTree.prototype._cQ5=function(_cHR1){if(!_cHR1){return false;}var _c4B1=this._cPC1;if(!_c4B1){_c4B1=this._cQ71.F_GetTreeViewNode();}var nl=_cHR1.selectNodes("member");var d=_c4B1.ownerDocument;var _cFK1=nl.length;if(_cFK1>0){var _cIL1=(_cFK1>=this._cX2+1);if(_cIL1){_cFK1--;}for(var i=0;i<_cFK1;i++){var _cFL1=nl.item(i);if(_cFL1.nodeName=="member"){this._cS4(d, _c4B1, _cFL1, this._cJG(_c4B1));}}if(_cIL1){var n=_c4B1.appendChild(d.createElement("treeNode"));n.setAttribute( "expandable", "false" );var _cE21=_c4B1;while(_cE21&&!_cE21.getAttribute("_path")){_cE21=_cE21.parentNode;}U_XML.F_SetAttributeString( n, 'idsLabel="IDS_MI_POPUP_METADATA_SEARCH" smallIcon="hal/images/btn_search.gif" classPrefix="clsTreeNode_hyperlink" forceHover="true" forceSelection="true"' );U_XML.F_CopyAttribute(n, _cE21, "_path");U_XML.F_CopyAttribute(n, _cE21, "nodeName");}}return true;};function C_PackageTreeSettings(_cGN1){this._cTC1=_cGN1.split(",");};C_PackageTreeSettings.K_iMembersTree=0;C_PackageTreeSettings.K_iGenericTree=1;C_PackageTreeSettings.K_iDimensions=2;C_PackageTreeSettings.K_iHierarchies=3;C_PackageTreeSettings.K_iMembers=4;C_PackageTreeSettings.K_iLevels=5;C_PackageTreeSettings.K_iLevelMembers=6;C_PackageTreeSettings.K_iMemberProperties=7;C_PackageTreeSettings.prototype.F_GetValue=function(i){return(this._cTC1[i]=="1");};C_PackageTreeSettings.prototype.F_SetValue=function(i,b){this._cTC1[i]=(b?"1":"0");};C_PackageTreeSettings.prototype.F_ToString=function(){return this._cTC1.join(",");};