org.opencms.xml.containerpage
Class CmsFormatterBean

java.lang.Object
  extended by org.opencms.xml.containerpage.CmsFormatterBean

public class CmsFormatterBean
extends java.lang.Object

A bean containing formatter configuration data as strings.

Since:
8.0.0

Field Summary
static java.lang.String PREVIEW_TYPE
          Default formatter type constant.
static int PREVIEW_WIDTH
          The width of the preview window for the formatters.
static java.lang.String WILDCARD_TYPE
          Wildcard formatter type for width based formatters.
 
Constructor Summary
CmsFormatterBean(java.lang.String containerType, java.lang.String jspRootPath, CmsUUID jspStructureId, int minWidth, int maxWidth, boolean preview, boolean searchContent, java.lang.String location)
          Constructor for creating a new formatter configuration with resource structure id.
CmsFormatterBean(java.lang.String containerType, java.lang.String jspRootPath, java.lang.String minWidthStr, java.lang.String maxWidthStr, java.lang.String preview, java.lang.String searchContent, java.lang.String location)
          Constructor for creating a new formatter configuration without resource structure id.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.String getContainerType()
          Returns the formatter container type.
 java.lang.String getJspRootPath()
          Returns the root path of the formatter JSP in the OpenCms VFS.
 CmsUUID getJspStructureId()
          Returns the structure id of the JSP resource for this formatter.
 java.lang.String getLocation()
          Returns the location this formatter was defined in.
 int getMaxWidth()
          Returns the maximum formatter width.
 int getMinWidth()
          Returns the minimum formatter width.
 int hashCode()
           
 boolean isMatchAll()
          Returns true if this formatter should match all type/width combinations.
 boolean isPreviewFormatter()
          Indicates if this formatter is to be used as preview in the ADE gallery GUI.
static boolean isPreviewType(java.lang.String containerType)
          Checks if the given container type matches the ADE gallery preview type.
 boolean isSearchContent()
          Returns true in case an XML content formatted with this formatter should be included in the online full text search.
 boolean isTypeFormatter()
          Returns true in case this formatter is based on type information.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PREVIEW_TYPE

public static final java.lang.String PREVIEW_TYPE
Default formatter type constant.

See Also:
Constant Field Values

PREVIEW_WIDTH

public static final int PREVIEW_WIDTH
The width of the preview window for the formatters.

See Also:
Constant Field Values

WILDCARD_TYPE

public static final java.lang.String WILDCARD_TYPE
Wildcard formatter type for width based formatters.

See Also:
Constant Field Values
Constructor Detail

CmsFormatterBean

public CmsFormatterBean(java.lang.String containerType,
                        java.lang.String jspRootPath,
                        CmsUUID jspStructureId,
                        int minWidth,
                        int maxWidth,
                        boolean preview,
                        boolean searchContent,
                        java.lang.String location)
Constructor for creating a new formatter configuration with resource structure id.

Parameters:
containerType - the formatter container type
jspRootPath - the formatter JSP VFS root path
jspStructureId - the structure id of the formatter JSP
minWidth - the formatter min width
maxWidth - the formatter max width
preview - indicates if this formatter is to be used for the preview in the ADE gallery GUI
searchContent - indicates if the content should be searchable in the online index when this formatter is used
location - the location where this formatter was defined, should be an OpenCms VFS resource path

CmsFormatterBean

public CmsFormatterBean(java.lang.String containerType,
                        java.lang.String jspRootPath,
                        java.lang.String minWidthStr,
                        java.lang.String maxWidthStr,
                        java.lang.String preview,
                        java.lang.String searchContent,
                        java.lang.String location)
Constructor for creating a new formatter configuration without resource structure id.

Parameters:
containerType - the formatter container type
jspRootPath - the formatter JSP VFS root path
minWidthStr - the formatter min width
maxWidthStr - the formatter max width
preview - indicates if this formatter is to be used for the preview in the ADE gallery GUI
searchContent - indicates if the content should be searchable in the online index when this formatter is used
location - the location where this formatter was defined, should be an OpenCms VFS resource path
Method Detail

isPreviewType

public static boolean isPreviewType(java.lang.String containerType)
Checks if the given container type matches the ADE gallery preview type.

Parameters:
containerType - the container type to check
Returns:
true if the given container type matches the ADE gallery preview type

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object
See Also:
Object.equals(java.lang.Object)

getContainerType

public java.lang.String getContainerType()
Returns the formatter container type.

If this is "*", then the formatter is a width based formatter.

Returns:
the formatter container type

getJspRootPath

public java.lang.String getJspRootPath()
Returns the root path of the formatter JSP in the OpenCms VFS.

Returns:
the root path of the formatter JSP in the OpenCms VFS.


getJspStructureId

public CmsUUID getJspStructureId()
Returns the structure id of the JSP resource for this formatter.

Returns:
the structure id of the JSP resource for this formatter

getLocation

public java.lang.String getLocation()
Returns the location this formatter was defined in.

This will be an OpenCms VFS root path, either to the XML schema XSD, or the configuration file this formatter was defined in, or to the JSP that makes up this formatter.

Returns:
the location this formatter was defined in

getMaxWidth

public int getMaxWidth()
Returns the maximum formatter width.

If this is not set, then Integer.MAX_VALUE is returned.

Returns:
the maximum formatter width

getMinWidth

public int getMinWidth()
Returns the minimum formatter width.

If this is not set, then -1 is returned.

Returns:
the minimum formatter width

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()

isMatchAll

public boolean isMatchAll()
Returns true if this formatter should match all type/width combinations.

Returns:
true if this formatter should match all type/width combinations

isPreviewFormatter

public boolean isPreviewFormatter()
Indicates if this formatter is to be used as preview in the ADE gallery GUI.

Returns:
true if this formatter is to be used as preview in the ADE gallery GUI

isSearchContent

public boolean isSearchContent()
Returns true in case an XML content formatted with this formatter should be included in the online full text search.

Returns:
true in case an XML content formatted with this formatter should be included in the online full text search

isTypeFormatter

public boolean isTypeFormatter()
Returns true in case this formatter is based on type information.

Returns:
true in case this formatter is based on type information