Package org.opencms.workplace.list
Class CmsListMetadata
- java.lang.Object
-
- org.opencms.workplace.list.CmsListMetadata
-
public class CmsListMetadata extends java.lang.Object
This is class contains all the information for defining a whole html list.- Since:
- 6.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
CmsListMetadata.I_CsvItemFormatter
Interface used for formatting list data in text form.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
SEARCH_BAR_INPUT_ID
the html id for the input element of the search bar.
-
Constructor Summary
Constructors Constructor Description CmsListMetadata(java.lang.String listId)
Default Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addColumn(CmsListColumnDefinition listColumn)
Adds a new column definition at the end.void
addColumn(CmsListColumnDefinition listColumn, int position)
Adds a new column definition at the given position.void
addIndependentAction(I_CmsListAction action)
Adds a list item independent action.void
addItemDetails(CmsListItemDetails itemDetail)
Adds a new item detail definition at the end.void
addItemDetails(CmsListItemDetails itemDetail, int position)
Adds a new item detail definition at the given position.void
addMultiAction(CmsListMultiAction multiAction)
Adds an action applicable to more than one list item at once.java.lang.String
csvEmptyList()
Generates the csv output for an empty table.java.lang.String
csvHeader()
Returns the csv output for the header of the list.java.lang.String
csvItem(CmsListItem item)
Returns the csv output for a list item.CmsListColumnDefinition
getColumnDefinition(java.lang.String columnId)
Returns a column definition object for a given column id.java.util.List<CmsListColumnDefinition>
getColumnDefinitions()
Returns all columns definitions.I_CmsListAction
getIndependentAction(java.lang.String actionId)
Returns an independent action object for a given id.java.util.List<I_CmsListAction>
getIndependentActions()
Returns the list of independent actions.CmsListItemDetails
getItemDetailDefinition(java.lang.String itemDetailId)
Returns the item details definition object for a given id.java.util.List<CmsListItemDetails>
getItemDetailDefinitions()
Returns all detail definitions.java.lang.String
getListId()
Returns the id of the list.CmsListMultiAction
getMultiAction(java.lang.String actionId)
Returns a multi action object for a given id.java.util.List<CmsListMultiAction>
getMultiActions()
Returns the list of multi actions.CmsListSearchAction
getSearchAction()
Returns the search action.int
getWidth()
Returns the total number of displayed columns.A_CmsListDialog
getWp()
Returns the related workplace dialog.boolean
hasActions()
Returnstrue
if the list definition contains an action.boolean
hasCheckMultiActions()
Returnstrue
if at least 'check' multiaction has been set.boolean
hasMultiActions()
Returnstrue
if the list definition contains a multi action.boolean
hasSingleActions()
Returnstrue
if any column definition contains a single action.java.lang.String
htmlActionBar()
Returns the html code for the action bar.java.lang.String
htmlEmptyTable()
Generates the hml code for an empty table.java.lang.String
htmlHeader(CmsHtmlList list)
Returns the html code for the header of the list.java.lang.String
htmlItem(CmsListItem item, boolean odd, boolean isPrintable)
Returns the html code for a list item.java.lang.String
htmlMultiActionBar()
Returns the html code for the multi action bar.java.lang.String
htmlSearchBar()
Generates the html code for the search bar.boolean
isSearchable()
Returnstrue
if the list is searchable.boolean
isSelfManaged()
Returns the self Managed flag.boolean
isSorteable()
Returnstrue
if any column is sorteable.boolean
isVolatile()
Returnstrue
if this metadata object should not be cached.void
setCsvItemFormatter(CmsListMetadata.I_CsvItemFormatter formatter)
Sets the CSV item formatter to use.void
setSearchAction(CmsListSearchAction searchAction)
Sets the search action.void
setSelfManaged(boolean selfManaged)
Sets the self Managed flag.void
setVolatile(boolean volatileFlag)
Sets the volatile flag.void
setWp(A_CmsListDialog wp)
Sets the related workplace dialog.void
toogleDetailState(java.lang.String itemDetailId)
Toggles the given item detail state from visible to hidden or from hidden to visible.
-
-
-
Field Detail
-
SEARCH_BAR_INPUT_ID
public static final java.lang.String SEARCH_BAR_INPUT_ID
the html id for the input element of the search bar.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CmsListMetadata
public CmsListMetadata(java.lang.String listId)
Default Constructor.- Parameters:
listId
- the id of the list
-
-
Method Detail
-
addColumn
public void addColumn(CmsListColumnDefinition listColumn)
Adds a new column definition at the end.By default a column is printable if it is the first column in the list, or if it is sorteable.
If you want to override this behaviour, use the
CmsListColumnDefinition.setPrintable(boolean)
method after calling this one.- Parameters:
listColumn
- the column definition- See Also:
CmsIdentifiableObjectContainer
-
addColumn
public void addColumn(CmsListColumnDefinition listColumn, int position)
Adds a new column definition at the given position.By default a column is printable if it is the first column in the list, or if it is sorteable.
If you want to override this behaviour, use the
CmsListColumnDefinition.setPrintable(boolean)
method after calling this one.- Parameters:
listColumn
- the column definitionposition
- the position- See Also:
CmsIdentifiableObjectContainer
-
addIndependentAction
public void addIndependentAction(I_CmsListAction action)
Adds a list item independent action.- Parameters:
action
- the action
-
addItemDetails
public void addItemDetails(CmsListItemDetails itemDetail)
Adds a new item detail definition at the end.- Parameters:
itemDetail
- the item detail definition- See Also:
CmsIdentifiableObjectContainer
-
addItemDetails
public void addItemDetails(CmsListItemDetails itemDetail, int position)
Adds a new item detail definition at the given position.- Parameters:
itemDetail
- the item detail definitionposition
- the position- See Also:
CmsIdentifiableObjectContainer
-
addMultiAction
public void addMultiAction(CmsListMultiAction multiAction)
Adds an action applicable to more than one list item at once.It will be executed with a list of
s.CmsListItem
- Parameters:
multiAction
- the action
-
csvEmptyList
public java.lang.String csvEmptyList()
Generates the csv output for an empty table.- Returns:
- csv output
-
csvHeader
public java.lang.String csvHeader()
Returns the csv output for the header of the list.- Returns:
- csv output
-
csvItem
public java.lang.String csvItem(CmsListItem item)
Returns the csv output for a list item.- Parameters:
item
- the list item to render- Returns:
- csv output
-
getColumnDefinition
public CmsListColumnDefinition getColumnDefinition(java.lang.String columnId)
Returns a column definition object for a given column id.- Parameters:
columnId
- the column id- Returns:
- the column definition, or
null
if not present
-
getColumnDefinitions
public java.util.List<CmsListColumnDefinition> getColumnDefinitions()
Returns all columns definitions.- Returns:
- a list of
s.CmsListColumnDefinition
-
getIndependentAction
public I_CmsListAction getIndependentAction(java.lang.String actionId)
Returns an independent action object for a given id.- Parameters:
actionId
- the id- Returns:
- the independent action, or
null
if not present
-
getIndependentActions
public java.util.List<I_CmsListAction> getIndependentActions()
Returns the list of independent actions.- Returns:
- a list of
sI_CmsListAction
-
getItemDetailDefinition
public CmsListItemDetails getItemDetailDefinition(java.lang.String itemDetailId)
Returns the item details definition object for a given id.- Parameters:
itemDetailId
- the id- Returns:
- the item details definition, or
null
if not present
-
getItemDetailDefinitions
public java.util.List<CmsListItemDetails> getItemDetailDefinitions()
Returns all detail definitions.- Returns:
- a list of
.CmsListItemDetails
-
getListId
public java.lang.String getListId()
Returns the id of the list.- Returns:
- the id of list
-
getMultiAction
public CmsListMultiAction getMultiAction(java.lang.String actionId)
Returns a multi action object for a given id.- Parameters:
actionId
- the id- Returns:
- the multi action, or
null
if not present
-
getMultiActions
public java.util.List<CmsListMultiAction> getMultiActions()
Returns the list of multi actions.- Returns:
- a list of
sCmsListMultiAction
-
getSearchAction
public CmsListSearchAction getSearchAction()
Returns the search action.- Returns:
- the search action
-
getWidth
public int getWidth()
Returns the total number of displayed columns.- Returns:
- the total number of displayed columns
-
getWp
public A_CmsListDialog getWp()
Returns the related workplace dialog.- Returns:
- the related workplace dialog
-
hasActions
public boolean hasActions()
Returnstrue
if the list definition contains an action.- Returns:
true
if the list definition contains an action
-
hasCheckMultiActions
public boolean hasCheckMultiActions()
Returnstrue
if at least 'check' multiaction has been set.- Returns:
true
if at least 'check' multiaction has been set
-
hasMultiActions
public boolean hasMultiActions()
Returnstrue
if the list definition contains a multi action.- Returns:
true
if the list definition contains a multi action
-
hasSingleActions
public boolean hasSingleActions()
Returnstrue
if any column definition contains a single action.- Returns:
true
if any column definition contains a single action
-
htmlActionBar
public java.lang.String htmlActionBar()
Returns the html code for the action bar.- Returns:
- html code
-
htmlEmptyTable
public java.lang.String htmlEmptyTable()
Generates the hml code for an empty table.- Returns:
- html code
-
htmlHeader
public java.lang.String htmlHeader(CmsHtmlList list)
Returns the html code for the header of the list.- Parameters:
list
- the list to generate the code for- Returns:
- html code
-
htmlItem
public java.lang.String htmlItem(CmsListItem item, boolean odd, boolean isPrintable)
Returns the html code for a list item.- Parameters:
item
- the list item to renderodd
- if the position is odd or evenisPrintable
- if the list is to be printed- Returns:
- html code
-
htmlMultiActionBar
public java.lang.String htmlMultiActionBar()
Returns the html code for the multi action bar.- Returns:
- html code
-
htmlSearchBar
public java.lang.String htmlSearchBar()
Generates the html code for the search bar.- Returns:
- html code
-
isSearchable
public boolean isSearchable()
Returnstrue
if the list is searchable.- Returns:
true
if the list is searchable
-
isSelfManaged
public boolean isSelfManaged()
Returns the self Managed flag.- Returns:
- the self Managed flag
-
isSorteable
public boolean isSorteable()
Returnstrue
if any column is sorteable.- Returns:
true
if any column is sorteable
-
isVolatile
public boolean isVolatile()
Returnstrue
if this metadata object should not be cached.- Returns:
true
if this metadata object should not be cached.
-
setCsvItemFormatter
public void setCsvItemFormatter(CmsListMetadata.I_CsvItemFormatter formatter)
Sets the CSV item formatter to use.- Parameters:
formatter
- the CSV item formatter
-
setSearchAction
public void setSearchAction(CmsListSearchAction searchAction)
Sets the search action.- Parameters:
searchAction
- the search action to set
-
setSelfManaged
public void setSelfManaged(boolean selfManaged)
Sets the self Managed flag.- Parameters:
selfManaged
- the self Managed flag to set
-
setVolatile
public void setVolatile(boolean volatileFlag)
Sets the volatile flag.- Parameters:
volatileFlag
- the volatile flag to set
-
setWp
public void setWp(A_CmsListDialog wp)
Sets the related workplace dialog.- Parameters:
wp
- the related workplace dialog to set
-
toogleDetailState
public void toogleDetailState(java.lang.String itemDetailId)
Toggles the given item detail state from visible to hidden or from hidden to visible.- Parameters:
itemDetailId
- the item detail id
-
-