public interface ContentView extends Serializable
It has a name that will be the resulting page provider name too. It handles a page provider and accepts configuration needed to handle rendering, like the search layout (for filtering options), the result layout (for results rendering), actions (for buttons available when selecting result objects), the selection list name...
It also handles refresh or reset of its provider, depending on its cache key and refresh events configuration.
Modifier and Type | Field and Description |
---|---|
static String |
CONTENT_VIEW_PAGE_CHANGED_EVENT
Seam event to be fired when the current page of the content view's page
provider has changed
|
static String |
CONTENT_VIEW_PAGE_SIZE_CHANGED_EVENT
Seam event to be fired when the page size of the content view has changed
|
static String |
CONTENT_VIEW_REFRESH_EVENT
Seam event to be fired when the content view's page provider has
refreshed
|
static String |
SEARCH_DOCUMENT_EL_VARIABLE |
Modifier and Type | Method and Description |
---|---|
List<String> |
getActionsCategories()
Returns the list of action categories to display buttons available on
selection of items.
|
String |
getCacheKey()
Returns the cache key for this content view provider, resolving from the
current
FacesContext instance if it's an EL expression. |
Integer |
getCacheSize()
Returns the cache size for this content view.
|
PageProvider<?> |
getCurrentPageProvider()
Returns the current page provider, or null if methods
getPageProvider() ,
getPageProvider(DocumentModel, List, Long, Long, Object...) or
getPageProviderWithParams(Object...) were never called before. |
Long |
getCurrentPageSize()
Returns the current page size, as set using
setCurrentPageSize(Long) , or the page size set on current page
provider if not null. |
ContentViewLayout |
getCurrentResultLayout()
Returns the current result layout, as set using
setCurrentResultLayout(ContentViewLayout) , or the first of
defined result layouts when not set. |
List<String> |
getCurrentResultLayoutColumns()
Returns the list of selected result layout columns, resolving the bound
EL expression set in the content view definition if columns where not
explicitely set with
setCurrentResultLayoutColumns(List) . |
String |
getEmptySentence()
Returns a sentence to display when this content view is empty
|
List<String> |
getFlags()
Returns the list of flags set on this content view, useful to group
them, see
ContentViewService.getContentViewNames(String) |
String |
getIconPath()
Returns the icon relative path for this content view.
|
String |
getName()
Returns the name of this content view
|
PageProvider<?> |
getPageProvider()
Gets page provider according to given parameters
|
PageProvider<?> |
getPageProvider(DocumentModel searchDocument,
List<SortInfo> sortInfos,
Long pageSize,
Long currentPage,
Object... params)
Gets page provider according to given parameters
|
PageProvider<?> |
getPageProviderWithParams(Object... params)
Gets page provider according to given parameters
|
String |
getPagination()
Returns the pagination type to be used in pagination rendering
|
Object[] |
getQueryParameters()
Returns the query parameters for this content view provider provider,
resolving from the current
FacesContext instance if they are EL
expressions. |
List<String> |
getRefreshEventNames()
Returns the list of event names that should trigger a refresh of this
content view page provider.
|
List<String> |
getResetEventNames()
Returns the list of event names that should trigger a reset of this
content view page provider.
|
List<String> |
getResultLayoutColumns()
Deprecated.
use
getCurrentResultLayoutColumns() instead |
List<ContentViewLayout> |
getResultLayouts()
Returns the result layouts, used to display results.
|
DocumentModel |
getSearchDocumentModel()
Returns the search document model as set on the content view.
|
String |
getSearchDocumentModelType()
Returns the search document model type as defined in the XML
configuration.
|
ContentViewLayout |
getSearchLayout()
Returns the search layout, used to filter results.
|
String |
getSelectionListName()
Returns the selection list name
|
boolean |
getShowFilterForm()
Returns true is the filter form should be displayed.
|
boolean |
getShowPageSizeSelector()
Returns true is the page size selector should be displayed.
|
boolean |
getShowRefreshCommand()
Returns true is the refresh command should be displayed.
|
boolean |
getShowTitle()
Returns true is the title should be displayed before the result layout
selector.
|
String |
getTitle()
Returns a title for this content view
|
boolean |
getTranslateEmptySentence()
Returns a boolean stating if sentence to display is empty has to be
translated
|
boolean |
getTranslateTitle()
Returns a boolean stating if title has to be translated
|
boolean |
getUseGlobalPageSize()
Returns true is this content view can use the global page size set on
the application.
|
void |
refreshAndRewindPageProvider()
Refreshes the current page provider if not null, see
PageProvider.refresh() , and resets the current page to the
first one. |
void |
refreshPageProvider()
Refreshes the current page provider if not null, see
PageProvider.refresh() . |
void |
resetPageProvider()
Resets the page provider.
|
void |
resetSearchDocumentModel()
Resets the search document model, setting it to null so that it's
recomputed when calling
getSearchDocumentModel() |
void |
setCurrentPageSize(Long pageSize)
Sets the current page size.
|
void |
setCurrentResultLayout(ContentViewLayout layout)
Sets the current result layout.
|
void |
setCurrentResultLayout(String resultLayoutName)
Sets the current result layout given its name.
|
void |
setCurrentResultLayoutColumns(List<String> resultColumns)
Sets the list of result layout columns.
|
void |
setSearchDocumentModel(DocumentModel doc)
Sets the search document model to be passed on the page provider, and
set it also on the current page provider if not null.
|
static final String SEARCH_DOCUMENT_EL_VARIABLE
static final String CONTENT_VIEW_PAGE_CHANGED_EVENT
static final String CONTENT_VIEW_REFRESH_EVENT
static final String CONTENT_VIEW_PAGE_SIZE_CHANGED_EVENT
String getName()
String getTitle()
boolean getTranslateTitle()
getTitle()
boolean getShowTitle()
String getSelectionListName()
String getPagination()
List<String> getActionsCategories()
List<String> getFlags()
ContentViewService.getContentViewNames(String)
ContentViewLayout getSearchLayout()
List<ContentViewLayout> getResultLayouts()
ContentViewLayout getCurrentResultLayout()
setCurrentResultLayout(ContentViewLayout)
, or the first of
defined result layouts when not set.void setCurrentResultLayout(ContentViewLayout layout)
void setCurrentResultLayout(String resultLayoutName)
Long getCurrentPageSize()
setCurrentPageSize(Long)
, or the page size set on current page
provider if not null.void setCurrentPageSize(Long pageSize)
@Deprecated List<String> getResultLayoutColumns()
getCurrentResultLayoutColumns()
insteadList<String> getCurrentResultLayoutColumns()
setCurrentResultLayoutColumns(List)
.void setCurrentResultLayoutColumns(List<String> resultColumns)
String getCacheKey()
FacesContext
instance if it's an EL expression.Integer getCacheSize()
String getIconPath()
Object[] getQueryParameters()
FacesContext
instance if they are EL
expressions.List<String> getRefreshEventNames()
List<String> getResetEventNames()
PageProvider<?> getPageProvider(DocumentModel searchDocument, List<SortInfo> sortInfos, Long pageSize, Long currentPage, Object... params) throws ClientException
searchDocument
- document that will be set on the page provider. If
this document is null, we try to retrieve the content view
document model calling getSearchDocumentModel()
. If
it is not null, it is set on the page provider.sortInfos
- if not null, will override default sort info put in the
page provider XML descriptionpageSize
- if not null, will override default page size put in the
page provider XML descriptioncurrentPage
- if not null, will set the current page to given oneparams
- if not null, will set the parameters on provider. If null,
will take parameters as resolved on the content view from the
XML configuration, see getQueryParameters()
ClientException
PageProvider<?> getPageProviderWithParams(Object... params) throws ClientException
ClientException
using
null as every argument except params
PageProvider<?> getPageProvider() throws ClientException
ClientException
, using
null as every argument
PageProvider<?> getCurrentPageProvider()
getPageProvider()
,
getPageProvider(DocumentModel, List, Long, Long, Object...)
or
getPageProviderWithParams(Object...)
were never called before.void resetPageProvider()
A new page provider will be computed next time
getPageProviderWithParams(Object...)
is called. Sort information
and query parameters will have to be re-generated.
void refreshPageProvider()
PageProvider.refresh()
.
Sort information and query parameters and current page are kept.
void refreshAndRewindPageProvider()
PageProvider.refresh()
, and resets the current page to the
first one.
Sort information and query parameters are kept.
boolean getUseGlobalPageSize()
boolean getShowPageSizeSelector()
boolean getShowRefreshCommand()
boolean getShowFilterForm()
Filter form is displayed on top of content view results, using the search document model and search layout if they have been set on the content view.
DocumentModel getSearchDocumentModel()
If this document is null and a EL binding has been set on the content view description, the document model will be resolved from this binding, and set as the search document model.
Else, if the content view is using a provider that needs a search document model, a new one is created and attached to it thanks to the document type held in the definition.
void setSearchDocumentModel(DocumentModel doc)
void resetSearchDocumentModel()
getSearchDocumentModel()
String getSearchDocumentModelType()
String getEmptySentence()
boolean getTranslateEmptySentence()
getEmptySentence()
Copyright © 2013 Nuxeo SA. All Rights Reserved.