Hiding some of items from the Add itemmenu/function menu on SmartUI

1. How can we hide some of items from the Add item menu/function menu on SmartUI ? Also, how can we achieve that on a folder level?         .
2. Can we hide this some of those items from the functions menu in smart UI based on group or role?
3. Can anything that has been created using active view(similar to we have in classic UI) can be applied to smart UI? How can we achieve that? For all this please refer to the screenshots.

We have been suggested that ActiveView cannot be applied to SmartUI and that any customizations need to be done via the SmartUI SDK. Can anyone give direction as to how we can achieve this? It would be super helpful!
Tagged:

Comments

  • Do these items appear in the Classic UI for the same page ? if they do then you should be able to follow the standard development process to remove them in some cases (usually the WebNodeCMD and WebNodeAction IsEnabled).
  • Thanks Greg for the response, We know it can be done through customization but is there something out of the box for this? that would be great !
  • nothing out of the box unfortunately. If you just want to hide the items you can use a Global Appearance, CustomView etc to play with the DOM objects and hide them, although this does not stop them from being available to be directly called - or called elsewhere, e.g. function menu etc. For complete coverage you are likely to need a partner solution or custom code to filter out as above. There are some third parties that do container level permissioning which may be enough.
  • Ferdinand Prantl
    edited July 14, 2021 #5
    If you integrate Smart UI widgets outside CS (outside /app), you have various options. If you use the Smart UI page (/app) your options are limited.

    What you asked for is called "role-based configuration", in contrast with "right-based configuration".Regardless the authenticated user's rights, you want to hide toolbar buttons or menu items to optimize the usability of a usage scenarios. It is not been planned right now (LPAD-84577, LPAD-64030). You can file a feature request about the role-based configuration at Customer Support to give this issue more priority.

    If you are able to use user rights and functional rights to disable an action, it will work in both Classic UI and Smart UI. If you used ActiveViews or Appearances to hide an action, it will not work in Smart UI. ActiveViews or Appearances cannot be  used in Smart UI, because Smart UI does not implement scenarios using always-reloaded pages, where ActiveViews or Appearances would be triggered. Smart UI offeres extension points, which are triggered dynamically, when the particular scenario gets executed.


    Integrations

    Integrations outside CS /app (FolderBrowserWidget or other widgets) can use the following tricks:

    Remove the commands with action signatures that you want to hide. Works globally on the integration page. The commands will be available neither interactively, nor programmatically.

    <pre class="CodeBlock"><code><div>// Disable copying and moving everywhere, including non-interactive code.
    csui.onReady3({...}, [..., 'csui/utils/commands'],
      function (..., commands) {
        commands.remove(['Copy', 'Move']);
        ...
      });</div><div></div>
    Use tool item masks to whitelist or blacklist tool items in a particular scenario or globally. Works depending on the scope of the tool item mask. The commands will be available in other scenarios and programmatically.

    <div><pre class="CodeBlock"><code><div>require.config({</div><div>&nbsp; // Disable copying and moving in the nodestable widget.</div><div>&nbsp; 'csui/widgets/nodestable/toolbaritems.masks': {</div><div>&nbsp; &nbsp; custom: {</div><div>&nbsp; &nbsp; &nbsp; tableHeaderToolbar: { blacklist: ['Copy', 'Move'] },</div><div>&nbsp; &nbsp; &nbsp; inlineActionbar: { blacklist: ['Copy', 'Move'] }</div><div>&nbsp; &nbsp; }</div><div>&nbsp; },</div><div>&nbsp; // Disable deletion in all toolbars.</div><div>&nbsp; 'csui/utils/toolitem.masks/global.toolitems.mask': {</div><div>&nbsp; &nbsp; custom: { blacklist: ['Delete'] }</div><div>&nbsp; },</div><div>&nbsp; // Remove Compound Document from the Add Item menu.</div><div>&nbsp; 'csui/utils/toolitem.masks/creation.toolitems.mask': {</div><div>&nbsp; &nbsp; custom: { blacklist: [136] }</div><div>&nbsp; }</div><div>&nbsp; // Allow only Properties, Open and Download commands in Recently Accessed.</div><div>&nbsp; 'csui/widgets/recentlyaccessedtable/toolbaritems.masks' {</div><div>&nbsp; &nbsp; custom: {</div><div>&nbsp; &nbsp; &nbsp; tableHeaderToolbar: { whitelist: ['Properties', 'Open', 'Download'] },</div><div>&nbsp; &nbsp; &nbsp; inlineActionbar: { whitelist: ['Properties', 'Open', 'Download'] }</div><div>&nbsp; &nbsp; }</div><div>&nbsp; }</div><div>});</div><div>csui.onReady3(...);</div><div></div>
    Create a widget instance with custom commands or tool item masks. Only the nodestable widget supports this today. The customization will apply only to the single widget instance.

    <div><pre class="CodeBlock"><code><div>csui.onReady3({...}, [..., 'csui/widgets/nodestable/nodestable.view'],</div><div>&nbsp; function (..., NodesTableView) {</div><div>&nbsp; &nbsp; ...</div><div>&nbsp; &nbsp; var nodesTableView = new NodesTableView({</div><div>&nbsp; &nbsp; &nbsp; commands: ...,</div><div>&nbsp; &nbsp; &nbsp; toolbarItemsMasks: ...,</div><div>&nbsp; &nbsp; &nbsp; ...</div><div>&nbsp; &nbsp; });</div><div>&nbsp; &nbsp; ...</div><div>&nbsp; });</div><h2></h2>

    Application

    Programmatic features sketched above are programmatic ways how to implement role-based configuration. The CS Smart UI page (/app) uses configuration supplied by CS modules. OpenText does not offer a module that would supply administration pages for this, AFAIK.

    For example, tool item masks san be applied by the result of `CSUI::Extension.GetDynamicConfiguration` in the Smart UI extensions registration OScript code. For example, I saw a custom module hiding the "Sign out" menu item (signture "SignOut") and showing a command to select if you work as yourself or on behalf of somebody else. However, developing a general role-based configuration (user profile concept), is not a small task. I know only about prototypes demonstrating the API, for example:


  • Uldis
    edited February 27, 2023 #6

    Hi

    Thanks for the samples.

    So with this code you can remove standard Add Items like documents, folders.

    'csui/utils/toolitem.masks/creation.toolitems.mask':

    {custom: { blacklist: [144,0,136,'CreateInstanceFromSidePanel'] }}

    For some reason I can't get rid of Email Folders.

    Also how do you remove “Document from template” (signature: CreateInstanceFromSidePanel)?

    I know this could be possible in the configuration and using some user privileges. But how to do this only in the widget?

  • Figured about Email Folder and Wiki. Need to add signature and commandData in addition.

    'csui/utils/toolitem.masks/creation.toolitems.mask':{

    'custom': { blacklist: [

    {signature: 'AddEmailFolder',commandData: {type: 751}},

    {signature: 'AddWiki',commandData: {type: 5573}}

    ] }

    }

    Still not sure how to separately remove “Document from template”