@Name(value="webActions") @Scope(value=CONVERSATION) @Install(precedence=10) public class WebActionsBean extends Object implements WebActions, Serializable
Modifier and Type | Field and Description |
---|---|
protected ActionContextProvider |
actionContextProvider |
protected ActionManager |
actionManager |
protected TabActionsSelection |
currentTabActions |
protected NavigationContext |
navigationContext |
protected List<Action> |
subTabsActionsList |
protected String |
subTabsCategory |
protected List<Action> |
tabsActionsList |
AJAX_TAB_PROPERTY, CURRENT_TAB_CHANGED_EVENT, CURRENT_TAB_SELECTED_EVENT, DEFAULT_TABS_CATEGORY, DOCUMENTS_MAIN_TAB_ID, MAIN_TAB_ID_PARAMETER, MAIN_TABS_CATEGORY, NULL_TAB_ID, SUBTAB_CATEGORY_SUFFIX, TAB_IDS_PARAMETER
Constructor and Description |
---|
WebActionsBean() |
Modifier and Type | Method and Description |
---|---|
boolean |
canUseAjaxTabs()
Returns true if history push state is supported by browser.
|
boolean |
checkFilter(String filterId) |
protected ActionContext |
createActionContext() |
protected ActionContext |
createActionContext(DocumentModel document) |
Action |
getAction(ActionContext context,
String actionId,
boolean removeFiltered,
boolean postFilter)
Return action in given action context for given id.
|
Action |
getAction(String actionId,
ActionContext context,
boolean removeFiltered) |
Action |
getAction(String actionId,
boolean removeFiltered) |
Action |
getActionForDocument(String actionId,
DocumentModel document,
boolean removeFiltered)
Return action with given id, with context filled with given document.
|
List<Action> |
getActions(ActionContext context,
String category,
boolean removeFiltered,
boolean postFilter)
Return actions in given action context for given category.
|
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> |
getActionsList(String category,
ActionContext context,
boolean removeFiltered)
Returns all filtered actions for a given category and given resolution context.
|
List<Action> |
getActionsList(String category,
Boolean removeFiltered)
Returns all filtered actions for a given category and given resolution context, creating a new context for the
filters resolution.
|
List<Action> |
getActionsListForDocument(String category,
DocumentModel document,
boolean removeFiltered)
Returns all filtered actions for a given category and a context built with given current document context,
creating a new context for the filters resolution.
|
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,...
|
protected Action |
getDefaultTab(String category) |
Action |
getDocumentAction(DocumentModel document,
String actionId,
boolean removeFiltered,
boolean postFilter)
Return action in given document context for given id.
|
List<Action> |
getDocumentActions(DocumentModel document,
String category,
boolean removeFiltered,
boolean postFilter)
Return actions in given document context for given category.
|
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.
|
boolean |
hasCurrentTabId(String category)
Indicates if the current tab id is set for given category
|
boolean |
isAvailable(ActionContext context,
Action action)
Returns true if filters evaluation for given action, in given action context, grants access.
|
boolean |
isAvailableForDocument(DocumentModel document,
Action action)
Returns true if filters evaluation for given action, in given document context, grants access.
|
void |
onHotReloadFlush() |
boolean |
removeActionOptims()
Returns true if configuration property to remove optimizations around actions (for compatibility) has been
enabled.
|
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 . |
protected void |
resetSubTabs() |
void |
resetTabList()
Resets actions resolved for category
WebActions.DEFAULT_TABS_CATEGORY so that they're recomputed. |
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.
|
boolean |
useAjaxTabs()
Returns true if ajaxified behaviour of tabs is activated on the server, and if history push state is supported by
browser.
|
@In(create=true, required=false) protected transient ActionManager actionManager
@In(create=true, required=false) protected transient ActionContextProvider actionContextProvider
@In(create=true, required=false) protected transient NavigationContext navigationContext
protected List<Action> tabsActionsList
protected String subTabsCategory
protected List<Action> subTabsActionsList
protected TabActionsSelection currentTabActions
public WebActionsBean()
public List<Action> getDocumentActions(DocumentModel document, String category, boolean removeFiltered, boolean postFilter)
WebActions
getDocumentActions
in interface WebActions
public Action getDocumentAction(DocumentModel document, String actionId, boolean removeFiltered, boolean postFilter)
WebActions
Returns null if action is not found or filtered (depending on additional parameters).
getDocumentAction
in interface WebActions
public List<Action> getActions(ActionContext context, String category, boolean removeFiltered, boolean postFilter)
WebActions
getActions
in interface WebActions
public Action getAction(ActionContext context, String actionId, boolean removeFiltered, boolean postFilter)
WebActions
Returns null if action is not found or filtered (depending on additional parameters).
getAction
in interface WebActions
public boolean isAvailableForDocument(DocumentModel document, Action action)
WebActions
isAvailableForDocument
in interface WebActions
public boolean isAvailable(ActionContext context, Action action)
WebActions
isAvailable
in interface WebActions
public List<Action> getActionsList(String category, ActionContext context, boolean removeFiltered)
WebActions
Actions are filtered according to filters set on the actions definitions.
Since 5.8, the category can be a list of categories, separated by commas.
getActionsList
in interface WebActions
public List<Action> getActionsList(String category, Boolean removeFiltered)
WebActions
Actions are filtered according to filters set on the actions definitions.
Since 5.8, the category can be a list of categories, separated by commas.
getActionsList
in interface WebActions
public List<Action> getActionsList(String category, ActionContext context)
WebActions
Actions are filtered according to filters set on the actions definitions.
Since 5.8, the category can be a list of categories, separated by commas.
getActionsList
in interface WebActions
public List<Action> getActionsListForDocument(String category, DocumentModel document, boolean removeFiltered)
WebActions
Actions are filtered according to filters set on the actions definitions.
Since 5.8, the category can be a list of categories, separated by commas.
getActionsListForDocument
in interface WebActions
public List<Action> getActionsList(String category)
WebActions
Since 5.8, the category can be a list of categories, separated by commas.
getActionsList
in interface WebActions
WebActions.getActionsList(String, ActionContext)
public List<Action> getUnfiltredActionsList(String category, ActionContext context)
WebActions
Actions are not filtered according to filters set on the actions definitions: actions that should have been removed are just marked as non-available.
Since 5.8, the category can be a list of categories, separated by commas.
getUnfiltredActionsList
in interface WebActions
public List<Action> getUnfiltredActionsList(String category)
WebActions
Since 5.8, the category can be a list of categories, separated by commas.
getUnfiltredActionsList
in interface WebActions
WebActions.getUnfiltredActionsList(String, ActionContext)
public List<Action> getAllActions(String category)
WebActions
getAllActions
in interface WebActions
protected ActionContext createActionContext()
protected ActionContext createActionContext(DocumentModel document)
public Action getAction(String actionId, boolean removeFiltered)
getAction
in interface WebActions
ActionManager.getAction(String, ActionContext, boolean)
public Action getActionForDocument(String actionId, DocumentModel document, boolean removeFiltered)
WebActions
getActionForDocument
in interface WebActions
ActionManager.getAction(String, ActionContext, boolean)
public Action getAction(String actionId, ActionContext context, boolean removeFiltered)
getAction
in interface WebActions
ActionManager.getAction(String, ActionContext, boolean)
public boolean checkFilter(String filterId)
checkFilter
in interface WebActions
ActionManager.checkFilter(String, ActionContext)
protected Action getDefaultTab(String category)
public Action getCurrentTabAction(String category)
WebActions
getCurrentTabAction
in interface WebActions
public void setCurrentTabAction(String category, Action tabAction)
WebActions
If given action is null, it resets the current action for this category.
setCurrentTabAction
in interface WebActions
public Action getCurrentSubTabAction(String parentActionId)
WebActions
WebActions.SUBTAB_CATEGORY_SUFFIX
.getCurrentSubTabAction
in interface WebActions
public String getCurrentTabId(String category)
WebActions
getCurrentTabId
in interface WebActions
public boolean hasCurrentTabId(String category)
WebActions
hasCurrentTabId
in interface WebActions
public void setCurrentTabId(String category, String tabId, String... subTabIds)
WebActions
setCurrentTabId
in interface WebActions
public String getCurrentTabIds()
WebActions
getCurrentTabIds
in interface WebActions
public void setCurrentTabIds(String tabIds)
WebActions
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,...
setCurrentTabIds
in interface WebActions
public void resetCurrentTabs()
WebActions
resetCurrentTabs
in interface WebActions
public void resetCurrentTabs(String category)
WebActions
WebActions.SUBTAB_CATEGORY_SUFFIX
.resetCurrentTabs
in interface WebActions
public void resetCurrentTab()
WebActions
WebActions.DEFAULT_TABS_CATEGORY
.resetCurrentTab
in interface WebActions
protected void resetSubTabs()
@Observer(value={"userAllDocumentTypesSelectionChanged","locationSelectionChanged"}, create=false) @BypassInterceptors public void resetTabList()
WebActions
WebActions.DEFAULT_TABS_CATEGORY
so that they're recomputed. Also calls
WebActions.resetCurrentTab()
resetTabList
in interface WebActions
@Factory(value="tabsActionsList", scope=EVENT) public List<Action> getTabsList()
WebActions
WebActions.DEFAULT_TABS_CATEGORY
getTabsList
in interface WebActions
@Factory(value="subTabsActionsList", scope=EVENT) public List<Action> getSubTabsList()
WebActions
WebActions.SUBTAB_CATEGORY_SUFFIX
.getSubTabsList
in interface WebActions
@Factory(value="currentTabAction", scope=EVENT) public Action getCurrentTabAction()
WebActions
WebActions.DEFAULT_TABS_CATEGORY
getCurrentTabAction
in interface WebActions
public void setCurrentTabAction(Action currentTabAction)
WebActions
WebActions.DEFAULT_TABS_CATEGORY
setCurrentTabAction
in interface WebActions
@Factory(value="currentSubTabAction", scope=EVENT) public Action getCurrentSubTabAction()
WebActions
WebActions.SUBTAB_CATEGORY_SUFFIX
.getCurrentSubTabAction
in interface WebActions
public void setCurrentSubTabAction(Action tabAction)
WebActions
WebActions.SUBTAB_CATEGORY_SUFFIX
.setCurrentSubTabAction
in interface WebActions
public String getCurrentTabId()
WebActions
WebActions.DEFAULT_TABS_CATEGORY
getCurrentTabId
in interface WebActions
public void setCurrentTabId(String tabId)
WebActions
WebActions.DEFAULT_TABS_CATEGORY
.
Does nothing if tabId is null, but resets current tab for this category when using an empty string instead.
setCurrentTabId
in interface WebActions
public String getCurrentSubTabId()
WebActions
WebActions.SUBTAB_CATEGORY_SUFFIX
.getCurrentSubTabId
in interface WebActions
public void setCurrentSubTabId(String tabId)
WebActions
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.
setCurrentSubTabId
in interface WebActions
public String setCurrentTabAndNavigate(String currentTabActionId)
WebActions
WebActions.setCurrentTabAndNavigate(DocumentModel, String)
for the current document.
Given action should hold the category WebActions.DEFAULT_TABS_CATEGORY
setCurrentTabAndNavigate
in interface WebActions
NavigationContext.getCurrentDocument()
public String setCurrentTabAndNavigate(DocumentModel document, String currentTabActionId)
WebActions
Given action should hold the category WebActions.DEFAULT_TABS_CATEGORY
setCurrentTabAndNavigate
in interface WebActions
document
- to document which will be shown in the view pagecurrentTabActionId
- the tab that will be selected in the view page@Deprecated public List<Action> getSubViewActionsList()
getSubViewActionsList
in interface WebActions
@Deprecated public void selectTabAction()
selectTabAction
in interface WebActions
@Deprecated public String getCurrentLifeCycleState()
getCurrentLifeCycleState
in interface WebActions
@Deprecated public void setTabsList(List<Action> tabsList)
setTabsList
in interface WebActions
@Deprecated public void setSubTabsList(List<Action> tabsList)
setSubTabsList
in interface WebActions
@Deprecated public void setCurrentTabAction(String currentTabActionId)
setCurrentTabAction
in interface WebActions
@Factory(value="useAjaxTabs", scope=SESSION) public boolean useAjaxTabs()
WebActions
useAjaxTabs
in interface WebActions
WebActions.AJAX_TAB_PROPERTY
,
WebActions.canUseAjaxTabs()
@Factory(value="canUseAjaxTabs", scope=SESSION) public boolean canUseAjaxTabs()
WebActions
canUseAjaxTabs
in interface WebActions
WebActions.useAjaxTabs()
@Factory(value="removeActionOptims", scope=SESSION) public boolean removeActionOptims()
@Observer(value="flush", create=false) @BypassInterceptors public void onHotReloadFlush()
Copyright © 2016 Nuxeo SA. All rights reserved.