HOME_TAB action does not exist?

Using the Change Tab automation action with HOME_TAB as the parameter I get the following error message; ERROR [org.nuxeo.ecm.platform.ui.web.api.TabActionsSelection] Cannot set current tab with id 'HOME_TAB': action does not exist.

The home tab works from the standard web screen.

Any ideas why I cant switch to Home from an automation action?

0 votes

1 answers

1254 views

ANSWER

Just tried MAIN_TABS:home as the parameter to the Change Tab automation action. Same error with, of course, MAIN_TABS:home in place of HOME_TAB.
08/21/2012

Trying to you MultiNavTreeManager to get to HOME page from an automation chain but this Class does not seem to be available in CAP+DM!

Any comments or suggestions would be very helpful.

Thanks,

08/27/2012



This is normal as Change Tab change the tab of on the Default Category. I think there is no standard operation to do that, and would be great to improve the change tab action to have the possibility to specify the tab category we want the action.

Waiting that create an operation that takes the tab id and the category as parameter and simply do :

@Operation(id = ChangeTab2.ID, category = Constants.CAT_UI, requires = Constants.SEAM_CONTEXT, label = "Change Tab2", description = "Change the selected tab for the current document. Preserve the current input.")
    public class ChangeTab2 {

    public static final String ID = "Seam.ChangeTab2";

    @Context
    protected OperationContext ctx;

    @Param(name = "tab")
    protected String tab;

    @Param(name = "category", required = false)
    protected String category;

    @OperationMethod
    public void run() {
        if (category == null) {
           category = VIEW_ACTION_LIST;
        }

        OperationHelper.getWebActions().setCurrentTabId(category, tab, null);
    }
}

I hope this works.

0 votes



Ben, thanks for the reply.

I created the action as you suggested and called it from my automation chain, however it doesn't seem to change the Category to MAIN_TAB. I logged the parameters to be sure they are correct , MAIN_TAB = category and home = tab. I also logged the TAB LIST after I call setCurrentTabId and I get:

2012-08-30 16:05:16,604 INFO [org.nuxeo.zaxis.bes.BESChangeTab] Id = TAB_VIEW_FOLDERISH 2012-08-30 16:05:16,605 INFO [org.nuxeo.zaxis.bes.BESChangeTab] Label = action.view.summary 2012-08-30 16:05:16,605 INFO [org.nuxeo.zaxis.bes.BESChangeTab] Link = /incl/tabs/document_view.xhtml 2012-08-30 16:05:16,605 INFO [org.nuxeo.zaxis.bes.BESChangeTab] Id = TAB_EDIT 2012-08-30 16:05:16,606 INFO [org.nuxeo.zaxis.bes.BESChangeTab] Label = action.view.modification 2012-08-30 16:05:16,606 INFO [org.nuxeo.zaxis.bes.BESChangeTab] Link = /incl/tabs/bes_document_edit.xhtml 2012-08-30 16:05:16,606 INFO [org.nuxeo.zaxis.bes.BESChangeTab] Id = CUSTOM_TAB_RIGHTS_ACTION 2012-08-30 16:05:16,607 INFO [org.nuxeo.zaxis.bes.BESChangeTab] Label = action.view.rights 2012-08-30 16:05:16,607 INFO [org.nuxeo.zaxis.bes.BESChangeTab] Link = /incl/tabs/document_rights.xhtml 2012-08-30 16:05:16,607 INFO [org.nuxeo.zaxis.bes.BESChangeTab] Id = TAB_CONTENT_JBPM 2012-08-30 16:05:16,608 INFO [org.nuxeo.zaxis.bes.BESChangeTab] Label = action.view.review 2012-08-30 16:05:16,608 INFO [org.nuxeo.zaxis.bes.BESChangeTab] Link = /incl/tabs/document_process.xhtml 2012-08-30 16:05:16,608 INFO [org.nuxeo.zaxis.bes.BESChangeTab] Id = view_comments 2012-08-30 16:05:16,609 INFO [org.nuxeo.zaxis.bes.BESChangeTab] Label = action.view.comments 2012-08-30 16:05:16,609 INFO [org.nuxeo.zaxis.bes.BESChangeTab] Link = /incl/tabs/document_comments.xhtml 2012-08-30 16:05:16,609 INFO [org.nuxeo.zaxis.bes.BESChangeTab] Id = TAB_CONTENT_HISTORY 2012-08-30 16:05:16,610 INFO [org.nuxeo.zaxis.bes.BESChangeTab] Label = action.view.history 2012-08-30 16:05:16,610 INFO [org.nuxeo.zaxis.bes.BESChangeTab] Link = /incl/tabs/document_history.xhtml 2012-08-30 16:05:16,610 INFO [org.nuxeo.zaxis.bes.BESChangeTab] Id = TAB_MANAGE 2012-08-30 16:05:16,610 INFO [org.nuxeo.zaxis.bes.BESChangeTab] Label = action.view.manage 2012-08-30 16:05:16,611 INFO [org.nuxeo.zaxis.bes.BESChangeTab] Link = /incl/tabs/document_manage.xhtml

Which shows the following error from the Studio automation chain is outpu because the category is not set correctly.

[org.nuxeo.ecm.platform.ui.web.api.TabActionsSelection] Cannot set current action 'home' for category 'VIEW_ACTION_LIST' as this action does not hold the given category.

I've logged the output of a call to OperationHelper.getWebActions().getActionsList(WebActions.MAIN_TABS_CATEGORY)

08/30/2012

And I can see the following Actions: 2012-08-30 16:05:16,611 INFO [org.nuxeo.zaxis.bes.BESChangeTab] Link = /incl/tabs/document_manage.xhtml 2012-08-30 16:05:16,612 INFO [org.nuxeo.zaxis.bes.BESChangeTab] Action Id = home 2012-08-30 16:05:16,613 INFO [org.nuxeo.zaxis.bes.BESChangeTab] Action Label = label.main.tab.home 2012-08-30 16:05:16,613 INFO [org.nuxeo.zaxis.bes.BESChangeTab] Action Link = view_home 2012-08-30 16:05:16,613 INFO [org.nuxeo.zaxis.bes.BESChangeTab] Action Id = documents 2012-08-30 16:05:16,614 INFO [org.nuxeo.zaxis.bes.BESChangeTab] Action Label = label.main.tab.documents 2012-08-30 16:05:16,614 INFO [org.nuxeo.zaxis.bes.BESChangeTab] Action Link = view_documents 2012-08-30 16:05:16,617 INFO [org.nuxeo.zaxis.bes.BESChangeTab] Action Id = admin 2012-08-30 16:05:16,617 INFO [org.nuxeo.zaxis.bes.BESChangeTab] Action Label = label.main.tab.admin.center 2012-08-30 16:05:16,618 INFO [org.nuxeo.zaxis.bes.BESChangeTab] Action Link = view_admin 2012-08-30 16:05:16,618 INFO [org.nuxeo.zaxis.bes.BESChangeTab] Actions List = [home, documents, admin]
08/30/2012