|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opencms.xml.content.CmsDefaultXmlContentHandler
org.opencms.widgets.CmsCategoryXmlContentHandler
This handler adds the categories to the current resource and all siblings.
Field Summary |
Fields inherited from interface org.opencms.xml.content.I_CmsXmlContentHandler |
ATTRIBUTES, MAPTO_ATTRIBUTE, MAPTO_PROPERTY, MAPTO_PROPERTY_INDIVIDUAL, MAPTO_PROPERTY_LIST, MAPTO_PROPERTY_LIST_INDIVIDUAL, MAPTO_PROPERTY_LIST_SHARED, MAPTO_PROPERTY_SHARED |
Constructor Summary | |
CmsCategoryXmlContentHandler()
Default constructor. |
Method Summary | |
protected java.util.List |
getCategories(CmsXmlContent content,
java.util.Locale locale)
Returns all categories set for the given locale. |
static java.util.Locale |
getDefaultLocale(CmsObject cms,
java.lang.String resource)
Returns the default locale in the content of the given resource. |
CmsFile |
prepareForWrite(CmsObject cms,
CmsXmlContent content,
CmsFile file)
Prepares the given XML content to be written to the OpenCms VFS. |
protected void |
resetCategories(CmsObject cms,
CmsResource resource)
Removes this resource from all categories. |
CmsXmlContentErrorHandler |
resolveValidation(CmsObject cms,
I_CmsXmlContentValue value,
CmsXmlContentErrorHandler errorHandler)
Performs a validation of the given XML content value, and saves all errors or warnings found in the provided XML content error handler. |
protected void |
setCategories(CmsObject cms,
CmsXmlContent content,
CmsResource resource,
java.util.Locale locale)
Sets categories from any category widget for the given locale. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CmsCategoryXmlContentHandler()
Method Detail |
public static java.util.Locale getDefaultLocale(CmsObject cms, java.lang.String resource)
cms
- the cms contextresource
- the resource path to get the default locale for
public CmsFile prepareForWrite(CmsObject cms, CmsXmlContent content, CmsFile file) throws CmsException
I_CmsXmlContentHandler
This method is always called before any content gets written. It can be used to perform XML validation, pretty - printing or customized actions on the given XML content.
prepareForWrite
in interface I_CmsXmlContentHandler
prepareForWrite
in class CmsDefaultXmlContentHandler
CmsException
I_CmsXmlContentHandler.prepareForWrite(org.opencms.file.CmsObject, org.opencms.xml.content.CmsXmlContent, org.opencms.file.CmsFile)
public CmsXmlContentErrorHandler resolveValidation(CmsObject cms, I_CmsXmlContentValue value, CmsXmlContentErrorHandler errorHandler)
I_CmsXmlContentHandler
The errorHandler parameter is optional, if null
is given a new error handler
instance must be created.
resolveValidation
in interface I_CmsXmlContentHandler
resolveValidation
in class CmsDefaultXmlContentHandler
CmsDefaultXmlContentHandler.resolveValidation(org.opencms.file.CmsObject, org.opencms.xml.types.I_CmsXmlContentValue, org.opencms.xml.content.CmsXmlContentErrorHandler)
protected java.util.List getCategories(CmsXmlContent content, java.util.Locale locale)
content
- the xml content to checklocale
- the locale to use
true
, if there is a category widget presentprotected void resetCategories(CmsObject cms, CmsResource resource) throws CmsException
cms
- the cms contextresource
- the resource to reset the categories for
CmsException
- if something goes wrongprotected void setCategories(CmsObject cms, CmsXmlContent content, CmsResource resource, java.util.Locale locale) throws CmsException
cms
- the cms contextresource
- the resource to set the categories forcontent
- the xml contentlocale
- the locale to read the categories from
CmsException
- if an error occurred.
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |