org.opencms.jsp.util
Class CmsTemplateContentListItem

java.lang.Object
  extended byorg.opencms.jsp.util.CmsTemplateContentListItem

public class CmsTemplateContentListItem
extends java.lang.Object

Holds information of a single XMLContent list item, either for the page side elements or the center area.

Use the newInstance() method with correct arguments to create a fully configured item object for list generation.

Since:
6.0.0
Version:
$Revision: 1.8 $
Author:
Andreas Zahner

Field Summary
static java.lang.String DISPLAYAREA_CENTER
          The display area of the list: center.
static java.lang.String DISPLAYAREA_LEFT
          The display area of the list: left.
static java.lang.String DISPLAYAREA_RIGHT
          The display area of the list: right.
static java.lang.String[] DISPLAYAREAS
          The possible display areas for the template.
static java.lang.String LISTVARIATION_LONG
          The name of the list variation: long.
static java.lang.String LISTVARIATION_SHORT
          The name of the list variation: short.
static java.lang.String[] LISTVARIATIONS
          The possible list variations for a content type.
static java.lang.String MACRO_LISTINDEX
          Macro used in property definition names to resolve the list index.
static java.lang.String MACRO_MICROSITEFOLDER
          Macro used in folder String to represent the microsite folder.
static java.lang.String PARAM_COLLECTOR
          Request parameter name for the collector.
static java.lang.String PARAM_COUNT
          Request parameter name for the list count.
static java.lang.String PARAM_ELEMENTCOUNT
          Request parameter name maximum number of elements to show.
static java.lang.String PARAM_FOLDER
          Request parameter name for the xmlcontent folder.
static java.lang.String PARAM_LISTELEMENT
          Request parameter name for the xmlcontent listelement.
static java.lang.String PROPERTY_LAYOUT_COLLECTOR
          Name of the property key to set the element collector.
static java.lang.String PROPERTY_LAYOUT_COUNT
          Name of the property key to set the element count.
static java.lang.String PROPERTY_LAYOUT_FOLDER
          Name of the property key to set the folder holding the contents.
static java.lang.String PROPERTY_LAYOUT_TYPE
          Name of the property key to set the element type.
static java.lang.String PROPERTY_LAYOUT_VARIATION
          Name of the property key to set the list variation.
static java.lang.String PROPERTY_VALUE_NONE
          The property value for displaying no list.
 
Constructor Summary
CmsTemplateContentListItem()
           
 
Method Summary
 java.lang.String getCollector()
          Returns the collector to use for this list.
 int getCount()
          Returns the maximum count of entries for elements.
static java.util.Map getDefaultValuesFromMessages(CmsMessages messages)
          Creates a Map holding the default values for the list creation from given workplace messages.
 java.lang.String getDisplayArea()
          Returns the display area for this XMLContent list.
 java.lang.String getFolder()
          Returns the folder which holds the XMLContent.
 java.lang.String getListElement()
          Returns the list element URI to use to display the list.
 java.lang.String getType()
          Returns the XMLContent type.
 java.lang.String getVariation()
          Returns the list variation.
 void includeListItem(CmsJspActionElement jsp, boolean showPageLinks)
          Includes the list generation JSP and creates the necessary request parameters for the included JSP.
static CmsTemplateContentListItem newInstance(java.util.Map defaultValues, java.util.Map properties, java.lang.String microSiteFolder, java.lang.String displayArea, int index)
          Factory method to create a new CmsTemplateContentListItem instance.
protected  void setCollector(java.lang.String collector)
          Sets the collector to use for this list.
protected  void setCount(int count)
          Sets the maximum count of entries for elements.
protected  void setDisplayArea(java.lang.String displayArea)
          Sets the display area for this XMLContent list.
protected  void setFolder(java.lang.String contentFolder)
          Sets the folder which holds the XMLContent.
protected  void setListElement(java.lang.String listElement)
          Sets the list element URI to use to display the list.
protected  void setType(java.lang.String type)
          Sets the XMLContent type.
protected  void setVariation(java.lang.String variation)
          Sets the list variation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DISPLAYAREA_CENTER

public static final java.lang.String DISPLAYAREA_CENTER
The display area of the list: center.

See Also:
Constant Field Values

DISPLAYAREA_LEFT

public static final java.lang.String DISPLAYAREA_LEFT
The display area of the list: left.

See Also:
Constant Field Values

DISPLAYAREA_RIGHT

public static final java.lang.String DISPLAYAREA_RIGHT
The display area of the list: right.

See Also:
Constant Field Values

DISPLAYAREAS

public static final java.lang.String[] DISPLAYAREAS
The possible display areas for the template.


LISTVARIATION_LONG

public static final java.lang.String LISTVARIATION_LONG
The name of the list variation: long.

See Also:
Constant Field Values

LISTVARIATION_SHORT

public static final java.lang.String LISTVARIATION_SHORT
The name of the list variation: short.

See Also:
Constant Field Values

LISTVARIATIONS

public static final java.lang.String[] LISTVARIATIONS
The possible list variations for a content type.


MACRO_LISTINDEX

public static final java.lang.String MACRO_LISTINDEX
Macro used in property definition names to resolve the list index.

See Also:
Constant Field Values

MACRO_MICROSITEFOLDER

public static final java.lang.String MACRO_MICROSITEFOLDER
Macro used in folder String to represent the microsite folder.

See Also:
Constant Field Values

PARAM_COLLECTOR

public static final java.lang.String PARAM_COLLECTOR
Request parameter name for the collector.

See Also:
Constant Field Values

PARAM_COUNT

public static final java.lang.String PARAM_COUNT
Request parameter name for the list count.

See Also:
Constant Field Values

PARAM_ELEMENTCOUNT

public static final java.lang.String PARAM_ELEMENTCOUNT
Request parameter name maximum number of elements to show.

See Also:
Constant Field Values

PARAM_FOLDER

public static final java.lang.String PARAM_FOLDER
Request parameter name for the xmlcontent folder.

See Also:
Constant Field Values

PARAM_LISTELEMENT

public static final java.lang.String PARAM_LISTELEMENT
Request parameter name for the xmlcontent listelement.

See Also:
Constant Field Values

PROPERTY_LAYOUT_COLLECTOR

public static final java.lang.String PROPERTY_LAYOUT_COLLECTOR
Name of the property key to set the element collector.

See Also:
Constant Field Values

PROPERTY_LAYOUT_COUNT

public static final java.lang.String PROPERTY_LAYOUT_COUNT
Name of the property key to set the element count.

See Also:
Constant Field Values

PROPERTY_LAYOUT_FOLDER

public static final java.lang.String PROPERTY_LAYOUT_FOLDER
Name of the property key to set the folder holding the contents.

See Also:
Constant Field Values

PROPERTY_LAYOUT_TYPE

public static final java.lang.String PROPERTY_LAYOUT_TYPE
Name of the property key to set the element type.

See Also:
Constant Field Values

PROPERTY_LAYOUT_VARIATION

public static final java.lang.String PROPERTY_LAYOUT_VARIATION
Name of the property key to set the list variation.

See Also:
Constant Field Values

PROPERTY_VALUE_NONE

public static final java.lang.String PROPERTY_VALUE_NONE
The property value for displaying no list.

See Also:
Constant Field Values
Constructor Detail

CmsTemplateContentListItem

public CmsTemplateContentListItem()
Method Detail

getDefaultValuesFromMessages

public static java.util.Map getDefaultValuesFromMessages(CmsMessages messages)
Creates a Map holding the default values for the list creation from given workplace messages.

Parameters:
messages - the localized workplace messages
Returns:
the default values for the list creation from given workplace messages

newInstance

public static CmsTemplateContentListItem newInstance(java.util.Map defaultValues,
                                                     java.util.Map properties,
                                                     java.lang.String microSiteFolder,
                                                     java.lang.String displayArea,
                                                     int index)
Factory method to create a new CmsTemplateContentListItem instance.

If no type for the specified index can be found, null is returned.

Parameters:
defaultValues - holds the default values for collector, count, list folder, JSP element
properties - the properties of the layout file to use to get the list information
microSiteFolder - the folder URI of the current microsite
displayArea - the area where to build the lists (left, center or right)
index - the index of the content list item to create
Returns:
a new instance of a CmsTemplateContentListItem

getCollector

public java.lang.String getCollector()
Returns the collector to use for this list.

Returns:
the collector to use for this list

getCount

public int getCount()
Returns the maximum count of entries for elements.

Returns:
the maximum count of entries for elements

getDisplayArea

public java.lang.String getDisplayArea()
Returns the display area for this XMLContent list.

Returns:
the display area for this XMLContent list

getFolder

public java.lang.String getFolder()
Returns the folder which holds the XMLContent.

Returns:
the folder which holds the XMLContent

getListElement

public java.lang.String getListElement()
Returns the list element URI to use to display the list.

Returns:
the list element URI to use to display the list

getType

public java.lang.String getType()
Returns the XMLContent type.

Returns:
the XMLContent type

getVariation

public java.lang.String getVariation()
Returns the list variation.

Returns:
the list variation

includeListItem

public void includeListItem(CmsJspActionElement jsp,
                            boolean showPageLinks)
                     throws javax.servlet.jsp.JspException
Includes the list generation JSP and creates the necessary request parameters for the included JSP.

Parameters:
jsp - the JSP action element
showPageLinks - flag to determine if page links should be shown
Throws:
javax.servlet.jsp.JspException - if inclusion of the element fails

setCollector

protected void setCollector(java.lang.String collector)
Sets the collector to use for this list.

Parameters:
collector - the collector to use for this list

setCount

protected void setCount(int count)
Sets the maximum count of entries for elements.

Parameters:
count - the maximum count of entries for elements

setDisplayArea

protected void setDisplayArea(java.lang.String displayArea)
Sets the display area for this XMLContent list.

Parameters:
displayArea - the display area for this XMLContent list

setFolder

protected void setFolder(java.lang.String contentFolder)
Sets the folder which holds the XMLContent.

Parameters:
contentFolder - the folder which holds the XMLContent

setListElement

protected void setListElement(java.lang.String listElement)
Sets the list element URI to use to display the list.

Parameters:
listElement - the list element URI to use to display the list

setType

protected void setType(java.lang.String type)
Sets the XMLContent type.

Parameters:
type - the XMLContent type to set

setVariation

protected void setVariation(java.lang.String variation)
Sets the list variation.

Parameters:
variation - the list variation to set