Base.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // Licensed Materials - Property of IBM
  2. //
  3. // IBM Cognos Products: cogadmin
  4. //
  5. // (C) Copyright IBM Corp. 2008, 2011.
  6. //
  7. // US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  8. //
  9. //
  10. // Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
  11. // Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
  12. dojo.provide("com.ibm.cognos.admin.xts.Base");
  13. dojo.declare("com.ibm.cognos.admin.xts.Base",null,{
  14. constructor : function (frag,args){
  15. this.frag = frag;
  16. this.args = args;
  17. },
  18. initialize: function(){
  19. if (this.frag){
  20. this.buildBridge();
  21. }
  22. },
  23. buildBridge: function(){
  24. //Summary
  25. // publish any function with _THIS_ as a prefix to global
  26. //Tag
  27. // protected
  28. var proto = this.constructor.prototype;
  29. for(var o in proto){
  30. if (typeof(this[o]) == "function" && o.indexOf("_THIS_") == 0){
  31. dojo.global[this.frag.id + o.substr(6)] = dojo.hitch(this, this[o]);
  32. }
  33. }
  34. },
  35. getId: function(id){
  36. //Summary
  37. // map the id to _THIS_
  38. //Tag
  39. // protected
  40. return (this.frag) ? this.frag.id+id : id;
  41. }
  42. });