org.opencms.frontend.templateone.modules
Class CmsLayoutXmlContentHandler

java.lang.Object
  extended by org.opencms.xml.content.CmsDefaultXmlContentHandler
      extended by org.opencms.frontend.templateone.modules.CmsLayoutXmlContentHandler
All Implemented Interfaces:
org.opencms.xml.content.I_CmsXmlContentHandler

public class CmsLayoutXmlContentHandler
extends org.opencms.xml.content.CmsDefaultXmlContentHandler

A special XML content handler, will be used by all XML contents that create layout files.

Layout files with properties attached to them are used to create structured content lists in the center or on the right side of template one.

Since:
6.1.7

Field Summary
static java.lang.String CONFIG_RESTYPE_NAME
          The resource type name of the configuration files using this handler.
static java.lang.String ELEMENT_COLLECTOR
          The element name for the layout item collector name.
static java.lang.String ELEMENT_COUNT
          The element name for the layout item list count.
static java.lang.String ELEMENT_LAYOUT
          The element name for the layout.
static java.lang.String ELEMENT_RESOURCETYPE
          The element name for the layout item resource type.
static java.lang.String ELEMENT_VFSFOLDER
          The element name for the layout item VFS folder.
static java.lang.String PROPERTY_LAYOUT_COLUMN
          The name of the leyout column property.
 
Fields inherited from class org.opencms.xml.content.CmsDefaultXmlContentHandler
APPINFO_APPINFO, APPINFO_ATTR_COLLAPSE, APPINFO_ATTR_CONFIGURATION, APPINFO_ATTR_DEFAULT, APPINFO_ATTR_DESCRIPTION, APPINFO_ATTR_ELEMENT, APPINFO_ATTR_ERROR, APPINFO_ATTR_INVALIDATE, APPINFO_ATTR_KEY, APPINFO_ATTR_LOCALE, APPINFO_ATTR_MAPTO, APPINFO_ATTR_MAXWIDTH, APPINFO_ATTR_MESSAGE, APPINFO_ATTR_MINWIDTH, APPINFO_ATTR_NAME, APPINFO_ATTR_NICE_NAME, APPINFO_ATTR_PREVIEW, APPINFO_ATTR_REGEX, APPINFO_ATTR_RULE_REGEX, APPINFO_ATTR_RULE_TYPE, APPINFO_ATTR_SEARCHCONTENT, APPINFO_ATTR_SELECT_INHERIT, APPINFO_ATTR_TYPE, APPINFO_ATTR_TYPE_NODE, APPINFO_ATTR_TYPE_PARENT, APPINFO_ATTR_TYPE_WARNING, APPINFO_ATTR_URI, APPINFO_ATTR_USEALL, APPINFO_ATTR_VALUE, APPINFO_ATTR_WIDGET, APPINFO_ATTR_WIDGET_CONFIG, APPINFO_ATTRIBUTE_TYPE_CSS, APPINFO_ATTRIBUTE_TYPE_JAVASCRIPT, APPINFO_BUNDLE, APPINFO_DEFAULT, APPINFO_DEFAULTS, APPINFO_FORMATTER, APPINFO_FORMATTERS, APPINFO_HEAD_INCLUDE, APPINFO_HEAD_INCLUDES, APPINFO_LAYOUT, APPINFO_LAYOUTS, APPINFO_MAPPING, APPINFO_MAPPINGS, APPINFO_MODELFOLDER, APPINFO_PREVIEW, APPINFO_RELATION, APPINFO_RELATIONS, APPINFO_RESOURCE, APPINFO_RESOURCEBUNDLE, APPINFO_RULE, APPINFO_SCHEMA_FILE, APPINFO_SCHEMA_FILE_TYPES, APPINFO_SCHEMA_SYSTEM_ID, APPINFO_SCHEMA_TYPES_SYSTEM_ID, APPINFO_SEARCHSETTING, APPINFO_SEARCHSETTINGS, APPINFO_SETTING, APPINFO_SETTINGS, APPINFO_TAB, APPINFO_TABS, APPINFO_VALIDATIONRULE, APPINFO_VALIDATIONRULES, ATTRIBUTE_INCLUDE_TYPE_CSS, ATTRIBUTE_INCLUDE_TYPE_JAVASCRIPT, m_configurationValues, m_cssHeadIncludes, m_defaultValues, m_elementMappings, m_elementWidgets, m_formatterConfiguration, m_formatters, m_jsHeadIncludes, m_messageBundleName, m_modelFolder, m_previewLocation, m_relationChecks, m_relations, m_searchSettings, m_settings, m_tabs, m_titleMappings, m_validationErrorMessages, m_validationErrorRules, m_validationWarningMessages, m_validationWarningRules, MACRO_PREVIEW_TEMPFILE, MESSAGE_VALIDATION_DEFAULT_ERROR, MESSAGE_VALIDATION_DEFAULT_WARNING
 
Fields inherited from interface org.opencms.xml.content.I_CmsXmlContentHandler
ATTRIBUTES, MAPTO_ATTRIBUTE, MAPTO_PERMISSION, MAPTO_PROPERTY, MAPTO_PROPERTY_INDIVIDUAL, MAPTO_PROPERTY_LIST, MAPTO_PROPERTY_LIST_INDIVIDUAL, MAPTO_PROPERTY_LIST_SHARED, MAPTO_PROPERTY_SHARED, MAPTO_URLNAME
 
Constructor Summary
CmsLayoutXmlContentHandler()
          Creates a new instance of the default XML content handler.
 
Method Summary
 org.opencms.file.CmsFile prepareForWrite(org.opencms.file.CmsObject cms, org.opencms.xml.content.CmsXmlContent content, org.opencms.file.CmsFile file)
          This overwrites the super implementation to revolve additional fixed property mappings.
protected  void removeEmptyLayoutMappings(org.opencms.file.CmsObject cms, org.opencms.xml.content.CmsXmlContent content)
          Removes the layout property values on resources for non-existing, optional elements.
protected  void resolveLayoutMappings(org.opencms.file.CmsObject cms, org.opencms.xml.content.CmsXmlContent content)
          Resolves the special layout property mappings for the resource.
 
Methods inherited from class org.opencms.xml.content.CmsDefaultXmlContentHandler
addCheckRule, addConfiguration, addDefault, addDefaultCheckRules, addMapping, addSearchSetting, addValidationRule, addWidget, getConfiguration, getCSSHeadIncludes, getDefault, getFormatterConfiguration, getJSHeadIncludes, getLocaleForResource, getMappings, getMessages, getModelFolder, getPreview, getReferencePath, getRelationType, getRelationType, getSettings, getTabs, getTitleMapping, getValidationMessage, getWidget, init, initDefaultValues, initFormatters, initHeadIncludes, initialize, initLayouts, initMappings, initModelFolder, initPreview, initRelations, initResourceBundle, initSearchSettings, initSettings, initTabs, initValidationRules, invalidateBrokenLinks, isInvalidateParent, isSearchable, key, prepareForUse, removeEmptyMappings, resolveMapping, resolveValidation, validateAppinfoElement, validateCategories, validateLink, validateValue, validateValue, writeCategories
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONFIG_RESTYPE_NAME

public static final java.lang.String CONFIG_RESTYPE_NAME
The resource type name of the configuration files using this handler.

See Also:
Constant Field Values

ELEMENT_COLLECTOR

public static final java.lang.String ELEMENT_COLLECTOR
The element name for the layout item collector name.

See Also:
Constant Field Values

ELEMENT_COUNT

public static final java.lang.String ELEMENT_COUNT
The element name for the layout item list count.

See Also:
Constant Field Values

ELEMENT_LAYOUT

public static final java.lang.String ELEMENT_LAYOUT
The element name for the layout.

See Also:
Constant Field Values

ELEMENT_RESOURCETYPE

public static final java.lang.String ELEMENT_RESOURCETYPE
The element name for the layout item resource type.

See Also:
Constant Field Values

ELEMENT_VFSFOLDER

public static final java.lang.String ELEMENT_VFSFOLDER
The element name for the layout item VFS folder.

See Also:
Constant Field Values

PROPERTY_LAYOUT_COLUMN

public static final java.lang.String PROPERTY_LAYOUT_COLUMN
The name of the leyout column property.

See Also:
Constant Field Values
Constructor Detail

CmsLayoutXmlContentHandler

public CmsLayoutXmlContentHandler()
Creates a new instance of the default XML content handler.

Method Detail

prepareForWrite

public org.opencms.file.CmsFile prepareForWrite(org.opencms.file.CmsObject cms,
                                                org.opencms.xml.content.CmsXmlContent content,
                                                org.opencms.file.CmsFile file)
                                         throws org.opencms.main.CmsException
This overwrites the super implementation to revolve additional fixed property mappings.

Specified by:
prepareForWrite in interface org.opencms.xml.content.I_CmsXmlContentHandler
Overrides:
prepareForWrite in class org.opencms.xml.content.CmsDefaultXmlContentHandler
Throws:
org.opencms.main.CmsException
See Also:
I_CmsXmlContentHandler.prepareForWrite(org.opencms.file.CmsObject, org.opencms.xml.content.CmsXmlContent, org.opencms.file.CmsFile)

removeEmptyLayoutMappings

protected void removeEmptyLayoutMappings(org.opencms.file.CmsObject cms,
                                         org.opencms.xml.content.CmsXmlContent content)
                                  throws org.opencms.main.CmsException
Removes the layout property values on resources for non-existing, optional elements.

Parameters:
cms - the current users OpenCms context
content - the XML content to remove the property values for
Throws:
org.opencms.main.CmsException - in case of read/write errors accessing the OpenCms VFS

resolveLayoutMappings

protected void resolveLayoutMappings(org.opencms.file.CmsObject cms,
                                     org.opencms.xml.content.CmsXmlContent content)
                              throws org.opencms.main.CmsException
Resolves the special layout property mappings for the resource.

These mappings are not defined in the XSD, they are fixed for the layout configuration XML contents.

Parameters:
cms - the current users OpenCms context
content - the XML content to map the layout property values for
Throws:
org.opencms.main.CmsException - in case of read/write errors accessing the OpenCms VFS