ViewerConfig.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. *+------------------------------------------------------------------------+
  3. *| Licensed Materials - Property of IBM
  4. *| IBM Cognos Products: Viewer
  5. *| (C) Copyright IBM Corp. 2013
  6. *|
  7. *| US Government Users Restricted Rights - Use, duplication or
  8. *| disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  9. *|
  10. *+------------------------------------------------------------------------+
  11. */
  12. function ViewerConfig() {
  13. this.uiConfig = new ViewerUIConfig();
  14. this.findConfig = typeof ViewerFindActionConfig == "function" ? new ViewerFindActionConfig() : null;
  15. this.httpRequestConfig = typeof ViewerHttpRequestConfig == "function" ? new ViewerHttpRequestConfig() : null;
  16. this.eventsConfig = typeof ViewerEventsConfig == "function" ? new ViewerEventsConfig() : null;
  17. }
  18. ViewerConfig.prototype.configure = function(configuration) {
  19. if (!configuration) {
  20. return;
  21. }
  22. if (configuration.findAction && this.findConfig) {
  23. this.findConfig.configure(configuration.findAction);
  24. }
  25. if (configuration.UI) {
  26. this.uiConfig.configure(configuration.UI);
  27. }
  28. if (configuration.httpRequestCallbacks && this.httpRequestConfig) {
  29. this.httpRequestConfig.configure(configuration.httpRequestCallbacks);
  30. }
  31. if (configuration.events && this.eventsConfig) {
  32. this.eventsConfig.configure(configuration.events);
  33. }
  34. };
  35. ViewerConfig.prototype.getUIConfig = function() {
  36. return this.uiConfig;
  37. };
  38. ViewerConfig.prototype.getFindActionConfig = function() {
  39. return this.findConfig;
  40. };
  41. ViewerConfig.prototype.getHttpRequestConfig = function() {
  42. return this.httpRequestConfig;
  43. };
  44. ViewerConfig.prototype.getEventsConfig = function() {
  45. return this.eventsConfig;
  46. };