tm1web.html 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <!
  2. IBM Confidential
  3. OCO Source Materials
  4. BI and PM: pmpsvc
  5. (C) Copyright IBM Corp.2008, 2009, 2010, 2011
  6. The source code for this program is not published or otherwise
  7. divested of its trade secrets, irrespective of what has been
  8. deposited with the U.S. Copyright Office.
  9. >
  10. <html>
  11. <head>
  12. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  13. <meta http-equiv="expires" content="0">
  14. </head>
  15. <body>
  16. <form name="planningForm" method="post" action="" style="display:none;">
  17. <input name="c_pp" type="hidden" value="">
  18. <input name="c_crn" type="hidden" value="">
  19. <input name="c_gw" type="hidden" value="">
  20. <input name="validateServers" type="hidden" value="">
  21. <input name="aid" type="hidden" value="">
  22. <input name="cp" type="hidden" value="0">
  23. <input name="nodeID" type="hidden" value="">
  24. <input name="portal" type="hidden" value="">
  25. <input name="applicationId" type="hidden" value="">
  26. <input name="host" type="hidden" value="">
  27. <input name="server" type="hidden" value="">
  28. <input name="c_ss" type="hidden" value="">
  29. </form>
  30. <script language="JavaScript">
  31. debugger;
  32. // Update the following to point to the location of the TM1Web service(s)
  33. var tm1webServices = ["http://localhost:8080","http://localhost:9510"];
  34. var sHref = location.href;
  35. var gPos = sHref.indexOf("tm1web.html");
  36. var sGateway = sHref.substring(0, gPos-1);
  37. var sCP = "0";
  38. // If URL contains a TM1Web service address parameter 'ps' then it must be included
  39. // in the list of valid server locations, otherwise you will be redirected under the current location
  40. var sPS = decodeURIComponent(getQueryVariable("ps")).toLowerCase();
  41. if (sPS == "") {
  42. // If the current location is beneath the dispatcher service, assume the TM1Web service is a sibling
  43. // of the dispatcher service on the same domain
  44. var len = sGateway.length;
  45. if (len > 5 && sGateway.substring(len-5, len).toLowerCase() == "/p2pd") {
  46. sPS = sGateway.substring(0, len-5);
  47. } else {
  48. sPS = sGateway;
  49. }
  50. } else {
  51. for (var i = 0; i < tm1webServices.length; ++i) {
  52. if (tm1webServices[i].toLowerCase() == sPS) break;
  53. }
  54. if (i == tm1webServices.length) {
  55. sPS = "";
  56. }
  57. }
  58. if (sPS != "") {
  59. var sUrl = sPS + "/tm1web/";
  60. // Check for the page requested - default to applications if no page was specificied
  61. var sPage = decodeURIComponent(getQueryVariable("pg"));
  62. if (sPage == "") {
  63. sUrl += "applications.jsp";
  64. } else {
  65. var cSep = '?';
  66. iPos = sPage.indexOf("CogrcpServlet");
  67. if (iPos == -1) {
  68. sUrl += sPage;
  69. if (sPage == "TM1WebCubeViewer.jsp") {
  70. sUrl += "?HostName=";
  71. sUrl += decodeURIComponent(getQueryVariable("HostName"));
  72. sUrl += "&ServerName=";
  73. sUrl += decodeURIComponent(getQueryVariable("ServerName"));
  74. sUrl += "&CubeName=";
  75. sUrl += decodeURIComponent(getQueryVariable("CubeName"));
  76. sUrl += "&CubeViewName=";
  77. sUrl += decodeURIComponent(getQueryVariable("CubeViewName"));
  78. sUrl += "&Password=";
  79. sUrl += decodeURIComponent(getQueryVariable("cam_passport"));
  80. var accessType = decodeURIComponent(getQueryVariable("AccessType"));
  81. sUrl += "&AccessType=" + (accessType ? accessType : "PUBLIC");
  82. } else if (sPage == "TM1WebWebSheeter.jsp") {
  83. sUrl += "?HostName=";
  84. sUrl += decodeURIComponent(getQueryVariable("HostName"));
  85. sUrl += "&ServerName=";
  86. sUrl += decodeURIComponent(getQueryVariable("ServerName"));
  87. sUrl += "&WebSheet=";
  88. sUrl += decodeURIComponent(getQueryVariable("CubeName"));
  89. sUrl += "&Password=";
  90. sUrl += decodeURIComponent(getQueryVariable("cam_passport"));
  91. sUrl +="&AccessType=PUBLIC";
  92. } else if (sPage == "TM1WebAPISample.html") {
  93. sUrl += "?HostName=";
  94. sUrl += decodeURIComponent(getQueryVariable("HostName"));
  95. sUrl += "&ServerName=";
  96. sUrl += decodeURIComponent(getQueryVariable("ServerName"));
  97. sUrl += "&WebSheet=";
  98. sUrl += decodeURIComponent(getQueryVariable("CubeName"));
  99. sUrl += "&Password=";
  100. sUrl += decodeURIComponent(getQueryVariable("cam_passport"));
  101. sUrl +="&AccessType=PUBLIC";
  102. }
  103. } else {
  104. sUrl += "applications.jsp";
  105. sCP = "1";
  106. }
  107. }
  108. var planningForm = document.planningForm;
  109. planningForm.c_gw.value = sGateway;
  110. planningForm.c_pp.value = getQueryVariable("cam_passport");
  111. planningForm.c_crn.value = getQueryVariable("CRN");
  112. planningForm.validateServers.value = getQueryVariable("validateServers");
  113. planningForm.aid.value = decodeURIComponent(getQueryVariable("aid"));
  114. planningForm.cp.value = sCP;
  115. planningForm.nodeID.value = decodeURIComponent(getQueryVariable("nodeID"));
  116. planningForm.portal.value = getQueryVariable("portal");
  117. planningForm.applicationId.value = getQueryVariable("applicationId");
  118. planningForm.host.value = getQueryVariable("host");
  119. planningForm.server.value = getQueryVariable("server");
  120. planningForm.c_ss.value = getCookie("cc_session");
  121. // support workflow urls in cognos connection
  122. if (planningForm.c_pp.value == null || planningForm.c_pp.value == "") {
  123. var aCookie = document.cookie.split("; ");
  124. for (var i = 0; i < aCookie.length; ++i) {
  125. var sCrumb = aCookie[i].split("=");
  126. if (sCrumb[0] == "cam_passport") {
  127. planningForm.c_pp.value = sCrumb[1];
  128. } else if (sCrumb[0] == "CRN") {
  129. planningForm.c_crn.value = sCrumb[1];
  130. }
  131. }
  132. }
  133. planningForm.action = sUrl;
  134. planningForm.submit();
  135. }
  136. function getQueryVariable(variable) {
  137. var query = window.location.search.substring(1);
  138. var vars = query.split("&");
  139. for (var i = 0; i < vars.length; i++) {
  140. var pair = vars[i].split("=");
  141. if (pair[0] == variable) {
  142. return pair[1];
  143. }
  144. }
  145. return "";
  146. }
  147. function getCookie(name)
  148. {
  149. var arg = name + "=";
  150. var alen = arg.length;
  151. var clen = document.cookie.length;
  152. var i = 0;
  153. while (i < clen)
  154. {
  155. var j = i + alen;
  156. if (document.cookie.substring(i, j) == arg)
  157. return getCookieVal (j);
  158. i = document.cookie.indexOf(" ", i) + 1;
  159. if (i == 0)
  160. break;
  161. }
  162. return null;
  163. }
  164. function getCookieVal(offset)
  165. {
  166. var endstr = document.cookie.indexOf (";", offset);
  167. if (endstr == -1)
  168. endstr = document.cookie.length;
  169. return document.cookie.substring(offset, endstr);
  170. }
  171. </script>
  172. <center><b>The TM1Web service parameter was not specified or is not one of the configured locations</b></center>
  173. </body>
  174. </html>