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?
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.
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)
Any comments or suggestions would be very helpful.
Thanks,