123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294 |
- // Licensed Materials - Property of IBM
- // IBM Cognos Products: XQE
- // (C) Copyright IBM Corp. 2008, 2015
- // US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- if (!window.CognosObjectFactory) {
- window.CognosObjectFactory = function() {
- throw 'RuntimeException: CognosObjectFactory is a static class and may not be instantiated';
- }
- CognosObjectFactory.init = function(objName) {
- var namespace = objName.split(".");
- var obj=window;
- for (var i=0; i < namespace.length;i++) {
- if (!obj[namespace[i]]) {
- obj = obj[namespace[i]] = {};
- } else {
- obj = obj[namespace[i]];
- if (typeof(obj) != "object")
- throw new Error(objName + " already exists and is not an object");
- }
- }
- return obj;
- }
- }
- CognosObjectFactory.init("com.cognos.xqe.admin");
- com.cognos.xqe.admin.init = function(frag) {
- frag.addEventListener("com.ibm.portal.extension.queryServiceTask.transferState", "com.cognos.xqe.admin.onTransferState");
- com.cognos.xqe.admin.fragment = frag;
- }
- com.cognos.xqe.admin.onTransferState = function(evt) {
- var xqeAdminFragment = com.cognos.xqe.admin.fragment;
- with (evt.payload) {
- form = document.getElementById(xqeAdminFragment.id+'pform');
-
- dataSourceType = form.xqeQSATPage_DATASOURCE_TYPE_Hidden;
-
- if (dataSourceType.value == "ROLAP") {
-
- operationIndex = form.xqeROLAPQSATPage_selectedOperation.selectedIndex;
- operationName = form[xqeAdminFragment.hiddenOperationFields[operationIndex]];
- dispatcherName = form.xqeROLAPQSATPage_selectedDispatcher.options[form.xqeROLAPQSATPage_selectedDispatcher.selectedIndex];
-
- var cubeList = "";
- var elementCount = form.length;
- var cubeCount = 0;
- for(var i = 0; i < elementCount; i++) {
- var element = form.elements[i];
- if (element.type == 'checkbox' && element.checked) {
- if (element.id != 'control_checkbox') {
- cubeList += '<item xsi:type=\"xsd:string\">' + element.value + '</item>';
- cubeCount++;
- }
- }
- }
-
- if (cubeCount == 0) {
- javascript:alert(xqeAdminFragment.i18n.UI_xqeCubeMsgSelectAtleastOneCube);
- isValid = false;
- } else {
- isValid = true;
- }
-
- isDirty = true;
- 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]\"> ";
- 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>" +
-
- "<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>";
-
- options += "<item xsi:type=\"bus:monitorOptionGUID\"><name xsi:type=\"bus:monitorOptionEnum\">dispatcherID</name><value xsi:type=\"bus:guid\">" + dispatcherName.value + "</value></item>" + "</value></options>";
- } else if (dataSourceType.value == "DMR") {
- var radioButtonElementValue = "";
- var oRadio = form.elements['xqeQSATPage_DMR_Radio_Button_Group'];
-
- for(var i = 0; i < oRadio.length; i++) {
- if(oRadio[i].checked) {
- radioButtonElementValue = oRadio[i].value;
- break;
- }
- }
-
- if (radioButtonElementValue == 'Package') {
- form.xqeQSATPage_DataSources.value = "";
- } else if (radioButtonElementValue == 'DataSources') {
- form.xqeQSATPage_Package.value = "";
- }
-
- flushOperationDisplayName = form.xqeQSATPage_FLUSH_Hidden;
- dumpOperationDisplayName = form.xqeQSATPage_DUMP_Hidden;
- dsName = form.xqeQSATPage_DataSources;
- packageName = form.xqeQSATPage_Package;
-
- operationIndex = form.xqeQSATPage_Operations.selectedIndex;
-
- if (operationIndex == 0) {
- operationName = form.xqeQSATPage_FLUSH_Hidden;
- } else {
- operationName = form.xqeQSATPage_DUMP_Hidden;
- }
-
- recvdDsName = form.xqeQSATPage_DataSources_Hidden;
- recvdPackageName = form.xqeQSATPage_Package_Hidden;
- recvdOperationName = form.xqeQSATPage_Operations_Hidden;
- if (recvdDsName != dsName || recvdPackageName != packageName || operationName != recvdOperationName) {
- isDirty = true;
- } else {
- isDirty = false;
- }
- if (dsName.value == '' && packageName.value == '') {
- javascript:alert(xqeAdminFragment.i18n.UI_xqeCubeMsgEnterValidDataSourceOrPackageName);
- isValid = false;
- } else {
- isValid = true;
- }
- options = null;
- if (operationName.value == flushOperationDisplayName.value) {
- 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\">"
- + encodeURI(xmlencode(dsName.value)) + "\"/\"" + encodeURI(xmlencode(packageName.value)) + "\"/\"" + dataSourceType.value
- + "</item> </value> </item></value> </options>";
- } else if (operationName.value == dumpOperationDisplayName.value) {
- 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\">"
- + encodeURI(xmlencode(dsName.value)) + "\"/\"" + encodeURI(xmlencode(packageName.value)) + "\"/\"" + dataSourceType.value
- + "</item> </value> </item></value> </options>";
- } else {
- options = null;
- }
- } else if (dataSourceType.value == "ESSBASE") {
- flushOperationDisplayName = form.xqeQSATPage_FLUSH_Hidden;
- dumpOperationDisplayName = form.xqeQSATPage_DUMP_Hidden;
- dsName = form.xqeQSATPage_DataSources;
- ctlgName = form.xqeQSATPage_Catalogs;
- cubeName = form.xqeQSATPage_Cubes;
-
- operationIndex = form.xqeQSATPage_Operations.selectedIndex;
-
- if (operationIndex == 0) {
- operationName = form.xqeQSATPage_FLUSH_Hidden;
- } else {
- operationName = form.xqeQSATPage_DUMP_Hidden;
- }
- recvdDsName = form.xqeQSATPage_DataSources_Hidden;
- recvdCtlgName = form.xqeQSATPage_Catalogs_Hidden;
- recvdCubeName = form.xqeQSATPage_Cubes_Hidden;
- recvdOperationName = form.xqeQSATPage_Operations_Hidden;
- if (recvdDsName != dsName || recvdCtlgName != ctlgName || recvdCubeName != cubeName || operationName != recvdOperationName) {
- isDirty = true;
- } else {
- isDirty = false;
- }
- if (dsName.value == '' || ctlgName.value == '' || cubeName.value == '') {
- javascript:alert(xqeAdminFragment.i18n.UI_xqeCubeMsgEnterValidDataSourceCatalogCube);
- isValid = false;
- } else {
- isValid = true;
- }
- options = null;
- if (operationName.value == flushOperationDisplayName.value) {
- 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\">"
- + encodeURI(xmlencode(dsName.value)) + "\"/\"" + encodeURI(xmlencode(ctlgName.value)) + "\"/\"" + encodeURI(xmlencode(cubeName.value)) + "\"/\"" + dataSourceType.value
- + "</item> </value> </item></value> </options>";
- } else if (operationName.value == dumpOperationDisplayName.value) {
- 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\">"
- + encodeURI(xmlencode(dsName.value)) + "\"/\"" + encodeURI(xmlencode(ctlgName.value)) + "\"/\"" + encodeURI(xmlencode(cubeName.value)) + "\"/\"" + dataSourceType.value
- + "</item> </value> </item></value> </options>";
- } else {
- options = null;
- }
- } else if (dataSourceType.value == "SAPBW") {
- flushOperationDisplayName = form.xqeQSATPage_FLUSH_Hidden;
- dumpOperationDisplayName = form.xqeQSATPage_DUMP_Hidden;
- dsName = form.xqeQSATPage_DataSources;
- ctlgName = form.xqeQSATPage_Catalogs;
- cubeName = form.xqeQSATPage_Cubes;
-
- operationIndex = form.xqeQSATPage_Operations.selectedIndex;
-
- if (operationIndex == 0) {
- operationName = form.xqeQSATPage_FLUSH_Hidden;
- } else {
- operationName = form.xqeQSATPage_DUMP_Hidden;
- }
- recvdDsName = form.xqeQSATPage_DataSources_Hidden;
- recvdCtlgName = form.xqeQSATPage_Catalogs_Hidden;
- recvdCubeName = form.xqeQSATPage_Cubes_Hidden;
- recvdOperationName = form.xqeQSATPage_Operations_Hidden;
- if (recvdDsName != dsName || recvdCtlgName != ctlgName || recvdCubeName != cubeName || operationName != recvdOperationName) {
- isDirty = true;
- } else {
- isDirty = false;
- }
- if (dsName.value == '' || ctlgName.value == '' || cubeName.value == '') {
- javascript:alert(xqeAdminFragment.i18n.UI_xqeCubeMsgEnterValidDataSourceCatalogCube);
- isValid = false;
- } else {
- isValid = true;
- }
- options = null;
- if (operationName.value == flushOperationDisplayName.value) {
- 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\">"
- + encodeURI(xmlencode(dsName.value)) + "\"/\"" + encodeURI(xmlencode(ctlgName.value)) + "\"/\"" + encodeURI(xmlencode(cubeName.value)) + "\"/\"" + dataSourceType.value
- + "</item> </value> </item></value> </options>";
- } else if (operationName.value == dumpOperationDisplayName.value) {
- 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\">"
- + encodeURI(xmlencode(dsName.value)) + "\"/\"" + encodeURI(xmlencode(ctlgName.value)) + "\"/\"" + encodeURI(xmlencode(cubeName.value)) + "\"/\"" + dataSourceType.value
- + "</item> </value> </item></value> </options>";
- } else {
- options = null;
- }
- } else {
- flushOperationDisplayName = form.xqeQSATPage_FLUSH_Hidden;
- dumpOperationDisplayName = form.xqeQSATPage_DUMP_Hidden;
- dsName = form.xqeQSATPage_DataSources;
- ctlgName = form.xqeQSATPage_Catalogs;
- cubeName = form.xqeQSATPage_Cubes;
-
- operationIndex = form.xqeQSATPage_Operations.selectedIndex;
-
- if (operationIndex == 0) {
- operationName = form.xqeQSATPage_FLUSH_Hidden;
- } else {
- operationName = form.xqeQSATPage_DUMP_Hidden;
- }
- recvdDsName = form.xqeQSATPage_DataSources_Hidden;
- recvdCtlgName = form.xqeQSATPage_Catalogs_Hidden;
- recvdCubeName = form.xqeQSATPage_Cubes_Hidden;
- recvdOperationName = form.xqeQSATPage_Operations_Hidden;
- if (recvdDsName != dsName || recvdCtlgName != ctlgName || recvdCubeName != cubeName || operationName != recvdOperationName) {
- isDirty = true;
- } else {
- isDirty = false;
- }
- if (dsName.value == '' || ctlgName.value == '' || cubeName.value == '') {
- javascript:alert(xqeAdminFragment.i18n.UI_xqeCubeMsgEnterValidDataSourceCatalogCube);
- isValid = false;
- } else {
- isValid = true;
- }
- options = null;
- if (operationName.value == flushOperationDisplayName.value) {
- 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\">"
- + encodeURI(xmlencode(dsName.value)) + "\"/\"" + encodeURI(xmlencode(ctlgName.value)) + "\"/\"" + encodeURI(xmlencode(cubeName.value))
- + "</item> </value> </item></value> </options>";
- } else if (operationName.value == dumpOperationDisplayName.value) {
- 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\">"
- + encodeURI(xmlencode(dsName.value)) + "\"/\"" + encodeURI(xmlencode(ctlgName.value)) + "\"/\"" + encodeURI(xmlencode(cubeName.value))
- + "</item> </value> </item></value> </options>";
- } else {
- options = null;
- }
- }
- }
- }
|