@Name(value="contentViewActions") @Scope(value=CONVERSATION) public class ContentViewActions extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
protected ContentViewCache |
cache |
protected ContentViewRestActions |
contentViewRestActions |
protected ContentViewService |
contentViewService |
protected ContentView |
currentContentView |
protected Long |
globalPageSize |
protected WebActions |
webActions |
Constructor and Description |
---|
ContentViewActions() |
Modifier and Type | Method and Description |
---|---|
protected ActionContext |
createContentViewActionContext(DocumentModel currentDocument,
ContentView contentView,
Object showPageSizeSelector,
Object showRefreshCommand,
Object showCSVExport,
Object showPDFExport,
Object showSyndicationLinks,
Object showSlideshow,
Object showEditColumns,
Object showEditRows,
Object showSpreadsheet) |
List<Action> |
getActionsList(String category,
DocumentModel currentDocument,
ContentView contentView,
Object showPageSizeSelector,
Object showRefreshCommand,
Object showCSVExport,
Object showPDFExport,
Object showSyndicationLinks,
Object showSlideshow,
Object showEditColumns,
Object showEditRows,
Object showSpreadsheet)
Returns actions filtered depending on given custom context.
|
ContentView |
getContentView(String name) |
ContentView |
getContentView(String name,
DocumentModel searchDocumentModel)
Returns content view with given name, or null if no content view with this name is found.
|
ContentView |
getContentViewWithProvider(String name) |
ContentView |
getContentViewWithProvider(String name,
DocumentModel searchDocumentModel) |
ContentView |
getContentViewWithProvider(String name,
DocumentModel searchDocumentModel,
List<SortInfo> sortInfos,
Long pageSize,
Long currentPage) |
ContentView |
getContentViewWithProvider(String name,
DocumentModel searchDocumentModel,
List<SortInfo> sortInfos,
Long defaultPageSize,
Long pageSize,
Long currentPage) |
protected ContentView |
getContentViewWithProvider(String name,
DocumentModel searchDocumentModel,
List<SortInfo> sortInfos,
Long defaultPageSize,
Long pageSize,
Long currentPage,
Object... params)
Helper method to retrieve a content view, taking care of initialization of page provider according to parameters
and current global page size.
|
ContentView |
getContentViewWithProvider(String name,
DocumentModel searchDocumentModel,
List<SortInfo> sortInfos,
Long pageSize,
Long currentPage,
Object... params) |
ContentView |
getCurrentContentView()
Returns the current global content view.
|
Long |
getCurrentGlobalPageSize()
Returns the global page size, or returns the page size on current content view if set.
|
Long |
getGlobalPageSize()
Returns the global page size
|
List<javax.faces.model.SelectItem> |
getPageSizeOptions(ContentView cv)
Returns the list of available options for page size selections, for given content view.
|
void |
refresh(String contentViewName) |
void |
refreshAll() |
void |
refreshAndRewind(String contentViewName) |
void |
refreshAndRewindAll() |
void |
refreshOnSeamEvent(String seamEventName)
Refreshes all content views that have declared the given seam event name as a refresh event in their XML
configuration.
|
void |
reset(String contentViewName) |
void |
resetAggregates(String contentViewName) |
void |
resetAll() |
void |
resetAllContent() |
void |
resetPageProvider(String contentViewName) |
void |
resetPageProviderOnSeamEvent(String seamEventName)
Resets all content views page providers that have declared the given seam event name as a reset event in their
XML configuration.
|
ContentView |
restoreContentView(ContentViewState state)
Restore a Content View from the given ContentView state.
|
ContentView |
restoreContentView(String contentViewName,
Long currentPage,
Long pageSize,
List<SortInfo> sortInfos,
String jsonContentViewState)
Restore a content view from the given parameters.
|
void |
setCurrentContentView(ContentView cv)
Sets the current global content view.
|
void |
setCurrentGlobalPageSize(Long pageSize)
Sets the global page size, useful to set the value having the appropriate selection set, see
getCurrentContentView() |
void |
setGlobalPageSize(Long pageSize)
Sets the global page size
|
@In(create=true) protected ContentViewRestActions contentViewRestActions
@In(create=true) protected ContentViewService contentViewService
protected final ContentViewCache cache
protected Long globalPageSize
@In(create=true, required=false) protected transient WebActions webActions
protected ContentView currentContentView
public ContentViewActions()
public ContentView getCurrentContentView()
Current content view is usually the last one displayed on the page, but this may change depending on calls to
setCurrentContentView(ContentView)
.
public void setCurrentContentView(ContentView cv)
getCurrentGlobalPageSize()
public Long getCurrentGlobalPageSize()
public void setCurrentGlobalPageSize(Long pageSize)
getCurrentContentView()
public Long getGlobalPageSize()
public List<javax.faces.model.SelectItem> getPageSizeOptions(ContentView cv)
This method relies on a hard-coded set of available values, and adapts it to the current content view page size and max page size information to present more or less items from this list.
public void setGlobalPageSize(Long pageSize)
public ContentView getContentView(String name)
public ContentView getContentView(String name, DocumentModel searchDocumentModel)
If parameter searchDocumentModel is not null, it will be set on the content view. If it is null and the content is using a provider that needs it, a new document model is created and attached to it. This document model is resolved from the binding put in the content view XML definition, or from the document type in this definition if no binding is set.
If not null, this content view is set as the current content view so that subsequent calls to other methods can
take information from it, like getCurrentGlobalPageSize()
The content view is put in a cache map so that it's not rebuilt at each call. It is rebuilt when its cache key changes (if defined).
public ContentView getContentViewWithProvider(String name)
public ContentView getContentViewWithProvider(String name, DocumentModel searchDocumentModel)
public ContentView getContentViewWithProvider(String name, DocumentModel searchDocumentModel, List<SortInfo> sortInfos, Long pageSize, Long currentPage)
public ContentView getContentViewWithProvider(String name, DocumentModel searchDocumentModel, List<SortInfo> sortInfos, Long defaultPageSize, Long pageSize, Long currentPage)
public ContentView getContentViewWithProvider(String name, DocumentModel searchDocumentModel, List<SortInfo> sortInfos, Long pageSize, Long currentPage, Object... params)
protected ContentView getContentViewWithProvider(String name, DocumentModel searchDocumentModel, List<SortInfo> sortInfos, Long defaultPageSize, Long pageSize, Long currentPage, Object... params)
This method is not public to avoid EL method resolution issues.
public ContentView restoreContentView(String contentViewName, Long currentPage, Long pageSize, List<SortInfo> sortInfos, String jsonContentViewState) throws UnsupportedEncodingException
The content view is put in a cache map so that it's not rebuilt at each call. It is rebuilt when its cache key changes (if defined).
UnsupportedEncodingException
public ContentView restoreContentView(ContentViewState state) throws UnsupportedEncodingException
The content view is put in a cache map so that it's not rebuilt at each call. It is rebuilt when its cache key changes (if defined).
UnsupportedEncodingException
@BypassInterceptors public void refreshOnSeamEvent(String seamEventName)
@BypassInterceptors public void resetPageProviderOnSeamEvent(String seamEventName)
@BypassInterceptors public void refreshAndRewind(String contentViewName)
@BypassInterceptors public void resetAggregates(String contentViewName)
@BypassInterceptors public void resetPageProvider(String contentViewName)
@BypassInterceptors public void resetAllContent()
@BypassInterceptors public void resetAll()
@BypassInterceptors public void refreshAll()
@BypassInterceptors public void refreshAndRewindAll()
public List<Action> getActionsList(String category, DocumentModel currentDocument, ContentView contentView, Object showPageSizeSelector, Object showRefreshCommand, Object showCSVExport, Object showPDFExport, Object showSyndicationLinks, Object showSlideshow, Object showEditColumns, Object showEditRows, Object showSpreadsheet)
Boolean values are declared as objects to avoid conversion to "false" when variable is not defined, and keep "null" value.
protected ActionContext createContentViewActionContext(DocumentModel currentDocument, ContentView contentView, Object showPageSizeSelector, Object showRefreshCommand, Object showCSVExport, Object showPDFExport, Object showSyndicationLinks, Object showSlideshow, Object showEditColumns, Object showEditRows, Object showSpreadsheet)
Copyright © 2017 Nuxeo. All rights reserved.