admin_console.js 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. // Licensed Materials - Property of IBM
  2. // IBM Cognos Products: XQE
  3. // (C) Copyright IBM Corp. 2008, 2015
  4. // US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  5. if (!window.CognosObjectFactory) {
  6. window.CognosObjectFactory = function() {
  7. throw 'RuntimeException: CognosObjectFactory is a static class and may not be instantiated';
  8. }
  9. CognosObjectFactory.init = function(objName) {
  10. var namespace = objName.split(".");
  11. var obj=window;
  12. for (var i=0; i < namespace.length;i++) {
  13. if (!obj[namespace[i]]) {
  14. obj = obj[namespace[i]] = {};
  15. } else {
  16. obj = obj[namespace[i]];
  17. if (typeof(obj) != "object")
  18. throw new Error(objName + " already exists and is not an object");
  19. }
  20. }
  21. return obj;
  22. }
  23. }
  24. CognosObjectFactory.init("com.cognos.xqe.admin");
  25. com.cognos.xqe.admin.init = function(frag) {
  26. frag.addEventListener("com.ibm.portal.extension.queryServiceTask.transferState", "com.cognos.xqe.admin.onTransferState");
  27. com.cognos.xqe.admin.fragment = frag;
  28. }
  29. com.cognos.xqe.admin.onTransferState = function(evt) {
  30. var xqeAdminFragment = com.cognos.xqe.admin.fragment;
  31. with (evt.payload) {
  32. form = document.getElementById(xqeAdminFragment.id+'pform');
  33. dataSourceType = form.xqeQSATPage_DATASOURCE_TYPE_Hidden;
  34. if (dataSourceType.value == "ROLAP") {
  35. operationIndex = form.xqeROLAPQSATPage_selectedOperation.selectedIndex;
  36. operationName = form[xqeAdminFragment.hiddenOperationFields[operationIndex]];
  37. dispatcherName = form.xqeROLAPQSATPage_selectedDispatcher.options[form.xqeROLAPQSATPage_selectedDispatcher.selectedIndex];
  38. var cubeList = "";
  39. var elementCount = form.length;
  40. var cubeCount = 0;
  41. for(var i = 0; i < elementCount; i++) {
  42. var element = form.elements[i];
  43. if (element.type == 'checkbox' && element.checked) {
  44. if (element.id != 'control_checkbox') {
  45. cubeList += '<item xsi:type=\"xsd:string\">' + element.value + '</item>';
  46. cubeCount++;
  47. }
  48. }
  49. }
  50. if (cubeCount == 0) {
  51. javascript:alert(xqeAdminFragment.i18n.UI_xqeCubeMsgSelectAtleastOneCube);
  52. isValid = false;
  53. } else {
  54. isValid = true;
  55. }
  56. isDirty = true;
  57. options = "<options xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"bus:optionArrayProp\"> <value xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\" xsi:type=\"SOAP-ENC:Array\" SOAP-ENC:arrayType=\"bus:option[3]\"> ";
  58. options += "<item xsi:type=\"bus:genericOptionBoolean\"><name xsi:type=\"xsd:string\">http://developer.cognos.com/ceba/constants/queryTaskOptionEnum#"+xqeAdminFragment.optionNames[operationIndex]+"</name><value xsi:type=\"xsd:boolean\">true</value></item>" +
  59. "<item xsi:type=\"bus:genericOptionStringArray\"><name xsi:type=\"xsd:string\">http://developer.cognos.com/ceba/constants/queryTaskOptionEnum#"+xqeAdminFragment.optionNames[operationIndex]+"Context</name><value xsi:type=\"SOAP-ENC:Array\" SOAP-ENC:arrayType=\"xsd:string[" + cubeCount + "]\"> " + cubeList + " </value> </item>";
  60. options += "<item xsi:type=\"bus:monitorOptionGUID\"><name xsi:type=\"bus:monitorOptionEnum\">dispatcherID</name><value xsi:type=\"bus:guid\">" + dispatcherName.value + "</value></item>" + "</value></options>";
  61. } else if (dataSourceType.value == "DMR") {
  62. var radioButtonElementValue = "";
  63. var oRadio = form.elements['xqeQSATPage_DMR_Radio_Button_Group'];
  64. for(var i = 0; i < oRadio.length; i++) {
  65. if(oRadio[i].checked) {
  66. radioButtonElementValue = oRadio[i].value;
  67. break;
  68. }
  69. }
  70. if (radioButtonElementValue == 'Package') {
  71. form.xqeQSATPage_DataSources.value = "";
  72. } else if (radioButtonElementValue == 'DataSources') {
  73. form.xqeQSATPage_Package.value = "";
  74. }
  75. flushOperationDisplayName = form.xqeQSATPage_FLUSH_Hidden;
  76. dumpOperationDisplayName = form.xqeQSATPage_DUMP_Hidden;
  77. dsName = form.xqeQSATPage_DataSources;
  78. packageName = form.xqeQSATPage_Package;
  79. operationIndex = form.xqeQSATPage_Operations.selectedIndex;
  80. if (operationIndex == 0) {
  81. operationName = form.xqeQSATPage_FLUSH_Hidden;
  82. } else {
  83. operationName = form.xqeQSATPage_DUMP_Hidden;
  84. }
  85. recvdDsName = form.xqeQSATPage_DataSources_Hidden;
  86. recvdPackageName = form.xqeQSATPage_Package_Hidden;
  87. recvdOperationName = form.xqeQSATPage_Operations_Hidden;
  88. if (recvdDsName != dsName || recvdPackageName != packageName || operationName != recvdOperationName) {
  89. isDirty = true;
  90. } else {
  91. isDirty = false;
  92. }
  93. if (dsName.value == '' && packageName.value == '') {
  94. javascript:alert(xqeAdminFragment.i18n.UI_xqeCubeMsgEnterValidDataSourceOrPackageName);
  95. isValid = false;
  96. } else {
  97. isValid = true;
  98. }
  99. options = null;
  100. if (operationName.value == flushOperationDisplayName.value) {
  101. options = "<options xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"bus:optionArrayProp\"> <value xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\" xsi:type=\"SOAP-ENC:Array\" SOAP-ENC:arrayType=\"bus:option[2]\"> <item xsi:type=\"bus:genericOptionBoolean\"><name xsi:type=\"xsd:string\">http://developer.cognos.com/ceba/constants/queryTaskOptionEnum#clearCache</name><value xsi:type=\"xsd:boolean\">true</value></item> <item xsi:type=\"bus:genericOptionStringArray\"><name xsi:type=\"xsd:string\">http://developer.cognos.com/ceba/constants/queryTaskOptionEnum#clearCacheContext</name><value xsi:type=\"SOAP-ENC:Array\" SOAP-ENC:arrayType=\"xsd:string[1]\"> <item xsi:type=\"xsd:string\">"
  102. + encodeURI(xmlencode(dsName.value)) + "\"/\"" + encodeURI(xmlencode(packageName.value)) + "\"/\"" + dataSourceType.value
  103. + "</item> </value> </item></value> </options>";
  104. } else if (operationName.value == dumpOperationDisplayName.value) {
  105. options = "<options xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"bus:optionArrayProp\"> <value xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\" xsi:type=\"SOAP-ENC:Array\" SOAP-ENC:arrayType=\"bus:option[2]\"> <item xsi:type=\"bus:genericOptionBoolean\"><name xsi:type=\"xsd:string\">http://developer.cognos.com/ceba/constants/queryTaskOptionEnum#DumpCacheState</name><value xsi:type=\"xsd:boolean\">true</value></item> <item xsi:type=\"bus:genericOptionStringArray\"><name xsi:type=\"xsd:string\">http://developer.cognos.com/ceba/constants/queryTaskOptionEnum#DumpCacheStateContext</name><value xsi:type=\"SOAP-ENC:Array\" SOAP-ENC:arrayType=\"xsd:string[1]\"> <item xsi:type=\"xsd:string\">"
  106. + encodeURI(xmlencode(dsName.value)) + "\"/\"" + encodeURI(xmlencode(packageName.value)) + "\"/\"" + dataSourceType.value
  107. + "</item> </value> </item></value> </options>";
  108. } else {
  109. options = null;
  110. }
  111. } else if (dataSourceType.value == "ESSBASE") {
  112. flushOperationDisplayName = form.xqeQSATPage_FLUSH_Hidden;
  113. dumpOperationDisplayName = form.xqeQSATPage_DUMP_Hidden;
  114. dsName = form.xqeQSATPage_DataSources;
  115. ctlgName = form.xqeQSATPage_Catalogs;
  116. cubeName = form.xqeQSATPage_Cubes;
  117. operationIndex = form.xqeQSATPage_Operations.selectedIndex;
  118. if (operationIndex == 0) {
  119. operationName = form.xqeQSATPage_FLUSH_Hidden;
  120. } else {
  121. operationName = form.xqeQSATPage_DUMP_Hidden;
  122. }
  123. recvdDsName = form.xqeQSATPage_DataSources_Hidden;
  124. recvdCtlgName = form.xqeQSATPage_Catalogs_Hidden;
  125. recvdCubeName = form.xqeQSATPage_Cubes_Hidden;
  126. recvdOperationName = form.xqeQSATPage_Operations_Hidden;
  127. if (recvdDsName != dsName || recvdCtlgName != ctlgName || recvdCubeName != cubeName || operationName != recvdOperationName) {
  128. isDirty = true;
  129. } else {
  130. isDirty = false;
  131. }
  132. if (dsName.value == '' || ctlgName.value == '' || cubeName.value == '') {
  133. javascript:alert(xqeAdminFragment.i18n.UI_xqeCubeMsgEnterValidDataSourceCatalogCube);
  134. isValid = false;
  135. } else {
  136. isValid = true;
  137. }
  138. options = null;
  139. if (operationName.value == flushOperationDisplayName.value) {
  140. options = "<options xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"bus:optionArrayProp\"> <value xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\" xsi:type=\"SOAP-ENC:Array\" SOAP-ENC:arrayType=\"bus:option[2]\"> <item xsi:type=\"bus:genericOptionBoolean\"><name xsi:type=\"xsd:string\">http://developer.cognos.com/ceba/constants/queryTaskOptionEnum#clearCache</name><value xsi:type=\"xsd:boolean\">true</value></item> <item xsi:type=\"bus:genericOptionStringArray\"><name xsi:type=\"xsd:string\">http://developer.cognos.com/ceba/constants/queryTaskOptionEnum#clearCacheContext</name><value xsi:type=\"SOAP-ENC:Array\" SOAP-ENC:arrayType=\"xsd:string[1]\"> <item xsi:type=\"xsd:string\">"
  141. + encodeURI(xmlencode(dsName.value)) + "\"/\"" + encodeURI(xmlencode(ctlgName.value)) + "\"/\"" + encodeURI(xmlencode(cubeName.value)) + "\"/\"" + dataSourceType.value
  142. + "</item> </value> </item></value> </options>";
  143. } else if (operationName.value == dumpOperationDisplayName.value) {
  144. options = "<options xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"bus:optionArrayProp\"> <value xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\" xsi:type=\"SOAP-ENC:Array\" SOAP-ENC:arrayType=\"bus:option[2]\"> <item xsi:type=\"bus:genericOptionBoolean\"><name xsi:type=\"xsd:string\">http://developer.cognos.com/ceba/constants/queryTaskOptionEnum#DumpCacheState</name><value xsi:type=\"xsd:boolean\">true</value></item> <item xsi:type=\"bus:genericOptionStringArray\"><name xsi:type=\"xsd:string\">http://developer.cognos.com/ceba/constants/queryTaskOptionEnum#DumpCacheStateContext</name><value xsi:type=\"SOAP-ENC:Array\" SOAP-ENC:arrayType=\"xsd:string[1]\"> <item xsi:type=\"xsd:string\">"
  145. + encodeURI(xmlencode(dsName.value)) + "\"/\"" + encodeURI(xmlencode(ctlgName.value)) + "\"/\"" + encodeURI(xmlencode(cubeName.value)) + "\"/\"" + dataSourceType.value
  146. + "</item> </value> </item></value> </options>";
  147. } else {
  148. options = null;
  149. }
  150. } else if (dataSourceType.value == "SAPBW") {
  151. flushOperationDisplayName = form.xqeQSATPage_FLUSH_Hidden;
  152. dumpOperationDisplayName = form.xqeQSATPage_DUMP_Hidden;
  153. dsName = form.xqeQSATPage_DataSources;
  154. ctlgName = form.xqeQSATPage_Catalogs;
  155. cubeName = form.xqeQSATPage_Cubes;
  156. operationIndex = form.xqeQSATPage_Operations.selectedIndex;
  157. if (operationIndex == 0) {
  158. operationName = form.xqeQSATPage_FLUSH_Hidden;
  159. } else {
  160. operationName = form.xqeQSATPage_DUMP_Hidden;
  161. }
  162. recvdDsName = form.xqeQSATPage_DataSources_Hidden;
  163. recvdCtlgName = form.xqeQSATPage_Catalogs_Hidden;
  164. recvdCubeName = form.xqeQSATPage_Cubes_Hidden;
  165. recvdOperationName = form.xqeQSATPage_Operations_Hidden;
  166. if (recvdDsName != dsName || recvdCtlgName != ctlgName || recvdCubeName != cubeName || operationName != recvdOperationName) {
  167. isDirty = true;
  168. } else {
  169. isDirty = false;
  170. }
  171. if (dsName.value == '' || ctlgName.value == '' || cubeName.value == '') {
  172. javascript:alert(xqeAdminFragment.i18n.UI_xqeCubeMsgEnterValidDataSourceCatalogCube);
  173. isValid = false;
  174. } else {
  175. isValid = true;
  176. }
  177. options = null;
  178. if (operationName.value == flushOperationDisplayName.value) {
  179. options = "<options xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"bus:optionArrayProp\"> <value xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\" xsi:type=\"SOAP-ENC:Array\" SOAP-ENC:arrayType=\"bus:option[2]\"> <item xsi:type=\"bus:genericOptionBoolean\"><name xsi:type=\"xsd:string\">http://developer.cognos.com/ceba/constants/queryTaskOptionEnum#clearCache</name><value xsi:type=\"xsd:boolean\">true</value></item> <item xsi:type=\"bus:genericOptionStringArray\"><name xsi:type=\"xsd:string\">http://developer.cognos.com/ceba/constants/queryTaskOptionEnum#clearCacheContext</name><value xsi:type=\"SOAP-ENC:Array\" SOAP-ENC:arrayType=\"xsd:string[1]\"> <item xsi:type=\"xsd:string\">"
  180. + encodeURI(xmlencode(dsName.value)) + "\"/\"" + encodeURI(xmlencode(ctlgName.value)) + "\"/\"" + encodeURI(xmlencode(cubeName.value)) + "\"/\"" + dataSourceType.value
  181. + "</item> </value> </item></value> </options>";
  182. } else if (operationName.value == dumpOperationDisplayName.value) {
  183. options = "<options xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"bus:optionArrayProp\"> <value xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\" xsi:type=\"SOAP-ENC:Array\" SOAP-ENC:arrayType=\"bus:option[2]\"> <item xsi:type=\"bus:genericOptionBoolean\"><name xsi:type=\"xsd:string\">http://developer.cognos.com/ceba/constants/queryTaskOptionEnum#DumpCacheState</name><value xsi:type=\"xsd:boolean\">true</value></item> <item xsi:type=\"bus:genericOptionStringArray\"><name xsi:type=\"xsd:string\">http://developer.cognos.com/ceba/constants/queryTaskOptionEnum#DumpCacheStateContext</name><value xsi:type=\"SOAP-ENC:Array\" SOAP-ENC:arrayType=\"xsd:string[1]\"> <item xsi:type=\"xsd:string\">"
  184. + encodeURI(xmlencode(dsName.value)) + "\"/\"" + encodeURI(xmlencode(ctlgName.value)) + "\"/\"" + encodeURI(xmlencode(cubeName.value)) + "\"/\"" + dataSourceType.value
  185. + "</item> </value> </item></value> </options>";
  186. } else {
  187. options = null;
  188. }
  189. } else {
  190. flushOperationDisplayName = form.xqeQSATPage_FLUSH_Hidden;
  191. dumpOperationDisplayName = form.xqeQSATPage_DUMP_Hidden;
  192. dsName = form.xqeQSATPage_DataSources;
  193. ctlgName = form.xqeQSATPage_Catalogs;
  194. cubeName = form.xqeQSATPage_Cubes;
  195. operationIndex = form.xqeQSATPage_Operations.selectedIndex;
  196. if (operationIndex == 0) {
  197. operationName = form.xqeQSATPage_FLUSH_Hidden;
  198. } else {
  199. operationName = form.xqeQSATPage_DUMP_Hidden;
  200. }
  201. recvdDsName = form.xqeQSATPage_DataSources_Hidden;
  202. recvdCtlgName = form.xqeQSATPage_Catalogs_Hidden;
  203. recvdCubeName = form.xqeQSATPage_Cubes_Hidden;
  204. recvdOperationName = form.xqeQSATPage_Operations_Hidden;
  205. if (recvdDsName != dsName || recvdCtlgName != ctlgName || recvdCubeName != cubeName || operationName != recvdOperationName) {
  206. isDirty = true;
  207. } else {
  208. isDirty = false;
  209. }
  210. if (dsName.value == '' || ctlgName.value == '' || cubeName.value == '') {
  211. javascript:alert(xqeAdminFragment.i18n.UI_xqeCubeMsgEnterValidDataSourceCatalogCube);
  212. isValid = false;
  213. } else {
  214. isValid = true;
  215. }
  216. options = null;
  217. if (operationName.value == flushOperationDisplayName.value) {
  218. options = "<options xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"bus:optionArrayProp\"> <value xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\" xsi:type=\"SOAP-ENC:Array\" SOAP-ENC:arrayType=\"bus:option[2]\"> <item xsi:type=\"bus:genericOptionBoolean\"><name xsi:type=\"xsd:string\">http://developer.cognos.com/ceba/constants/queryTaskOptionEnum#clearCache</name><value xsi:type=\"xsd:boolean\">true</value></item> <item xsi:type=\"bus:genericOptionStringArray\"><name xsi:type=\"xsd:string\">http://developer.cognos.com/ceba/constants/queryTaskOptionEnum#clearCacheContext</name><value xsi:type=\"SOAP-ENC:Array\" SOAP-ENC:arrayType=\"xsd:string[1]\"> <item xsi:type=\"xsd:string\">"
  219. + encodeURI(xmlencode(dsName.value)) + "\"/\"" + encodeURI(xmlencode(ctlgName.value)) + "\"/\"" + encodeURI(xmlencode(cubeName.value))
  220. + "</item> </value> </item></value> </options>";
  221. } else if (operationName.value == dumpOperationDisplayName.value) {
  222. options = "<options xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"bus:optionArrayProp\"> <value xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\" xsi:type=\"SOAP-ENC:Array\" SOAP-ENC:arrayType=\"bus:option[2]\"> <item xsi:type=\"bus:genericOptionBoolean\"><name xsi:type=\"xsd:string\">http://developer.cognos.com/ceba/constants/queryTaskOptionEnum#DumpCacheState</name><value xsi:type=\"xsd:boolean\">true</value></item> <item xsi:type=\"bus:genericOptionStringArray\"><name xsi:type=\"xsd:string\">http://developer.cognos.com/ceba/constants/queryTaskOptionEnum#DumpCacheStateContext</name><value xsi:type=\"SOAP-ENC:Array\" SOAP-ENC:arrayType=\"xsd:string[1]\"> <item xsi:type=\"xsd:string\">"
  223. + encodeURI(xmlencode(dsName.value)) + "\"/\"" + encodeURI(xmlencode(ctlgName.value)) + "\"/\"" + encodeURI(xmlencode(cubeName.value))
  224. + "</item> </value> </item></value> </options>";
  225. } else {
  226. options = null;
  227. }
  228. }
  229. }
  230. }