Package org.opencms.ade.contenteditor
Class CmsContentTypeVisitor
java.lang.Object
org.opencms.ade.contenteditor.CmsContentTypeVisitor
Visitor to read all types and attribute configurations within a content definition.
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
Helper class to evaluate the widget display type.protected static enum
Widget display type evaluation rules. -
Constructor Summary
ConstructorDescriptionCmsContentTypeVisitor
(CmsObject cms, CmsFile file, Locale locale) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic List<CmsTabInfo>
collectTabInfos
(CmsObject cms, CmsXmlContentDefinition definition, CmsMessages messages) Returns the tab informations for the given content definition.protected Map<String,
CmsAttributeConfiguration> Returns the attribute configurations.Gets the CMS context.Gets the list of widgets which have been processed by this visitor.Gets the map of complex widget configurations.getLabel
(I_CmsXmlSchemaType value, String defaultValue) Returns the label for this value.Returns the locale synchronized attribute names.Gets the optional dynamic category fields collected so far.Returns the tabInfos.getTypes()
Returns the types of the visited content definition.protected Collection<CmsExternalWidgetConfiguration>
Returns the external widget configurations.boolean
Returns if the visited content has invisible fields.boolean
isDynamicallyLoaded
(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, Locale messageLocale) Visits all types within the XML content definition.
-
Constructor Details
-
CmsContentTypeVisitor
Constructor.- Parameters:
cms
- the CMS contextfile
- the content filelocale
- the content locale
-
-
Method Details
-
collectTabInfos
public static List<CmsTabInfo> collectTabInfos(CmsObject cms, CmsXmlContentDefinition definition, CmsMessages messages) Returns the tab informations for the given content definition.- Parameters:
cms
- the CMS contextdefinition
- the content definitionmessages
- the localization messages- Returns:
- the tab informations
-
getCmsObject
Gets the CMS context.- Returns:
- the CMS context
-
getCollectedWidgets
Gets the list of widgets which have been processed by this visitor.- Returns:
- the list of widget
-
getComplexWidgetData
Gets the map of complex widget configurations.- Returns:
- a map from attribute names to complex widget configurations
-
getLabel
Returns the label for this value.- Parameters:
value
- the valuedefaultValue
- the default value- Returns:
- the label
-
getOptionalDynamicCategoryFields
Gets the optional dynamic category fields collected so far.- Returns:
- the optional dynamic category fields
-
getTabInfos
Returns the tabInfos.- Returns:
- the tabInfos
-
hasInvisibleFields
Returns if the visited content has invisible fields.- Returns:
true
if the visited content has invisible fields
-
isDynamicallyLoaded
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
Visits all types within the XML content definition.- Parameters:
xmlContentDefinition
- the content definitionmessageLocale
- the locale
-
getAttributeConfigurations
Returns the attribute configurations.- Returns:
- the attribute configurations
-
getLocaleSynchronizations
Returns the locale synchronized attribute names.- Returns:
- the locale synchronized attribute names
-
getTypes
Returns the types of the visited content definition.- Returns:
- the types
-
getWidgetConfigurations
Returns the external widget configurations.- Returns:
- the external widget configurations
-