/****************************************************************
** Licensed Materials - Property of IBM
**
** IBM Cognos Products: mdsrv
**
** (C) Copyright IBM Corp. 2008, 2010
**
** US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
*****************************************************************/

if(!IMPORT_UTIL){
var IMPORT_UTIL={};
}
IMPORT_UTIL.KEYCODE_SPACEBAR=32;
IMPORT_UTIL.KEYCODE_ENTER=13;
function URLRequestInvoker(){
};
URLRequestInvoker.prototype.MakeAsyncRequestInIFrame=function(_1,_2){
var _3=document.getElementById("debuggingPane");
if(_3&&_3.style.display!="none"){
var _4="";
for(var p in _2){
_4+="<b>"+p+"</b> = "+_2[p]+"<br>\n";
}
_3.innerHTML="<u><b>URL</b></u>: &nbsp; "+_1+"<br><br>"+"<u><b>POST Data</b></u>: <pre>"+_4+"</pre>\n\n";
}
var _6=document.getElementById("communicationIFramePlaceholder");
if(!_6){
_6=document.createElement("div");
_6.setAttribute("id","communicationIFramePlaceholder");
document.body.appendChild(_6);
}
_6.innerHTML="<iframe id=\"communicationIFrame\" name=\"communicationIFrame\" title=\"communicationIFrame\"  width=\"1000\" height=\"200\" "+"frameborder=\"0\" style=\"display: none; margin-top: 50px; border: 1px dotted darkgray; \">\n"+"This browser does not support iframes!\n"+"</iframe>\n";
var _7=document.getElementById("communicationIFrame");
var _8=_7.contentWindow.document;
if(_8.body==null){
var _9=_8.createElement("body");
_8.appendChild(_9);
}
this.InvokeUrlThroughPostRequest(_1,_2,_8);
};
URLRequestInvoker.prototype.MakeAsyncRequestInIFrame2=function(_a,_b){
var _c=document.getElementById("debuggingPane");
if(_c&&_c.style.display!="none"){
var _d="";
for(var p in _b){
_d+="<b>"+p+"</b> = "+_b[p]+"<br>\n";
}
_c.innerHTML="<u><b>URL</b></u>: &nbsp; "+_a+"<br><br>"+"<u><b>POST Data</b></u>: <pre>"+_d+"</pre>\n\n";
}
var _f=document.getElementById("communicationIFramePlaceholder2");
if(!_f){
_f=document.createElement("div");
_f.setAttribute("id","communicationIFramePlaceholder2");
document.body.appendChild(_f);
}
_f.innerHTML="<iframe id=\"communicationIFrame2\" name=\"communicationIFrame\" title=\"communicationIFrame\"  width=\"1000\" height=\"200\" "+"frameborder=\"0\" style=\"display: none; margin-top: 50px; border: 1px dotted darkgray; \">\n"+"This browser does not support iframes!\n"+"</iframe>\n";
var _10=document.getElementById("communicationIFrame2");
var _11=_10.contentWindow.document;
if(_11.body==null){
var _12=_11.createElement("body");
_11.appendChild(_12);
}
this.InvokeUrlThroughPostRequest(_a,_b,_11);
};
URLRequestInvoker.prototype.InvokeUrlThroughPostRequest=function(url,_14,_15){
_15.write("<html><head><base href=\""+window.location+"\"></head><body></body></html>");
buildAndSubmitDynamicForm(_15,_15.body,url,_14);
};
function buildAndSubmitDynamicForm(_16,_17,url,_19){
var _1a=_16.createElement("form");
_1a.setAttribute("method","POST");
_1a.setAttribute("id","communicationForm");
_1a.setAttribute("name","communicationForm");
_1a.setAttribute("action",url);
for(var p in _19){
var _1c=_16.createElement("input");
_1c.setAttribute("type","hidden");
_1c.setAttribute("id",p);
_1c.setAttribute("name",p);
_1c.setAttribute("value",_19[p]);
_1a.appendChild(_1c);
}
var _1d=_17.appendChild(_1a);
_1a.submit();
};
URLRequestInvoker.prototype.DestroyCommunicationIFrame_work=function(){
};
URLRequestInvoker.prototype.RequestFinished=function(){
var _1e=this;
setTimeout(function(){
_1e.DestroyCommunicationIFrame_work();
},500);
};
urlRequestInvoker=new URLRequestInvoker();
function AreObjectsEqual(_1f,_20,_21){
if(_1f==null&&_20==null){
return true;
}else{
if(_20==null){
return false;
}
}
var _22=true;
for(var i in _1f){
if(_21.indexOf(i)!=-1){
continue;
}
if(_1f[i]!=_20[i]){
_22=false;
break;
}
}
return _22;
};
function EncloseInQuotes(str){
var _25="'";
if(str.indexOf(_25)!=-1){
_25="\"";
}
return _25+str+_25;
};
function DumpHtmlDomElement(_26){
var _27=Math.min(_26.childNodes.length,3);
var _28="";
for(var a=0;a<_27;a++){
_28+="\tchildNodes["+a+"].nodeName:\t\t"+_26.childNodes[a].nodeName+"\n"+"\tchildNodes["+a+"].nodeValue:\t\t"+_26.childNodes[a].nodeValue+"\n"+"\tchildNodes["+a+"].childNodes.length:\t"+_26.childNodes[a].childNodes.length+"\n"+"\n";
}
alert("tagName:\t\t"+_26.tagName+"\n"+"nodeName:\t"+_26.nodeName+"\n"+"name:\t\t"+_26.name+"\n"+"\n"+"type:\t\t"+_26.type+"\n"+"className:\t"+_26.className+"\n"+"id:\t\t"+_26.id+"\n"+"value:\t\t"+_26.value+"\n"+"\n"+"innerHTML:\t"+_26.innerHTML+"\n"+"\n"+"childNodes.length:\t"+_26.childNodes.length+"\n"+_28);
};
function handle_onkeydown(e){
e=window.event||e;
keycode=e.keyCode||e.which;
if(keycode==IMPORT_UTIL.KEYCODE_ENTER||keycode==IMPORT_UTIL.KEYCODE_SPACEBAR){
var _2b=e.target||e.srcElement;
_2b.click(e);
return false;
}
return true;
};
function DumpXmlDomElement(_2c){
var _2d=Math.min(_2c.attributes.length,3);
var _2e="";
for(var a=0;a<_2d;a++){
var _30=_2c.attributes[a].nodeValue;
_2e+="\tattributes["+a+"].nodeName:\t\t"+_2c.attributes[a].nodeName+"\n"+"\tattributes["+a+"].nodeValue:\t\t"+_30+"\n"+"\tattributes["+a+"].childNodes.length:\t"+_2c.attributes[a].childNodes.length+"\n"+"\n";
}
var _31=Math.min(_2c.childNodes.length,3);
var _32="";
for(var a=0;a<_31;a++){
_32+="\tchildNodes["+a+"].nodeName:\t\t"+_2c.childNodes[a].nodeName+"\n"+"\tchildNodes["+a+"].nodeValue:\t\t"+_2c.childNodes[a].nodeValue+"\n"+"\tchildNodes["+a+"].childNodes.length:\t"+_2c.childNodes[a].childNodes.length+"\n"+"\n";
}
alert("DumpXmlDomElement\n"+"\n"+"nodeName:\t"+_2c.nodeName+"\n"+"nodeType:\t"+_2c.nodeType+"\n"+"nodeValue:\t"+_2c.nodeValue+"\n"+"\n"+"attributes.length:  "+_2c.attributes.length+"\t(showing first "+_2d+" attributes out of "+_2c.attributes.length+")\n"+_2e+"\n"+"childNodes.length:  "+_2c.childNodes.length+"\t(showing first "+_31+" attributes out of "+_2c.childNodes.length+")\n"+_32+"\n"+"\n");
};
G_HAL.F_Include(WEB_CONTENT+"/hal/C_Deck.js");
G_HAL.F_Include(WEB_CONTENT+"/hal/C_TreeView.js");
G_HAL.F_Include(WEB_CONTENT+"/hal/C_ListView.js");
G_HAL.F_Include(WEB_CONTENT+"/hal/U_CookieJar.js");
G_HAL.F_Include(WEB_CONTENT+"/hal/C_Dialog.js");
G_HAL.F_Include(WEB_CONTENT+"/common/json/json2.js");
G_HAL.F_Include(WEB_CONTENT+"/hal/G_ResManager.js");
G_HAL.F_Include(WEB_CONTENT+"/hal/C_MultiScriptRequest.js");
G_HAL.F_Include(WEB_CONTENT+"/hal/C_ComboBox.js");
G_HAL.F_Include(WEB_CONTENT+"/hal/C_PropertySheet.js");
var kDatabaseTypeStr="database";
var kCatalogTypeStr="catalog";
var kCubeTypeStr="cube";
var kInfoQueryTypeStr="infoQuery";
var kDimensionGroupTypeStr="dimensionGroup";
var kDimensionTypeStr="dimension";
var kMeasuresGroupTypeStr="Measures";
var kMeasureTypeStr="measure";
var asyncErrorPagePid="importWizard_communication_error_page";
var mapCubeAliasLanguages;
var cubeNodeList;
var mapCubeDimTables;
var G_App={};
function ImportWizard(){
this.credentials="";
};
ImportWizard.prototype.setDataSourceCredentials=function(_33){
this.credentials=_33;
urlRequestInvoker.RequestFinished();
};
ImportWizard.prototype.updateCredentials=function(_34){
var _35=new Object();
_35["pid"]="updateCredentials";
_35["current_credentials"]=this.credentials;
_35["newcredentials_password"]=_34;
_35["error_pid"]=asyncErrorPagePid;
var _36=GATEWAY_URL+"/metadataUIService";
urlRequestInvoker.MakeAsyncRequestInIFrame(_36,_35);
};
ImportWizard.prototype.checkNext=function(){
var _37=G_App.m_oDeck.F_GetIndex();
switch(_37){
case 0:
var msg=this.checkImportSelectionRestraints();
if(msg&&msg!=null){
return msg;
}
msg=this.checkDesignLocaleSelected();
if(msg&&msg!=null){
return msg;
}
break;
case 1:
break;
case 2:
break;
case 3:
break;
}
return null;
};
ImportWizard.prototype.checkDesignLocaleSelected=function(){
var _39=document.getElementById("designLanguage");
if(_39.selectedIndex<0){
return localizedStrings["MSR_SAP_designLocaleRequired"];
}
};
ImportWizard.prototype.checkImportSelectionRestraints=function(){
var _3a=G_App.m_oTreeViewCheckboxes.F_GetCheckedNodes();
if(_3a.length==0){
return localizedStrings["MSR_SAP_mustImportAtLeastOneItem"];
}
return null;
};
IMPORTWIZARD=new ImportWizard();
G_App.F_HAL_OnLoad=function(){
G_ResManager.F_SetLocale("en");
G_ResManager.F_LoadStrings([],this);
G_HAL.F_EnableAccessibility(G_BrowserInfo.M_bIsFirefox);
};
G_App.initControls=function(){
this.m_oDeck=new C_Deck(document.getElementById("divDeck"),this);
UpdateButtonsEnableStatus(0);
this.F_ApplySkin("corporate|portal");
this.m_treeViewNodesDoc=U_XML.F_CreateDocument();
var _3b=this.m_treeViewNodesDoc.appendChild(this.m_treeViewNodesDoc.createElement("treeView"));
_3b.setAttribute("id","TreeView");
_3b.setAttribute("showCheckboxes","true");
if(!IMPORTWIZARD.isEdit){
this.PopulateTreeView_RootNode(this.m_treeViewNodesDoc,_3b);
}
this.m_oTreeViewCheckboxes=new C_TreeView(document.getElementById("divTreeViewCheckboxes"),_3b,this);
g_expandTreeLevel=0;
var _3c=document.getElementById("useV5DataServer");
_3c.checked=IMPORTWIZARD.bUseV5DataServer;
if(IMPORTWIZARD.bDisableClassic=="true"){
_3c.style.display="none";
}
var _3d=U_XML.F_CreateDocument();
var _3e=_3d.appendChild(_3d.createElement("listView"));
_3e.setAttribute("id","CubesListView");
_3e.setAttribute("showCheckboxes","false");
_3e.setAttribute("multiSelect","false");
_3e.appendChild(_3d.createElement("listItems"));
this.m_oListViewCubes=new C_ListView(document.getElementById("divListViewCubes"),_3e,this);
var _3f=U_XML.F_CreateDocument();
var _40=_3f.appendChild(_3f.createElement("listView"));
_40.setAttribute("id","DimensionsListView");
_40.setAttribute("showCheckboxes","false");
_40.setAttribute("multiSelect","false");
_40.appendChild(_3f.createElement("listItems"));
this.m_oListViewDimensions=new C_ListView(document.getElementById("divListViewDimensions"),_40,this);
var _41=U_XML.F_CreateDocument();
var _42=_41.appendChild(_41.createElement("listView"));
_42.setAttribute("id","AliasTablesListView");
_42.setAttribute("showCheckboxes","false");
_42.setAttribute("multiSelect","false");
_42.appendChild(_41.createElement("listItems"));
this.m_oListViewAliasTables=new C_ListView(document.getElementById("divListViewAliasTables"),_42,this);
var _43=U_XML.F_CreateDocument();
var _44=_43.appendChild(_43.createElement("listView"));
_44.setAttribute("id","LanguagesListView");
_44.setAttribute("view","checkbox");
_44.setAttribute("showCheckboxes","true");
_44.appendChild(_43.createElement("listItems"));
this.m_oListViewCheckboxes=new C_ListView(document.getElementById("divListViewCheckboxes"),_44,this);
PopulateLanguagesListBox();
if(IMPORTWIZARD.enableTest==false){
ShowPackageRenameDlgIfNeeded();
}
};
G_App.expandNode=function(_45){
if(IMPORTWIZARD.enableTest==true){
if(_45!=null){
G_App.m_oTreeViewCheckboxes.F_ExpandNode(_45);
G_App.m_oTreeViewCheckboxes.F_Draw();
}
}
};
G_App.initializeTreeViewCheckBox=function(){
this.m_treeViewNodesDoc=U_XML.F_CreateDocument();
var _46=this.m_treeViewNodesDoc.appendChild(this.m_treeViewNodesDoc.createElement("treeView"));
_46.setAttribute("id","TreeView");
_46.setAttribute("showCheckboxes","true");
this.PopulateTreeView_RootNode(this.m_treeViewNodesDoc,_46);
this.m_oTreeViewCheckboxes=new C_TreeView(document.getElementById("divTreeViewCheckboxes"),_46,this);
mapCubeAliasLanguages=new Object();
mapCubeDimTables=new Object();
g_expandTreeLevel=0;
var _47=G_App.m_oTreeViewCheckboxes.F_GetTreeViewNode();
var _48=_47.selectSingleNode("treeNode");
if(_48!=null){
setTimeout(function(){
G_App.expandNode(_48);
},700);
}
};
G_App.F_ListView_OnCheckboxClick=function(_49,_4a,_4b){
if(_49==G_App.m_oListViewCheckboxes){
var _4c=G_App.m_oListViewCheckboxes.F_GetCheckedListItems();
var _4d=new Array();
for(var n=0;n<_4c.length;n++){
var _4f=_4c[n];
var _50=_4f.getAttribute("value");
_4d[n]=_50;
}
var _51=getSelectedCubeUniqueName();
if(_51!=null){
var _52=G_App.m_oListViewDimensions.F_GetSelectedListItem();
if(_52!=null){
var _53=_52.getAttribute("label");
var _54=G_App.m_oListViewAliasTables.F_GetSelectedListItem();
if(_54!=null){
var _55=_54.getAttribute("label");
var _56=mapCubeAliasLanguages[_51];
if(_56==null){
_56=new Object();
mapCubeAliasLanguages[_51]=_56;
}
var _57=_56[_53];
if(_57==null){
_57=new Object();
_56[_53]=_57;
}
if(G_App.checkLangIsUsed(_57,_4d)==false){
_4a.setAttribute("checked","false");
G_App.m_oListViewCheckboxes.F_Draw();
return;
}
_57[_55]=_4d;
}
}
}
}
};
G_App.checkLangIsUsed=function(_58,_59){
var _5a=G_App.m_oListViewAliasTables.F_GetSelectedListItem();
if(_5a!=null){
var _5b=_5a.getAttribute("label");
for(var _5c in _58){
if(_5b!=_5c){
var _5d=_58[_5c];
for(var n=0;n<_5d.length;n++){
var _5f=_5d[n];
for(var k=0;k<_59.length;k++){
var _61=_59[k];
if(_61==_5f){
var _62=localizedStrings["MSR_ESB_tooManyLanguages"].replace("{0}",_5c);
if(_62){
alert(_62);
}
return false;
}
}
}
}
}
}
return true;
};
G_App.F_ListView_OnItemClick=function(_63,_64,_65){
if(_63==G_App.m_oListViewCubes){
G_App.RepopulateDimTablesListView();
}
if(_63==G_App.m_oListViewDimensions){
var _66=getSelectedCubeUniqueName();
var _67=mapCubeDimTables[_66];
G_App.PopulateAliasTablesListView(_67);
}else{
if(_63==G_App.m_oListViewAliasTables){
G_App.RepopulateLanguagesListView();
}
}
};
G_App.RepopulateDimTablesListView=function(){
var _68=G_App.m_oListViewCubes.F_GetSelectedListItem();
var _69=getSelectedCubeUniqueName();
var _6a=mapCubeDimTables[_69];
if(_6a==null){
var _6b=_68.getAttribute("value");
for(var k=0;k<cubeNodeList.length;k++){
var _6d=cubeNodeList[k];
var _6e=_6d.getAttribute("value");
if(_6b==_6e){
PopulateDimensionsListBox(_6d);
break;
}
}
}else{
metadataDimensionListResultsReceived(_6a);
}
};
G_App.RepopulateLanguagesListView=function(){
G_App.m_oListViewCheckboxes.F_UncheckAll();
var _6f=getSelectedCubeUniqueName();
if(_6f!=null){
var _70=G_App.m_oListViewDimensions.F_GetSelectedListItem();
var _71=getSelectedDimUniqueName();
if(_71!=null){
var _72=mapCubeAliasLanguages[_6f];
if(_72!=null){
var _73=_72[_71];
if(_73!=null){
var _74=G_App.m_oListViewAliasTables.F_GetSelectedListItem();
if(_74!=null){
var _75=_74.getAttribute("label");
var _76=_73[_75];
if(_76!=null){
var _77=G_App.m_oListViewCheckboxes.F_GetListItems();
for(var n=0;n<_77.length;n++){
var _79=_77[n];
var _7a=_79.getAttribute("value");
var _7b=_79.getAttribute("label");
for(var k=0;k<_76.length;k++){
var _7d=_76[k];
if(_7a==_7d){
_79.setAttribute("checked","true");
break;
}
}
}
}
}
}
}
}
}
G_App.m_oListViewCheckboxes.F_Draw();
};
function OnUseV5DataServerBtnClicked(_7e){
G_App.m_oTreeViewCheckboxes.F_Detach();
G_App.initializeTreeViewCheckBox();
};
function selectFirstItemInTreeControl(){
var _7f=G_App.m_oTreeViewCheckboxes.F_GetFirstVisibleTreeItem();
if(_7f){
_7f.focus();
}
};
G_App.F_ResManager_OnStringsLoaded=function(_80){
G_ResManager.F_LoadResources([WEB_CONTENT+"/mdsrv/res/EditVariablesResources.xml"],this);
};
G_App.F_ResManager_OnResourcesLoaded=function(_81){
this.initControls();
};
function retrieveImportSpec(){
var _82=GATEWAY_URL+"/metadataUIService";
D_Progress.F_DisableCancel();
D_Progress.F_Show(null,localizedStrings["MSR_SAP_Loading"]);
var _83={};
_83["pid"]="importWizard_ImportSpec_pid";
_83["packageLocation"]=IMPORTWIZARD.packageLocation;
_83["packageName"]=IMPORTWIZARD.packageName;
_83["error_pid"]=asyncErrorPagePid;
IMPORTWIZARD.onResumeFromNonRecoverableError=function(){
hideProgressIfShowing();
};
urlRequestInvoker.MakeAsyncRequestInIFrame(_82,_83);
};
function GenerateJSONString(obj){
var _85="";
for(var i in obj){
_85+="\t\t\""+i+"\": ";
_85+="\""+obj[i]+"\",\n";
}
var _87=_85.lastIndexOf(",");
_85="\t{\n"+_85.substr(0,_87)+"\n\t}\n";
return _85;
};
G_App.PopulateTreeView_RootNode=function(_88,_89){
var _8a=_89.appendChild(_88.createElement("treeNode"));
var _8b={};
_8b["type"]=kDatabaseTypeStr;
_8b["uniqueName"]=kDatabaseTypeStr;
var _8c=GetIconFilePath(kDatabaseTypeStr);
var _8d=GenerateJSONString(_8b);
_8a.setAttribute("value",_8d);
_8a.setAttribute("label",IMPORTWIZARD.dataSourceName);
_8a.setAttribute("smallIcon",_8c);
_8a.setAttribute("expandedSmallIcon",_8c);
_8a.setAttribute("expandable","true");
_8a.setAttribute("staticCheckbox","true");
_8a.setAttribute("role","treeItem");
_8a.setAttribute("tooltip",kDatabaseTypeStr);
};
var bIsLanguagesListPopulated=false;
function getSelectedCubeUniqueName(){
var _8e=G_App.m_oListViewCubes.F_GetSelectedListItem();
if(_8e==null){
return null;
}
var _8f=_8e.getAttribute("value");
var _90=eval("("+_8f+")");
return _90.uniqueName;
};
function getSelectedDimUniqueName(){
var _91=G_App.m_oListViewDimensions.F_GetSelectedListItem();
if(_91==null){
return null;
}
return _91.getAttribute("label");
};
function PopulateLanguagesListBox(){
var _92=GATEWAY_URL+"/metadataUIService";
D_Progress.F_DisableCancel();
D_Progress.F_Show(null,localizedStrings["MSR_SAP_Loading"]);
var _93={};
_93["pid"]="OLAPImportWizard_Languages_pid";
_93["datasource"]=IMPORTWIZARD.dataSourceName;
_93["dataSourceCredentials"]=IMPORTWIZARD.credentials;
_93["error_pid"]=asyncErrorPagePid;
urlRequestInvoker.MakeAsyncRequestInIFrame(_92,_93);
};
G_App.PopulateLanguagesListView=function(_94){
var _95=document.getElementById("designLanguage");
var _96=0;
for(var i=0;i<_94.length;i++){
var _98=this.m_oListViewCheckboxes.F_AppendNewListItem();
_98.setAttribute("value",_94[i].localeId);
_98.setAttribute("label",_94[i].localeName);
_98.setAttribute("staticCheckbox","false");
_98.setAttribute("checked","false");
if(_94[i].localeId==IMPORTWIZARD.productLocale){
_96=i;
}
_95.options[i]=new Option(_94[i].localeName,_94[i].localeId);
}
_95.selectedIndex=_96;
bIsLanguagesListPopulated=true;
hideProgressIfShowing();
};
function providerLangResultsReceived(_99){
G_App.PopulateLanguagesListView(_99.lang);
G_App.m_oListViewCheckboxes.F_Draw();
urlRequestInvoker.RequestFinished();
setTimeout(function(){
var _9a=G_App.m_oTreeViewCheckboxes.F_GetTreeViewNode();
var _9b=_9a.selectSingleNode("treeNode");
G_App.expandNode(_9b);
},700);
};
function importSpecReceivedReceived(_9c){
D_Progress.F_Hide();
urlRequestInvoker.RequestFinished();
G_App.m_oTreeViewCheckboxes.F_StartAsyncLoad();
var _9d=G_App.m_treeViewNodesDoc;
var _9e=G_App.m_oTreeViewCheckboxes.F_GetTreeViewNode();
IMPORTWIZARD.dataSourceName=_9c.node.Name;
PopulateTreeView(_9c.node,_9d,_9e);
G_App.m_oTreeViewCheckboxes.F_EndAsyncLoad(true);
selectFirstItemInTreeControl();
};
function SaveModifiedSettings(){
var _9f=GATEWAY_URL+"/metadataUIService";
D_Progress.F_DisableCancel();
D_Progress.F_Show(null,localizedStrings["MSR_SAP_Saving"]);
var _a0={};
_a0["pid"]="saveModifiedPackageSettings_pid";
_a0["searchPath"]=IMPORTWIZARD.packageLocation+"/package[@name="+EncloseInQuotes(IMPORTWIZARD.packageName)+"]/model";
_a0["property"]="http://developer.cognos.com/ceba/constants/queryOptionEnum#mode";
var _a1=document.getElementById("ms_useV5DataServer");
if(_a1.checked){
_a0["value"]="http://developer.cognos.com/ceba/constants/queryModeEnum#dynamic";
}else{
_a0["value"]="http://developer.cognos.com/ceba/constants/queryModeEnum#compatible";
}
_a0["error_pid"]=asyncErrorPagePid;
urlRequestInvoker.MakeAsyncRequestInIFrame(_9f,_a0);
};
function OnSaveModifiedPackageSettingsRequestCompleted(){
D_Progress.F_Hide();
urlRequestInvoker.RequestFinished();
window.location.replace(IMPORTWIZARD.backURL);
};
function PopulateTreeView(_a2,_a3,_a4){
var _a5=_a2.Name;
var _a6=_a2.Type;
var _a7=_a2.Selected!=null&&_a2.Selected!="false";
var _a8={};
_a8["type"]=_a6;
_a8["uniqueName"]=(_a2.uniqueName!=null)?_a2.uniqueName:_a2.Name;
var _a9=GenerateJSONString(_a8);
var _aa=GetIconFilePath(_a6);
var _ab=GetIconFilePath(_a6);
var _ac=(_a6!=kCubeTypeStr);
var _ad=(_a6==kDimensionGroupTypeStr||_a6==kDimensionTypeStr||_a6==kMeasuresGroupTypeStr||_a6==kMeasureTypeStr);
var _ae=(_a6!=kCubeTypeStr);
var _af=!_ad&&_a7;
var _b0=_a4.appendChild(_a3.createElement("treeNode"));
_b0.setAttribute("value",_a9);
_b0.setAttribute("label",_a5);
_b0.setAttribute("smallIcon",_aa);
_b0.setAttribute("expandedSmallIcon",_ab);
_b0.setAttribute("tooltip",_a6);
_b0.setAttribute("expandable",_ac?"true":"false");
_b0.setAttribute("hideCheckbox",_ad?"true":"false");
_b0.setAttribute("staticCheckbox",_ae?"true":"false");
_b0.setAttribute("checked",_af?"true":"false");
if(IMPORTWIZARD.enableTest){
if(_a8["uniqueName"]==IMPORTWIZARD.treeLevels[g_expandTreeLevel]){
g_viewNodeToExpand=_b0;
}
if(_a8["type"]==kCubeTypeStr){
if(_a8["uniqueName"]==IMPORTWIZARD.cubeToSelect){
_b0.setAttribute("checked","true");
}
}
}
if(_a2.children!=null){
for(var i=0;i<_a2.children.length;i++){
PopulateTreeView(_a2.children[i],_a3,_b0);
}
}
};
function ExtractSelectedTreeNodes(_b2,_b3){
if(_b2.childNodes!=null&&_b2.childNodes.length>0){
_b3.children=[];
for(var i=0;i<_b2.childNodes.length;i++){
var _b5=_b2.childNodes[i].getAttribute("label");
var _b6=_b2.childNodes[i].getAttribute("value");
var _b7=eval("("+_b6+")");
var _b8=_b7.type;
var _b9=_b7.uniqueName;
_b3.children[i]={};
_b3.children[i]["uniqueName"]=_b9;
_b3.children[i].Selected="true";
_b3.children[i].Type=_b8;
_b3.children[i].Value="false";
_b3.children[i].Name=_b5;
ExtractSelectedTreeNodes(_b2.childNodes[i],_b3.children[i]);
}
}
};
var g_treeNodeBeingPopulated=null;
var g_expandTreeLevel=0;
var g_viewNodeToExpand=null;
var g_dimNum=0;
var g_aliasNum=0;
G_App.F_TreeView_OnPopulateChildren=function(_ba,_bb){
var _bc=document.getElementById("nextButton");
EnableButton(_bc,false);
var _bd=document.getElementById("finishButton");
IMPORTWIZARD.isFinishButtonEnabled=IsButtonEnabled(_bd);
EnableButton(_bd,false);
var _be=_bb;
var _bf="";
do{
var _c0=_be.getAttribute("label");
var _c1=_be.getAttribute("value");
var _c2=eval("("+_c1+")");
var _c3=_c2.type;
var _c4=_c2.uniqueName;
var _c5=(_bf=="");
var _c6={};
_c6.Name=_c0;
_c6.Type=_c3;
_c6.Value="false";
if(_c3==kDatabaseTypeStr){
_c6.dbType=IMPORTWIZARD.dataSourceType;
_c6.isSystem="false";
}else{
_c6.uniqueName=_c4;
}
if(_c5){
_c6.Selected="true";
_c6.expansion="true";
ExtractSelectedTreeNodes(_bb,_c6);
}
strNodePathEntry=JSON.stringify(_c6,null,"\t");
var _c7=(_be==_bb)?"\n":",\n";
_bf=strNodePathEntry+_c7+_bf;
_be=_be.parentNode;
}while(_be!=null&&_be.tagName=="treeNode");
_bf="{\"node\":[\n"+_bf+"]}";
g_treeNodeBeingPopulated=_bb;
var _c8=GATEWAY_URL+"/metadataUIService";
var _c9={};
if(IMPORTWIZARD.enableTestNoDBConnection){
_c9["pid"]="importWizard_GetTreeNodes_TEST_pid";
}else{
_c9["pid"]="importWizard_GetTreeNodes_pid";
}
_c9["connectionName"]=IMPORTWIZARD.dataSourceName;
_c9["nodePath"]=_bf;
_c9["dataSourceCredentials"]=IMPORTWIZARD.credentials;
_c9["error_pid"]=asyncErrorPagePid;
var _ca=document.getElementById("useV5DataServer");
_c9["useV5DataServer"]=_ca.checked?"true":"false";
IMPORTWIZARD.onResumeFromRecoveredErrorHandler=function(){
urlRequestInvoker.RequestFinished();
G_App.m_oTreeViewCheckboxes.F_EndAsyncLoad(false);
g_treeNodeBeingPopulated=null;
if(this.retry){
this.retry=false;
G_App.m_oTreeViewCheckboxes.F_ExpandNode(_bb);
}
};
IMPORTWIZARD.onResumeFromNonRecoverableError=function(){
G_App.m_oTreeViewCheckboxes.F_EndAsyncLoad(false);
g_treeNodeBeingPopulated=null;
urlRequestInvoker.RequestFinished();
};
urlRequestInvoker.MakeAsyncRequestInIFrame(_c8,_c9);
return true;
};
G_App.F_HAL_OnUnLoad=function(){
this.m_oTreeViewCheckboxes.F_Detach();
this.m_oListViewCheckboxes.F_Detach();
if(this.m_oPropertySheet!=null){
this.m_oPropertySheet.F_Detach();
}
};
G_App.F_ApplySkin=function(_cb){
var _cc=_cb.split("|");
var _cd=_cc[0];
var _ce=_cc[1];
var _cf=WEB_CONTENT+"/skins/"+_cd+"/hal/hal_portal_skin.css";
var _d0=WEB_CONTENT+"/skins/"+_cd+"/hal/hal_skin.css";
var _d1=document.getElementById("idHALSkinCSS");
if(_d1){
_d1.parentNode.removeChild(_d1);
}
var _d2=document.getElementsByTagName("head")[0];
var _d3=document.createElement("link");
_d3.id="idHALSkinCSS";
_d3.type="text/css";
_d3.rel="stylesheet";
_d3.href=_cf;
_d2.appendChild(_d3);
var _d4=document.createElement("link");
_d4.id="idHALSkinCSS";
_d4.type="text/css";
_d4.rel="stylesheet";
_d4.href=_d0;
_d2.appendChild(_d4);
document.body.style.backgroundColor=(_ce=="portal")?"#FFFFFF":"";
var _d5=new Date();
_d5.setUTCFullYear(_d5.getUTCFullYear()+1);
U_CookieJar.F_SetCookie("skin",_cb,_d5);
};
G_App.F_Deck_OnBeforeCardVisible=function(_d6,_d7,_d8,_d9){
};
G_App.F_Deck_OnAfterCardVisible=function(_da,_db,_dc,_dd){
if(_da==this.m_oDeck){
var _de=[localizedStrings["MSR_SAP_selectObjectsTitle"],localizedStrings["MSR_SAP_selectLanguagesTitle"],localizedStrings["MSR_SAP_generateDimensionsTitle"]];
document.getElementById("dialogHeaderTitle").innerHTML=_de[_dd];
UpdateButtonsEnableStatus(_dd);
if(_dd==1){
if(bIsLanguagesListPopulated==false){
PopulateLanguagesListBox();
}
var _df=G_App.m_oTreeViewCheckboxes.F_GetCheckedNodes();
var _e0=[];
for(var _e1 in mapCubeDimTables){
var _e2=false;
for(var n=0;n<_df.length;n++){
var _e4=_df.item(n);
var _e5=_e4.getAttribute("value");
var _e6=eval("("+_e5+")");
var _e7=_e6.uniqueName;
if(_e7==_e1){
_e2=true;
break;
}
}
if(_e2==false){
_e0.push(_e1);
}
}
for(var k=0;k<_e0.length;k++){
var _e9=_e0[k];
delete mapCubeDimTables[_e9];
if(mapCubeAliasLanguages[_e9]!=null){
delete mapCubeAliasLanguages[_e9];
}
}
PopulateCubes(_df);
}else{
if(_dd==2){
var _ea=document.getElementById("radioShortName");
if(_ea){
_ea.focus();
}
}
}
}
};
G_App.F_Next=function(){
var msg=IMPORTWIZARD.checkNext();
if(msg){
alert(msg);
}else{
var _ec=G_App.m_oDeck.F_GetIndex();
switch(_ec){
case 0:
if(mapCubeDimTables==null){
mapCubeDimTables=new Object();
}
if(mapCubeAliasLanguages==null){
mapCubeAliasLanguages=new Object();
}
break;
case 1:
break;
case 2:
break;
case 3:
break;
}
this.m_oDeck.F_Next();
}
};
function PopulateCubes(_ed){
cubeNodeList=_ed;
G_App.m_oListViewCubes.F_Clear();
var _ee=document.getElementById("nextButton");
EnableButton(_ee,false);
var _ef=document.getElementById("finishButton");
EnableButton(_ef,true);
if(D_Progress.F_IsActiveDialog()==false){
D_Progress.F_DisableCancel();
D_Progress.F_Show(null,localizedStrings["MSR_SAP_Loading"]);
}
for(var i=0;i<_ed.length;i++){
var _f1=_ed[i];
var _f2=_f1.getAttribute("label");
var _f3=_f1.getAttribute("value");
var _f4=eval("("+_f3+")");
var _f5=_f4.type;
var _f6=_f4.uniqueName;
var _f7=G_App.m_oListViewCubes.F_AppendNewListItem();
_f7.setAttribute("value",_f3);
_f7.setAttribute("label",_f2);
}
G_App.selectFirstListBoxItem(G_App.m_oListViewCubes);
G_App.m_oListViewCubes.F_Draw();
var _f8=_ed[0];
PopulateDimensionsListBox(_f8);
hideProgressIfShowing();
};
function PopulateDimensionsListBox(_f9){
var _fa=document.getElementById("nextButton");
EnableButton(_fa,false);
var _fb=document.getElementById("finishButton");
IMPORTWIZARD.isFinishButtonEnabled=IsButtonEnabled(_fb);
EnableButton(_fb,false);
if(D_Progress.F_IsActiveDialog()==false){
D_Progress.F_DisableCancel();
D_Progress.F_Show(null,localizedStrings["MSR_SAP_Loading"]);
}
var _fc=_f9;
var _fd="";
do{
var _fe=_fc.getAttribute("label");
var _ff=_fc.getAttribute("value");
var _100=eval("("+_ff+")");
var _101=_100.type;
var _102=_100.uniqueName;
var _103=(_fd=="");
var _104={};
_104.Name=_fe;
_104.Type=_101;
_104.Value="false";
if(_101==kDatabaseTypeStr){
_104.dbType=IMPORTWIZARD.dataSourceType;
_104.isSystem="false";
}else{
_104.uniqueName=_102;
}
if(_103){
_104.Selected="true";
_104.expansion="true";
ExtractSelectedTreeNodes(_f9,_104);
}
strNodePathEntry=JSON.stringify(_104,null,"\t");
var _105=(_fc==_f9)?"\n":",\n";
_fd=strNodePathEntry+_105+_fd;
_fc=_fc.parentNode;
}while(_fc!=null&&_fc.tagName=="treeNode");
_fd="{\"node\":[\n"+_fd+"]}";
g_treeNodeBeingPopulated=_f9;
var _106=GATEWAY_URL+"/metadataUIService";
var _107={};
if(IMPORTWIZARD.enableTestNoDBConnection){
_107["pid"]="OLAPImportWizard_GetDimensionsList_TEST_pid";
}else{
_107["pid"]="OLAPImportWizard_GetDimensionsList_pid";
}
_107["connectionName"]=IMPORTWIZARD.dataSourceName;
_107["nodePath"]=_fd;
_107["dataSourceCredentials"]=IMPORTWIZARD.credentials;
_107["error_pid"]=asyncErrorPagePid;
var _108=document.getElementById("useV5DataServer");
_107["useV5DataServer"]=_108.checked?"true":"false";
IMPORTWIZARD.onResumeFromRecoveredErrorHandler=function(){
urlRequestInvoker.RequestFinished();
G_App.m_oTreeViewCheckboxes.F_EndAsyncLoad(false);
g_treeNodeBeingPopulated=null;
if(this.retry){
this.retry=false;
G_App.m_oTreeViewCheckboxes.F_ExpandNode(_f9);
}
};
IMPORTWIZARD.onResumeFromNonRecoverableError=function(){
G_App.m_oTreeViewCheckboxes.F_EndAsyncLoad(false);
g_treeNodeBeingPopulated=null;
urlRequestInvoker.RequestFinished();
};
urlRequestInvoker.MakeAsyncRequestInIFrame2(_106,_107);
};
G_App.F_Back=function(){
this.m_oDeck.F_Back();
};
G_App.F_TreeView_OnNodeCheck=function(_109,_10a){
};
G_App.F_TreeView_OnNodeClick=function(_10b,_10c,_10d){
};
G_App.F_TreeView_OnNodeDblClick=function(_10e,_10f){
};
function IsButtonEnabled(_110){
return (_110.className=="commandButton");
};
function EnableButton(_111,_112){
var _113=IsButtonEnabled(_111);
if(_112==true){
_111.className="commandButton";
_111.onmouseover=function(e){
this.className="commandButtonOver";
};
_111.onmouseout=function(e){
this.className="commandButton";
};
_111.onmousedown=function(e){
this.className="commandButton";
};
_111.onkeypress=handle_onkeydown;
_111.children[0].tabIndex=0;
if(_113==false){
if(_111.onclick_enabled!=null){
_111.onclick=_111.onclick_enabled;
}
if(_111.ondblclick_enabled!=null){
_111.ondblclick=_111.ondblclick_enabled;
}
}
}else{
if(_112==false){
_111.className="commandButtonInactiveII";
_111.onmouseover=null;
_111.onmouseout=null;
_111.onmousedown=null;
_111.onkeypress=null;
_111.children[0].tabIndex=-1;
if(_113==true){
_111.onclick_enabled=_111.onclick;
_111.ondblclick_enabled=_111.ondblclick;
}
_111.onclick="";
_111.ondblclick="";
}
}
};
function UpdateButtonsEnableStatus(_117){
var _118=document.getElementById("prevButton");
var _119=(_117!=0);
if(_119){
_118.onclick=function(e){
G_App.F_Back();
};
_118.ondblclick=function(e){
G_App.F_Back();
};
}
EnableButton(_118,_119);
var _11c=document.getElementById("nextButton");
var _11d=(_117!=G_App.m_oDeck.F_GetNumberOfCards()-1);
if(_11d){
_11c.onclick=function(e){
G_App.F_Next();
};
_11c.ondblclick=function(e){
G_App.F_Next();
};
}
EnableButton(_11c,_11d);
var _120=document.getElementById("finishButton");
var _121=(_117==G_App.m_oDeck.F_GetNumberOfCards()-1);
if(_121){
_120.onclick=function(e){
WizardDone();
};
_120.ondblclick=function(e){
WizardDone();
};
EnableButton(_120,_121);
}
};
function UpdateImportSpecLang(){
for(var _124 in mapCubeDimTables){
var _125=mapCubeDimTables[_124];
var _126=mapCubeAliasLanguages[_124];
if(_126!=null){
for(var _127 in _126){
var _128=_126[_127];
for(var i=0;i<_125.node.children.length;i++){
treeViewDim=_125.node.children[i];
if(treeViewDim.children!=null){
for(var k=0;k<treeViewDim.children.length;k++){
var _12b=treeViewDim.children[k];
var _12c=_12b.Name;
var _12d=_12b.Type;
if(_12d=="aliasTable"){
var _12e=_128[_12c];
if(_12e!=null){
for(var n=0;n<_12e.length;n++){
var _130=_12e[n];
var _131={};
_131.Name=_12c;
_131.Type="aliasTableLang";
_131.uniqueName=_130;
treeViewDim.children.push(_131);
}
}
}
}
}
}
}
}
}
};
function associateCubesWithAliases(_132){
for(var i=0;i<_132.length;i++){
var _134=_132[i].children;
if(_134!=null){
associateCubesWithAliases(_134);
}else{
var cube=mapCubeDimTables[_132[i].Name];
if(cube!=null){
_132[i].children=cube.node.children;
}
}
}
};
function WizardDone(){
UpdateImportSpecLang();
var _136=G_App.m_oTreeViewCheckboxes.F_GetCheckedNodes();
if(_136.length==0){
alert("No objects have been selected for the import.\n\nImport action cancelled.\n");
return;
}
var _137=[];
for(var n=0;n<_136.length;n++){
var _139=_136.item(n);
_137[n]=GetTreeNodePath(_139);
}
ConsolidateTree(_137,0);
if(_137.length!=1){
alert("ASSERT FAILED:  The number tree objects must be 1!\n\nIt is currently: "+_137.length);
}
associateCubesWithAliases(_137);
var _13a={};
_13a["node"]=[];
_13a["node"][0]=_137[0];
var _13b=JSON.stringify(_13a,null,"\t");
var _13c=document.getElementById("useV5DataServer");
var _13d=document.getElementById("designLanguage");
var _13e={};
_13e["params"]={};
_13e["params"]["UseV5DataServer"]=_13c.checked?"true":"false";
_13e["params"].designLocale=_13d.options[_13d.selectedIndex].value;
var _13f=JSON.stringify(_13e,null,"\t");
var _140={};
_140["pkgInfo"]={};
_140["pkgInfo"]["Name"]=IMPORTWIZARD.packageName;
_140["pkgInfo"]["Description"]=IMPORTWIZARD.packageDescription;
_140["pkgInfo"]["ScreenTip"]=IMPORTWIZARD.packageScreentip;
_140["pkgInfo"]["Location"]=IMPORTWIZARD.packageLocation;
var _141=JSON.stringify(_140,null,"\t");
IMPORTWIZARD.onResumeFromNonRecoverableError=function(){
hideProgressIfShowing();
};
var _142=new ImportHelper(_13b,_13f,_141);
_142.runImport();
D_Progress.F_DisableCancel();
D_Progress.F_Show(null,localizedStrings["MSR_SAP_creatingPackage"]);
};
function hideProgressIfShowing(){
if(D_Progress.F_IsActiveDialog()){
D_Progress.F_Hide();
}
};
function GetTreeNodePath(_143){
var _144=_143;
var _145={};
var _146=true;
do{
var _147=_144.getAttribute("label");
var _148=_144.getAttribute("value");
var _149=eval("("+_148+")");
var _14a=_149.type;
var _14b=_149.uniqueName;
var _14c={};
_14c.Name=_147;
_14c.Type=_14a;
_14c.Value=(_14a==kDatabaseTypeStr||_14a==kCatalogTypeStr)?"partial":"true";
if(_14a==kDatabaseTypeStr){
_14c.dbType=IMPORTWIZARD.dataSourceType;
_14c.isSystem="false";
}else{
_14c.uniqueName=_14b;
}
if(!_146){
_14c.children=[_145];
}
_145=_14c;
_144=_144.parentNode;
_146=false;
}while(_144!=null&&_144.tagName=="treeNode");
return _145;
};
function ConsolidateTree(_14d,_14e){
if(_14e<_14d.length-2){
ConsolidateTree(_14d,_14e+1);
}
for(var n=_14d.length-1;n>(_14e);n--){
var _150=_14d[_14e];
var _151=_14d[n];
if(AreObjectsEqual(_150,_151,["children"])){
if(_150.children==undefined||_150.children==null){
_150.children=_151.children;
}else{
_150.children=_150.children.concat(_151.children);
}
_14d.splice(n,1);
ConsolidateTree(_150.children,0);
}
}
};
G_App.F_OnCancel=function(){
D_Progress.F_Hide();
};
function GetIconFilePath(_152){
var _153=WEB_CONTENT+"/mdsrv/importWizardUI/images/";
var _154=[];
_154[kDatabaseTypeStr]=_153+"icon_data_source.gif";
_154[kCatalogTypeStr]=_153+"icon_catalog.gif";
_154[kCubeTypeStr]=_153+"icon_cube.gif";
_154[kInfoQueryTypeStr]=_153+"icon_info_query.gif";
_154[kDimensionGroupTypeStr]=_153+"icon_folder_dimensions.gif";
_154[kDimensionTypeStr]=_153+"icon_dimension.gif";
_154[kMeasuresGroupTypeStr]=_153+"icon_folder_measures.gif";
_154[kMeasureTypeStr]=_153+"icon_measure.gif";
_154["unknown"]=WEB_CONTENT+"/hal/images/btn_new.gif";
var _155=_154[_152];
if(_155==null){
_155=_154["unknown"];
}
return _155;
};
function metadataTreeResultsReceived(_156){
if(g_treeNodeBeingPopulated==null){
return;
}
if(_156==null){
G_App.m_oTreeViewCheckboxes.F_EndAsyncLoad(true);
g_treeNodeBeingPopulated=null;
urlRequestInvoker.RequestFinished();
return;
}
g_viewNodeToExpand=null;
G_App.m_oTreeViewCheckboxes.F_Clear(g_treeNodeBeingPopulated);
for(var i=0;i<_156.node.children.length;i++){
var aDoc=G_App.m_treeViewNodesDoc;
PopulateTreeView(_156.node.children[i],aDoc,g_treeNodeBeingPopulated);
}
G_App.m_oTreeViewCheckboxes.F_EndAsyncLoad(true);
g_treeNodeBeingPopulated=null;
urlRequestInvoker.RequestFinished();
var _159=document.getElementById("nextButton");
EnableButton(_159,true);
var _15a=document.getElementById("finishButton");
EnableButton(_15a,IMPORTWIZARD.isFinishButtonEnabled);
g_expandTreeLevel+=1;
if(g_viewNodeToExpand!=null){
setTimeout(function(){
G_App.expandNode(g_viewNodeToExpand);
},700);
}
if(IMPORTWIZARD.enableTest==true){
if(g_expandTreeLevel==IMPORTWIZARD.treeLevels.length+1){
setTimeout(function(){
G_App.F_Next();
},700);
}
}
};
function metadataDimensionListResultsReceived(_15b){
var _15c=getSelectedCubeUniqueName();
if(_15c!=null){
mapCubeDimTables[_15c]=JSON.parse(JSON.stringify(_15b));
}
G_App.PopulateDimensionsListView(_15b);
hideProgressIfShowing();
urlRequestInvoker.RequestFinished();
G_App.m_oListViewDimensions.F_Draw();
G_App.selectFirstListBoxItem(G_App.m_oListViewDimensions);
G_App.m_oListViewDimensions.F_Draw();
if(IMPORTWIZARD.enableTest==false){
G_App.PopulateAliasTablesListView(_15b);
}
if(IMPORTWIZARD.enableTest==true){
for(var dim in IMPORTWIZARD.dimAlias){
G_App.m_oListViewDimensions.F_DeselectAll();
var _15e=new String(dim);
g_dimNum=_15e.substr(1);
G_App.selectListBoxItem(G_App.m_oListViewDimensions,g_dimNum);
G_App.m_oListViewDimensions.F_Draw();
G_App.PopulateAliasTablesListView(_15b);
}
WizardDone();
}
var _15f=G_App.m_oListViewDimensions.F_GetFirstSelectableItem();
if(_15f){
var _160=document.getElementById(_15f.getAttribute("htmlId"));
if(_160){
_160.focus();
}
}
G_App.m_oListViewDimensions.F_Draw();
var _161=document.getElementById("finishButton");
EnableButton(_161,IMPORTWIZARD.isFinishButtonEnabled);
};
G_App.PopulateDimensionsListView=function(_162){
G_App.m_oListViewDimensions.F_Clear();
for(var i=0;i<_162.node.children.length;i++){
treeViewNodeData=_162.node.children[i];
var _164=treeViewNodeData.Name;
var _165=treeViewNodeData.Type;
var _166=this.m_oListViewDimensions.F_AppendNewListItem();
_166.setAttribute("value",_165);
_166.setAttribute("label",_164);
}
};
G_App.PopulateAliasTablesListView=function(_167){
if(_167==null){
return;
}
var _168=G_App.m_oListViewDimensions.F_GetSelectedListItem();
if(_168!=null){
var _169="false";
G_App.m_oListViewAliasTables.F_Clear();
var _16a=_168.getAttribute("label");
var _16b=_168.getAttribute("value");
for(var i=0;i<_167.node.children.length;i++){
var _16d=_167.node.children[i];
var _16e=_16d.Name;
var _16f=_16d.Type;
if(_16e==_16a){
if(_16d.children!=null){
for(var k=0;k<_16d.children.length;k++){
var _171=_16d.children[k];
var _172=_171.Name;
var _173=_171.Type;
var _174=this.m_oListViewAliasTables.F_AppendNewListItem();
_174.setAttribute("label",_172);
_174.setAttribute("value",_173);
}
_169="true";
}
break;
}
}
if(_169=="true"){
G_App.dissableLanguageBox("false");
G_App.m_oListViewCheckboxes.F_Draw();
G_App.selectFirstListBoxItem(G_App.m_oListViewAliasTables);
G_App.RepopulateLanguagesListView();
G_App.m_oListViewCheckboxes.F_DeselectAll();
G_App.selectFirstListBoxItem(G_App.m_oListViewCheckboxes);
G_App.m_oListViewCheckboxes.F_Draw();
if(IMPORTWIZARD.enableTest==true){
var dim="d"+g_dimNum;
var _176=IMPORTWIZARD.dimAlias[dim];
for(var _177 in _176){
G_App.m_oListViewAliasTables.F_DeselectAll();
var _178=new String(_177);
g_aliasNum=_178.substr(1);
G_App.selectListBoxItem(G_App.m_oListViewAliasTables,g_aliasNum);
G_App.m_oListViewAliasTables.F_Draw();
G_App.RepopulateLanguagesListView();
var _179=_176[_177];
for(var lang in _179){
var _17b=G_App.m_oListViewCheckboxes.F_GetListItems();
var _17c=_17b.length;
for(var i=0;i<_17c;i++){
var la=_17b.item(i);
langName=la.getAttribute("label");
if(langName==lang){
la.setAttribute("checked","true");
G_App.F_ListView_OnCheckboxClick(G_App.m_oListViewCheckboxes,la,null);
break;
}
}
G_App.m_oListViewCheckboxes.F_Draw();
}
G_App.m_oListViewCheckboxes.F_Draw();
}
}
}else{
G_App.m_oListViewCheckboxes.F_UncheckAll();
G_App.m_oListViewCheckboxes.F_DeselectAll();
G_App.m_oListViewCheckboxes.F_Draw();
G_App.dissableLanguageBox("true");
G_App.m_oListViewCheckboxes.F_Draw();
}
G_App.m_oListViewAliasTables.F_Draw();
}
};
G_App.dissableLanguageBox=function(_17e){
var nl=G_App.m_oListViewCheckboxes.F_GetListItems();
for(var i=0;i<nl.length;i++){
var _181=nl.item(i);
_181.setAttribute("staticCheckbox",_17e);
}
};
G_App.selectFirstListBoxItem=function(_182){
var _183=_182.F_GetListViewNode().selectNodes("listItems/listItem");
if(_183!=null&&_183.length>0){
var _184=_183.item(0);
_184.setAttribute("selected","true");
}
};
G_App.selectListBoxItem=function(_185,_186){
var _187=_185.F_GetListViewNode().selectNodes("listItems/listItem");
if(_187!=null&&_187.length>0){
if(_186<_187.length){
var _188=_187.item(_186);
_188.setAttribute("selected","true");
}
}
};
function HandleException(_189){
hideProgressIfShowing();
var _18a=new ErrorPageManager();
if(_189.isQF){
document.getElementById("main").style.display="none";
_18a.handleQF(_189.faultDom,ErrorPageClosed);
}else{
if(_189.isCAM){
document.getElementById("main").style.display="none";
_18a.handleCAM(_189,ErrorPageClosed);
}else{
var msg=_189.messageString;
if(msg===""){
msg=localizedStrings["MSR_SAP_unknownErrorMessage"];
}
var _18c=_189.stackTrace;
_18c=unescape(_18c);
document.getElementById("main").style.display="none";
document.getElementById("editSelection").style.display="none";
_18a.setupAndDisplayErrorPage(localizedStrings["MSR_SAP_errorPageTitle"],"",msg,_18c,ErrorPageClosed);
}
}
};
function ErrorPageClosed(_18d){
document.getElementById("main").style.display="block";
if(IMPORTWIZARD.onResumeFromNonRecoverableError&&!_18d){
IMPORTWIZARD.onResumeFromNonRecoverableError();
}
};
function launchFromEdit(){
var _18e=document.getElementById("modifyMetadataSelections");
var _18f=document.getElementById("editVariables");
var _190=document.getElementById("modifySettings");
var _191=document.getElementById("editSelection");
if(_18e.checked){
_191.style.display="none";
var main=document.getElementById("main");
main.style.display="block";
retrieveImportSpec();
}else{
if(_18f.checked){
_191.style.display="none";
OnShowVariables();
}else{
if(_190.checked){
SaveModifiedSettings();
}
}
}
};
function ImportHelper(_193,_194,_195){
this.m_importSpec=_193;
this.m_parameters=_194;
this.m_packageInfo=_195;
};
ImportHelper.prototype.runImport=function(){
var _196=GATEWAY_URL+"/metadataUIService";
this.m_requestId=new Date().getTime();
var _197={};
if(IMPORTWIZARD.enableTestNoDBConnection){
_197["pid"]="OLAPImportWizard_Import_TEST_pid";
}else{
_197["pid"]="OLAPImportWizard_Import_pid";
}
_197["importSpec"]=this.m_importSpec;
_197["parameters"]=this.m_parameters;
_197["packageInfo"]=this.m_packageInfo;
_197["requestId"]=this.m_requestId;
_197["dataSourceCredentials"]=IMPORTWIZARD.credentials;
_197["error_pid"]=asyncErrorPagePid;
if(IMPORTWIZARD.enableTest==true){
_197["enableTest"]="true";
}
urlRequestInvoker.MakeAsyncRequestInIFrame(_196,_197);
};
function VariablesHelper(_198,_199){
this.m_pkgLocation=_198;
this.m_pkgName=_199;
};
VariablesHelper.prototype.retrieveVariables=function(_19a,_19b){
var _19c=GATEWAY_URL+"/metadataUIService";
var _19d=new Object();
_19d["pid"]="getSAPBWVariables_pid";
_19d["packageLocation"]=this.m_pkgLocation;
_19d["packageName"]=this.m_pkgName;
_19d["error_pid"]=_19b;
this.m_retrievedCallback=_19a;
urlRequestInvoker.MakeAsyncRequestInIFrame(_19c,_19d);
};
VariablesHelper.prototype.setJsonVariables=function(_19e){
this.m_jsonVariables=_19e;
this.m_retrievedCallback();
};
VariablesHelper.prototype.saveChanges=function(_19f,_1a0){
var _1a1=GATEWAY_URL+"/metadataUIService";
var _1a2=new Object();
_1a2["pid"]="updateSAPBWVariables_pid";
_1a2["modelPath"]=this.m_pkgLocation+"/package[@name="+EncloseInQuotes(this.m_pkgName)+"]/model";
_1a2["variables"]=JSON.stringify(this.m_jsonVariables,null,"\t");
_1a2["error_pid"]=_1a0;
this.m_saveCallback=_19f;
urlRequestInvoker.MakeAsyncRequestInIFrame(_1a1,_1a2);
};
VariablesHelper.prototype.saveStatus=function(_1a3){
urlRequestInvoker.RequestFinished();
this.m_saveCallback(_1a3);
};
function OnShowVariables(){
D_Progress.F_DisableCancel();
D_Progress.F_Show(null,localizedStrings["MSR_SAP_Loading"]);
var _1a4=document.getElementById("main");
_1a4.innerHTML=document.getElementById("editVariablesPane").innerHTML;
_1a4.style.display="block";
variablesHelper.retrieveVariables(OnVariablesResultsReceived,asyncErrorPagePid);
};
function OnVariablesResultsReceived(){
G_App.F_SetupPropSheet(variablesHelper);
urlRequestInvoker.RequestFinished();
D_Progress.F_Hide();
var _1a5=G_App.m_nPropertySheet.selectSingleNode(".//properties/group");
if(_1a5){
var _1a6=G_App.m_oPropertySheet.F_GetFocusableElements(_1a5.getAttribute("name"));
if(_1a6&&_1a6.length>0){
_1a6[0].focus();
}
}
};
function OnEditVariablesOKBtnClick(){
D_Progress.F_DisableCancel();
D_Progress.F_Show(null,localizedStrings["MSR_SAP_Saving"]);
variablesHelper.saveChanges(OnSaveVariablesDoneResult,asyncErrorPagePid);
};
function OnSaveVariablesDoneResult(_1a7){
D_Progress.F_Hide();
window.location.replace(IMPORTWIZARD.backURL);
};
function OnEditVariablesCancelBtnClick(){
window.location.replace(IMPORTWIZARD.backURL);
};
G_App.F_SetupPropSheet=function(_1a8){
this.m_nPropertySheet=G_ResManager.F_GetResource("VariablesPropertySheet");
var _1a9=this.m_nPropertySheet.getElementsByTagName("properties")[0];
var _1aa=this.m_nPropertySheet.getElementsByTagName("objects")[0];
var _1ab=_1aa.getElementsByTagName("object")[0];
var _1ac=false;
for(var _1ad=0;_1ad<_1a8.m_jsonVariables.dataSource.length;_1ad++){
var _1ae=_1a8.m_jsonVariables.dataSource[_1ad];
for(var _1af=0;_1af<_1ae.variables.length;_1af++){
_1ac=true;
var _1b0=_1ae.variables[_1af];
var _1b1=this.m_nPropertySheet.ownerDocument.createElement("group");
_1b1.setAttribute("name","Group_"+_1ad+"_"+_1af);
_1b1.setAttribute("label",_1ae.cube+"  -  "+_1b0.name);
_1a9.appendChild(_1b1);
for(var _1b2=0;_1b2<_1b0.children.length;_1b2++){
var _1b3=_1b0.children[_1b2];
if(!_1b3){
continue;
}
var _1b4="variablesHelper.m_jsonVariables.dataSource["+_1ad+"].variables["+_1af+"].children["+_1b2+"]";
var _1b5=this.m_nPropertySheet.ownerDocument.createElement("property");
_1b5.setAttribute("name",_1b4);
var type="text";
if(_1b3.name=="isKeyDate"||_1b3.name=="showKeyAndCaption"){
type="boolean";
}else{
if(_1b3.name=="promptType"){
type="dropDownList";
}
}
_1b5.setAttribute("type",type);
if(type=="dropDownList"){
_1b5.setAttribute("listView","VariablesPropertySheet_ListView1");
}
_1b5.setAttribute("label",_1b3.displayName);
_1b1.appendChild(_1b5);
var _1b7=this.m_nPropertySheet.ownerDocument.createElement("propertyRef");
_1b7.setAttribute("ref",_1b4);
_1ab.appendChild(_1b7);
}
}
}
if(!_1ac){
var _1b8=document.getElementById("divPropertySheet1");
_1b8.style.borderWidth=0;
_1b8.innerHTML="<div class=\"formLabel\" style=\"margin-top: 2em;\">"+localizedStrings["MSR_SAP_noVariablesForEdit"]+"</div>";
var _1b9=document.getElementById("editVariablesOKButton");
EnableButton(_1b9,false);
return;
}else{
this.m_oPropertySheet=new C_PropertySheet(document.getElementById("divPropertySheet1"),this.m_nPropertySheet,this,document.body,"clsPropertiesPaneInputBlocker");
this.m_divPropertySheet=document.getElementById("divPropertySheet1");
this.m_divPropertySheet.onkeydown=this.m_oPropertySheet.F_OnKeyDown.F_CreateEventMethodCallback(this.m_oPropertySheet);
this.f_showProperties();
}
};
G_App.F_RetrieveData=function(){
};
G_App.f_showProperties=function(_1ba){
if(!_1ba){
this.f_updatePropertyInfo();
this.m_oPropertySheet.F_Clear();
}
this.m_oPropertySheet.F_SetUpdate(Boolean(_1ba));
for(var _1bb=0;_1bb<this.m_oPropertySheet.Groups.length;_1bb++){
var _1bc=this.m_oPropertySheet.Groups[_1bb];
this.m_oPropertySheet.F_StartPropertyGroup(_1bc.Name);
var _1bd=_1bc.Properties;
var _1be=_1bd.length;
for(var i=0;i<_1be;i++){
var _1c0=_1bd[i];
if(this.m_oPropertySheet.F_ObjectSupportsProperty("Object1",_1c0)){
var _1c1=this.m_nPropertySheet.selectSingleNode("properties/group/property[@name='"+_1c0+"']");
var _1c0=_1c1.getAttribute("name");
var _1c2=eval(_1c0).value;
this.m_oPropertySheet.F_ShowProperty(_1c0,_1c2?_1c2:"");
}
}
this.m_oPropertySheet.F_EndPropertyGroup();
}
this.m_oPropertySheet.F_EndAllPropertyGroups();
};
G_App.F_PropertySheet_GetPropertyListView=function(_1c3,_1c4,_1c5,_1c6){
return G_ResManager.F_GetResource(_1c4);
};
G_App.F_PropertySheet_OnShowDropDown=function(_1c7,_1c8,_1c9,_1ca,td){
G_Debug.F_Print("F_PropertySheet_OnShowDropDown: "+_1c8+"="+_1c9);
var _1cc=parseInt(this.m_oPropertySheet.F_GetPropertyAttribute(_1c8,"listViewHeight"));
var _1cd=parseInt(this.m_oPropertySheet.F_GetPropertyAttribute(_1c8,"listViewWidth"));
this.m_oPropertySheet.F_ShowListView(_1c8,_1c9,_1ca,_1cc,_1cd);
};
G_App.F_PropertySheet_OnPropertyChange=function(_1ce,_1cf,_1d0){
G_Debug.F_Print("F_PropertySheet_OnPropertyChange: "+_1cf+"="+_1d0);
eval(_1cf).value=_1d0;
setTimeout(G_App.f_showProperties.bind(G_App,true),0);
};
G_App.F_PropertySheet_OnPropertyDelete=function(_1d1,_1d2){
G_Debug.F_Print("F_PropertySheet_OnPropertyDelete: "+_1d2);
eval(_1d2).value="";
setTimeout(G_App.f_showProperties.bind(G_App,true),0);
};
G_App.F_PropertySheet_OnPropertyAction=function(_1d3,_1d4,_1d5,_1d6){
};
G_App.F_PropertySheet_OnCycleDropDownList=function(_1d7,_1d8,_1d9){
G_Debug.F_Print("F_PropertySheet_OnCycleDropDownList: "+_1d8+"="+_1d9);
};
G_App.F_PropertySheet_OnPropertyFailedValidation=function(_1da,_1db,_1dc,_1dd,_1de,_1df){
G_Debug.F_Print("F_PropertySheet_OnPropertyFailedValidation: "+_1dc+"="+_1dd);
};
G_App.F_PropertySheet_OnPropertyActivated=function(_1e0,_1e1){
G_Debug.F_Print("F_PropertySheet_OnPropertyActivated: "+_1e1);
this.f_updatePropertyInfo(_1e1);
};
G_App.F_PropertySheet_OnPropertyDeactivated=function(_1e2,_1e3){
G_Debug.F_Print("F_PropertySheet_OnPropertyDeactivated: "+_1e3);
this.f_updatePropertyInfo();
};
G_App.f_updatePropertyInfo=function(_1e4){
var _1e5="";
var _1e6="";
if(_1e4){
_1e5=this.m_oPropertySheet.F_GetLabel(_1e4);
_1e6="This is the description of "+_1e5;
}
document.getElementById("idPropertiesPane_divInfoTitle").innerText=_1e5;
document.getElementById("idPropertiesPane_divInfoDescription").innerText=_1e6;
};