Search code examples
pluginsjardojoecmibm-content-navigator

params for switch to favorites pane (Home Feature not loading favorites)


i have this requirement on IBM Content Navigator about a personalized (feature) homepage with various buttons used to switch between feature; i've made all works except for the one linked to the Home feature (favorites)

i've already tried to call the feature with thoose params:

    params.repositoryId="FNOSARCHIVIO"; 
    params.application="navigator";
    params.desktop="OneFile";
    params.userid="sys.filenetsvil";

but with no success, the feature is switched (after the button press it switch to the home feature) but it does not load the favorites of the user

here is my switch-feature method (taken for the ibm icn redbook + some modification)

        switchFeature: function (featureIdToSwitch) {
             //get layout from destop
            var layout = ecm.model.desktop.getLayout();

            // get the corresponding button of the LaunchBar Container
            var feaButt = layout.launchBarContainer.getFeatureButtonByID(featureIdToSwitch);

            var params = {}; 
//          params.repositoryId="FNOSARCHIVIO"; 
//          params.application="navigator";
//          params.desktop="OneFile";
//          params.userid="sys.filenetsvil";

            // switching to the target feature
//          feaButt.child.loadContent; 

            layout.launchBarContainer.selectContentPane(feaButt, featureIdToSwitch, params);
        } 

on the frontend i have 4 simple dojo buttons with onClick action, nothing special.

i use this feature id:

        switchToHome: function () {
        this.switchFeature('favorites');
    },

this is what i mean when i say "it switch the feature but do not load the favorites:"

Home feature called from my button: https://ibb.co/GMW7L2x

Home feature called from the standard toolbar: https://ibb.co/BBgr36L

looks like it is loading the feature but it is not calling the listFavorites()

i cannot find any help on IBM docs or forum, any help here ? thanks!


Solution

  • At least i managed to do it, i post it here, hope helps someone:

    1- override the default favorite feature (the java class), using the same js plugin, overriding this:

     @Override
     public String getContentClass() {
         return "ecm.widget.layout.HomePane";
     }
    

    and set it to preLoaded:

     @Override
     public boolean isPreLoad() {
         return true;
     }
    

    then, on the frontend, retrive the js feature, and load the content:

        var targetFeature = layout.launchBarContainer.getContentPaneByID(featureIdToSwitch); 
        targetFeature.loadContent()
    

    you can call the loadContent() only if the feature has been preLoaded or alredy invoke at leat once