Class CmsDefaultXmlContentHandler
- All Implemented Interfaces:
I_CmsXmlContentHandler
,I_CmsXmlContentVisibilityHandler
- Direct Known Subclasses:
CmsCategoryXmlContentHandler
,CmsHtmlRedirectHandler
,CmsListConfigContentHandler
,CmsXmlContainerPageHandler
,CmsXmlDynamicFunctionHandler
,CmsXmlGroupContainerHandler
,CmsXmlInheritGroupContainerHandler
- Since:
- 6.0.0
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Enum for IfInvalidRelation field setting values.protected static class
Contains the visibility handler configuration for a content field path.Nested classes/interfaces inherited from interface org.opencms.xml.content.I_CmsXmlContentHandler
I_CmsXmlContentHandler.DisplayType, I_CmsXmlContentHandler.JsonRendererSettings, I_CmsXmlContentHandler.MappingType, I_CmsXmlContentHandler.SynchronizationMode
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Attribute name for configuration string.static final String
Constant for the "appinfo" element name itself.static final String
Constant for the "addto" appinfo attribute name.static final String
Constant for the "boost" appinfo attribute name.static final String
Constant for the "class" appinfo attribute name.static final String
Constant for the "collapse" appinfo attribute name.static final String
Constant for the "configuration" appinfo attribute name.static final String
The exclude from index attribute.static final String
Constant for the "copyfields" appinfo attribute name.static final String
Constant for the "default" appinfo attribute name.static final String
Constant for the "description" appinfo attribute name.static final String
Constant for the "displaycompact" appinfo attribute name.static final String
Constant for the "element" appinfo attribute name.static final String
Constant for the "error" appinfo attribute name.static final String
Constant for the "invalidate" appinfo attribute name.static final String
Constant for the "key" appinfo attribute name.static final String
Constant for the "locale" appinfo attribute name.static final String
Constant for the "mapping" appinfo attribute name.static final String
Constant for the "mapto" appinfo attribute name.static final String
Constant for the "maxwidth" appinfo attribute name.static final String
Constant for the "message" appinfo attribute name.static final String
Constant for the "minwidth" appinfo attribute name.static final String
Constant for the "name" appinfo attribute name.static final String
Constant for the "nice-name" appinfo attribute name.static final String
Constant for the "params" appinfo attribute name.static final String
Constant for the "preview" appinfo attribute name.static final String
Constant for the "regex" appinfo attribute name.static final String
Constant for the "resolveMacros" attribute name.static final String
Constant for the "rule-regex" appinfo attribute name.static final String
Constant for the "rule-type" appinfo attribute name.static final String
Constant for the "scope" appinfo attribute name.static final String
Constant for the "searchcontent" appinfo attribute name.static final String
Constant for the "select-inherit" appinfo attribute name.static final String
Constant for the "sourcefield" appinfo attribute name.static final String
Constant for the "targetfield" appinfo attribute name.static final String
Constant for the "type" appinfo attribute name.static final String
Constant for the "node" appinfo attribute value.static final String
Constant for the "parent" appinfo attribute value.static final String
Constant for the "warning" appinfo attribute value.static final String
Constant for the "uri" appinfo attribute name.static final String
Constant for the "useall" appinfo attribute name.static final String
Constant for the "value" appinfo attribute name.static final String
Constant for the "widget" appinfo attribute name.static final String
Constant for the "widget-config" appinfo attribute name.static final String
Constant for formatter include resource type 'CSS'.static final String
Constant for formatter include resource type 'JAVASCRIPT'.static final String
Constant for the "bundle" appinfo element name.static final String
Constant for the "default" appinfo element name.static final String
Constant for the "defaults" appinfo element name.static final String
Constant for the "edithandler" appinfo element name.static final String
Constant for the "editorchangehandler" appinfo element name.static final String
Constant for the "editorchangehandlers" appinfo element name.static final String
Constant for the "forbidden-contexts" appinfo attribute name.static final String
Constant for the "formatter" appinfo element name.static final String
Constant for the "formatters" appinfo element name.static final String
Constant for the 'geomapping' node.static final String
Constant for the "headinclude" appinfo element name.static final String
Constant for the "headincludes" appinfo element name.static final String
Constant for the "layout" appinfo element name.static final String
Constant for the "layouts" appinfo element name.static final String
Constant for the "mapping" appinfo element name.static final String
Constant for the "mappings" appinfo element name.static final String
Constant for the 'messagekeyhandler' node.static final String
Constant for the "modelfolder" appinfo element name.static final String
Constant for the "nestedformatter" appinfo element name.static final String
Constant for the "nestedformatters" appinfo element name.static final String
Constant for the "param" appinfo attribute name.static final String
Constant for the "parameters" appinfo element name.static final String
Constant for the "preview" appinfo element name.static final String
Constant for the "propertybundle" appinfo element name.static final String
Constant for the "relation" appinfo element name.static final String
Constant for the "relations" appinfo element name.static final String
Constant for the "resource" appinfo element name.static final String
Constant for the "resourcebundle" appinfo element name.static final String
Constant for the "resourcebundles" appinfo element name.static final String
Constant for the reverse-mapping-enabled appinfo element name.static final String
Constant for the "rule" appinfo element name.static final String
The file where the default appinfo schema is located.static final String
The file where the default appinfo schema types are located.static final String
The XML system id for the default appinfo schema types.static final String
The XML system id for the default appinfo schema types.static final String
Constant for the "searchsetting" appinfo element name.static final String
Constant for the "searchsettings" appinfo element name.static final String
Constant for the "setting" appinfo element name.static final String
Constant for the "settings" appinfo element name.static final String
Constant for the "solrfield" appinfo element name.static final String
Constant for the "synchronization" appinfo element name.static final String
Constant for the "synchronizations" appinfo element name.static final String
Constant for the "tab" appinfo element name.static final String
Constant for the "tabs" appinfo element name.static final String
Node name.static final String
Node name.static final String
Constant for the "validationrule" appinfo element name.static final String
Constant for the "validationrules" appinfo element name.static final String
Constant for the "element" value of the appinfo attribute "addto".static final String
Constant for the "page" value of the appinfo attribute "addto".static final String
version-transformation node name.static final String
Constant for the "visibilities" appinfo element name.static final String
Constant for the "visibility" appinfo element name.static final String
Constant for the "xmlbundle" appinfo element name.static final String
Attribute name.static final String
Attribute name.static final String
Attribute name.static final String
Constant for head include type attribute: CSS.static final String
Constant for head include type attribute: java-script.static final String
Field for mapping geo-coordinates.protected CmsDefaultSet<String>
The set of allowed templates.The cached map of combined synchronization information.The configuration values for the element widgets (as defined in the annotations).The CSS resources to include into the html-page head.The default values for the elements (as defined in the annotations).The element mappings (as defined in the annotations).protected CmsFormatterConfiguration
The formatter configuration.protected List<CmsFormatterBean>
The list of formatters from the XSD.protected List<CmsGeoMappingConfiguration.Entry>
The configured geo-coordinate mapping configuration entries.Relation actions.The java-script resources to include into the html-page head.The resource bundle name to be used for localization of this content handler.protected String
The folder containing the model file(s) for the content.protected String
The preview location (as defined in the annotations).protected String
Name of the field used for geo-coordinate mapping.The relation check rules.protected Map<String,
CmsRelationType> The relation check rules.protected Map<String,
CmsSearchField> The Solr field configurations.protected Map<String,
CmsSearchField> The Solr field configurations added to the container pages contents are on.protected Map<String,
I_CmsXmlContentValue.SearchContentType> The search settings.protected org.antlr.stringtemplate.StringTemplateGroup
String template group for the simple search setting expansions.protected Map<String,
CmsXmlContentProperty> The configured settings for the formatters (as defined in the annotations).The configured locale synchronization elements.protected List<CmsXmlContentTab>
The configured tabs.The list of mappings to the "Title" property.protected boolean
Flag which controls whether the Acacia editor should be disabled for this type.The messages for the error validation rules.The validation rules that cause an error (as defined in the annotations).The messages for the warning validation rules.The validation rules that cause a warning (as defined in the annotations).protected String
Path to XSL transform in VFS to use for version transformation.static final String
Macro for resolving the preview URI.protected static final String
Default message for validation errors.protected static final String
Default message for validation warnings.static final String
Node name for change handler.static final String
Constant for the 'Setting' node name.Fields inherited from interface org.opencms.xml.content.I_CmsXmlContentHandler
ATTRIBUTE_DATEEXPIRED, ATTRIBUTE_DATERELEASED, 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
ConstructorDescriptionCreates a new instance of the default XML content handler. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addCheckRule
(CmsXmlContentDefinition contentDefinition, String elementName, String invalidate, String type) Adds a check rule for a specified element.protected void
addConfiguration
(CmsXmlContentDefinition contentDefinition, String elementName, String configurationValue) Adds a configuration value for an element widget.protected void
addDefault
(CmsXmlContentDefinition contentDefinition, String elementName, String defaultValue, String resolveMacrosValue) Adds a default value for an element.protected void
addDefaultCheckRules
(CmsXmlContentDefinition rootContentDefinition, I_CmsXmlSchemaType schemaType, String elementPath) Adds all needed default check rules recursively for the given schema type.protected void
addDisplayType
(CmsXmlContentDefinition contentDefinition, String elementName, I_CmsXmlContentHandler.DisplayType displayType) Adds the given element to the compact view set.protected void
Finally adds the field used for geo-coordinate mapping by combining the configuration from the geomapping section and the field settings.protected void
addMapping
(CmsXmlContentDefinition contentDefinition, String elementName, String mapping, String useDefault) Adds an element mapping.protected void
addNestedFormatter
(String elementName, CmsXmlContentDefinition contentDefinition) Adds a nested formatter element.protected void
addSearchField
(CmsXmlContentDefinition contentDefinition, CmsSearchField field) Deprecated.protected void
addSearchField
(CmsXmlContentDefinition contentDefinition, CmsSearchField field, I_CmsXmlContentHandler.MappingType type) Adds a Solr field for an element.protected void
addSearchSetting
(CmsXmlContentDefinition contentDefinition, String elementName, I_CmsXmlContentValue.SearchContentType value) Adds a search setting for an element.protected void
addSimpleSearchSetting
(CmsXmlContentDefinition contentDef, String name, String value) Adds search settings as defined by 'simple' syntax in fields.protected void
addValidationRule
(CmsXmlContentDefinition contentDefinition, String elementName, String regex, String message, boolean isWarning) Adds a validation rule for a specified element.protected void
addWidget
(CmsXmlContentDefinition contentDefinition, String elementName, String name) Adds a GUI widget for a specified element.boolean
applyReverseAvailabilityMapping
(CmsObject cms, CmsXmlContent content, CmsMappingResolutionContext.AttributeType attr, List<Locale> resourceLocales, long valueToSet) Writes an availability date back to the content, if a mapping is defined for it.boolean
Checks if an availability attribute should be written back to the content if the availability is changed through the availability dialog.createRootCms
(CmsObject cms) Copies a given CMS context and set the copy's site root to '/'.createVisibilityConfiguration
(String className, String params) Helper method to create a visibility configuration.Gets the list of allowed template context names.protected org.opencms.xml.content.CmsDefaultXmlContentHandler.MappingInfo
Returns information about the availability mapping for the given availability attribute.Gets the list of change handler configurations.getComplexWidget
(CmsObject cms, String path) Gets the unconfigured complex widget defined for the given path.getConfiguration
(String path) Gets the widget configuration for the given sub-path.Returns the configuration String value for the widget used to edit the given XML content schema type.getConfiguredDisplayType
(String path, I_CmsXmlContentHandler.DisplayType defaultValue) Gets the configured display type for a given path.Returns the resource-independent CSS resources to include into the html-page head.getCSSHeadIncludes
(CmsObject cms, CmsResource resource) Returns all the CSS resources to include into the html-page head.getDefault
(CmsObject cms, CmsResource resource, I_CmsXmlSchemaType type, String path, Locale locale) Returns the default String value for the given XML content schema type object in the given XML content.getDefault
(CmsObject cms, I_CmsXmlContentValue value, Locale locale) Returns the default String value for the given XML content schema type object in the given XML content.Gets the default complex widget to be used for this type.Gets the default complex widget class name configured for this type.Gets the default complex widget configuration string configured for this type.Returns if the widget for this type should be displayed in compact view.Returns the edit handler if configured.getEditorChangeHandlers
(boolean selfOnly) Returns the editor change handlers.Gets the help texts for the fields.Gets the labels for the fields.getFormatterConfiguration
(CmsObject cms, CmsResource resource) Returns the container page element formatter configuration for a given resource.Gets the geo mapping configuration.Gets the action to perform if the given name refers to a link field which refers to a VFS file that no longer exists.Returns the resource-independent javascript resources to include into the html-page head.getJSHeadIncludes
(CmsObject cms, CmsResource resource) Returns all the javascript resources to include into the html-page head.Gets the JSON renderer settings.getLocalesForResource
(CmsObject cms, String resource) Returns the configured default locales for the content of the given resource.Gets the mappings defined in the schema.getMappings
(String elementName) Returns the all mappings defined for the given element xpath.Gets the message key fallback handler.getMessages
(Locale locale) Returns theCmsMessages
that are used to resolve localized keys for the given locale in this content handler.Returns the folder name that contains eventual XML content model files to use for this resource type.protected List<I_CmsXmlContentEditorChangeHandler>
Creates editor change handler instances for all nested fields that have configured them in their field settingsgetNestedFormatters
(CmsObject cms, CmsResource res, Locale locale, javax.servlet.ServletRequest req) Returns the nested formatters for the given resource.getParameter
(String name) Gets the parameter with the given name..Gets the set of parameters.getPreview
(CmsObject cms, CmsXmlContent content, String resourcename) Returns the preview URI for the given XML content value object to be displayed in the editor.protected String
getReferencePath
(CmsObject cms, I_CmsXmlContentValue value) Returns the category reference path for the given value.getRelationType
(String xpath) Returns the relation type for the given path.getRelationType
(String xpath, CmsRelationType defaultType) Returns the relation type for the given path.Deprecated.Returns the search content type, ie., the way how to integrate the value into full text search.Returns all configured Search fields for this XML content.Returns all configured Search fields for this XML content that should be attached to container pages the content is placed on.Returns the search content settings defined in the annotation node of this XML content.getSettings
(CmsObject cms, CmsResource resource) Returns the element settings defined for the container page formatters.getSynchronizations
(boolean recursive) Returns the configuration for elements that require a synchronization across all locales.getTabs()
Returns the tabs to be displayed in the editor.getTitleMapping
(CmsObject cms, CmsXmlContent document, Locale locale) Returns the "Title" mapping set for the given XML content document in the given Locale.getValidationError
(String elementName) Gets the validation error message configured in the schema for the element.protected String
getValidationMessage
(CmsObject cms, I_CmsXmlContentValue value, String regex, String valueStr, boolean matchResult, boolean isWarning) Returns the validation message to be displayed if a certain rule was violated.getValidationWarning
(String elementName) Gets the validation warning message configured in the schema for the element.getValidationWarningOrErrorMessage
(CmsObject cms, Locale locale, String elementName, boolean isWarning, boolean keyOnly) Helper method for reading a validation message or the corresponding message key.Gets the version transformation VFS path.getVisibilityConfigString
(String field) Returns the configured visibility parameter string for the given field if the content handler itself is the visibility handler, and null otherwise.Gets the widget for the given path and CMS context.getWidget
(I_CmsXmlSchemaType value) Deprecated.boolean
Returns true if the contents for this content handler have schema-based formatters which can be disabled or enabled.boolean
Returns whether there are nested formatters configured for this content type.boolean
Returns if there are locale synchronized elements configured.boolean
Returns if there are visibility handlers configured for this content type.protected void
init()
Called when this content handler is initialized.protected void
initDefaultValues
(org.dom4j.Element root, CmsXmlContentDefinition contentDefinition) Initializes the default values for this content handler.protected void
initDefaultWidget
(org.dom4j.Element element) Initializes the default complex widget.protected void
initEditHandler
(org.dom4j.Element handlerElement) Initializes the edit handler.protected void
initEditorChangeHandlers
(org.dom4j.Element element) Initializes the editor change handlers.protected void
initField
(org.dom4j.Element elem, CmsXmlContentDefinition contentDef) Processes a single field definition.protected void
initFields
(org.dom4j.Element parent, CmsXmlContentDefinition contentDef) Processes all field declarations in the schema.protected void
initFormatters
(org.dom4j.Element root, CmsXmlContentDefinition contentDefinition) Initializes the formatters for this content handler.protected void
initHeadIncludes
(org.dom4j.Element root, CmsXmlContentDefinition contentDefinition) Initializes the head includes for this content handler.void
initialize
(org.dom4j.Element appInfoElement, CmsXmlContentDefinition contentDefinition) Initializes this content handler for the given XML content definition by analyzing the "appinfo" node.protected void
initJsonRenderer
(org.dom4j.Element element) Reads the JSON renderer settings.protected void
initLayouts
(org.dom4j.Element root, CmsXmlContentDefinition contentDefinition) Initializes the layout for this content handler.protected void
initMappings
(org.dom4j.Element root, CmsXmlContentDefinition contentDefinition) Initializes the element mappings for this content handler.protected void
initModelFolder
(org.dom4j.Element root, CmsXmlContentDefinition contentDefinition) Initializes the folder containing the model file(s) for this content handler.protected void
initNestedFormatters
(org.dom4j.Element element, CmsXmlContentDefinition contentDefinition) Initializes the nested formatter fields.protected void
initParameters
(org.dom4j.Element root) Initializes the parameters from the schema.protected void
initPreview
(org.dom4j.Element root, CmsXmlContentDefinition contentDefinition) Initializes the preview location for this content handler.protected void
initRelations
(org.dom4j.Element root, CmsXmlContentDefinition contentDefinition) Initializes the relation configuration for this content handler.protected void
initResourceBundle
(org.dom4j.Element root, CmsXmlContentDefinition contentDefinition, boolean single) Initializes the resource bundle to use for localized messages in this content handler.protected void
initSearchSettings
(org.dom4j.Element root, CmsXmlContentDefinition contentDefinition) Initializes the search exclusions values for this content handler.protected void
initSettings
(org.dom4j.Element root, CmsXmlContentDefinition contentDefinition) Initializes the element settings for this content handler.protected void
initSynchronizations
(org.dom4j.Element root, CmsXmlContentDefinition contentDefinition) Initializes the locale synchronizations elements.protected void
initTabs
(org.dom4j.Element root, CmsXmlContentDefinition contentDefinition) Initializes the tabs for this content handler.protected void
initTemplates
(org.dom4j.Element root, CmsXmlContentDefinition contentDefinition) Initializes the forbidden template contexts.protected void
initValidationRules
(org.dom4j.Element root, CmsXmlContentDefinition contentDefinition) Initializes the validation rules this content handler.protected void
initVisibilities
(org.dom4j.Element root, CmsXmlContentDefinition contentDefinition) Initializes the content visibility settings.void
invalidateBrokenLinks
(CmsObject cms, CmsXmlContent document) Performs a check of the given XML document.boolean
Returns true if the Acacia editor is disabled for this type.boolean
Returnstrue
if the XML content should be indexed when it is dropped in a container page, and returnsfalse
if this XML content should be indexed as 'stand-alone' document.protected boolean
isInvalidateParent
(String xpath) Returns the is-invalidate-parent flag for the given xpath.boolean
isValueVisible
(CmsObject cms, I_CmsXmlSchemaType value, String elementName, String params, CmsResource resource, Locale contentLocale) Returns the content field visibilty.boolean
isVisible
(CmsObject cms, I_CmsXmlSchemaType contentValue, String valuePath, CmsResource resource, Locale contentLocale) Returns if the given content field should be visible to the current user.protected String
Returns the localized resource string for a given message key according to the configured resource bundle of this content handler.protected Set<I_CmsXmlContentHandler.MappingType>
parseSearchMappingTypes
(org.dom4j.Element solrElement) prepareForUse
(CmsObject cms, CmsXmlContent content) Prepares the given XML content to be used after it was read from the OpenCms VFS.prepareForWrite
(CmsObject cms, CmsXmlContent content, CmsFile file) Prepares the given XML content to be written to the OpenCms VFS.protected void
removeEmptyMappings
(CmsObject cms, CmsFile file, CmsXmlContent content) Removes property values on resources for non-existing, optional elements.protected void
resolveDefaultMappings
(CmsObject cms, CmsFile file, CmsXmlContent content) Resolves those mappings for which no content value exists and useDefault is set to true.void
resolveMapping
(CmsObject cms, CmsXmlContent content, I_CmsXmlContentValue value) Resolves the value mappings of the given XML content value, according to the rules of this XML content handler.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
validateAppinfoElement
(org.dom4j.Element appinfoElement) Validates if the givenappinfo
element node from the XML content definition schema is valid according the the capabilities of this content handler.protected CmsXmlContentErrorHandler
validateCategories
(CmsObject cms, I_CmsXmlContentValue value, CmsXmlContentErrorHandler errorHandler) The errorHandler parameter is optional, ifnull
is given a new error handler instance must be created.protected boolean
validateLink
(CmsObject cms, I_CmsXmlContentValue value, CmsXmlContentErrorHandler errorHandler) Validates the given rules against the given value.protected CmsXmlContentErrorHandler
validateValue
(CmsObject cms, I_CmsXmlContentValue value, String valueStr, CmsXmlContentErrorHandler errorHandler, boolean isWarning) Checks the default XML schema validation rules.protected CmsXmlContentErrorHandler
validateValue
(CmsObject cms, I_CmsXmlContentValue value, CmsXmlContentErrorHandler errorHandler, Map<String, String> rules, boolean isWarning) Validates the given rules against the given value.protected CmsFile
writeCategories
(CmsObject cms, CmsFile file, CmsXmlContent content) Writes the categories if a category widget is present.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.opencms.xml.content.I_CmsXmlContentHandler
isSearchable
-
Field Details
-
A_CONFIGURATION
Attribute name for configuration string.- See Also:
-
APPINFO_APPINFO
Constant for the "appinfo" element name itself.- See Also:
-
APPINFO_ATTR_ADD_TO
Constant for the "addto" appinfo attribute name.- See Also:
-
APPINFO_ATTR_BOOST
Constant for the "boost" appinfo attribute name.- See Also:
-
APPINFO_ATTR_CLASS
Constant for the "class" appinfo attribute name.- See Also:
-
APPINFO_ATTR_COLLAPSE
Constant for the "collapse" appinfo attribute name.- See Also:
-
APPINFO_ATTR_CONFIGURATION
Constant for the "configuration" appinfo attribute name.- See Also:
-
APPINFO_ATTR_CONTAINER_PAGE_ONLY
The exclude from index attribute.- See Also:
-
APPINFO_ATTR_COPY_FIELDS
Constant for the "copyfields" appinfo attribute name.- See Also:
-
APPINFO_ATTR_DEFAULT
Constant for the "default" appinfo attribute name.- See Also:
-
APPINFO_ATTR_DESCRIPTION
Constant for the "description" appinfo attribute name.- See Also:
-
APPINFO_ATTR_DISPLAY
Constant for the "displaycompact" appinfo attribute name.- See Also:
-
APPINFO_ATTR_ELEMENT
Constant for the "element" appinfo attribute name.- See Also:
-
APPINFO_ATTR_ERROR
Constant for the "error" appinfo attribute name.- See Also:
-
APPINFO_ATTR_INVALIDATE
Constant for the "invalidate" appinfo attribute name.- See Also:
-
APPINFO_ATTR_KEY
Constant for the "key" appinfo attribute name.- See Also:
-
APPINFO_ATTR_LOCALE
Constant for the "locale" appinfo attribute name.- See Also:
-
APPINFO_ATTR_MAPPING
Constant for the "mapping" appinfo attribute name.- See Also:
-
APPINFO_ATTR_MAPTO
Constant for the "mapto" appinfo attribute name.- See Also:
-
APPINFO_ATTR_MAXWIDTH
Constant for the "maxwidth" appinfo attribute name.- See Also:
-
APPINFO_ATTR_MESSAGE
Constant for the "message" appinfo attribute name.- See Also:
-
APPINFO_ATTR_MINWIDTH
Constant for the "minwidth" appinfo attribute name.- See Also:
-
APPINFO_ATTR_NAME
Constant for the "name" appinfo attribute name.- See Also:
-
APPINFO_ATTR_NICE_NAME
Constant for the "nice-name" appinfo attribute name.- See Also:
-
APPINFO_ATTR_PARAMS
Constant for the "params" appinfo attribute name.- See Also:
-
APPINFO_ATTR_PREVIEW
Constant for the "preview" appinfo attribute name.- See Also:
-
APPINFO_ATTR_REGEX
Constant for the "regex" appinfo attribute name.- See Also:
-
APPINFO_ATTR_RESOLVE_MACROS
Constant for the "resolveMacros" attribute name.- See Also:
-
APPINFO_ATTR_RULE_REGEX
Constant for the "rule-regex" appinfo attribute name.- See Also:
-
APPINFO_ATTR_RULE_TYPE
Constant for the "rule-type" appinfo attribute name.- See Also:
-
APPINFO_ATTR_SCOPE
Constant for the "scope" appinfo attribute name.- See Also:
-
APPINFO_ATTR_SEARCHCONTENT
Constant for the "searchcontent" appinfo attribute name.- See Also:
-
APPINFO_ATTR_SELECT_INHERIT
Constant for the "select-inherit" appinfo attribute name.- See Also:
-
APPINFO_ATTR_SOURCE_FIELD
Constant for the "sourcefield" appinfo attribute name.- See Also:
-
APPINFO_ATTR_TARGET_FIELD
Constant for the "targetfield" appinfo attribute name.- See Also:
-
APPINFO_ATTR_TYPE
Constant for the "type" appinfo attribute name.- See Also:
-
APPINFO_ATTR_TYPE_NODE
Constant for the "node" appinfo attribute value.- See Also:
-
APPINFO_ATTR_TYPE_PARENT
Constant for the "parent" appinfo attribute value.- See Also:
-
APPINFO_ATTR_TYPE_WARNING
Constant for the "warning" appinfo attribute value.- See Also:
-
APPINFO_ATTR_URI
Constant for the "uri" appinfo attribute name.- See Also:
-
APPINFO_ATTR_USEALL
Constant for the "useall" appinfo attribute name.- See Also:
-
APPINFO_ATTR_VALUE
Constant for the "value" appinfo attribute name.- See Also:
-
APPINFO_ATTR_WIDGET
Constant for the "widget" appinfo attribute name.- See Also:
-
APPINFO_ATTR_WIDGET_CONFIG
Constant for the "widget-config" appinfo attribute name.- See Also:
-
APPINFO_ATTRIBUTE_TYPE_CSS
Constant for formatter include resource type 'CSS'.- See Also:
-
APPINFO_ATTRIBUTE_TYPE_JAVASCRIPT
Constant for formatter include resource type 'JAVASCRIPT'.- See Also:
-
APPINFO_BUNDLE
Constant for the "bundle" appinfo element name.- See Also:
-
APPINFO_DEFAULT
Constant for the "default" appinfo element name.- See Also:
-
APPINFO_DEFAULTS
Constant for the "defaults" appinfo element name.- See Also:
-
APPINFO_EDIT_HANDLER
Constant for the "edithandler" appinfo element name.- See Also:
-
APPINFO_EDITOR_CHANGE_HANDLER
Constant for the "editorchangehandler" appinfo element name.- See Also:
-
APPINFO_EDITOR_CHANGE_HANDLERS
Constant for the "editorchangehandlers" appinfo element name.- See Also:
-
APPINFO_FORBIDDEN_CONTEXTS
Constant for the "forbidden-contexts" appinfo attribute name.- See Also:
-
APPINFO_FORMATTER
Constant for the "formatter" appinfo element name.- See Also:
-
APPINFO_FORMATTERS
Constant for the "formatters" appinfo element name.- See Also:
-
APPINFO_GEOMAPPING
Constant for the 'geomapping' node.- See Also:
-
APPINFO_HEAD_INCLUDE
Constant for the "headinclude" appinfo element name.- See Also:
-
APPINFO_HEAD_INCLUDES
Constant for the "headincludes" appinfo element name.- See Also:
-
APPINFO_LAYOUT
Constant for the "layout" appinfo element name.- See Also:
-
APPINFO_LAYOUTS
Constant for the "layouts" appinfo element name.- See Also:
-
APPINFO_MAPPING
Constant for the "mapping" appinfo element name.- See Also:
-
APPINFO_MAPPINGS
Constant for the "mappings" appinfo element name.- See Also:
-
APPINFO_MESSAGEKEYHANDLER
Constant for the 'messagekeyhandler' node.- See Also:
-
APPINFO_MODELFOLDER
Constant for the "modelfolder" appinfo element name.- See Also:
-
APPINFO_NESTED_FORMATTER
Constant for the "nestedformatter" appinfo element name.- See Also:
-
APPINFO_NESTED_FORMATTERS
Constant for the "nestedformatters" appinfo element name.- See Also:
-
APPINFO_PARAM
Constant for the "param" appinfo attribute name.- See Also:
-
APPINFO_PARAMETERS
Constant for the "parameters" appinfo element name.- See Also:
-
APPINFO_PREVIEW
Constant for the "preview" appinfo element name.- See Also:
-
APPINFO_PROPERTYBUNDLE
Constant for the "propertybundle" appinfo element name.- See Also:
-
APPINFO_RELATION
Constant for the "relation" appinfo element name.- See Also:
-
APPINFO_RELATIONS
Constant for the "relations" appinfo element name.- See Also:
-
APPINFO_RESOURCE
Constant for the "resource" appinfo element name.- See Also:
-
APPINFO_RESOURCEBUNDLE
Constant for the "resourcebundle" appinfo element name.- See Also:
-
APPINFO_RESOURCEBUNDLES
Constant for the "resourcebundles" appinfo element name.- See Also:
-
APPINFO_REVERSE_MAPPING_ENABLED
Constant for the reverse-mapping-enabled appinfo element name.- See Also:
-
APPINFO_RULE
Constant for the "rule" appinfo element name.- See Also:
-
APPINFO_SCHEMA_FILE
The file where the default appinfo schema is located.- See Also:
-
APPINFO_SCHEMA_FILE_TYPES
The file where the default appinfo schema types are located.- See Also:
-
APPINFO_SCHEMA_SYSTEM_ID
The XML system id for the default appinfo schema types.- See Also:
-
APPINFO_SCHEMA_TYPES_SYSTEM_ID
The XML system id for the default appinfo schema types.- See Also:
-
APPINFO_SEARCHSETTING
Constant for the "searchsetting" appinfo element name.- See Also:
-
APPINFO_SEARCHSETTINGS
Constant for the "searchsettings" appinfo element name.- See Also:
-
APPINFO_SETTING
Constant for the "setting" appinfo element name.- See Also:
-
APPINFO_SETTINGS
Constant for the "settings" appinfo element name.- See Also:
-
APPINFO_SOLR_FIELD
Constant for the "solrfield" appinfo element name.- See Also:
-
APPINFO_SYNCHRONIZATION
Constant for the "synchronization" appinfo element name.- See Also:
-
APPINFO_SYNCHRONIZATIONS
Constant for the "synchronizations" appinfo element name.- See Also:
-
APPINFO_TAB
Constant for the "tab" appinfo element name.- See Also:
-
APPINFO_TABS
Constant for the "tabs" appinfo element name.- See Also:
-
APPINFO_TEMPLATE
Node name.- See Also:
-
APPINFO_TEMPLATES
Node name.- See Also:
-
APPINFO_VALIDATIONRULE
Constant for the "validationrule" appinfo element name.- See Also:
-
APPINFO_VALIDATIONRULES
Constant for the "validationrules" appinfo element name.- See Also:
-
APPINFO_VALUE_ADD_TO_CONTENT
Constant for the "element" value of the appinfo attribute "addto".- See Also:
-
APPINFO_VALUE_ADD_TO_PAGE
Constant for the "page" value of the appinfo attribute "addto".- See Also:
-
APPINFO_VERSION_TRANSFORMATION
version-transformation node name.- See Also:
-
APPINFO_VISIBILITIES
Constant for the "visibilities" appinfo element name.- See Also:
-
APPINFO_VISIBILITY
Constant for the "visibility" appinfo element name.- See Also:
-
APPINFO_XMLBUNDLE
Constant for the "xmlbundle" appinfo element name.- See Also:
-
ATTR_ENABLED
Attribute name.- See Also:
-
ATTR_ENABLED_BY_DEFAULT
Attribute name.- See Also:
-
ATTR_USE_ACACIA
Attribute name.- See Also:
-
ATTRIBUTE_INCLUDE_TYPE_CSS
Constant for head include type attribute: CSS.- See Also:
-
ATTRIBUTE_INCLUDE_TYPE_JAVASCRIPT
Constant for head include type attribute: java-script.- See Also:
-
GEOMAPPING_FIELD
Field for mapping geo-coordinates.- See Also:
-
MACRO_PREVIEW_TEMPFILE
Macro for resolving the preview URI.- See Also:
-
N_CHANGEHANDLER
Node name for change handler.- See Also:
-
N_SETTING
Constant for the 'Setting' node name.- See Also:
-
MESSAGE_VALIDATION_DEFAULT_ERROR
Default message for validation errors.- See Also:
-
MESSAGE_VALIDATION_DEFAULT_WARNING
Default message for validation warnings.- See Also:
-
m_allowedTemplates
The set of allowed templates. -
m_combinedSynchronizations
protected LinkedHashMap<String,I_CmsXmlContentHandler.SynchronizationMode> m_combinedSynchronizationsThe cached map of combined synchronization information. -
m_configurationValues
The configuration values for the element widgets (as defined in the annotations). -
m_cssHeadIncludes
The CSS resources to include into the html-page head. -
m_defaultValues
The default values for the elements (as defined in the annotations). -
m_elementMappings
The element mappings (as defined in the annotations). -
m_formatterConfiguration
The formatter configuration. -
m_formatters
The list of formatters from the XSD. -
m_geomappingEntries
The configured geo-coordinate mapping configuration entries. -
m_invalidRelationActions
Relation actions. -
m_jsHeadIncludes
The java-script resources to include into the html-page head. -
m_messageBundleNames
The resource bundle name to be used for localization of this content handler. -
m_modelFolder
The folder containing the model file(s) for the content. -
m_previewLocation
The preview location (as defined in the annotations). -
m_primaryGeomappingField
Name of the field used for geo-coordinate mapping. -
m_relationChecks
The relation check rules. -
m_relations
The relation check rules. -
m_searchFields
The Solr field configurations. -
m_searchFieldsPage
The Solr field configurations added to the container pages contents are on. -
m_searchSettings
The search settings. -
m_searchTemplateGroup
String template group for the simple search setting expansions. -
m_settings
The configured settings for the formatters (as defined in the annotations). -
m_synchronizations
The configured locale synchronization elements. -
m_tabs
The configured tabs. -
m_titleMappings
The list of mappings to the "Title" property. -
m_useAcacia
Flag which controls whether the Acacia editor should be disabled for this type. -
m_validationErrorMessages
The messages for the error validation rules. -
m_validationErrorRules
The validation rules that cause an error (as defined in the annotations). -
m_validationWarningMessages
The messages for the warning validation rules. -
m_validationWarningRules
The validation rules that cause a warning (as defined in the annotations). -
m_versionTransformation
Path to XSL transform in VFS to use for version transformation.
-
-
Constructor Details
-
CmsDefaultXmlContentHandler
public CmsDefaultXmlContentHandler()Creates a new instance of the default XML content handler.
-
-
Method Details
-
applyReverseAvailabilityMapping
public boolean applyReverseAvailabilityMapping(CmsObject cms, CmsXmlContent content, CmsMappingResolutionContext.AttributeType attr, List<Locale> resourceLocales, long valueToSet) Description copied from interface:I_CmsXmlContentHandler
Writes an availability date back to the content, if a mapping is defined for it.- Specified by:
applyReverseAvailabilityMapping
in interfaceI_CmsXmlContentHandler
- Parameters:
cms
- the CMS contextcontent
- the content to write toattr
- the attribute to writeresourceLocales
- the locales of the resourcevalueToSet
- the value to write- See Also:
-
canUseReverseAvailabilityMapping
Description copied from interface:I_CmsXmlContentHandler
Checks if an availability attribute should be written back to the content if the availability is changed through the availability dialog.- Specified by:
canUseReverseAvailabilityMapping
in interfaceI_CmsXmlContentHandler
- Parameters:
attr
- the attribute to check- Returns:
- true if the attribute should be written to the content
- See Also:
-
createRootCms
Copies a given CMS context and set the copy's site root to '/'.- Parameters:
cms
- the CMS context to copy- Returns:
- the copy
- Throws:
CmsException
- if something goes wrong
-
getAllowedTemplates
Description copied from interface:I_CmsXmlContentHandler
Gets the list of allowed template context names.- Specified by:
getAllowedTemplates
in interfaceI_CmsXmlContentHandler
- Returns:
- the list of allowed template context names
- See Also:
-
getChangeHandlerConfigs
Description copied from interface:I_CmsXmlContentHandler
Gets the list of change handler configurations.- Specified by:
getChangeHandlerConfigs
in interfaceI_CmsXmlContentHandler
- Returns:
- the list of change handler configurations
- See Also:
-
getComplexWidget
Description copied from interface:I_CmsXmlContentHandler
Gets the unconfigured complex widget defined for the given path.- Specified by:
getComplexWidget
in interfaceI_CmsXmlContentHandler
- Parameters:
cms
- the CMS contextpath
- the value path- Returns:
- the complex widget
- See Also:
-
getConfiguration
Description copied from interface:I_CmsXmlContentHandler
Returns the configuration String value for the widget used to edit the given XML content schema type.If no configuration value is available, this method must return
null
.- Specified by:
getConfiguration
in interfaceI_CmsXmlContentHandler
- Parameters:
type
- the value to get the widget configuration for- Returns:
- the configuration String value for the widget used to edit the given XML content schema type
- See Also:
-
getConfiguration
Description copied from interface:I_CmsXmlContentHandler
Gets the widget configuration for the given sub-path.- Specified by:
getConfiguration
in interfaceI_CmsXmlContentHandler
- Parameters:
path
- a sub-path- Returns:
- the widget configuration for the given sub-path
- See Also:
-
getConfiguredDisplayType
public I_CmsXmlContentHandler.DisplayType getConfiguredDisplayType(String path, I_CmsXmlContentHandler.DisplayType defaultValue) Description copied from interface:I_CmsXmlContentHandler
Gets the configured display type for a given path.- Specified by:
getConfiguredDisplayType
in interfaceI_CmsXmlContentHandler
- Parameters:
path
- the pathdefaultValue
- the value to return if no configured display type is found- Returns:
- the configured display type (or the default value)
- See Also:
-
getCSSHeadIncludes
Description copied from interface:I_CmsXmlContentHandler
Returns the resource-independent CSS resources to include into the html-page head.- Specified by:
getCSSHeadIncludes
in interfaceI_CmsXmlContentHandler
- Returns:
- the CSS resources to include into the html-page head
- See Also:
-
getCSSHeadIncludes
Description copied from interface:I_CmsXmlContentHandler
Returns all the CSS resources to include into the html-page head.- Specified by:
getCSSHeadIncludes
in interfaceI_CmsXmlContentHandler
- Parameters:
cms
- the current CMS contextresource
- the resource from which to get the head includes- Returns:
- the CSS resources to include into the html-page head
- Throws:
CmsException
- if something goes wrong- See Also:
-
getDefault
public String getDefault(CmsObject cms, CmsResource resource, I_CmsXmlSchemaType type, String path, Locale locale) Description copied from interface:I_CmsXmlContentHandler
Returns the default String value for the given XML content schema type object in the given XML content.If a schema type does not have a default value, this method must return
null
.- Specified by:
getDefault
in interfaceI_CmsXmlContentHandler
- Parameters:
cms
- the current users OpenCms contextresource
- the content resourcetype
- the type to get the default forpath
- the element pathlocale
- the currently selected locale for the value- Returns:
- the default String value for the given XML content value object
- See Also:
-
getDefault
Description copied from interface:I_CmsXmlContentHandler
Returns the default String value for the given XML content schema type object in the given XML content.If a schema type does not have a default value, this method must return
null
.- Specified by:
getDefault
in interfaceI_CmsXmlContentHandler
- Parameters:
cms
- the current users OpenCms contextvalue
- the value to get the default forlocale
- the currently selected locale for the value- Returns:
- the default String value for the given XML content value object
- See Also:
-
getDefaultComplexWidget
Description copied from interface:I_CmsXmlContentHandler
Gets the default complex widget to be used for this type.- Specified by:
getDefaultComplexWidget
in interfaceI_CmsXmlContentHandler
- Returns:
- the default complex widget for this type
- See Also:
-
getDefaultComplexWidgetClass
Description copied from interface:I_CmsXmlContentHandler
Gets the default complex widget class name configured for this type.- Specified by:
getDefaultComplexWidgetClass
in interfaceI_CmsXmlContentHandler
- Returns:
- the default complex widget class name
- See Also:
-
getDefaultComplexWidgetConfiguration
Description copied from interface:I_CmsXmlContentHandler
Gets the default complex widget configuration string configured for this type.- Specified by:
getDefaultComplexWidgetConfiguration
in interfaceI_CmsXmlContentHandler
- Returns:
- the default complex widget configuration string
- See Also:
-
getDisplayType
Description copied from interface:I_CmsXmlContentHandler
Returns if the widget for this type should be displayed in compact view.- Specified by:
getDisplayType
in interfaceI_CmsXmlContentHandler
- Parameters:
type
- the value to check the view mode for- Returns:
- the widgets display type
- See Also:
-
getEditHandler
Returns the edit handler if configured.- Specified by:
getEditHandler
in interfaceI_CmsXmlContentHandler
- Returns:
- the edit handler
-
getEditorChangeHandlers
Description copied from interface:I_CmsXmlContentHandler
Returns the editor change handlers.- Specified by:
getEditorChangeHandlers
in interfaceI_CmsXmlContentHandler
- Parameters:
selfOnly
- if true, only return editor change handlers configured directly for this content handler- Returns:
- the editor change handlers
- See Also:
-
getFieldHelp
Gets the help texts for the fields.- Returns:
- the help texts for the fields
-
getFieldLabels
Gets the labels for the fields.- Returns:
- the labels for the fields
-
getFormatterConfiguration
Description copied from interface:I_CmsXmlContentHandler
Returns the container page element formatter configuration for a given resource.- Specified by:
getFormatterConfiguration
in interfaceI_CmsXmlContentHandler
- Parameters:
cms
- the current users OpenCms context, used for selecting the right projectresource
- the resource for which the formatter configuration should be retrieved- Returns:
- the container page element formatter configuration for this handler
- See Also:
-
getGeoMappingConfiguration
Gets the geo mapping configuration.- Specified by:
getGeoMappingConfiguration
in interfaceI_CmsXmlContentHandler
- Returns:
- the geo mapping configuration
-
getInvalidRelationAction
Description copied from interface:I_CmsXmlContentHandler
Gets the action to perform if the given name refers to a link field which refers to a VFS file that no longer exists.- Specified by:
getInvalidRelationAction
in interfaceI_CmsXmlContentHandler
- Parameters:
name
- the field name- Returns:
- the action
- See Also:
-
getJSHeadIncludes
Description copied from interface:I_CmsXmlContentHandler
Returns the resource-independent javascript resources to include into the html-page head.- Specified by:
getJSHeadIncludes
in interfaceI_CmsXmlContentHandler
- Returns:
- the javascript resources to include into the html-page head
- See Also:
-
getJSHeadIncludes
Description copied from interface:I_CmsXmlContentHandler
Returns all the javascript resources to include into the html-page head.- Specified by:
getJSHeadIncludes
in interfaceI_CmsXmlContentHandler
- Parameters:
cms
- the current CMS contextresource
- the resource for which the head includes should be retrieved- Returns:
- the javascript resources to include into the html-page head
- Throws:
CmsException
- if something goes wrong- See Also:
-
getJsonRendererSettings
Description copied from interface:I_CmsXmlContentHandler
Gets the JSON renderer settings.- Specified by:
getJsonRendererSettings
in interfaceI_CmsXmlContentHandler
- Returns:
- the JSON renderer settings
- See Also:
-
getMappings
Description copied from interface:I_CmsXmlContentHandler
Gets the mappings defined in the schema.- Specified by:
getMappings
in interfaceI_CmsXmlContentHandler
- Returns:
- the mappings
- See Also:
-
getMappings
Returns the all mappings defined for the given element xpath.- Specified by:
getMappings
in interfaceI_CmsXmlContentHandler
- Parameters:
elementName
- the element xpath to look up the mapping for- Returns:
- the mapping defined for the given element xpath
- Since:
- 7.0.2
-
getMessageKeyHandler
Description copied from interface:I_CmsXmlContentHandler
Gets the message key fallback handler.This is used to automatically provide fallbacks for missing message keys in the editor.
- Specified by:
getMessageKeyHandler
in interfaceI_CmsXmlContentHandler
- Returns:
- the message key fallback handler
- See Also:
-
getMessages
Description copied from interface:I_CmsXmlContentHandler
Returns theCmsMessages
that are used to resolve localized keys for the given locale in this content handler.If no localized messages are configured for this content handler, this method returns
null
.- Specified by:
getMessages
in interfaceI_CmsXmlContentHandler
- Parameters:
locale
- the locale to get the messages for- Returns:
- the
CmsMessages
that are used to resolve localized keys for the given locale in this content handler - See Also:
-
getModelFolder
Description copied from interface:I_CmsXmlContentHandler
Returns the folder name that contains eventual XML content model files to use for this resource type.- Specified by:
getModelFolder
in interfaceI_CmsXmlContentHandler
- Returns:
- the folder name containing eventual XML content master files
- See Also:
-
getNestedFormatters
public List<String> getNestedFormatters(CmsObject cms, CmsResource res, Locale locale, javax.servlet.ServletRequest req) Description copied from interface:I_CmsXmlContentHandler
Returns the nested formatters for the given resource.- Specified by:
getNestedFormatters
in interfaceI_CmsXmlContentHandler
- Parameters:
cms
- the cms contextres
- the resourcelocale
- the content localereq
- the request if available- Returns:
- the nested formatter ids
- See Also:
-
getParameter
Description copied from interface:I_CmsXmlContentHandler
Gets the parameter with the given name..- Specified by:
getParameter
in interfaceI_CmsXmlContentHandler
- Parameters:
name
- the parameter name- Returns:
- the parameter value
- See Also:
-
getParameters
Gets the set of parameters.- Returns:
- zhr drz og pstsmrzrtd d
-
getPreview
Description copied from interface:I_CmsXmlContentHandler
Returns the preview URI for the given XML content value object to be displayed in the editor.If
null
is returned, no preview is possible for contents using this handler.- Specified by:
getPreview
in interfaceI_CmsXmlContentHandler
- Parameters:
cms
- the current OpenCms user contextcontent
- the XML content to display the preview URI forresourcename
- the name in the VFS of the resource that is currently edited- Returns:
- the preview URI for the given XML content value object to be displayed in the editor
- See Also:
-
getRelationType
Deprecated.Description copied from interface:I_CmsXmlContentHandler
Returns the relation type for the given value.- Specified by:
getRelationType
in interfaceI_CmsXmlContentHandler
- Parameters:
value
- the value to get the relation type for- Returns:
- the relation type for the given value
- See Also:
-
getRelationType
Description copied from interface:I_CmsXmlContentHandler
Returns the relation type for the given path.- Specified by:
getRelationType
in interfaceI_CmsXmlContentHandler
- Parameters:
xpath
- the path to get the relation type for- Returns:
- the relation type for the given path
- See Also:
-
getRelationType
Description copied from interface:I_CmsXmlContentHandler
Returns the relation type for the given path.- Specified by:
getRelationType
in interfaceI_CmsXmlContentHandler
- Parameters:
xpath
- the path to get the relation type fordefaultType
- the default type if none is set- Returns:
- the relation type for the given path
- See Also:
-
getSearchContentType
Description copied from interface:I_CmsXmlContentHandler
Returns the search content type, ie., the way how to integrate the value into full text search.For the full text search, the value of all elements in one locale of the XML content are combined to one big text, which is referred to as the "content" in the context of the full text search. With this option, it is possible to hide certain elements from this "content" that does not make sense to include in the full text search.
Moreover, if the value contains a link to another resource, the content of that other resource can be added.
- Specified by:
getSearchContentType
in interfaceI_CmsXmlContentHandler
- Parameters:
value
- the XML content value to check- Returns:
- the search content type, indicating how the element should be added to the content for the full text search
- See Also:
-
getSearchFields
Description copied from interface:I_CmsXmlContentHandler
Returns all configured Search fields for this XML content.- Specified by:
getSearchFields
in interfaceI_CmsXmlContentHandler
- Returns:
- the Search fields for this XMl content
- See Also:
-
getSearchFieldsForPage
Description copied from interface:I_CmsXmlContentHandler
Returns all configured Search fields for this XML content that should be attached to container pages the content is placed on.- Specified by:
getSearchFieldsForPage
in interfaceI_CmsXmlContentHandler
- Returns:
- the Search fields for this XMl content
- See Also:
-
getSearchSettings
Description copied from interface:I_CmsXmlContentHandler
Returns the search content settings defined in the annotation node of this XML content.A search setting defined within the xsd:annotaion node of an XML schema definition can look like:
<searchsetting element="Image/Align" searchContent="false"/>
The returned map contains the 'element' attribute value as keys and the 'searchContent' attribute value as values.
- Specified by:
getSearchSettings
in interfaceI_CmsXmlContentHandler
- Returns:
- the search field settings for this XML content schema
- See Also:
-
getSettings
Description copied from interface:I_CmsXmlContentHandler
Returns the element settings defined for the container page formatters.- Specified by:
getSettings
in interfaceI_CmsXmlContentHandler
- Parameters:
cms
- the current CMS contextresource
- the resource for which to get the setting definitions- Returns:
- the element settings defined for the container page formatters
- See Also:
-
getSynchronizations
Description copied from interface:I_CmsXmlContentHandler
Returns the configuration for elements that require a synchronization across all locales.- Specified by:
getSynchronizations
in interfaceI_CmsXmlContentHandler
- Parameters:
recursive
- if true, recursively combines all synchronization information from nested schemas, otherwise only returns the synchronizations for this schema- Returns:
- the synchronization information
- See Also:
-
getTabs
Description copied from interface:I_CmsXmlContentHandler
Returns the tabs to be displayed in the editor.- Specified by:
getTabs
in interfaceI_CmsXmlContentHandler
- Returns:
- the tabs to be displayed in the editor
- See Also:
-
getTitleMapping
Description copied from interface:I_CmsXmlContentHandler
Returns the "Title" mapping set for the given XML content document in the given Locale.- Specified by:
getTitleMapping
in interfaceI_CmsXmlContentHandler
- Parameters:
cms
- the current OpenCms user contextdocument
- the XML content to get the title mapping for (this must be of a type that uses this handler)locale
- the locale to get the title mapping for- Returns:
- the "Title" mapping set for the given XML content document in the given Locale
- See Also:
-
getValidationError
Gets the validation error message configured in the schema for the element.- Parameters:
elementName
- the name of the element- Returns:
- the validation message
-
getValidationWarning
Gets the validation warning message configured in the schema for the element.- Parameters:
elementName
- the name of the element- Returns:
- the validation message
-
getValidationWarningOrErrorMessage
public String getValidationWarningOrErrorMessage(CmsObject cms, Locale locale, String elementName, boolean isWarning, boolean keyOnly) Helper method for reading a validation message or the corresponding message key.- Parameters:
cms
- the current CMS contextlocale
- the localeelementName
- the element nameisWarning
- true if we want the warning message, false for the error messagekeyOnly
- true if we want the key rather than the message- Returns:
- the message or message key
-
getVersionTransformation
Description copied from interface:I_CmsXmlContentHandler
Gets the version transformation VFS path.If schema versions are used, the the XSLT transformation read from this VFS path is used to transform contents of older versions into the current version.
- Specified by:
getVersionTransformation
in interfaceI_CmsXmlContentHandler
- Returns:
- the VFS path to read an XSLT file for version transformation from
- See Also:
-
getVisibilityConfigString
Returns the configured visibility parameter string for the given field if the content handler itself is the visibility handler, and null otherwise.- Parameters:
field
- a field name- Returns:
- the visibility parameter
-
getWidget
Description copied from interface:I_CmsXmlContentHandler
Gets the widget for the given path and CMS context.- Specified by:
getWidget
in interfaceI_CmsXmlContentHandler
- Parameters:
cms
- the current CMS contextpath
- the XML value path- Returns:
- the widget for the path
- See Also:
-
getWidget
Deprecated.Description copied from interface:I_CmsXmlContentHandler
Returns the editor widget that should be used for the given XML content value.The handler implementations should use the "appinfo" node of the XML content definition schema to define the mappings of elements to widgets.
- Specified by:
getWidget
in interfaceI_CmsXmlContentHandler
- Parameters:
value
- the XML content value to get the widget for- Returns:
- the editor widget that should be used for the given XML content value
- See Also:
-
hasModifiableFormatters
Description copied from interface:I_CmsXmlContentHandler
Returns true if the contents for this content handler have schema-based formatters which can be disabled or enabled.- Specified by:
hasModifiableFormatters
in interfaceI_CmsXmlContentHandler
- Returns:
- true if the contents for this content handler have schema-based formatters which can be disabled or enabled
- See Also:
-
hasNestedFormatters
Description copied from interface:I_CmsXmlContentHandler
Returns whether there are nested formatters configured for this content type.- Specified by:
hasNestedFormatters
in interfaceI_CmsXmlContentHandler
- Returns:
true
if there are nested formatters configured for this content type- See Also:
-
hasSynchronizedElements
Description copied from interface:I_CmsXmlContentHandler
Returns if there are locale synchronized elements configured.- Specified by:
hasSynchronizedElements
in interfaceI_CmsXmlContentHandler
- Returns:
true
if there are locale synchronized elements configured- See Also:
-
hasVisibilityHandlers
Description copied from interface:I_CmsXmlContentHandler
Returns if there are visibility handlers configured for this content type.- Specified by:
hasVisibilityHandlers
in interfaceI_CmsXmlContentHandler
- Returns:
true
if there are visibility handlers configured for this content type- See Also:
-
initialize
public void initialize(org.dom4j.Element appInfoElement, CmsXmlContentDefinition contentDefinition) throws CmsXmlException Description copied from interface:I_CmsXmlContentHandler
Initializes this content handler for the given XML content definition by analyzing the "appinfo" node.- Specified by:
initialize
in interfaceI_CmsXmlContentHandler
- Parameters:
appInfoElement
- the "appinfo" element root node to analyzecontentDefinition
- the XML content definition that XML content handler belongs to- Throws:
CmsXmlException
- if something goes wrong- See Also:
-
invalidateBrokenLinks
Description copied from interface:I_CmsXmlContentHandler
Performs a check of the given XML document.The main difference to the
I_CmsXmlContentHandler.resolveValidation(CmsObject, I_CmsXmlContentValue, CmsXmlContentErrorHandler)
method is that this method may silently remove some values, for instance, for broken links.- Specified by:
invalidateBrokenLinks
in interfaceI_CmsXmlContentHandler
- Parameters:
cms
- the current OpenCms user contextdocument
- the document to resolve the check rules for- See Also:
-
isAcaciaEditorDisabled
Returns true if the Acacia editor is disabled for this type.- Specified by:
isAcaciaEditorDisabled
in interfaceI_CmsXmlContentHandler
- Returns:
- true if the acacia editor is disabled
-
isContainerPageOnly
Description copied from interface:I_CmsXmlContentHandler
Returnstrue
if the XML content should be indexed when it is dropped in a container page, and returnsfalse
if this XML content should be indexed as 'stand-alone' document.This flag is intended by excluding XML contents from the search index that are not used as detail pages, but to index those extraction result when they are part of a container page.
In order to set this falg add an attribute
containerpageOnly="true"
to the'<searchsettings>-node'
of the XSD of the resource type you want to be indexed only when it is part of a container page.- Specified by:
isContainerPageOnly
in interfaceI_CmsXmlContentHandler
- Returns:
- the container page only flag
- See Also:
-
isValueVisible
public boolean isValueVisible(CmsObject cms, I_CmsXmlSchemaType value, String elementName, String params, CmsResource resource, Locale contentLocale) Returns the content field visibilty.This implementation will be used as default if no other org.opencms.xml.content.I_CmsXmlContentVisibilityHandler is configured.
Only users that are member in one of the specified groups will be allowed to view and edit the given content field.
The parameter should contain a '|' separated list of group names.
- Specified by:
isValueVisible
in interfaceI_CmsXmlContentVisibilityHandler
- Parameters:
cms
- the cms contextvalue
- the content valueelementName
- the path to the elementparams
- configuration parametersresource
- the edited resourcecontentLocale
- the locale being edited- Returns:
true
if the given content value field should be visible to the current user- See Also:
-
isVisible
public boolean isVisible(CmsObject cms, I_CmsXmlSchemaType contentValue, String valuePath, CmsResource resource, Locale contentLocale) Description copied from interface:I_CmsXmlContentHandler
Returns if the given content field should be visible to the current user.- Specified by:
isVisible
in interfaceI_CmsXmlContentHandler
- Parameters:
cms
- the cms contextcontentValue
- the content value typevaluePath
- the value pathresource
- the edited resourcecontentLocale
- the content locale- Returns:
true
if the given content field should be visible to the current user- See Also:
-
prepareForUse
Description copied from interface:I_CmsXmlContentHandler
Prepares the given XML content to be used after it was read from the OpenCms VFS.This method is always called after any content is unmarshalled. It can be used to perform customized actions on the given XML content.
- Specified by:
prepareForUse
in interfaceI_CmsXmlContentHandler
- Parameters:
cms
- the current OpenCms user contextcontent
- the XML content to be used as read from the VFS- Returns:
- the prepared content to be used
- See Also:
-
prepareForWrite
public CmsFile prepareForWrite(CmsObject cms, CmsXmlContent content, CmsFile file) throws CmsException Description copied from interface:I_CmsXmlContentHandler
Prepares the given XML content to be written to the OpenCms VFS.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.
- Specified by:
prepareForWrite
in interfaceI_CmsXmlContentHandler
- Parameters:
cms
- the current OpenCms user contextcontent
- the XML content to be writtenfile
- the resource the XML content in it's current state was unmarshalled from- Returns:
- the file to write to the OpenCms VFS, this will be an updated version of the parameter file
- Throws:
CmsException
- in case something goes wrong- See Also:
-
resolveMapping
public void resolveMapping(CmsObject cms, CmsXmlContent content, I_CmsXmlContentValue value) throws CmsException Description copied from interface:I_CmsXmlContentHandler
Resolves the value mappings of the given XML content value, according to the rules of this XML content handler.- Specified by:
resolveMapping
in interfaceI_CmsXmlContentHandler
- Parameters:
cms
- the current OpenCms user contextcontent
- the XML content to resolve the mappings forvalue
- the value to resolve the mappings for- Throws:
CmsException
- if something goes wrong- See Also:
-
resolveValidation
public CmsXmlContentErrorHandler resolveValidation(CmsObject cms, I_CmsXmlContentValue value, CmsXmlContentErrorHandler errorHandler) Description copied from interface:I_CmsXmlContentHandler
Performs a validation of the given XML content value, and saves all errors or warnings found in the provided XML content error handler.The errorHandler parameter is optional, if
null
is given a new error handler instance must be created.- Specified by:
resolveValidation
in interfaceI_CmsXmlContentHandler
- Parameters:
cms
- the current OpenCms user contextvalue
- the value to resolve the validation rules forerrorHandler
- (optional) an error handler instance that contains previous error or warnings- Returns:
- an error handler that contains all errors and warnings currently found
- See Also:
-
addCheckRule
protected void addCheckRule(CmsXmlContentDefinition contentDefinition, String elementName, String invalidate, String type) throws CmsXmlException Adds a check rule for a specified element.- Parameters:
contentDefinition
- the XML content definition this XML content handler belongs toelementName
- the element name to add the rule toinvalidate
-false
, to disable link check /true
ornode
, to invalidate just the single node if the link is broken /parent
, if this rule will invalidate the whole parent node in nested contenttype
- the relation type- Throws:
CmsXmlException
- in case an unknown element name is used
-
addConfiguration
protected void addConfiguration(CmsXmlContentDefinition contentDefinition, String elementName, String configurationValue) throws CmsXmlException Adds a configuration value for an element widget.- Parameters:
contentDefinition
- the XML content definition this XML content handler belongs toelementName
- the element nameconfigurationValue
- the configuration value to use- Throws:
CmsXmlException
- in case an unknown element name is used
-
addDefault
protected void addDefault(CmsXmlContentDefinition contentDefinition, String elementName, String defaultValue, String resolveMacrosValue) throws CmsXmlException Adds a default value for an element.- Parameters:
contentDefinition
- the XML content definition this XML content handler belongs toelementName
- the element name to mapdefaultValue
- the default value to useresolveMacrosValue
- the value of the 'resolveMacros' attribute- Throws:
CmsXmlException
- in case an unknown element name is used
-
addDefaultCheckRules
protected void addDefaultCheckRules(CmsXmlContentDefinition rootContentDefinition, I_CmsXmlSchemaType schemaType, String elementPath) throws CmsXmlException Adds all needed default check rules recursively for the given schema type.- Parameters:
rootContentDefinition
- the root content definitionschemaType
- the schema type to checkelementPath
- the current element path- Throws:
CmsXmlException
- if something goes wrong
-
addDisplayType
protected void addDisplayType(CmsXmlContentDefinition contentDefinition, String elementName, I_CmsXmlContentHandler.DisplayType displayType) throws CmsXmlException Adds the given element to the compact view set.- Parameters:
contentDefinition
- the XML content definition this XML content handler belongs toelementName
- the element namedisplayType
- the display type to use for the element widget- Throws:
CmsXmlException
- in case an unknown element name is used
-
addGeoMappingField
Finally adds the field used for geo-coordinate mapping by combining the configuration from the geomapping section and the field settings. -
addMapping
protected void addMapping(CmsXmlContentDefinition contentDefinition, String elementName, String mapping, String useDefault) throws CmsXmlException Adds an element mapping.- Parameters:
contentDefinition
- the XML content definition this XML content handler belongs toelementName
- the element name to mapmapping
- the mapping to useuseDefault
- the 'useDefault' attribute- Throws:
CmsXmlException
- in case an unknown element name is used
-
addNestedFormatter
protected void addNestedFormatter(String elementName, CmsXmlContentDefinition contentDefinition) throws CmsXmlException Adds a nested formatter element.- Parameters:
elementName
- the element namecontentDefinition
- the content definition- Throws:
CmsXmlException
- in case something goes wrong
-
addSearchField
@Deprecated protected void addSearchField(CmsXmlContentDefinition contentDefinition, CmsSearchField field) Deprecated.Adds a Solr field for an element.- Parameters:
contentDefinition
- the XML content definition this XML content handler belongs tofield
- the Solr field
-
addSearchField
protected void addSearchField(CmsXmlContentDefinition contentDefinition, CmsSearchField field, I_CmsXmlContentHandler.MappingType type) Adds a Solr field for an element.- Parameters:
contentDefinition
- the XML content definition this XML content handler belongs tofield
- the Solr fieldtype
- the type, specifying if the field should be attached to the document of the XML content or to all container pages the content is placed on
-
addSearchSetting
protected void addSearchSetting(CmsXmlContentDefinition contentDefinition, String elementName, I_CmsXmlContentValue.SearchContentType value) throws CmsXmlException Adds a search setting for an element.- Parameters:
contentDefinition
- the XML content definition this XML content handler belongs toelementName
- the element name to mapvalue
- the search setting value to store- Throws:
CmsXmlException
- in case an unknown element name is used
-
addSimpleSearchSetting
protected void addSimpleSearchSetting(CmsXmlContentDefinition contentDef, String name, String value) throws CmsXmlException Adds search settings as defined by 'simple' syntax in fields.- Parameters:
contentDef
- the content definitionname
- the element namevalue
- the search setting value- Throws:
CmsXmlException
- if something goes wrong
-
addValidationRule
protected void addValidationRule(CmsXmlContentDefinition contentDefinition, String elementName, String regex, String message, boolean isWarning) throws CmsXmlException Adds a validation rule for a specified element.- Parameters:
contentDefinition
- the XML content definition this XML content handler belongs toelementName
- the element name to add the rule toregex
- the validation rule regular expressionmessage
- the message in case validation fails (may be null)isWarning
- if true, this rule is used for warnings, otherwise it's an error- Throws:
CmsXmlException
- in case an unknown element name is used
-
addWidget
protected void addWidget(CmsXmlContentDefinition contentDefinition, String elementName, String name) throws CmsXmlException Adds a GUI widget for a specified element.- Parameters:
contentDefinition
- the XML content definition this XML content handler belongs toelementName
- the element name to mapname
- the widget to use as GUI for the element (registered alias or class name)- Throws:
CmsXmlException
- in case an unknown element name is used
-
createVisibilityConfiguration
protected CmsDefaultXmlContentHandler.VisibilityConfiguration createVisibilityConfiguration(String className, String params) Helper method to create a visibility configuration.- Parameters:
className
- the visibility handler class nameparams
- the parameters for the visibility- Returns:
- the visibility configuration
-
getAttributeMapping
protected org.opencms.xml.content.CmsDefaultXmlContentHandler.MappingInfo getAttributeMapping(CmsMappingResolutionContext.AttributeType attr) Returns information about the availability mapping for the given availability attribute.- Parameters:
attr
- the availability attribute- Returns:
- the information about the mapping
-
getLocalesForResource
Returns the configured default locales for the content of the given resource.- Parameters:
cms
- the cms contextresource
- the resource path to get the default locales for- Returns:
- the default locales of the resource
-
getNestedEditorChangeHandlers
Creates editor change handler instances for all nested fields that have configured them in their field settings- Returns:
- editor change handlers for all nested fields for which they are configured
-
getReferencePath
Returns the category reference path for the given value.- Parameters:
cms
- the cms contextvalue
- the xml content value- Returns:
- the category reference path for the given value
-
getValidationMessage
protected String getValidationMessage(CmsObject cms, I_CmsXmlContentValue value, String regex, String valueStr, boolean matchResult, boolean isWarning) Returns the validation message to be displayed if a certain rule was violated.- Parameters:
cms
- the current users OpenCms contextvalue
- the value to validateregex
- the rule that was violatedvalueStr
- the string value of the given valuematchResult
- if false, the rule was negatedisWarning
- if true, this validation indicate a warning, otherwise an error- Returns:
- the validation message to be displayed
-
init
Called when this content handler is initialized. -
initDefaultValues
protected void initDefaultValues(org.dom4j.Element root, CmsXmlContentDefinition contentDefinition) throws CmsXmlException Initializes the default values for this content handler.Using the default values from the appinfo node, it's possible to have more sophisticated logic for generating the defaults then just using the XML schema "default" attribute.
- Parameters:
root
- the "defaults" element from the appinfo node of the XML content definitioncontentDefinition
- the content definition the default values belong to- Throws:
CmsXmlException
- if something goes wrong
-
initDefaultWidget
Initializes the default complex widget.- Parameters:
element
- the element in which the default complex widget is configured
-
initEditHandler
Initializes the edit handler.- Parameters:
handlerElement
- the edit handler element
-
initEditorChangeHandlers
Initializes the editor change handlers.- Parameters:
element
- the editorchangehandlers node of the app info
-
initField
protected void initField(org.dom4j.Element elem, CmsXmlContentDefinition contentDef) throws CmsXmlException Processes a single field definition.- Parameters:
elem
- the parent elementcontentDef
- the content definition- Throws:
CmsXmlException
- if something goes wrong
-
initFields
protected void initFields(org.dom4j.Element parent, CmsXmlContentDefinition contentDef) throws CmsXmlException Processes all field declarations in the schema.- Parameters:
parent
- the parent elementcontentDef
- the content definition- Throws:
CmsXmlException
- if something goes wrong
-
initFormatters
Initializes the formatters for this content handler.- Parameters:
root
- the "formatters" element from the appinfo node of the XML content definitioncontentDefinition
- the content definition the formatters belong to
-
initHeadIncludes
Initializes the head includes for this content handler.- Parameters:
root
- the "headincludes" element from the appinfo node of the XML content definitioncontentDefinition
- the content definition the head-includes belong to
-
initJsonRenderer
Reads the JSON renderer settings.- Parameters:
element
- the configuration XML element
-
initLayouts
protected void initLayouts(org.dom4j.Element root, CmsXmlContentDefinition contentDefinition) throws CmsXmlException Initializes the layout for this content handler.Unless otherwise instructed, the editor uses one specific GUI widget for each XML value schema type. For example, for a
CmsXmlStringValue
the default widget is theCmsInputWidget
. However, certain values can also use more then one widget, for example you may also use aCmsCheckboxWidget
for a String value, and as a result the Strings possible values would be either"false"
or"true"
, but nevertheless be a String.The widget to use can further be controlled using the
widget
attribute. You can specify either a valid widget alias such asStringWidget
, or the name of a Java class that implements
.I_CmsWidget
Configuration options to the widget can be passed using the
configuration
attribute. You can specify any String as configuration. This String is then passed to the widget during initialization. It's up to the individual widget implementation to interpret this configuration String.- Parameters:
root
- the "layouts" element from the appinfo node of the XML content definitioncontentDefinition
- the content definition the layout belongs to- Throws:
CmsXmlException
- if something goes wrong
-
initMappings
protected void initMappings(org.dom4j.Element root, CmsXmlContentDefinition contentDefinition) throws CmsXmlException Initializes the element mappings for this content handler.Element mappings allow storing values from the XML content in other locations. For example, if you have an element called "Title", it's likely a good idea to store the value of this element also in the "Title" property of a XML content resource.
- Parameters:
root
- the "mappings" element from the appinfo node of the XML content definitioncontentDefinition
- the content definition the mappings belong to- Throws:
CmsXmlException
- if something goes wrong
-
initModelFolder
protected void initModelFolder(org.dom4j.Element root, CmsXmlContentDefinition contentDefinition) throws CmsXmlException Initializes the folder containing the model file(s) for this content handler.- Parameters:
root
- the "modelfolder" element from the appinfo node of the XML content definitioncontentDefinition
- the content definition the model folder belongs to- Throws:
CmsXmlException
- if something goes wrong
-
initNestedFormatters
protected void initNestedFormatters(org.dom4j.Element element, CmsXmlContentDefinition contentDefinition) throws CmsXmlException Initializes the nested formatter fields.- Parameters:
element
- the formatters elementcontentDefinition
- the content definition- Throws:
CmsXmlException
- in case something goes wron
-
initParameters
Initializes the parameters from the schema.- Parameters:
root
- the parameter root element
-
initPreview
protected void initPreview(org.dom4j.Element root, CmsXmlContentDefinition contentDefinition) throws CmsXmlException Initializes the preview location for this content handler.- Parameters:
root
- the "preview" element from the appinfo node of the XML content definitioncontentDefinition
- the content definition the validation rules belong to- Throws:
CmsXmlException
- if something goes wrong
-
initRelations
protected void initRelations(org.dom4j.Element root, CmsXmlContentDefinition contentDefinition) throws CmsXmlException Initializes the relation configuration for this content handler.OpenCms performs link checks for all OPTIONAL links defined in XML content values of type OpenCmsVfsFile. However, for most projects in the real world a more fine-grained control over the link check process is required. For these cases, individual relation behavior can be defined for the appinfo node.
Additional here can be defined an optional type for the relations, for instance.
- Parameters:
root
- the "relations" element from the appinfo node of the XML content definitioncontentDefinition
- the content definition the check rules belong to- Throws:
CmsXmlException
- if something goes wrong
-
initResourceBundle
protected void initResourceBundle(org.dom4j.Element root, CmsXmlContentDefinition contentDefinition, boolean single) throws CmsXmlException Initializes the resource bundle to use for localized messages in this content handler.- Parameters:
root
- the "resourcebundle" element from the appinfo node of the XML content definitioncontentDefinition
- the content definition the validation rules belong tosingle
- iftrue
we process the classic sinle line entry, otherwise it's the multiple line setting- Throws:
CmsXmlException
- if something goes wrong
-
initSearchSettings
protected void initSearchSettings(org.dom4j.Element root, CmsXmlContentDefinition contentDefinition) throws CmsXmlException Initializes the search exclusions values for this content handler.For the full text search, the value of all elements in one locale of the XML content are combined to one big text, which is referred to as the "content" in the context of the full text search. With this option, it is possible to hide certain elements from this "content" that does not make sense to include in the full text search.
- Parameters:
root
- the "searchsettings" element from the appinfo node of the XML content definitioncontentDefinition
- the content definition the default values belong to- Throws:
CmsXmlException
- if something goes wrong
-
initSettings
Initializes the element settings for this content handler.- Parameters:
root
- the "settings" element from the appinfo node of the XML content definitioncontentDefinition
- the content definition the element settings belong to
-
initSynchronizations
protected void initSynchronizations(org.dom4j.Element root, CmsXmlContentDefinition contentDefinition) Initializes the locale synchronizations elements.- Parameters:
root
- the synchronizations element of the content schema appinfo.contentDefinition
- the content definition
-
initTabs
Initializes the tabs for this content handler.- Parameters:
root
- the "tabs" element from the appinfo node of the XML content definitioncontentDefinition
- the content definition the tabs belong to
-
initTemplates
Initializes the forbidden template contexts.- Parameters:
root
- the root XML elementcontentDefinition
- the content definition
-
initValidationRules
protected void initValidationRules(org.dom4j.Element root, CmsXmlContentDefinition contentDefinition) throws CmsXmlException Initializes the validation rules this content handler.OpenCms always performs XML schema validation for all XML contents. However, for most projects in the real world a more fine-grained control over the validation process is required. For these cases, individual validation rules can be defined for the appinfo node.
- Parameters:
root
- the "validationrules" element from the appinfo node of the XML content definitioncontentDefinition
- the content definition the validation rules belong to- Throws:
CmsXmlException
- if something goes wrong
-
initVisibilities
Initializes the content visibility settings.- Parameters:
root
- the visibilities appinfo elementcontentDefinition
- the content definition
-
isInvalidateParent
Returns the is-invalidate-parent flag for the given xpath.- Parameters:
xpath
- the path to get the check rule for- Returns:
- the configured is-invalidate-parent flag for the given xpath
-
key
Returns the localized resource string for a given message key according to the configured resource bundle of this content handler.If the key was not found in the configured bundle, or no bundle is configured for this content handler, the return value is
"??? " + keyName + " ???"
.- Parameters:
keyName
- the key for the desired stringlocale
- the locale to get the key from- Returns:
- the resource string for the given key
- See Also:
-
parseSearchMappingTypes
protected Set<I_CmsXmlContentHandler.MappingType> parseSearchMappingTypes(org.dom4j.Element solrElement) - Parameters:
solrElement
- the XML node of the <solrfield> node- Returns:
- parsed values of the attribute "addto"
-
removeEmptyMappings
protected void removeEmptyMappings(CmsObject cms, CmsFile file, CmsXmlContent content) throws CmsException Removes property values on resources for non-existing, optional elements.- Parameters:
cms
- the current users OpenCms contextfile
- the file which is currently being prepared for writingcontent
- the XML content to remove the property values for- Throws:
CmsException
- in case of read/write errors accessing the OpenCms VFS
-
resolveDefaultMappings
protected void resolveDefaultMappings(CmsObject cms, CmsFile file, CmsXmlContent content) throws CmsException Resolves those mappings for which no content value exists and useDefault is set to true.- Parameters:
cms
- the CMS context to usefile
- the content filecontent
- the content object- Throws:
CmsException
- if something goes wrong
-
validateAppinfoElement
Validates if the givenappinfo
element node from the XML content definition schema is valid according the the capabilities of this content handler.- Parameters:
appinfoElement
- theappinfo
element node to validate- Throws:
CmsXmlException
- in case the element validation fails
-
validateCategories
protected CmsXmlContentErrorHandler validateCategories(CmsObject cms, I_CmsXmlContentValue value, CmsXmlContentErrorHandler errorHandler) The errorHandler parameter is optional, ifnull
is given a new error handler instance must be created.- Parameters:
cms
- the current OpenCms user contextvalue
- the value to resolve the validation rules forerrorHandler
- (optional) an error handler instance that contains previous error or warnings- Returns:
- an error handler that contains all errors and warnings currently found
-
validateLink
protected boolean validateLink(CmsObject cms, I_CmsXmlContentValue value, CmsXmlContentErrorHandler errorHandler) Validates the given rules against the given value.- Parameters:
cms
- the current users OpenCms contextvalue
- the value to validateerrorHandler
- the error handler to use in case errors or warnings are detected- Returns:
- if a broken link has been found
-
validateValue
protected CmsXmlContentErrorHandler validateValue(CmsObject cms, I_CmsXmlContentValue value, CmsXmlContentErrorHandler errorHandler, Map<String, String> rules, boolean isWarning) Validates the given rules against the given value.- Parameters:
cms
- the current users OpenCms contextvalue
- the value to validateerrorHandler
- the error handler to use in case errors or warnings are detectedrules
- the rules to validate the value againstisWarning
- if true, this validation should be stored as a warning, otherwise as an error- Returns:
- the updated error handler
-
validateValue
protected CmsXmlContentErrorHandler validateValue(CmsObject cms, I_CmsXmlContentValue value, String valueStr, CmsXmlContentErrorHandler errorHandler, boolean isWarning) Checks the default XML schema validation rules.These rules should only be tested if this is not a test for warnings.
- Parameters:
cms
- the current users OpenCms contextvalue
- the value to validatevalueStr
- the string value of the given valueerrorHandler
- the error handler to use in case errors or warnings are detectedisWarning
- if true, this validation should be stored as a warning, otherwise as an error- Returns:
- the updated error handler
-
writeCategories
protected CmsFile writeCategories(CmsObject cms, CmsFile file, CmsXmlContent content) throws CmsException Writes the categories if a category widget is present.- Parameters:
cms
- the cms contextfile
- the filecontent
- the xml content to set the categories for- Returns:
- the perhaps modified file
- Throws:
CmsException
- if something goes wrong
-