org.opencms.workplace.list
Class CmsListMetadata

java.lang.Object
  extended byorg.opencms.workplace.list.CmsListMetadata

public class CmsListMetadata
extends Object

This is class contains all the information for defining a whole html list.

Since:
6.0.0
Version:
$Revision: 1.19 $
Author:
Michael Moossen

Constructor Summary
CmsListMetadata(String listId)
          Default Constructor.
 
Method Summary
 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.
 CmsListColumnDefinition getColumnDefinition(String columnId)
          Returns a column definition object for a given column id.
 List getIndependentActions()
          Returns the list of independent actions.
 CmsListItemDetails getItemDetailDefinition(String itemDetailId)
          Returns a list item details definition object for a given id.
 List getListColumns()
          Returns all columns definitions.
 List getListDetails()
          Returns all detail definitions.
 String getListId()
          Returns the id of the list.
 List getMultiActions()
          Returns the list of multi actions.
 CmsListSearchAction getSearchAction()
          Returns the search action.
 int getWidth()
          Returns the total number of displayed columns.
 boolean hasActions()
          Returns true if the list definition contains an action.
 boolean hasMultiActions()
          Returns true if the list definition contains a multi action.
 boolean hasSingleActions()
          Returns true if any column definition contains a single action.
 String htmlActionBar(CmsWorkplace wp)
          Returns the html code for the action bar.
 String htmlEmptyTable(Locale locale)
          Generates the hml code for an empty table.
 String htmlHeader(CmsHtmlList list, CmsWorkplace wp)
          Returns the html code for the header of the list.
 String htmlItem(CmsListItem item, CmsWorkplace wp, boolean odd)
          Returns the html code for a list item.
 String htmlMultiActionBar(CmsWorkplace wp)
          Returns the html code for the multi action bar.
 String htmlSearchBar(CmsWorkplace wp)
          Generates the html code for the search bar.
 boolean isSearchable()
          Returns true if the list is searchable.
 boolean isSorteable()
          Returns true if any column is sorteable.
 void setSearchAction(CmsListSearchAction searchAction)
          Sets the search action.
 void toogleDetailState(String itemDetailId)
          Toggles the given item detail state from visible to hidden or from hidden to visible.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CmsListMetadata

public CmsListMetadata(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.

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.

Parameters:
listColumn - the column definition
position - 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 definition
position - 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 CmsListItems.

Parameters:
multiAction - the action

getColumnDefinition

public CmsListColumnDefinition getColumnDefinition(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

getIndependentActions

public List getIndependentActions()
Returns the list of independent actions.

Returns:
a list of I_CmsListActions

getItemDetailDefinition

public CmsListItemDetails getItemDetailDefinition(String itemDetailId)
Returns a list item details definition object for a given id.

Parameters:
itemDetailId - the id
Returns:
the list item details definition, or null if not present

getListColumns

public List getListColumns()
Returns all columns definitions.

Returns:
a list of CmsListColumnDefinitions.

getListDetails

public List getListDetails()
Returns all detail definitions.

Returns:
a list of CmsListItemDetails.

getListId

public String getListId()
Returns the id of the list.

Returns:
the id of list

getMultiActions

public List getMultiActions()
Returns the list of multi actions.

Returns:
a list of CmsListMultiActions

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

hasActions

public boolean hasActions()
Returns true if the list definition contains an action.

Returns:
true if the list definition contains an action

hasMultiActions

public boolean hasMultiActions()
Returns true if the list definition contains a multi action.

Returns:
true if the list definition contains a multi action

hasSingleActions

public boolean hasSingleActions()
Returns true if any column definition contains a single action.

Returns:
true if any column definition contains a single action

htmlActionBar

public String htmlActionBar(CmsWorkplace wp)
Returns the html code for the action bar.

Parameters:
wp - the workplace context
Returns:
html code

htmlEmptyTable

public String htmlEmptyTable(Locale locale)
Generates the hml code for an empty table.

Parameters:
locale - for localization
Returns:
html code

htmlHeader

public String htmlHeader(CmsHtmlList list,
                         CmsWorkplace wp)
Returns the html code for the header of the list.

Parameters:
list - the list to generate the code for
wp - the workplace instance
Returns:
html code

htmlItem

public String htmlItem(CmsListItem item,
                       CmsWorkplace wp,
                       boolean odd)
Returns the html code for a list item.

Parameters:
item - the list item to render
wp - the workplace context
odd - if the position is odd or even
Returns:
html code

htmlMultiActionBar

public String htmlMultiActionBar(CmsWorkplace wp)
Returns the html code for the multi action bar.

Parameters:
wp - the workplace context
Returns:
html code

htmlSearchBar

public String htmlSearchBar(CmsWorkplace wp)
Generates the html code for the search bar.

Parameters:
wp - the workplace context
Returns:
html code

isSearchable

public boolean isSearchable()
Returns true if the list is searchable.

Returns:
true if the list is searchable

isSorteable

public boolean isSorteable()
Returns true if any column is sorteable.

Returns:
true if any column is sorteable

setSearchAction

public void setSearchAction(CmsListSearchAction searchAction)
Sets the search action.

Parameters:
searchAction - the search action to set

toogleDetailState

public void toogleDetailState(String itemDetailId)
Toggles the given item detail state from visible to hidden or from hidden to visible.

Parameters:
itemDetailId - the item detail id