Content Management and Capture

 View Only
Expand all | Collapse all

Open StoredSearch onclick of a Button or a link in SearchPane in navigator

  • 1.  Open StoredSearch onclick of a Button or a link in SearchPane in navigator

    Posted Mon January 11, 2021 10:52 AM

    I have created an link/button in SearchPane. And i have created a storedSearch with few properties in it. Now on click of the link/search in SearchPane storedSearch should open in searchPane



    #IBMContentNavigator(ICN)
    #Support
    #SupportMigration


  • 2.  RE: Open StoredSearch onclick of a Button or a link in SearchPane in navigator
    Best Answer

    Posted Mon January 11, 2021 05:44 PM

    hello poojasp18

    Saved searches can be displayed under the All Searches node in the Search feature. Is there a different reason for why you need to link the saved search to a button in the Search feature, when you can already display it under the All Searches node?

    Is the search that you created working ?

    Or is the button when clicked not invoking the search?

    Please provide details on your use case.



    #IBMContentNavigator(ICN)
    #Support
    #SupportMigration


  • 3.  RE: Open StoredSearch onclick of a Button or a link in SearchPane in navigator
    Best Answer

    Posted Tue January 12, 2021 11:15 AM

    I know saved searches can be displayed under all searches. And yes my stored search is working fine.

    In my requirement, there we 2 searches we can create i.e "New Search" and "New cross-repository search".., here i am adding one more custom search in the dropdown which i an able to do using below code. Now i want to open a stored search onclicking the "New Custom Search"


    Here is the code for creating "New Custom Search"

    OnClick of 'NewSearch'/I have created one more new custom dropdown menu similar to 'NewSearch'. Onclick of that it should open my storedsearch


    Tried to extend

    ecm.widget.search.SearchSelector.extend({

    _createNewSearchButton: function() {...

    menu.addChild(new MenuItem({

    label: 'New custom Search',

    onClick: this.customSearch

    }));

    .......

    this._newSearchComboLink = new ComboLink({

    label: 'New custom Search',

    onClick: this.customSearch,

    dropDown: menu

    });

    in Custom Search function,

    open stored search


    ecm.model.desktop

          .getRepository(Desktop.defaultRepositoryId).retrieveSearchTemplate("{008FD276-0000-C215-A195-CD7DFAAF675A}",null,null,function(searchTemplate){

           console.log("*Inside retrieveSearchTemplate****");

          

          /* ecm.model.desktop

            .getRepository(Desktop.defaultRepositoryId).retrieveSearchTemplate("{2032BB71-0000-C116-BBE1-1AD96B8438C5}",null,null,function(searchTemplate){*/

            // debugger;

            console.log("inside getRepository");

            console.log("searchTemplate" +searchTemplate);

             

             

             

            this.chkSearchTabContainer = dijit.byId("chkSearchTabContainer");

            if(!this.chkSearchTabContainer){

              this.chkSearchTabContainer = new SearchTabContainer({


              },dojo.byId(domConstruct.create("div", {

                id : "checkSearchDIV"

              }, dojo.byId("myProgStackContainer"))))

            }


                  this.chkSearchTabContainer.openTab({

              tabType : "search",

              repository : ecm.model.desktop.getRepository(Desktop.defaultRepositoryId),

              openNewTab : true,

              selected : true,

              closable : true,

              name:"try",

              // version: version,

              searchTemplate : searchTemplate,

            });

            this.chkSearchTabContainer.startup();

            this.chkSearchTabContainer.show();

            console.log("Exit");


    not able to retrive stored search. Any idea how to do that?



    #IBMContentNavigator(ICN)
    #Support
    #SupportMigration


  • 4.  RE: Open StoredSearch onclick of a Button or a link in SearchPane in navigator
    Best Answer

    Posted Wed January 13, 2021 11:08 PM

    To open a search using the docId (ID of the document in the repository):

    repository.retrieveSearchTemplate("{98E7B3CB-50E3-4F6F-9A13-CBC03F497233}", null, null, function(searchTemplate) { var layout = ecm.model.desktop.getLayout(), launchBarContainer = layout && layout.launchBarContainer, searchFeatureButton = launchBarContainer ? launchBarContainer.getFeatureButtonByID("searchPane") : null if (searchFeatureButton) { var searchPane = searchFeatureButton.child; // the search feature pane (ecm.widget.SearchPane) searchPane.openSearch("search", searchTemplate.repository, searchTemplate.generateUUID(), searchTemplate); } });

    Make sure the the docId passed to repository.retrieveSearchTemplate is correct.

    Please note that SearchSelector._createNewSearchButton is a private method. We don't recommend referencing private methods since they may change is future releases without prior notice and break custom code.



    #IBMContentNavigator(ICN)
    #Support
    #SupportMigration


  • 5.  RE: Open StoredSearch onclick of a Button or a link in SearchPane in navigator
    Best Answer

    Posted Fri January 29, 2021 10:01 AM

    Hi Gabriel Garcia,

    Thank You. It worked for me... :-)



    #IBMContentNavigator(ICN)
    #Support
    #SupportMigration