rsCreateMenuActions.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // Licensed Materials - Property of IBM
  2. // IBM Cognos Products: rs
  3. // (C) Copyright IBM Corp. 2015, 2020
  4. // US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  5. define(['bi/glass/app/plugins/MenuActionInterface'], function(MenuActionInterface) {
  6. var CreateReportMenu = MenuActionInterface.extend({
  7. onSelectItem: function(context) {
  8. var v_sMenuItem = context.target.itemId;
  9. console.log("CreateReportMenu, " + v_sMenuItem + ", selected");
  10. console.log("CREATE TEMPLATE SELECTED.");
  11. context.glassContext.openAppView(
  12. 'authoring',
  13. {
  14. content:
  15. {
  16. // TODO
  17. // provide and id for glass to cache
  18. // HACK until we get we work out the proper id
  19. id: Date.now().toString(),
  20. }
  21. });
  22. },
  23. isItemVisible: function(context){
  24. console.log("rsAppRunMenu.isItemVisible");
  25. if (!context.glassContext.hasCapability('canUseReportStudio'))
  26. {
  27. return false;
  28. }
  29. return true;
  30. }
  31. });
  32. return CreateReportMenu;
  33. });