Smart View Action bar changes

Options

Hi ,

Does anyone have idea on how to disable the options appearing in Action bar in Smart view.

Client wants to hide some of the buttons at system level


Comments


  • @Jan Velas

    Any inputs on this?

  • Hi Youva,

    Sorry I was gone on vacation trip across the Europe. 😄

    One way I found is complicated and presumably not officially supported by Opentext. (I don't know any better though. 😉)

    It assumes you're trying to achieve this using Smart UI SDK and already know how to work with it.

    • Create and install Smart UI Extension project into your Content Server
    • In your generated "-extensions.json" add the following (remove comments)
    "csui/widgets/nodestable/toolbaritems.masks": { //<-- targets the file which handles masking buttons
      "masks": {
        "tableHeaderToolbar": { //<-- Name of the "toolbar" we want to control - table header
          "blacklist": [
            "AddVersion", //<-- Signatures of the "Commands" we want to hide
            "Classify",
            "Copy",
            "Delete",
            "Move",
            "RemoveClassification",
            "Reserve"
          ]
        },
        "inlineActionbar": { //<-- Different toolbar, this one is the one that shows when you mouse over row
          "blacklist": [
            "AddVersion",
            "Classify",
            "Copy",
            "Delete",
            "Move",
            "RemoveClassification",
            "Reserve"
          ]
        }
      }
    }
    
    • Run grunt and deploy the out-module on your Content Server
    • Restart the Content Server service (so CS can read the -extensions.json)

    Important notes:

    • This is not official guide, I figured all of this myself by digging through the code and debugging
    • NodesTable widget and SearchResults widget are separated -> have different masks
    • -> If you want to hide buttons in search results, use "csui/widgets/search.results/toolbaritems.masks"

    Useful info:

    • Every button = CommandModel
    • They are all registered in CommandsCollection (done with csui/utils/commands)
    • Every "toolbar controller view" in table view handles collecting and filtering commands to be created and displayed -> that's also where the masks affect the displayed commands
    • -> -> "lib\src\csui\controls\tableactionbar\tableactionbar.view.js": line 77
    options.collection = new FilteredToolItemsCollection(
      options.collection, {
      status: status,
      commands: this.commands,
      delayedActions: options.delayedActions,
      mask: options.toolItemsMask // <-- HERE is the toolItemsMask object
    });
    
    • Additionally, every button (= command) itself decides if it should be visible or not.
    • It does this by using the "enabled" method that gets inherited from the "CommandModel"
    • This method has conditions in it and if it returns true, the button is displayed
    • Common conditions are: Type limiting (only 144), selection limiting (only 1 row selected), ...
    • However, you cannot modify these conditions directly because they're part of the csui module which is outside of the scope of our extension - only opentext can safely modify the code in "csui" folder.

    I hope this may help you.

    Your Smart UI Rubber Duck 🦆

    Jan

  • PS: I think it would be ideal to somehow disable the commands on server side, using OScript, but that is something I never had a chance to try.

  • @Jan Velas

    Thank you so much for your inputs and efforts.

  • @Ján Veľas, Can you please let me know if we achieve this for a particular folders alone? Client wants to hide these Copy, Move, Delete for only a particular folder.

    Also one more doubt, can we configure the functions menu to remove or add new fields like we do in active view

  • Hello @bharath_ot,

    Client wants to hide these Copy, Move, Delete for only a particular folder.

    The best option would be to restrict the user permissions on the mentioned folder. But I assume you cannot do that, since you're asking here. 🙂

    Another option is to use the Smart UI SDK to replace the commands' code. I don't know if SDK allows you to easily change the csui (default) commands with new ones.

    The way I would do it if there is no better way:

    • I would first hide them via masks, like shown above,
    • then provide new commands from my extension I made in Smart UI SDK.
    • These commands would extend the original Copy, Move and Delete.
    • I would overwrite the function responsible for showing the commands in the bar, the "enabled" function.
    • In this function I would make a condition to not display the commands inside of a specific folder.
    • I would build and deploy the extension
    • And, of course, debug 😅

    If you need help with that please start a new thread and ping me.

    After a long break from the forums, 😴

    Jan


    PS: There is a known bug with the masks (from comment #4) not working in CS 22.1

    Opentext kindly provided a patch pat162004803 which should be available in System Center

  • Hello Jan,

    I tried to extend the copylink command but it's not working. I am able to duplicate the copy command but unable to extend.

  • Hello @mvna,

    Let's start a new discussion, please. :-)

    This page is about hiding commands in action bar and I don't want to clutter it.

    Just ping me in the new thread and I'll try to help.

    Jan

  • Hello Jan,

    I am able to achieve this by hiding the existing copy link and create a custom copy link for our customization requirements.

    Regards,

    Naveen.


  • @mvna


    Congrats on your achievement! Creating Custom Actions on the Smart UI Multi-Select command bar is something I have been after for a while too. Ultimately I want to create Custom Patch that adds/removes new commands and that when clicked would call a WebReport.

    (I think it is inappropriate to have to create full on module just to add a button to the screen)


    This patch would similar/moddeled

    to how you can create Appearances & ActiveViews in the Classic. As I have noted many times on this Forum, the Smart UI has so few entry points into in for the WebReport Developer.


    Please see:

    https://forums.opentext.com/forums/developer/discussion/309338/nodes-table-real-example#latest



    NodesList and NodesTable actually offer a even less Multi-Object commands i(f you are trying build an Aggregate View).


    Any chance you share with me the code to extend/control the Smart UI Multi-Select command?


    Regards,

    -MC

    mike@ggcs.ca

  • Thanks @Ján Veľas for detailed description.

    There is one more area (maybe there are even more like this, e.g. WF task view and similar) where it would be required to hide functions in similar way - metadata header (when you are in properties view or on document overview page and click on function menu).

    As it does not have special toolbars I had to omit one level and the code that was working for me (22.4):

    "csui/widgets/metadata/header.dropdown.menu.items.mask": {

    "masks": {

    "blacklist": [

    "AddVersion",

    ...

    ]

    }

    }


    And do you know if and how it would be possible to hide properties panels? When OT started to bundle all xECM modules in core, it added some function menu entries (luckily these can be hidden easily) as well as additional property panels. I asked OT if they plan to create some switch to enable/disable these modules (similarly as for WR or RM), but they told me that it is not planned. So, for customers who simply do not use any of xECM functionality, it does not make sense to show XReference panel or similar.

    Thanks,

    Ugis