Nuxeo Enterprise Platform 5.4

org.nuxeo.ecm.webapp.action
Class WebActionsBean

java.lang.Object
  extended by org.nuxeo.ecm.webapp.action.WebActionsBean
All Implemented Interfaces:
Serializable, WebActions, WebActionsLocal, StatefulBaseLifeCycle

@Name(value="webActions")
@Scope(value=CONVERSATION)
@Install(precedence=10)
public class WebActionsBean
extends Object
implements WebActionsLocal, Serializable

Component that handles actions retrieval as well as current tab(s) selection.

Author:
Eugen Ionica, Anahide Tchertchian, Florent Guillaume, Catalin Baican
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.nuxeo.ecm.platform.ui.web.api.WebActions
CURRENT_TAB_CHANGED_EVENT, DEFAULT_TABS_CATEGORY, NULL_TAB_ID, SUBTAB_CATEGORY_SUFFIX
 
Constructor Summary
WebActionsBean()
           
 
Method Summary
 void destroy()
           
 List<Action> getActionsList(String category)
          Returns all filtered actions for a given category, creating a new context for the filters resolution.
 List<Action> getActionsList(String category, ActionContext context)
          Returns all filtered actions for a given category and given resolution context.
 List<Action> getAllActions(String category)
          Returns all actions for a given category, without filtering.
 String getCurrentLifeCycleState()
          Deprecated. 
 Action getCurrentSubTabAction()
          Returns the current sub tab for a category computed from the current tab action id and the suffix WebActions.SUBTAB_CATEGORY_SUFFIX.
 Action getCurrentSubTabAction(String parentActionId)
          Returns the current sub tab action for given parent action, computing the category from parent action id with suffix WebActions.SUBTAB_CATEGORY_SUFFIX.
 String getCurrentSubTabId()
          Returns the current sub tab id for a category computed from the current tab action id and the suffix WebActions.SUBTAB_CATEGORY_SUFFIX.
 Action getCurrentTabAction()
          Returns the current action for category WebActions.DEFAULT_TABS_CATEGORY
 Action getCurrentTabAction(String category)
          Returns the current action for given category.
 String getCurrentTabId()
          Returns the current action id for category WebActions.DEFAULT_TABS_CATEGORY
 String getCurrentTabId(String category)
          Returns the current action id for given category
 String getCurrentTabIds()
          Returns current tab ids as a string, encoded as is: CATEGORY_1:ACTION_ID_1,CATEGORY_2:ACTION_ID_2,...
 List<Action> getSubTabsList()
          Returns filtered actions for a category computed from the current tab action id and the suffix WebActions.SUBTAB_CATEGORY_SUFFIX.
 List<Action> getSubViewActionsList()
          Deprecated. 
 List<Action> getTabsList()
          Returns filtered actions for the category WebActions.DEFAULT_TABS_CATEGORY
 List<Action> getUnfiltredActionsList(String category)
          Returns all actions for a given category, creating a new context for the filters resolution.
 List<Action> getUnfiltredActionsList(String category, ActionContext context)
          Returns all actions for a given category and given resolution context.
 void initialize()
           
 void readState()
          Activate method.
 void resetCurrentTab()
          Resets current tab information (includes sub tab information) for category WebActions.DEFAULT_TABS_CATEGORY.
 void resetCurrentTabs()
          Resets all current tabs information.
 void resetCurrentTabs(String category)
          Resets current tabs for given category, taking subtabs into account by resetting actions in categories computed from reset actions id with suffix WebActions.SUBTAB_CATEGORY_SUFFIX.
 void resetTabList()
          Resets actions resolved for category WebActions.DEFAULT_TABS_CATEGORY so that they're recomputed.
 void saveState()
          Passivate method.
 void selectTabAction()
          Deprecated. 
 void setCurrentSubTabAction(Action tabAction)
          Sets the current sub tab for a category computed from the current tab action id and the suffix WebActions.SUBTAB_CATEGORY_SUFFIX.
 void setCurrentSubTabId(String tabId)
          Sets the current sub tab id for a category computed from the current tab action id and the suffix WebActions.SUBTAB_CATEGORY_SUFFIX.
 void setCurrentTabAction(Action currentTabAction)
          Sets the current action for category WebActions.DEFAULT_TABS_CATEGORY
 void setCurrentTabAction(String currentTabActionId)
          Deprecated. 
 void setCurrentTabAction(String category, Action tabAction)
          Sets the current action for given category.
 String setCurrentTabAndNavigate(DocumentModel document, String currentTabActionId)
          Navigate to the given document and opens the view page of the given document selecting the given tab.
 String setCurrentTabAndNavigate(String currentTabActionId)
          Calls WebActions.setCurrentTabAndNavigate(DocumentModel, String) for the current document.
 void setCurrentTabId(String tabId)
          Sets the current action id for category WebActions.DEFAULT_TABS_CATEGORY.
 void setCurrentTabId(String category, String tabId, String... subTabIds)
          Sets the current action for given category, with additional sub tabs.
 void setCurrentTabIds(String tabIds)
          Sets current tab ids as a String, splitting on commas ',' and parsing each action information as is: CATEGORY:ACTION_ID[:OPTIONAL_SUB_ACTION_ID[:OPTIONAL_SUB_ACTION_ID]...]
 void setSubTabsList(List<Action> tabsList)
          Deprecated. 
 void setTabsList(List<Action> tabsList)
          Deprecated. 
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebActionsBean

public WebActionsBean()
Method Detail

initialize

public void initialize()
Specified by:
initialize in interface WebActionsLocal

destroy

@Destroy
public void destroy()
Specified by:
destroy in interface WebActionsLocal

saveState

public void saveState()
Description copied from interface: StatefulBaseLifeCycle
Passivate method.

Specified by:
saveState in interface StatefulBaseLifeCycle

readState

public void readState()
Description copied from interface: StatefulBaseLifeCycle
Activate method.

Specified by:
readState in interface StatefulBaseLifeCycle

getActionsList

public List<Action> getActionsList(String category,
                                   ActionContext context)
Description copied from interface: WebActions
Returns all filtered actions for a given category and given resolution context.

Actions are filtered according to filters set on the actions definitions.

Specified by:
getActionsList in interface WebActions

getActionsList

public List<Action> getActionsList(String category)
Description copied from interface: WebActions
Returns all filtered actions for a given category, creating a new context for the filters resolution.

Specified by:
getActionsList in interface WebActions
See Also:
WebActions.getActionsList(String, ActionContext)

getUnfiltredActionsList

public List<Action> getUnfiltredActionsList(String category,
                                            ActionContext context)
Description copied from interface: WebActions
Returns all actions for a given category and given resolution context.

Actions are not filtered according to filters set on the actions definitions: actions that should have been removed are just marked as non-available.

Specified by:
getUnfiltredActionsList in interface WebActions

getUnfiltredActionsList

public List<Action> getUnfiltredActionsList(String category)
Description copied from interface: WebActions
Returns all actions for a given category, creating a new context for the filters resolution.

Specified by:
getUnfiltredActionsList in interface WebActions
See Also:
WebActions.getUnfiltredActionsList(String, ActionContext)

getAllActions

public List<Action> getAllActions(String category)
Description copied from interface: WebActions
Returns all actions for a given category, without filtering.

Specified by:
getAllActions in interface WebActions

getCurrentTabAction

public Action getCurrentTabAction(String category)
Description copied from interface: WebActions
Returns the current action for given category.

Specified by:
getCurrentTabAction in interface WebActions

setCurrentTabAction

public void setCurrentTabAction(String category,
                                Action tabAction)
Description copied from interface: WebActions
Sets the current action for given category.

If given action is null, it resets the current action for this category.

Specified by:
setCurrentTabAction in interface WebActions

getCurrentSubTabAction

public Action getCurrentSubTabAction(String parentActionId)
Description copied from interface: WebActions
Returns the current sub tab action for given parent action, computing the category from parent action id with suffix WebActions.SUBTAB_CATEGORY_SUFFIX.

Specified by:
getCurrentSubTabAction in interface WebActions

getCurrentTabId

public String getCurrentTabId(String category)
Description copied from interface: WebActions
Returns the current action id for given category

Specified by:
getCurrentTabId in interface WebActions

setCurrentTabId

public void setCurrentTabId(String category,
                            String tabId,
                            String... subTabIds)
Description copied from interface: WebActions
Sets the current action for given category, with additional sub tabs.

Specified by:
setCurrentTabId in interface WebActions

getCurrentTabIds

public String getCurrentTabIds()
Description copied from interface: WebActions
Returns current tab ids as a string, encoded as is: CATEGORY_1:ACTION_ID_1,CATEGORY_2:ACTION_ID_2,...

Specified by:
getCurrentTabIds in interface WebActions

setCurrentTabIds

public void setCurrentTabIds(String tabIds)
Description copied from interface: WebActions
Sets current tab ids as a String, splitting on commas ',' and parsing each action information as is: CATEGORY:ACTION_ID[:OPTIONAL_SUB_ACTION_ID[:OPTIONAL_SUB_ACTION_ID]...]

If category is omitted or empty, the category WebActions.DEFAULT_TABS_CATEGORY will be used (if there is no subtab information).

The resulting string looks like: CATEGORY_1:ACTION_ID_1,CATEGORY_2:ACTION_ID_2_SUB_ACTION_ID_2,...

Specified by:
setCurrentTabIds in interface WebActions

resetCurrentTabs

public void resetCurrentTabs()
Description copied from interface: WebActions
Resets all current tabs information.

Specified by:
resetCurrentTabs in interface WebActions

resetCurrentTabs

public void resetCurrentTabs(String category)
Description copied from interface: WebActions
Resets current tabs for given category, taking subtabs into account by resetting actions in categories computed from reset actions id with suffix WebActions.SUBTAB_CATEGORY_SUFFIX.

Specified by:
resetCurrentTabs in interface WebActions

resetCurrentTab

public void resetCurrentTab()
Description copied from interface: WebActions
Resets current tab information (includes sub tab information) for category WebActions.DEFAULT_TABS_CATEGORY.

Specified by:
resetCurrentTab in interface WebActions

resetTabList

@Observer(value={"userAllDocumentTypesSelectionChanged","locationSelectionChanged"},
          create=false)
@BypassInterceptors
public void resetTabList()
Description copied from interface: WebActions
Resets actions resolved for category WebActions.DEFAULT_TABS_CATEGORY so that they're recomputed. Also calls WebActions.resetCurrentTab()

Specified by:
resetTabList in interface WebActions

getTabsList

@Factory(value="tabsActionsList",
         scope=EVENT)
public List<Action> getTabsList()
Description copied from interface: WebActions
Returns filtered actions for the category WebActions.DEFAULT_TABS_CATEGORY

Specified by:
getTabsList in interface WebActions

getSubTabsList

@Factory(value="subTabsActionsList",
         scope=EVENT)
public List<Action> getSubTabsList()
Description copied from interface: WebActions
Returns filtered actions for a category computed from the current tab action id and the suffix WebActions.SUBTAB_CATEGORY_SUFFIX.

Specified by:
getSubTabsList in interface WebActions

getCurrentTabAction

@Factory(value="currentTabAction",
         scope=EVENT)
public Action getCurrentTabAction()
Description copied from interface: WebActions
Returns the current action for category WebActions.DEFAULT_TABS_CATEGORY

Specified by:
getCurrentTabAction in interface WebActions

setCurrentTabAction

public void setCurrentTabAction(Action currentTabAction)
Description copied from interface: WebActions
Sets the current action for category WebActions.DEFAULT_TABS_CATEGORY

Specified by:
setCurrentTabAction in interface WebActions

getCurrentSubTabAction

@Factory(value="currentSubTabAction",
         scope=EVENT)
public Action getCurrentSubTabAction()
Description copied from interface: WebActions
Returns the current sub tab for a category computed from the current tab action id and the suffix WebActions.SUBTAB_CATEGORY_SUFFIX.

Specified by:
getCurrentSubTabAction in interface WebActions

setCurrentSubTabAction

public void setCurrentSubTabAction(Action tabAction)
Description copied from interface: WebActions
Sets the current sub tab for a category computed from the current tab action id and the suffix WebActions.SUBTAB_CATEGORY_SUFFIX.

Specified by:
setCurrentSubTabAction in interface WebActions

getCurrentTabId

public String getCurrentTabId()
Description copied from interface: WebActions
Returns the current action id for category WebActions.DEFAULT_TABS_CATEGORY

Specified by:
getCurrentTabId in interface WebActions

setCurrentTabId

public void setCurrentTabId(String tabId)
Description copied from interface: WebActions
Sets the current action id for category WebActions.DEFAULT_TABS_CATEGORY.

Does nothing if tabId is null, but resets current tab for this category when using an empty string instead.

Specified by:
setCurrentTabId in interface WebActions

getCurrentSubTabId

public String getCurrentSubTabId()
Description copied from interface: WebActions
Returns the current sub tab id for a category computed from the current tab action id and the suffix WebActions.SUBTAB_CATEGORY_SUFFIX.

Specified by:
getCurrentSubTabId in interface WebActions

setCurrentSubTabId

public void setCurrentSubTabId(String tabId)
Description copied from interface: WebActions
Sets the current sub tab id for a category computed from the current tab action id and the suffix WebActions.SUBTAB_CATEGORY_SUFFIX.

Does nothing if sub tab id is null, but resets current tab for this category when using an empty string instead.

Specified by:
setCurrentSubTabId in interface WebActions

setCurrentTabAndNavigate

public String setCurrentTabAndNavigate(String currentTabActionId)
Description copied from interface: WebActions
Calls WebActions.setCurrentTabAndNavigate(DocumentModel, String) for the current document.

Given action should hold the category WebActions.DEFAULT_TABS_CATEGORY

Specified by:
setCurrentTabAndNavigate in interface WebActions
See Also:
NavigationContext.getCurrentDocument()

setCurrentTabAndNavigate

public String setCurrentTabAndNavigate(DocumentModel document,
                                       String currentTabActionId)
Description copied from interface: WebActions
Navigate to the given document and opens the view page of the given document selecting the given tab.

Given action should hold the category WebActions.DEFAULT_TABS_CATEGORY

Specified by:
setCurrentTabAndNavigate in interface WebActions
Parameters:
document - to document which will be shown in the view page
currentTabActionId - the tab that will be selected in the view page
Returns:
the JSF view for the given document.

getSubViewActionsList

@Deprecated
public List<Action> getSubViewActionsList()
Deprecated. 

Specified by:
getSubViewActionsList in interface WebActions

selectTabAction

@Deprecated
public void selectTabAction()
Deprecated. 

Specified by:
selectTabAction in interface WebActions

getCurrentLifeCycleState

@Deprecated
public String getCurrentLifeCycleState()
                                throws ClientException
Deprecated. 

Specified by:
getCurrentLifeCycleState in interface WebActions
Throws:
ClientException

setTabsList

@Deprecated
public void setTabsList(List<Action> tabsList)
Deprecated. 

Specified by:
setTabsList in interface WebActions

setSubTabsList

@Deprecated
public void setSubTabsList(List<Action> tabsList)
Deprecated. 

Specified by:
setSubTabsList in interface WebActions

setCurrentTabAction

@Deprecated
public void setCurrentTabAction(String currentTabActionId)
Deprecated. 

Specified by:
setCurrentTabAction in interface WebActions

Nuxeo Enterprise Platform 5.4

Copyright © 2011 Nuxeo SAS. All Rights Reserved.