Content Management and Capture

Content Management and Capture

Come for answers. Stay for best practices. All we’re missing is you.

 View Only
  • 1.  ICN Custom Action - Enable/Disable for specific search template

    Posted Tue April 25, 2023 10:09 AM

    Hi All,

    Hope all are doing good.
    Requirement:
    I have an ICN desktop called "Desktopabc".
    There are lot of search templates in this Desktop that are belongs to different businesses.
    For one of the business, need to implement custom action called "Actionabc". This action should be visible to only that business search template.
    What I have done so far:
    I have implemented custom action "Actionabc".
    Currently it is visible in all the search template results context menu.
    I have implemented some kind of logic as work around. In this work around also the custom action is visible, but if clicking on this action will display message dialog that "this functionality is not for this search template".

    I am looking for a solution to hide(not show) this action for some search templates. Could you please suggest me solution.



    ------------------------------
    RAVI KUMAR
    ------------------------------


  • 2.  RE: ICN Custom Action - Enable/Disable for specific search template

    Posted Tue May 09, 2023 03:16 AM

    Hi All,

    Can anyone suggest the solution.



    ------------------------------
    RAVI KUMAR
    ------------------------------



  • 3.  RE: ICN Custom Action - Enable/Disable for specific search template

    Posted Wed May 10, 2023 11:09 AM

    You may be able to update your plugin to add a response filter that adds additional metadata to search templates included in the JSON response, and update the custom action to check the metadata to hide or show the action.



    ------------------------------
    ANDY Choi
    ------------------------------



  • 4.  RE: ICN Custom Action - Enable/Disable for specific search template

    Posted Tue May 16, 2023 11:14 AM

    Hi ANDY,

    Thank you very much.
    I have not understood completely. Could you please share the sample code.

    Regards,
    Ravi



    ------------------------------
    RAVI KUMAR
    ------------------------------



  • 5.  RE: ICN Custom Action - Enable/Disable for specific search template

    Posted Wed May 17, 2023 02:27 PM

    You can find sample code from the following location that implement PluginResponseFilter to add additional data to response data to be referenced from the client side.

    https://github.com/ibm-ecm/ibm-content-navigator-samples



    ------------------------------
    ANDY Choi
    ------------------------------



  • 6.  RE: ICN Custom Action - Enable/Disable for specific search template

    Posted Wed May 10, 2023 11:23 AM

    Hi Ravi,

    how about implementing an

    isVisible: function (repository, items)

    in your action?






    ------------------------------
    Marcus Kalthoff
    ------------------------------



  • 7.  RE: ICN Custom Action - Enable/Disable for specific search template

    Posted Tue May 16, 2023 11:15 AM

    Hi Marcus,

    Yes. But how do I know the search template in this function? or Am I missing something.

    Regards,
    Ravi



    ------------------------------
    RAVI KUMAR
    ------------------------------



  • 8.  RE: ICN Custom Action - Enable/Disable for specific search template

    Posted Wed May 17, 2023 02:10 AM

    Hi,
    I check the ICN code and found ICN uses this: item.isInstanceOf && item.isInstanceOf(ecm.model._SearchTemplateBase) to know if the item in items is a search template.



    ------------------------------
    JIE ZHANG
    ------------------------------