importWizard.js 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125
  1. /****************************************************************
  2. ** Licensed Materials - Property of IBM
  3. **
  4. ** IBM Cognos Products: mdsrv
  5. **
  6. ** (C) Copyright IBM Corp. 2008, 2010
  7. **
  8. ** US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  9. *****************************************************************/
  10. if(!IMPORT_UTIL){
  11. var IMPORT_UTIL={};
  12. }
  13. IMPORT_UTIL.KEYCODE_SPACEBAR=32;
  14. IMPORT_UTIL.KEYCODE_ENTER=13;
  15. function URLRequestInvoker(){
  16. };
  17. URLRequestInvoker.prototype.MakeAsyncRequestInIFrame=function(_1,_2){
  18. var _3=document.getElementById("debuggingPane");
  19. if(_3&&_3.style.display!="none"){
  20. var _4="";
  21. for(var p in _2){
  22. _4+="<b>"+p+"</b> = "+_2[p]+"<br>\n";
  23. }
  24. _3.innerHTML="<u><b>URL</b></u>: &nbsp; "+_1+"<br><br>"+"<u><b>POST Data</b></u>: <pre>"+_4+"</pre>\n\n";
  25. }
  26. var _6=document.getElementById("communicationIFramePlaceholder");
  27. if(!_6){
  28. _6=document.createElement("div");
  29. _6.setAttribute("id","communicationIFramePlaceholder");
  30. document.body.appendChild(_6);
  31. }
  32. _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";
  33. var _7=document.getElementById("communicationIFrame");
  34. var _8=_7.contentWindow.document;
  35. if(_8.body==null){
  36. var _9=_8.createElement("body");
  37. _8.appendChild(_9);
  38. }
  39. this.InvokeUrlThroughPostRequest(_1,_2,_8);
  40. };
  41. URLRequestInvoker.prototype.MakeAsyncRequestInIFrame2=function(_a,_b){
  42. var _c=document.getElementById("debuggingPane");
  43. if(_c&&_c.style.display!="none"){
  44. var _d="";
  45. for(var p in _b){
  46. _d+="<b>"+p+"</b> = "+_b[p]+"<br>\n";
  47. }
  48. _c.innerHTML="<u><b>URL</b></u>: &nbsp; "+_a+"<br><br>"+"<u><b>POST Data</b></u>: <pre>"+_d+"</pre>\n\n";
  49. }
  50. var _f=document.getElementById("communicationIFramePlaceholder2");
  51. if(!_f){
  52. _f=document.createElement("div");
  53. _f.setAttribute("id","communicationIFramePlaceholder2");
  54. document.body.appendChild(_f);
  55. }
  56. _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";
  57. var _10=document.getElementById("communicationIFrame2");
  58. var _11=_10.contentWindow.document;
  59. if(_11.body==null){
  60. var _12=_11.createElement("body");
  61. _11.appendChild(_12);
  62. }
  63. this.InvokeUrlThroughPostRequest(_a,_b,_11);
  64. };
  65. URLRequestInvoker.prototype.InvokeUrlThroughPostRequest=function(url,_14,_15){
  66. _15.write("<html><head><base href=\""+window.location+"\"></head><body></body></html>");
  67. buildAndSubmitDynamicForm(_15,_15.body,url,_14);
  68. };
  69. function buildAndSubmitDynamicForm(_16,_17,url,_19){
  70. var _1a=_16.createElement("form");
  71. _1a.setAttribute("method","POST");
  72. _1a.setAttribute("id","communicationForm");
  73. _1a.setAttribute("name","communicationForm");
  74. _1a.setAttribute("action",url);
  75. for(var p in _19){
  76. var _1c=_16.createElement("input");
  77. _1c.setAttribute("type","hidden");
  78. _1c.setAttribute("id",p);
  79. _1c.setAttribute("name",p);
  80. _1c.setAttribute("value",_19[p]);
  81. _1a.appendChild(_1c);
  82. }
  83. var _1d=_17.appendChild(_1a);
  84. _1a.submit();
  85. };
  86. URLRequestInvoker.prototype.DestroyCommunicationIFrame_work=function(){
  87. };
  88. URLRequestInvoker.prototype.RequestFinished=function(){
  89. var _1e=this;
  90. setTimeout(function(){
  91. _1e.DestroyCommunicationIFrame_work();
  92. },500);
  93. };
  94. urlRequestInvoker=new URLRequestInvoker();
  95. function AreObjectsEqual(_1f,_20,_21){
  96. if(_1f==null&&_20==null){
  97. return true;
  98. }else{
  99. if(_20==null){
  100. return false;
  101. }
  102. }
  103. var _22=true;
  104. for(var i in _1f){
  105. if(_21.indexOf(i)!=-1){
  106. continue;
  107. }
  108. if(_1f[i]!=_20[i]){
  109. _22=false;
  110. break;
  111. }
  112. }
  113. return _22;
  114. };
  115. function EncloseInQuotes(str){
  116. var _25="'";
  117. if(str.indexOf(_25)!=-1){
  118. _25="\"";
  119. }
  120. return _25+str+_25;
  121. };
  122. function DumpHtmlDomElement(_26){
  123. var _27=Math.min(_26.childNodes.length,3);
  124. var _28="";
  125. for(var a=0;a<_27;a++){
  126. _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";
  127. }
  128. 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);
  129. };
  130. function handle_onkeydown(e){
  131. e=window.event||e;
  132. keycode=e.keyCode||e.which;
  133. if(keycode==IMPORT_UTIL.KEYCODE_ENTER||keycode==IMPORT_UTIL.KEYCODE_SPACEBAR){
  134. var _2b=e.target||e.srcElement;
  135. _2b.click(e);
  136. return false;
  137. }
  138. return true;
  139. };
  140. function DumpXmlDomElement(_2c){
  141. var _2d=Math.min(_2c.attributes.length,3);
  142. var _2e="";
  143. for(var a=0;a<_2d;a++){
  144. var _30=_2c.attributes[a].nodeValue;
  145. _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";
  146. }
  147. var _31=Math.min(_2c.childNodes.length,3);
  148. var _32="";
  149. for(var a=0;a<_31;a++){
  150. _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";
  151. }
  152. 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");
  153. };
  154. G_HAL.F_Include(WEB_CONTENT+"/hal/C_Deck.js");
  155. G_HAL.F_Include(WEB_CONTENT+"/hal/C_TreeView.js");
  156. G_HAL.F_Include(WEB_CONTENT+"/hal/C_ListView.js");
  157. G_HAL.F_Include(WEB_CONTENT+"/hal/U_CookieJar.js");
  158. G_HAL.F_Include(WEB_CONTENT+"/hal/C_Dialog.js");
  159. G_HAL.F_Include(WEB_CONTENT+"/common/json/json2.js");
  160. G_HAL.F_Include(WEB_CONTENT+"/hal/G_ResManager.js");
  161. G_HAL.F_Include(WEB_CONTENT+"/hal/C_MultiScriptRequest.js");
  162. G_HAL.F_Include(WEB_CONTENT+"/hal/C_ComboBox.js");
  163. G_HAL.F_Include(WEB_CONTENT+"/hal/C_PropertySheet.js");
  164. var kDatabaseTypeStr="database";
  165. var kCatalogTypeStr="catalog";
  166. var kCubeTypeStr="cube";
  167. var kInfoQueryTypeStr="infoQuery";
  168. var kDimensionGroupTypeStr="dimensionGroup";
  169. var kDimensionTypeStr="dimension";
  170. var kMeasuresGroupTypeStr="Measures";
  171. var kMeasureTypeStr="measure";
  172. var asyncErrorPagePid="importWizard_communication_error_page";
  173. var G_App={};
  174. function ImportWizard(){
  175. this.credentials="";
  176. };
  177. ImportWizard.prototype.setDataSourceCredentials=function(_33){
  178. this.credentials=_33;
  179. urlRequestInvoker.RequestFinished();
  180. };
  181. ImportWizard.prototype.updateCredentials=function(_34){
  182. var _35=new Object();
  183. _35["pid"]="updateCredentials";
  184. _35["current_credentials"]=this.credentials;
  185. _35["newcredentials_password"]=_34;
  186. _35["error_pid"]=asyncErrorPagePid;
  187. var _36=GATEWAY_URL+"/metadataUIService";
  188. urlRequestInvoker.MakeAsyncRequestInIFrame(_36,_35);
  189. };
  190. ImportWizard.prototype.checkNext=function(){
  191. var _37=G_App.m_oDeck.F_GetIndex();
  192. switch(_37){
  193. case 0:
  194. var msg=this.checkImportSelectionRestraints();
  195. if(msg&&msg!=null){
  196. return msg;
  197. }
  198. break;
  199. case 1:
  200. var msg=this.checkDesignLocaleSelected();
  201. if(msg&&msg!=null){
  202. return msg;
  203. }
  204. break;
  205. case 2:
  206. break;
  207. case 3:
  208. break;
  209. }
  210. return null;
  211. };
  212. ImportWizard.prototype.checkDesignLocaleSelected=function(){
  213. var _39=document.getElementById("designLanguage");
  214. if(_39.selectedIndex<0){
  215. return localizedStrings["MSR_SAP_designLocaleRequired"];
  216. }
  217. };
  218. ImportWizard.prototype.checkImportSelectionRestraints=function(){
  219. var _3a=G_App.m_oTreeViewCheckboxes.F_GetCheckedNodes();
  220. var _3b=0;
  221. var _3c=0;
  222. for(var n=0;n<_3a.length;n++){
  223. var _3e=_3a.item(n);
  224. var _3f=_3e.getAttribute("value");
  225. var _40=eval("("+_3f+")");
  226. if(_40.type==kCubeTypeStr){
  227. _3b++;
  228. }else{
  229. if(_40.type==kInfoQueryTypeStr){
  230. _3c++;
  231. }
  232. }
  233. if(_3b>this.maxCubes){
  234. return localizedStrings["MSR_SAP_tooManyCubes"].replace("{0}",this.maxCubes);
  235. }
  236. if(_3c>this.maxInfoQueries){
  237. return localizedStrings["MSR_SAP_tooManyInfoQueries"].replace("{0}",this.maxInfoQueries);
  238. }
  239. }
  240. if(_3a.length==0){
  241. return localizedStrings["MSR_SAP_mustImportAtLeastOneItem"];
  242. }
  243. return null;
  244. };
  245. IMPORTWIZARD=new ImportWizard();
  246. G_App.F_HAL_OnLoad=function(){
  247. G_ResManager.F_SetLocale("en");
  248. G_ResManager.F_LoadStrings([],this);
  249. G_HAL.F_EnableAccessibility(G_BrowserInfo.M_bIsFirefox);
  250. };
  251. var useV5DataServerCheckBox=null;
  252. G_App.initControls=function(){
  253. this.m_oDeck=new C_Deck(document.getElementById("divDeck"),this);
  254. UpdateButtonsEnableStatus(0);
  255. var obj=document.getElementById("radioShortName");
  256. obj.checked=true;
  257. this.F_ApplySkin("corporate|portal");
  258. this.m_treeViewNodesDoc=U_XML.F_CreateDocument();
  259. var _42=this.m_treeViewNodesDoc.appendChild(this.m_treeViewNodesDoc.createElement("treeView"));
  260. _42.setAttribute("id","TreeView");
  261. _42.setAttribute("showCheckboxes","true");
  262. if(!IMPORTWIZARD.isEdit){
  263. this.PopulateTreeView_RootNode(this.m_treeViewNodesDoc,_42);
  264. }
  265. this.m_oTreeViewCheckboxes=new C_TreeView(document.getElementById("divTreeViewCheckboxes"),_42,this);
  266. var _43=document.getElementById("cbSAPBWDualStructuresSupport");
  267. _43.checked="true";
  268. useV5DataServerCheckBox=document.getElementById("useV5DataServer");
  269. useV5DataServerCheckBox.checked=IMPORTWIZARD.bUseV5DataServer;
  270. if(IMPORTWIZARD.bDisableClassic=="true"){
  271. useV5DataServerCheckBox.style.display="none";
  272. }
  273. var _44=U_XML.F_CreateDocument();
  274. var _45=_44.appendChild(_44.createElement("listView"));
  275. _45.setAttribute("id","LanguagesListView");
  276. _45.setAttribute("showCheckboxes","true");
  277. _45.appendChild(_44.createElement("listItems"));
  278. this.m_oListViewCheckboxes=new C_ListView(document.getElementById("divListViewCheckboxes"),_45,this);
  279. ShowPackageRenameDlgIfNeeded();
  280. if(IMPORTWIZARD.isEdit){
  281. var _46=document.getElementById("editVariables");
  282. if(_46){
  283. _46.focus();
  284. }
  285. }
  286. };
  287. G_App.initializeTreeViewCheckBox=function(){
  288. this.m_treeViewNodesDoc=U_XML.F_CreateDocument();
  289. var _47=this.m_treeViewNodesDoc.appendChild(this.m_treeViewNodesDoc.createElement("treeView"));
  290. _47.setAttribute("id","TreeView");
  291. _47.setAttribute("showCheckboxes","true");
  292. this.PopulateTreeView_RootNode(this.m_treeViewNodesDoc,_47);
  293. this.m_oTreeViewCheckboxes=new C_TreeView(document.getElementById("divTreeViewCheckboxes"),_47,this);
  294. mapCubeAliasLanguages=new Object();
  295. mapCubeDimTables=new Object();
  296. };
  297. function selectFirstItemInTreeControl(){
  298. var _48=G_App.m_oTreeViewCheckboxes.F_GetFirstVisibleTreeItem();
  299. if(_48){
  300. _48.focus();
  301. }
  302. };
  303. G_App.F_ResManager_OnStringsLoaded=function(_49){
  304. G_ResManager.F_LoadResources([WEB_CONTENT+"/mdsrv/res/EditVariablesResources.xml"],this);
  305. };
  306. G_App.F_ResManager_OnResourcesLoaded=function(_4a){
  307. this.initControls();
  308. };
  309. function retrieveImportSpec(){
  310. var _4b=GATEWAY_URL+"/metadataUIService";
  311. D_Progress.F_DisableCancel();
  312. D_Progress.F_Show(null,localizedStrings["MSR_SAP_Loading"]);
  313. var _4c={};
  314. _4c["pid"]="importWizard_ImportSpec_pid";
  315. _4c["packageLocation"]=IMPORTWIZARD.packageLocation;
  316. _4c["packageName"]=IMPORTWIZARD.packageName;
  317. _4c["error_pid"]=asyncErrorPagePid;
  318. IMPORTWIZARD.onResumeFromNonRecoverableError=function(){
  319. hideProgressIfShowing();
  320. };
  321. urlRequestInvoker.MakeAsyncRequestInIFrame(_4b,_4c);
  322. };
  323. function GenerateJSONString(obj){
  324. var _4e="";
  325. for(var i in obj){
  326. _4e+="\t\t\""+i+"\": ";
  327. _4e+="\""+obj[i]+"\",\n";
  328. }
  329. var _50=_4e.lastIndexOf(",");
  330. _4e="\t{\n"+_4e.substr(0,_50)+"\n\t}\n";
  331. return _4e;
  332. };
  333. G_App.PopulateTreeView_RootNode=function(_51,_52){
  334. var _53=_52.appendChild(_51.createElement("treeNode"));
  335. var _54={};
  336. _54["type"]=kDatabaseTypeStr;
  337. _54["uniqueName"]=kDatabaseTypeStr;
  338. var _55=GetIconFilePath(kDatabaseTypeStr);
  339. var _56=GenerateJSONString(_54);
  340. _53.setAttribute("value",_56);
  341. _53.setAttribute("label",IMPORTWIZARD.dataSourceName);
  342. _53.setAttribute("smallIcon",_55);
  343. _53.setAttribute("expandedSmallIcon",_55);
  344. _53.setAttribute("expandable","true");
  345. _53.setAttribute("staticCheckbox","true");
  346. _53.setAttribute("role","treeItem");
  347. _53.setAttribute("tooltip",kDatabaseTypeStr);
  348. };
  349. var bIsLanguagesListPopulated=false;
  350. function PopulateLanguagesListBox(){
  351. var _57=GATEWAY_URL+"/metadataUIService";
  352. D_Progress.F_DisableCancel();
  353. D_Progress.F_Show(null,localizedStrings["MSR_SAP_Loading"]);
  354. var _58={};
  355. _58["pid"]="importWizard_Languages_pid";
  356. _58["datasource"]=IMPORTWIZARD.dataSourceName;
  357. _58["dataSourceCredentials"]=IMPORTWIZARD.credentials;
  358. _58["useV5DataServer"]=useV5DataServerCheckBox.checked?"true":"false";
  359. _58["error_pid"]=asyncErrorPagePid;
  360. urlRequestInvoker.MakeAsyncRequestInIFrame(_57,_58);
  361. };
  362. G_App.PopulateLanguagesListView=function(_59){
  363. var _5a=document.getElementById("designLanguage");
  364. for(var i=0;i<_59.length;i++){
  365. var _5c=this.m_oListViewCheckboxes.F_AppendNewListItem();
  366. _5c.setAttribute("value",_59[i].localeId);
  367. _5c.setAttribute("label",_59[i].localeName);
  368. _5c.setAttribute("staticCheckbox","false");
  369. _5c.setAttribute("checked","false");
  370. _5a.options[i]=new Option(_59[i].localeName,_59[i].localeId);
  371. }
  372. bIsLanguagesListPopulated=true;
  373. };
  374. function OnUseV5DataServerBtnClicked(_5d){
  375. G_App.m_oTreeViewCheckboxes.F_Detach();
  376. G_App.initializeTreeViewCheckBox();
  377. };
  378. function providerLangResultsReceived(_5e){
  379. G_App.PopulateLanguagesListView(_5e.lang);
  380. G_App.m_oListViewCheckboxes.F_Draw();
  381. D_Progress.F_Hide();
  382. urlRequestInvoker.RequestFinished();
  383. var _5f=G_App.m_oListViewCheckboxes.F_GetFirstSelectableItem();
  384. if(_5f){
  385. var _60=document.getElementById(_5f.getAttribute("htmlId"));
  386. if(_60){
  387. _60.focus();
  388. }
  389. }
  390. };
  391. function importSpecReceivedReceived(_61){
  392. D_Progress.F_Hide();
  393. urlRequestInvoker.RequestFinished();
  394. G_App.m_oTreeViewCheckboxes.F_StartAsyncLoad();
  395. var _62=G_App.m_treeViewNodesDoc;
  396. var _63=G_App.m_oTreeViewCheckboxes.F_GetTreeViewNode();
  397. IMPORTWIZARD.dataSourceName=_61.node.Name;
  398. PopulateTreeView(_61.node,_62,_63);
  399. G_App.m_oTreeViewCheckboxes.F_EndAsyncLoad(true);
  400. selectFirstItemInTreeControl();
  401. };
  402. function SaveModifiedSettings(){
  403. var _64=GATEWAY_URL+"/metadataUIService";
  404. D_Progress.F_DisableCancel();
  405. D_Progress.F_Show(null,localizedStrings["MSR_SAP_Saving"]);
  406. var _65={};
  407. _65["pid"]="saveModifiedPackageSettings_pid";
  408. _65["searchPath"]=IMPORTWIZARD.packageLocation+"/package[@name="+EncloseInQuotes(IMPORTWIZARD.packageName)+"]/model";
  409. _65["property"]="http://developer.cognos.com/ceba/constants/queryOptionEnum#mode";
  410. if(useV5DataServerCheckBox.checked){
  411. _65["value"]="http://developer.cognos.com/ceba/constants/queryModeEnum#dynamic";
  412. }else{
  413. _65["value"]="http://developer.cognos.com/ceba/constants/queryModeEnum#compatible";
  414. }
  415. _65["error_pid"]=asyncErrorPagePid;
  416. urlRequestInvoker.MakeAsyncRequestInIFrame(_64,_65);
  417. };
  418. function OnSaveModifiedPackageSettingsRequestCompleted(){
  419. D_Progress.F_Hide();
  420. urlRequestInvoker.RequestFinished();
  421. window.location.replace(IMPORTWIZARD.backURL);
  422. };
  423. function PopulateTreeView(_66,_67,_68){
  424. var _69=_66.Name;
  425. var _6a=_66.Type;
  426. var _6b=_66.Selected!=null&&_66.Selected!="false";
  427. var _6c={};
  428. _6c["type"]=_6a;
  429. _6c["uniqueName"]=(_66.uniqueName!=null)?_66.uniqueName:_66.Name;
  430. var _6d=GenerateJSONString(_6c);
  431. var _6e=GetIconFilePath(_6a);
  432. var _6f=GetIconFilePath(_6a);
  433. var _70=(_6a!=kDimensionTypeStr&&_6a!=kMeasureTypeStr);
  434. var _71=(_6a==kDimensionGroupTypeStr||_6a==kDimensionTypeStr||_6a==kMeasuresGroupTypeStr||_6a==kMeasureTypeStr);
  435. var _72=(_6a==kDatabaseTypeStr||_6a==kCatalogTypeStr);
  436. var _73=!_71&&_6b;
  437. var _74=_68.appendChild(_67.createElement("treeNode"));
  438. _74.setAttribute("value",_6d);
  439. _74.setAttribute("label",_69);
  440. _74.setAttribute("smallIcon",_6e);
  441. _74.setAttribute("expandedSmallIcon",_6f);
  442. _74.setAttribute("tooltip",_6a);
  443. _74.setAttribute("expandable",_70?"true":"false");
  444. _74.setAttribute("hideCheckbox",_71?"true":"false");
  445. _74.setAttribute("staticCheckbox",_72?"true":"false");
  446. _74.setAttribute("checked",_73?"true":"false");
  447. if(_66.children!=null){
  448. for(var i=0;i<_66.children.length;i++){
  449. PopulateTreeView(_66.children[i],_67,_74);
  450. }
  451. }
  452. };
  453. function ExtractSelectedTreeNodes(_76,_77){
  454. if(_76.childNodes!=null&&_76.childNodes.length>0){
  455. _77.children=[];
  456. for(var i=0;i<_76.childNodes.length;i++){
  457. var _79=_76.childNodes[i].getAttribute("label");
  458. var _7a=_76.childNodes[i].getAttribute("value");
  459. var _7b=eval("("+_7a+")");
  460. var _7c=_7b.type;
  461. var _7d=_7b.uniqueName;
  462. _77.children[i]={};
  463. _77.children[i]["uniqueName"]=_7d;
  464. _77.children[i].Selected="true";
  465. _77.children[i].Type=_7c;
  466. _77.children[i].Value="false";
  467. _77.children[i].Name=_79;
  468. ExtractSelectedTreeNodes(_76.childNodes[i],_77.children[i]);
  469. }
  470. }
  471. };
  472. var g_treeNodeBeingPopulated=null;
  473. G_App.F_TreeView_OnPopulateChildren=function(_7e,_7f){
  474. var _80=document.getElementById("nextButton");
  475. EnableButton(_80,false);
  476. var _81=document.getElementById("finishButton");
  477. IMPORTWIZARD.isFinishButtonEnabled=IsButtonEnabled(_81);
  478. EnableButton(_81,false);
  479. var _82=_7f;
  480. var _83="";
  481. do{
  482. var _84=_82.getAttribute("label");
  483. var _85=_82.getAttribute("value");
  484. var _86=eval("("+_85+")");
  485. var _87=_86.type;
  486. var _88=_86.uniqueName;
  487. var _89=(_83=="");
  488. var _8a={};
  489. _8a.Name=_84;
  490. _8a.Type=_87;
  491. _8a.Value="false";
  492. if(_87==kDatabaseTypeStr){
  493. _8a.dbType="BW";
  494. var _8b=document.getElementById("cbSAPBWDualStructuresSupport");
  495. _8a.dualStructures=_8b.checked?"true":"false";
  496. _8a.isSystem="false";
  497. }else{
  498. _8a.uniqueName=_88;
  499. }
  500. if(_89){
  501. _8a.Selected="true";
  502. _8a.expansion="true";
  503. ExtractSelectedTreeNodes(_7f,_8a);
  504. }
  505. strNodePathEntry=JSON.stringify(_8a,null,"\t");
  506. var _8c=(_82==_7f)?"\n":",\n";
  507. _83=strNodePathEntry+_8c+_83;
  508. _82=_82.parentNode;
  509. }while(_82!=null&&_82.tagName=="treeNode");
  510. _83="{\"node\":[\n"+_83+"]}";
  511. g_treeNodeBeingPopulated=_7f;
  512. var _8d=GATEWAY_URL+"/metadataUIService";
  513. var _8e={};
  514. _8e["pid"]="importWizard_GetTreeNodes_pid";
  515. _8e["connectionName"]=IMPORTWIZARD.dataSourceName;
  516. _8e["nodePath"]=_83;
  517. _8e["dataSourceCredentials"]=IMPORTWIZARD.credentials;
  518. _8e["error_pid"]=asyncErrorPagePid;
  519. _8e["useV5DataServer"]=useV5DataServerCheckBox.checked?"true":"false";
  520. IMPORTWIZARD.onResumeFromRecoveredErrorHandler=function(){
  521. urlRequestInvoker.RequestFinished();
  522. G_App.m_oTreeViewCheckboxes.F_EndAsyncLoad(false);
  523. g_treeNodeBeingPopulated=null;
  524. if(this.retry){
  525. this.retry=false;
  526. G_App.m_oTreeViewCheckboxes.F_ExpandNode(_7f);
  527. }
  528. };
  529. IMPORTWIZARD.onResumeFromNonRecoverableError=function(){
  530. G_App.m_oTreeViewCheckboxes.F_EndAsyncLoad(false);
  531. g_treeNodeBeingPopulated=null;
  532. urlRequestInvoker.RequestFinished();
  533. };
  534. urlRequestInvoker.MakeAsyncRequestInIFrame(_8d,_8e);
  535. return true;
  536. };
  537. G_App.F_HAL_OnUnLoad=function(){
  538. this.m_oTreeViewCheckboxes.F_Detach();
  539. this.m_oListViewCheckboxes.F_Detach();
  540. if(this.m_oPropertySheet!=null){
  541. this.m_oPropertySheet.F_Detach();
  542. }
  543. };
  544. G_App.F_ApplySkin=function(_8f){
  545. var _90=_8f.split("|");
  546. var _91=_90[0];
  547. var _92=_90[1];
  548. var _93=WEB_CONTENT+"/skins/"+_91+"/hal/hal_portal_skin.css";
  549. var _94=WEB_CONTENT+"/skins/"+_91+"/hal/hal_skin.css";
  550. var _95=document.getElementById("idHALSkinCSS");
  551. if(_95){
  552. _95.parentNode.removeChild(_95);
  553. }
  554. var _96=document.getElementsByTagName("head")[0];
  555. var _97=document.createElement("link");
  556. _97.id="idHALSkinCSS";
  557. _97.type="text/css";
  558. _97.rel="stylesheet";
  559. _97.href=_93;
  560. _96.appendChild(_97);
  561. var _98=document.createElement("link");
  562. _98.id="idHALSkinCSS";
  563. _98.type="text/css";
  564. _98.rel="stylesheet";
  565. _98.href=_94;
  566. _96.appendChild(_98);
  567. document.body.style.backgroundColor=(_92=="portal")?"#FFFFFF":"";
  568. var _99=new Date();
  569. _99.setUTCFullYear(_99.getUTCFullYear()+1);
  570. U_CookieJar.F_SetCookie("skin",_8f,_99);
  571. };
  572. G_App.F_Deck_OnBeforeCardVisible=function(_9a,_9b,_9c,_9d){
  573. };
  574. G_App.F_Deck_OnAfterCardVisible=function(_9e,_9f,_a0,_a1){
  575. if(_9e==this.m_oDeck){
  576. var _a2=[localizedStrings["MSR_SAP_selectObjectsTitle"],localizedStrings["MSR_SAP_selectLanguagesTitle"],localizedStrings["MSR_SAP_generateDimensionsTitle"]];
  577. document.getElementById("dialogHeaderTitle").innerHTML=_a2[_a1];
  578. UpdateButtonsEnableStatus(_a1);
  579. if(_a1==1&&bIsLanguagesListPopulated==false){
  580. PopulateLanguagesListBox();
  581. }else{
  582. if(_a1==2){
  583. var _a3=document.getElementById("radioShortName");
  584. if(_a3){
  585. _a3.focus();
  586. }
  587. }
  588. }
  589. }
  590. };
  591. G_App.F_Next=function(){
  592. var msg=IMPORTWIZARD.checkNext();
  593. if(msg){
  594. alert(msg);
  595. }else{
  596. this.m_oDeck.F_Next();
  597. }
  598. };
  599. G_App.F_Back=function(){
  600. this.m_oDeck.F_Back();
  601. };
  602. G_App.F_TreeView_OnNodeCheck=function(_a5,_a6){
  603. var _a7=_a6;
  604. while(_a7.parentNode!=null&&_a7.parentNode.tagName=="treeNode"){
  605. var _a8=_a7.parentNode;
  606. var _a9=(_a7.getAttribute("checked")=="true");
  607. var _aa=!_a9;
  608. var _ab=(_a8.getAttribute("checked")=="true");
  609. var _ac=G_App.m_oTreeViewCheckboxes.F_GetCheckedChildrenNodes(_a8).length;
  610. if(_a7==_a6){
  611. _ac+=_aa?+1:-1;
  612. }
  613. _a8.setAttribute("checked",_ac>0?"true":"false");
  614. G_App.m_oTreeViewCheckboxes.F_UpdateNode(_a8);
  615. _a7=_a8;
  616. }
  617. };
  618. G_App.F_TreeView_OnNodeClick=function(_ad,_ae,_af){
  619. };
  620. G_App.F_TreeView_OnNodeDblClick=function(_b0,_b1){
  621. };
  622. function IsButtonEnabled(_b2){
  623. return (_b2.className=="commandButton");
  624. };
  625. function EnableButton(_b3,_b4){
  626. var _b5=IsButtonEnabled(_b3);
  627. if(_b4==true){
  628. _b3.className="commandButton";
  629. _b3.onmouseover=function(e){
  630. this.className="commandButtonOver";
  631. };
  632. _b3.onmouseout=function(e){
  633. this.className="commandButton";
  634. };
  635. _b3.onmousedown=function(e){
  636. this.className="commandButton";
  637. };
  638. _b3.onkeypress=handle_onkeydown;
  639. _b3.children[0].tabIndex=0;
  640. if(_b5==false){
  641. if(_b3.onclick_enabled!=null){
  642. _b3.onclick=_b3.onclick_enabled;
  643. }
  644. if(_b3.ondblclick_enabled!=null){
  645. _b3.ondblclick=_b3.ondblclick_enabled;
  646. }
  647. }
  648. }else{
  649. if(_b4==false){
  650. _b3.className="commandButtonInactiveII";
  651. _b3.onmouseover=null;
  652. _b3.onmouseout=null;
  653. _b3.onmousedown=null;
  654. _b3.onkeypress=null;
  655. _b3.children[0].tabIndex=-1;
  656. if(_b5==true){
  657. _b3.onclick_enabled=_b3.onclick;
  658. _b3.ondblclick_enabled=_b3.ondblclick;
  659. }
  660. _b3.onclick="";
  661. _b3.ondblclick="";
  662. }
  663. }
  664. };
  665. function UpdateButtonsEnableStatus(_b9){
  666. var _ba=document.getElementById("prevButton");
  667. var _bb=(_b9!=0);
  668. if(_bb){
  669. _ba.onclick=function(e){
  670. G_App.F_Back();
  671. };
  672. _ba.ondblclick=function(e){
  673. G_App.F_Back();
  674. };
  675. }
  676. EnableButton(_ba,_bb);
  677. var _be=document.getElementById("nextButton");
  678. var _bf=(_b9!=G_App.m_oDeck.F_GetNumberOfCards()-1);
  679. if(_bf){
  680. _be.onclick=function(e){
  681. G_App.F_Next();
  682. };
  683. _be.ondblclick=function(e){
  684. G_App.F_Next();
  685. };
  686. }
  687. EnableButton(_be,_bf);
  688. var _c2=document.getElementById("finishButton");
  689. var _c3=(_b9==G_App.m_oDeck.F_GetNumberOfCards()-1);
  690. if(_c3){
  691. _c2.onclick=function(e){
  692. WizardDone();
  693. };
  694. _c2.ondblclick=function(e){
  695. WizardDone();
  696. };
  697. EnableButton(_c2,_c3);
  698. }
  699. };
  700. function WizardDone(){
  701. var _c6=G_App.m_oTreeViewCheckboxes.F_GetCheckedNodes();
  702. if(_c6.length==0){
  703. alert("No objects have been selected for the import.\n\nImport action cancelled.\n");
  704. return;
  705. }
  706. var _c7=[];
  707. for(var n=0;n<_c6.length;n++){
  708. var _c9=_c6.item(n);
  709. _c7[n]=GetTreeNodePath(_c9);
  710. }
  711. ConsolidateTree(_c7,0);
  712. if(_c7.length!=1){
  713. alert("ASSERT FAILED: The number tree objects must be 1!\n\nIt is currently: "+_c7.length);
  714. }
  715. var _ca={};
  716. _ca["node"]=[];
  717. _ca["node"][0]=_c7[0];
  718. var _cb=JSON.stringify(_ca,null,"\t");
  719. var _cc=G_App.m_oListViewCheckboxes.F_GetCheckedListItems();
  720. var _cd=[];
  721. var _ce=[];
  722. for(var i=0;i<_cc.length;i++){
  723. var _d0=_cc.item(i);
  724. var _d1=_d0.getAttribute("value");
  725. var _d2=_d0.getAttribute("label");
  726. _cd.push(_d2);
  727. _ce.push(_d1);
  728. }
  729. var _d3=document.getElementById("radioShortName");
  730. var _d4=document.getElementById("radioLongName");
  731. var _d5=document.getElementById("radioTechnicalName");
  732. var _d6=_d3.value;
  733. if(_d4.checked){
  734. _d6=_d4.value;
  735. }else{
  736. if(_d5.checked){
  737. _d6=_d5.value;
  738. }
  739. }
  740. var _d7=document.getElementById("enhanceModelForSAP");
  741. var _d8=document.getElementById("useV5DataServer");
  742. var _d9=document.getElementById("designLanguage");
  743. var _da={};
  744. _da["params"]={};
  745. _da["params"]["ObjectName"]=_d6;
  746. _da["params"]["ObjectLayout"]=_d7.checked?"true":"false";
  747. _da["params"]["UseV5DataServer"]=_d8.checked?"true":"false";
  748. _da["params"].languages=_ce;
  749. _da["params"].designLocale=_d9.options[_d9.selectedIndex].value;
  750. var _db=JSON.stringify(_da,null,"\t");
  751. var _dc={};
  752. _dc["pkgInfo"]={};
  753. _dc["pkgInfo"]["Name"]=IMPORTWIZARD.packageName;
  754. _dc["pkgInfo"]["Description"]=IMPORTWIZARD.packageDescription;
  755. _dc["pkgInfo"]["ScreenTip"]=IMPORTWIZARD.packageScreentip;
  756. _dc["pkgInfo"]["Location"]=IMPORTWIZARD.packageLocation;
  757. var _dd=JSON.stringify(_dc,null,"\t");
  758. IMPORTWIZARD.onResumeFromNonRecoverableError=function(){
  759. hideProgressIfShowing();
  760. };
  761. var _de=new ImportHelper(_cb,_db,_dd);
  762. _de.runImport();
  763. D_Progress.F_DisableCancel();
  764. D_Progress.F_Show(null,localizedStrings["MSR_SAP_creatingPackage"]);
  765. };
  766. function hideProgressIfShowing(){
  767. if(D_Progress.F_IsActiveDialog()){
  768. D_Progress.F_Hide();
  769. }
  770. };
  771. function GetTreeNodePath(_df){
  772. var _e0=_df;
  773. var _e1={};
  774. var _e2=true;
  775. do{
  776. var _e3=_e0.getAttribute("label");
  777. var _e4=_e0.getAttribute("value");
  778. var _e5=eval("("+_e4+")");
  779. var _e6=_e5.type;
  780. var _e7=_e5.uniqueName;
  781. var _e8={};
  782. _e8.Name=_e3;
  783. _e8.Type=_e6;
  784. _e8.Value=(_e6==kDatabaseTypeStr||_e6==kCatalogTypeStr)?"partial":"true";
  785. if(_e6==kDatabaseTypeStr){
  786. _e8.dbType="BW";
  787. var _e9=document.getElementById("cbSAPBWDualStructuresSupport");
  788. _e8.dualStructures=_e9.checked?"true":"false";
  789. _e8.isSystem="false";
  790. }else{
  791. _e8.uniqueName=_e7;
  792. }
  793. if(!_e2){
  794. _e8.children=[_e1];
  795. }
  796. _e1=_e8;
  797. _e0=_e0.parentNode;
  798. _e2=false;
  799. }while(_e0!=null&&_e0.tagName=="treeNode");
  800. return _e1;
  801. };
  802. function ConsolidateTree(_ea,_eb){
  803. if(_eb<_ea.length-2){
  804. ConsolidateTree(_ea,_eb+1);
  805. }
  806. for(var n=_ea.length-1;n>(_eb);n--){
  807. var _ed=_ea[_eb];
  808. var _ee=_ea[n];
  809. if(AreObjectsEqual(_ed,_ee,["children"])){
  810. if(_ed.children==undefined||_ed.children==null){
  811. _ed.children=_ee.children;
  812. }else{
  813. _ed.children=_ed.children.concat(_ee.children);
  814. }
  815. _ea.splice(n,1);
  816. ConsolidateTree(_ed.children,0);
  817. }
  818. }
  819. };
  820. G_App.F_OnCancel=function(){
  821. D_Progress.F_Hide();
  822. };
  823. function GetIconFilePath(_ef){
  824. var _f0=WEB_CONTENT+"/mdsrv/importWizardUI/images/";
  825. var _f1=[];
  826. _f1[kDatabaseTypeStr]=_f0+"icon_data_source.gif";
  827. _f1[kCatalogTypeStr]=_f0+"icon_catalog.gif";
  828. _f1[kCubeTypeStr]=_f0+"icon_cube.gif";
  829. _f1[kInfoQueryTypeStr]=_f0+"icon_info_query.gif";
  830. _f1[kDimensionGroupTypeStr]=_f0+"icon_folder_dimensions.gif";
  831. _f1[kDimensionTypeStr]=_f0+"icon_dimension.gif";
  832. _f1[kMeasuresGroupTypeStr]=_f0+"icon_folder_measures.gif";
  833. _f1[kMeasureTypeStr]=_f0+"icon_measure.gif";
  834. _f1["unknown"]=WEB_CONTENT+"/hal/images/btn_new.gif";
  835. var _f2=_f1[_ef];
  836. if(_f2==null){
  837. _f2=_f1["unknown"];
  838. }
  839. return _f2;
  840. };
  841. function metadataTreeResultsReceived(_f3){
  842. if(g_treeNodeBeingPopulated==null){
  843. return;
  844. }
  845. if(_f3==null){
  846. G_App.m_oTreeViewCheckboxes.F_EndAsyncLoad(true);
  847. g_treeNodeBeingPopulated=null;
  848. urlRequestInvoker.RequestFinished();
  849. return;
  850. }
  851. G_App.m_oTreeViewCheckboxes.F_Clear(g_treeNodeBeingPopulated);
  852. for(var i=0;i<_f3.node.children.length;i++){
  853. var _f5=G_App.m_treeViewNodesDoc;
  854. PopulateTreeView(_f3.node.children[i],_f5,g_treeNodeBeingPopulated);
  855. }
  856. G_App.m_oTreeViewCheckboxes.F_EndAsyncLoad(true);
  857. g_treeNodeBeingPopulated=null;
  858. urlRequestInvoker.RequestFinished();
  859. var _f6=document.getElementById("nextButton");
  860. EnableButton(_f6,true);
  861. var _f7=document.getElementById("finishButton");
  862. EnableButton(_f7,IMPORTWIZARD.isFinishButtonEnabled);
  863. };
  864. function HandleException(_f8){
  865. hideProgressIfShowing();
  866. var _f9=new ErrorPageManager();
  867. if(_f8.isQF){
  868. document.getElementById("main").style.display="none";
  869. _f9.handleQF(_f8.faultDom,ErrorPageClosed);
  870. }else{
  871. if(_f8.isCAM){
  872. document.getElementById("main").style.display="none";
  873. _f9.handleCAM(_f8,ErrorPageClosed);
  874. }else{
  875. var msg=_f8.messageString;
  876. if(msg===""){
  877. msg=localizedStrings["MSR_SAP_unknownErrorMessage"];
  878. }
  879. var _fb=_f8.stackTrace;
  880. _fb=unescape(_fb);
  881. document.getElementById("main").style.display="none";
  882. document.getElementById("editSelection").style.display="none";
  883. _f9.setupAndDisplayErrorPage(localizedStrings["MSR_SAP_errorPageTitle"],"",msg,_fb,ErrorPageClosed);
  884. }
  885. }
  886. };
  887. function ErrorPageClosed(_fc){
  888. document.getElementById("main").style.display="block";
  889. if(IMPORTWIZARD.onResumeFromNonRecoverableError&&!_fc){
  890. IMPORTWIZARD.onResumeFromNonRecoverableError();
  891. }
  892. };
  893. function launchFromEdit(){
  894. var _fd=document.getElementById("modifyMetadataSelections");
  895. var _fe=document.getElementById("editVariables");
  896. var _ff=document.getElementById("modifySettings");
  897. var _100=document.getElementById("editSelection");
  898. if(_fd.checked){
  899. _100.style.display="none";
  900. var main=document.getElementById("main");
  901. main.style.display="block";
  902. retrieveImportSpec();
  903. }else{
  904. if(_fe.checked){
  905. _100.style.display="none";
  906. OnShowVariables();
  907. }else{
  908. if(_ff.checked){
  909. SaveModifiedSettings();
  910. }
  911. }
  912. }
  913. };
  914. function ImportHelper(_102,_103,_104){
  915. this.m_importSpec=_102;
  916. this.m_parameters=_103;
  917. this.m_packageInfo=_104;
  918. };
  919. ImportHelper.prototype.runImport=function(){
  920. var _105=GATEWAY_URL+"/metadataUIService";
  921. this.m_requestId=new Date().getTime();
  922. var _106={};
  923. _106["pid"]="importWizard_Import_pid";
  924. _106["importSpec"]=this.m_importSpec;
  925. _106["parameters"]=this.m_parameters;
  926. _106["packageInfo"]=this.m_packageInfo;
  927. _106["requestId"]=this.m_requestId;
  928. _106["dataSourceCredentials"]=IMPORTWIZARD.credentials;
  929. _106["error_pid"]=asyncErrorPagePid;
  930. urlRequestInvoker.MakeAsyncRequestInIFrame(_105,_106);
  931. };
  932. function VariablesHelper(_107,_108){
  933. this.m_pkgLocation=_107;
  934. this.m_pkgName=_108;
  935. };
  936. VariablesHelper.prototype.retrieveVariables=function(_109,_10a){
  937. var _10b=GATEWAY_URL+"/metadataUIService";
  938. var _10c=new Object();
  939. _10c["pid"]="getSAPBWVariables_pid";
  940. _10c["packageLocation"]=this.m_pkgLocation;
  941. _10c["packageName"]=this.m_pkgName;
  942. _10c["error_pid"]=_10a;
  943. this.m_retrievedCallback=_109;
  944. urlRequestInvoker.MakeAsyncRequestInIFrame(_10b,_10c);
  945. };
  946. VariablesHelper.prototype.setJsonVariables=function(_10d){
  947. this.m_jsonVariables=_10d;
  948. this.m_retrievedCallback();
  949. };
  950. VariablesHelper.prototype.saveChanges=function(_10e,_10f){
  951. var _110=GATEWAY_URL+"/metadataUIService";
  952. var _111=new Object();
  953. _111["pid"]="updateSAPBWVariables_pid";
  954. _111["modelPath"]=this.m_pkgLocation+"/package[@name="+EncloseInQuotes(this.m_pkgName)+"]/model";
  955. _111["variables"]=JSON.stringify(this.m_jsonVariables,null,"\t");
  956. _111["error_pid"]=_10f;
  957. this.m_saveCallback=_10e;
  958. urlRequestInvoker.MakeAsyncRequestInIFrame(_110,_111);
  959. };
  960. VariablesHelper.prototype.saveStatus=function(_112){
  961. urlRequestInvoker.RequestFinished();
  962. this.m_saveCallback(_112);
  963. };
  964. function OnShowVariables(){
  965. D_Progress.F_DisableCancel();
  966. D_Progress.F_Show(null,localizedStrings["MSR_SAP_Loading"]);
  967. var _113=document.getElementById("main");
  968. _113.innerHTML=document.getElementById("editVariablesPane").innerHTML;
  969. _113.style.display="block";
  970. variablesHelper.retrieveVariables(OnVariablesResultsReceived,asyncErrorPagePid);
  971. };
  972. function OnVariablesResultsReceived(){
  973. G_App.F_SetupPropSheet(variablesHelper);
  974. urlRequestInvoker.RequestFinished();
  975. D_Progress.F_Hide();
  976. var _114=G_App.m_nPropertySheet.selectSingleNode(".//properties/group");
  977. if(_114){
  978. var _115=G_App.m_oPropertySheet.F_GetFocusableElements(_114.getAttribute("name"));
  979. if(_115&&_115.length>0){
  980. _115[0].focus();
  981. }
  982. }
  983. };
  984. function OnEditVariablesOKBtnClick(){
  985. D_Progress.F_DisableCancel();
  986. D_Progress.F_Show(null,localizedStrings["MSR_SAP_Saving"]);
  987. variablesHelper.saveChanges(OnSaveVariablesDoneResult,asyncErrorPagePid);
  988. };
  989. function OnSaveVariablesDoneResult(_116){
  990. D_Progress.F_Hide();
  991. window.location.replace(IMPORTWIZARD.backURL);
  992. };
  993. function OnEditVariablesCancelBtnClick(){
  994. window.location.replace(IMPORTWIZARD.backURL);
  995. };
  996. G_App.F_SetupPropSheet=function(_117){
  997. this.m_nPropertySheet=G_ResManager.F_GetResource("VariablesPropertySheet");
  998. var _118=this.m_nPropertySheet.getElementsByTagName("properties")[0];
  999. var _119=this.m_nPropertySheet.getElementsByTagName("objects")[0];
  1000. var _11a=_119.getElementsByTagName("object")[0];
  1001. var _11b=false;
  1002. for(var _11c=0;_11c<_117.m_jsonVariables.dataSource.length;_11c++){
  1003. var _11d=_117.m_jsonVariables.dataSource[_11c];
  1004. for(var _11e=0;_11e<_11d.variables.length;_11e++){
  1005. _11b=true;
  1006. var _11f=_11d.variables[_11e];
  1007. var _120=this.m_nPropertySheet.ownerDocument.createElement("group");
  1008. _120.setAttribute("name","Group_"+_11c+"_"+_11e);
  1009. _120.setAttribute("label",_11d.cube+" - "+_11f.name);
  1010. _118.appendChild(_120);
  1011. for(var _121=0;_121<_11f.children.length;_121++){
  1012. var _122=_11f.children[_121];
  1013. if(!_122){
  1014. continue;
  1015. }
  1016. var _123="variablesHelper.m_jsonVariables.dataSource["+_11c+"].variables["+_11e+"].children["+_121+"]";
  1017. var _124=this.m_nPropertySheet.ownerDocument.createElement("property");
  1018. _124.setAttribute("name",_123);
  1019. var type="text";
  1020. if(_122.name=="isKeyDate"||_122.name=="showKeyAndCaption"){
  1021. type="boolean";
  1022. }else{
  1023. if(_122.name=="promptType"){
  1024. type="dropDownList";
  1025. }
  1026. }
  1027. _124.setAttribute("type",type);
  1028. if(type=="dropDownList"){
  1029. _124.setAttribute("listView","VariablesPropertySheet_ListView1");
  1030. }
  1031. _124.setAttribute("label",_122.displayName);
  1032. _120.appendChild(_124);
  1033. var _126=this.m_nPropertySheet.ownerDocument.createElement("propertyRef");
  1034. _126.setAttribute("ref",_123);
  1035. _11a.appendChild(_126);
  1036. }
  1037. }
  1038. }
  1039. if(!_11b){
  1040. var _127=document.getElementById("divPropertySheet1");
  1041. _127.style.borderWidth=0;
  1042. _127.innerHTML="<div class=\"formLabel\" style=\"margin-top: 2em;\">"+localizedStrings["MSR_SAP_noVariablesForEdit"]+"</div>";
  1043. var _128=document.getElementById("editVariablesOKButton");
  1044. EnableButton(_128,false);
  1045. return;
  1046. }else{
  1047. this.m_oPropertySheet=new C_PropertySheet(document.getElementById("divPropertySheet1"),this.m_nPropertySheet,this,document.body,"clsPropertiesPaneInputBlocker");
  1048. this.m_divPropertySheet=document.getElementById("divPropertySheet1");
  1049. this.m_divPropertySheet.onkeydown=this.m_oPropertySheet.F_OnKeyDown.F_CreateEventMethodCallback(this.m_oPropertySheet);
  1050. this.f_showProperties();
  1051. }
  1052. };
  1053. G_App.F_RetrieveData=function(){
  1054. };
  1055. G_App.f_showProperties=function(_129){
  1056. if(!_129){
  1057. this.f_updatePropertyInfo();
  1058. this.m_oPropertySheet.F_Clear();
  1059. }
  1060. this.m_oPropertySheet.F_SetUpdate(Boolean(_129));
  1061. for(var _12a=0;_12a<this.m_oPropertySheet.Groups.length;_12a++){
  1062. var _12b=this.m_oPropertySheet.Groups[_12a];
  1063. this.m_oPropertySheet.F_StartPropertyGroup(_12b.Name);
  1064. var _12c=_12b.Properties;
  1065. var _12d=_12c.length;
  1066. for(var i=0;i<_12d;i++){
  1067. var _12f=_12c[i];
  1068. if(this.m_oPropertySheet.F_ObjectSupportsProperty("Object1",_12f)){
  1069. var _130=this.m_nPropertySheet.selectSingleNode("properties/group/property[@name='"+_12f+"']");
  1070. var _12f=_130.getAttribute("name");
  1071. var _131=eval(_12f).value;
  1072. this.m_oPropertySheet.F_ShowProperty(_12f,_131?_131:"");
  1073. }
  1074. }
  1075. this.m_oPropertySheet.F_EndPropertyGroup();
  1076. }
  1077. this.m_oPropertySheet.F_EndAllPropertyGroups();
  1078. };
  1079. G_App.F_PropertySheet_GetPropertyListView=function(_132,_133,_134,_135){
  1080. return G_ResManager.F_GetResource(_133);
  1081. };
  1082. G_App.F_PropertySheet_OnShowDropDown=function(_136,_137,_138,_139,td){
  1083. G_Debug.F_Print("F_PropertySheet_OnShowDropDown: "+_137+"="+_138);
  1084. var _13b=parseInt(this.m_oPropertySheet.F_GetPropertyAttribute(_137,"listViewHeight"));
  1085. var _13c=parseInt(this.m_oPropertySheet.F_GetPropertyAttribute(_137,"listViewWidth"));
  1086. this.m_oPropertySheet.F_ShowListView(_137,_138,_139,_13b,_13c);
  1087. };
  1088. G_App.F_PropertySheet_OnPropertyChange=function(_13d,_13e,_13f){
  1089. G_Debug.F_Print("F_PropertySheet_OnPropertyChange: "+_13e+"="+_13f);
  1090. eval(_13e).value=_13f;
  1091. setTimeout(G_App.f_showProperties.bind(G_App,true),0);
  1092. };
  1093. G_App.F_PropertySheet_OnPropertyDelete=function(_140,_141){
  1094. G_Debug.F_Print("F_PropertySheet_OnPropertyDelete: "+_141);
  1095. eval(_141).value="";
  1096. setTimeout(G_App.f_showProperties.bind(G_App,true),0);
  1097. };
  1098. G_App.F_PropertySheet_OnPropertyAction=function(_142,_143,_144,_145){
  1099. };
  1100. G_App.F_PropertySheet_OnCycleDropDownList=function(_146,_147,_148){
  1101. G_Debug.F_Print("F_PropertySheet_OnCycleDropDownList: "+_147+"="+_148);
  1102. };
  1103. G_App.F_PropertySheet_OnPropertyFailedValidation=function(_149,_14a,_14b,_14c,_14d,_14e){
  1104. G_Debug.F_Print("F_PropertySheet_OnPropertyFailedValidation: "+_14b+"="+_14c);
  1105. };
  1106. G_App.F_PropertySheet_OnPropertyActivated=function(_14f,_150){
  1107. G_Debug.F_Print("F_PropertySheet_OnPropertyActivated: "+_150);
  1108. this.f_updatePropertyInfo(_150);
  1109. };
  1110. G_App.F_PropertySheet_OnPropertyDeactivated=function(_151,_152){
  1111. G_Debug.F_Print("F_PropertySheet_OnPropertyDeactivated: "+_152);
  1112. this.f_updatePropertyInfo();
  1113. };
  1114. G_App.f_updatePropertyInfo=function(_153){
  1115. var _154="";
  1116. var _155="";
  1117. if(_153){
  1118. _154=this.m_oPropertySheet.F_GetLabel(_153);
  1119. _155="This is the description of "+_154;
  1120. }
  1121. document.getElementById("idPropertiesPane_divInfoTitle").innerText=_154;
  1122. document.getElementById("idPropertiesPane_divInfoDescription").innerText=_155;
  1123. };