CustomFoldersSlideoutView.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. *+------------------------------------------------------------------------+
  3. *| Licensed Materials - Property of IBM
  4. *| IBM Cognos Products: Content Explorer
  5. *| (C) Copyright IBM Corp. 2017, 2018
  6. *|
  7. *| US Government Users Restricted Rights - Use, duplication or disclosure
  8. *| restricted by GSA ADP Schedule Contract with IBM Corp.
  9. *+------------------------------------------------------------------------+
  10. */
  11. define([
  12. 'bi/content_apps/LegacyCATeamFoldersView',
  13. 'bacontentnav/utils/ContentServiceUrls'
  14. ], function(TeamFoldersSlideoutView, ContentServiceUrls) {
  15. 'use strict'; //NOSONAR
  16. var CustomFoldersSlideoutView = TeamFoldersSlideoutView.extend({
  17. init: function(options) {
  18. void(options);
  19. CustomFoldersSlideoutView.inherited('init', this, arguments);
  20. var teamFolders = this.glassContext.getCoreSvc('.UserProfile').userProfileSettings.ui_teamFolders;
  21. if (teamFolders) {
  22. this.folder = teamFolders.pathRef;
  23. }
  24. },
  25. _getModuleName: function() {
  26. return 'bi/content_apps/CustomFoldersSlideoutView';
  27. },
  28. _getSwitchedModuleName: function() {
  29. this.logger.error('CustomFolders slideout does not support a wide view');
  30. },
  31. _getDefaultRequestURL: function() {
  32. var returnUrl = CustomFoldersSlideoutView.inherited('_getDefaultRequestURL', this, arguments);
  33. if (this.folder) {
  34. returnUrl = ContentServiceUrls.getBaseObjectsURL() + '/' + this.folder + '/items';
  35. }
  36. return returnUrl;
  37. },
  38. _getDefaultSelfURL: function() {
  39. var url = CustomFoldersSlideoutView.inherited('_getDefaultSelfURL', this, arguments);
  40. if (this.folder) {
  41. url = ContentServiceUrls.getBaseObjectsURL() + '/' + this.folder;
  42. }
  43. return url;
  44. }
  45. });
  46. return CustomFoldersSlideoutView;
  47. });