123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214 |
- var APPLICATION_PUSH_FAILED = -1;
- var APPLICATION_POP_FAILED = -2;
- function CApplicationManager()
- {
- this.m_oFormMgr = null;
- this.m_oFeatureMgr = null;
- this.m_oWindowMgr = null;
- this.m_oMiniQueryMgr = null;
- this.m_oReportMgr = null;
- this.m_oFeatureRegistry = null;
- this.m_oUserPreferenceManager = null;
- };
- CApplicationManager.prototype = new CDictionary();
- CApplicationManager.prototype.init = function ()
- {
-
- this.add("productLocale", "en");
- this.add("contentLocale", "en-us");
- this.add("numRows", 20);
- this.add("scriptEngine", "");
- this.add("paperOrientation", "Portrait");
- this.add("paperSize", "Letter");
- this.add("scaleToPage", true);
- };
- CApplicationManager.prototype.getFormManager = function ()
- {
- if (this.m_oFormMgr === null && typeof CFormManager == "function")
- {
- this.m_oFormMgr = new CFormManager();
- }
- return this.m_oFormMgr;
- };
- CApplicationManager.prototype.getFeatureManager = function ()
- {
- if (this.m_oFeatureMgr === null && typeof CFeatureManager == "function")
- {
- this.m_oFeatureMgr = new CFeatureManager();
- }
- return this.m_oFeatureMgr;
- };
- CApplicationManager.prototype.getUserPreferenceManager = function ()
- {
- if (this.m_oUserPreferenceManager === null && typeof CUserPreferenceManager == "function")
- {
- this.m_oUserPreferenceManager = new CUserPreferenceManager();
- }
- return this.m_oUserPreferenceManager;
- };
- CApplicationManager.prototype.getWindowManager = function ()
- {
- if (this.m_oWindowMgr === null && typeof CWindowManager == "function")
- {
- this.m_oWindowMgr = new CWindowManager();
- }
- return this.m_oWindowMgr;
- };
- CApplicationManager.prototype.getMiniQueryManager = function ()
- {
- if (this.m_oMiniQueryMgr === null && typeof CMiniQueryManager == "function")
- {
- this.m_oMiniQueryMgr = new CMiniQueryManager();
- this.m_oMiniQueryMgr.init();
- }
- return this.m_oMiniQueryMgr;
- };
- CApplicationManager.prototype.getReportManager = function ()
- {
- if (this.m_oReportMgr === null && typeof CReportManager == "function")
- {
- this.m_oReportMgr = new CReportManager();
- this.m_oReportMgr.init();
- }
- return this.m_oReportMgr;
- };
- CApplicationManager.prototype.getFeatureRegistry = function ()
- {
- if (this.m_oFeatureRegistry === null)
- {
- this.m_oFeatureRegistry = this.getFeatureManager().getFeatureRegistry();
- }
- return this.m_oFeatureRegistry;
- };
- CApplicationManager.prototype.getSelectionController = function ()
- {
- return this.getReportManager().getCVSelectionController();
- };
- CApplicationManager.prototype.getApplicationFrame = function ()
- {
- return this.getWindowManager().getApplicationFrame();
- };
- CApplicationManager.prototype.getDialogFrame = function ()
- {
- return this.getWindowManager().getDialogFrame();
- };
- CApplicationManager.prototype.getReportFrame = function ()
- {
- return this.getWindowManager().getReportFrame();
- };
- CApplicationManager.prototype.push = function (sKey, oValue)
- {
- var aValues = this.get(sKey);
- if (aValues instanceof Array)
- {
- aValues[aValues.length] = oValue;
- }
- else if (typeof aValues == "undefined")
- {
- aValues = new Array();
- aValues[0] = oValue;
- }
- else
- {
- return APPLICATION_PUSH_FAILED;
- }
- this.add(sKey, aValues);
- };
- CApplicationManager.prototype.pop = function (sKey)
- {
- var aKeys = this.get(sKey);
- var oValue = null;
- if (aKeys instanceof Array && aKeys.length > 0)
- {
- oValue = aKeys[aKeys.length - 1];
- deleteArrayEntry(aKeys, oValue);
- }
- else
- {
- return APPLICATION_POP_FAILED;
- }
- if (aKeys instanceof Array && aKeys.length > 0)
- {
- this.add(sKey, aKeys);
- }
- else
- {
- this.remove(sKey);
- }
- return oValue;
- };
- CApplicationManager.prototype.clearMenus = function()
- {
- var arMenus = new Array();
- if (typeof gQsContextMenu == "object") arMenus.push(gQsContextMenu);
- if (typeof gQsChartContextMenu == "object") arMenus.push(gQsChartContextMenu);
- if (typeof gQsFiltersContextMenu == "object") arMenus.push(gQsFiltersContextMenu);
- if (typeof gQsFilterIconContextMenu == "object") arMenus.push(gQsFilterIconContextMenu);
- if (typeof gQsMetadataTreeContextMenu == "object") arMenus.push(gQsMetadataTreeContextMenu);
- if (typeof gQsSortsContextMenu == "object") arMenus.push(gQsSortsContextMenu);
- if (typeof gQsSortIconContextMenu == "object") arMenus.push(gQsSortIconContextMenu);
- if (typeof gQsSuppressContextMenu == "object") arMenus.push(gQsSuppressContextMenu);
- if (typeof gQsSuppressIconContextMenu == "object") arMenus.push(gQsSuppressIconContextMenu);
- for (var i = 0; i < arMenus.length; i++)
- {
- if (typeof arMenus[i].hide == "function")
- {
- arMenus[i].hide();
- }
- }
- var arToolbars = new Array();
- if (typeof gQsToolbar == "object") arToolbars.push(gQsToolbar);
- if (typeof gTopToolbar == "object") arToolbars.push(gTopToolbar);
- if (typeof gTopToolbarLogon == "object") arToolbars.push(gTopToolbarLogon);
- for (var i = 0; i < arToolbars.length; i++)
- {
- if (arToolbars[i] && typeof arToolbars[i].closeMenus == "function")
- {
- arToolbars[i].closeMenus();
- }
- }
-
- hidePickers();
- };
- var goApplicationManager = new CApplicationManager();
- goApplicationManager.init();
|