Package org.opencms.ade.contenteditor
Class CmsContentTypeVisitor
- java.lang.Object
-
- org.opencms.ade.contenteditor.CmsContentTypeVisitor
-
public class CmsContentTypeVisitor extends java.lang.Object
Visitor to read all types and attribute configurations within a content definition.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
CmsContentTypeVisitor.DisplayTypeEvaluator
Helper class to evaluate the widget display type.protected static class
CmsContentTypeVisitor.EvaluationRule
Widget display type evaluation rules.
-
Constructor Summary
Constructors Constructor Description CmsContentTypeVisitor(CmsObject cms, CmsFile file, java.util.Locale locale)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.Map<java.lang.String,CmsAttributeConfiguration>
getAttributeConfigurations()
Returns the attribute configurations.CmsObject
getCmsObject()
Gets the CMS context.java.util.List<I_CmsWidget>
getCollectedWidgets()
Gets the list of widgets which have been processed by this visitor.java.util.Map<java.lang.String,CmsComplexWidgetData>
getComplexWidgetData()
Gets the map of complex widget configurations.java.lang.String
getLabel(I_CmsXmlSchemaType value, java.lang.String defaultValue)
Returns the label for this value.protected java.util.List<java.lang.String>
getLocaleSynchronizations()
Returns the locale synchronized attribute names.CmsDynamicCategoryFieldList
getOptionalDynamicCategoryFields()
Gets the optional dynamic category fields collected so far.java.util.List<CmsTabInfo>
getTabInfos()
Returns the tabInfos.protected java.util.Map<java.lang.String,CmsType>
getTypes()
Returns the types of the visited content definition.protected java.util.Collection<CmsExternalWidgetConfiguration>
getWidgetConfigurations()
Returns the external widget configurations.boolean
hasInvisibleFields()
Returns if the visited content has invisible fields.boolean
isDynamicallyLoaded(java.lang.String attributeName)
Returnstrue
if the value of the attribute is dynamically loaded.boolean
isEditorCompatible(CmsXmlContentDefinition xmlContentDefinition)
Checks if the content type widgets are compatible with the new content editor.void
visitTypes(CmsXmlContentDefinition xmlContentDefinition, java.util.Locale messageLocale)
Visits all types within the XML content definition.
-
-
-
Constructor Detail
-
CmsContentTypeVisitor
public CmsContentTypeVisitor(CmsObject cms, CmsFile file, java.util.Locale locale)
Constructor.- Parameters:
cms
- the CMS contextfile
- the content filelocale
- the content locale
-
-
Method Detail
-
getCmsObject
public CmsObject getCmsObject()
Gets the CMS context.- Returns:
- the CMS context
-
getCollectedWidgets
public java.util.List<I_CmsWidget> getCollectedWidgets()
Gets the list of widgets which have been processed by this visitor.- Returns:
- the list of widget
-
getComplexWidgetData
public java.util.Map<java.lang.String,CmsComplexWidgetData> getComplexWidgetData()
Gets the map of complex widget configurations.- Returns:
- a map from attribute names to complex widget configurations
-
getLabel
public java.lang.String getLabel(I_CmsXmlSchemaType value, java.lang.String defaultValue)
Returns the label for this value.- Parameters:
value
- the value- Returns:
- the label
-
getOptionalDynamicCategoryFields
public CmsDynamicCategoryFieldList getOptionalDynamicCategoryFields()
Gets the optional dynamic category fields collected so far.- Returns:
- the optional dynamic category fields
-
getTabInfos
public java.util.List<CmsTabInfo> getTabInfos()
Returns the tabInfos.- Returns:
- the tabInfos
-
hasInvisibleFields
public boolean hasInvisibleFields()
Returns if the visited content has invisible fields.- Returns:
true
if the visited content has invisible fields
-
isDynamicallyLoaded
public boolean isDynamicallyLoaded(java.lang.String attributeName)
Returnstrue
if the value of the attribute is dynamically loaded.- Parameters:
attributeName
- the attribute to check- Returns:
true
if the value of the attribute is dynamically loaded.
-
isEditorCompatible
public boolean isEditorCompatible(CmsXmlContentDefinition xmlContentDefinition) throws CmsXmlException
Checks if the content type widgets are compatible with the new content editor.- Parameters:
xmlContentDefinition
- the content definition- Returns:
true
if the content type widgets are compatible with the new content editor- Throws:
CmsXmlException
- if something goes wrong reading the type widget
-
visitTypes
public void visitTypes(CmsXmlContentDefinition xmlContentDefinition, java.util.Locale messageLocale)
Visits all types within the XML content definition.- Parameters:
xmlContentDefinition
- the content definitionmessageLocale
- the locale
-
getAttributeConfigurations
protected java.util.Map<java.lang.String,CmsAttributeConfiguration> getAttributeConfigurations()
Returns the attribute configurations.- Returns:
- the attribute configurations
-
getLocaleSynchronizations
protected java.util.List<java.lang.String> getLocaleSynchronizations()
Returns the locale synchronized attribute names.- Returns:
- the locale synchronized attribute names
-
getTypes
protected java.util.Map<java.lang.String,CmsType> getTypes()
Returns the types of the visited content definition.- Returns:
- the types
-
getWidgetConfigurations
protected java.util.Collection<CmsExternalWidgetConfiguration> getWidgetConfigurations()
Returns the external widget configurations.- Returns:
- the external widget configurations
-
-