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
Nested ClassesModifier and TypeClassDescriptionstatic enumEnum for IfInvalidRelation field setting values.protected static classContains 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
FieldsModifier and TypeFieldDescriptionstatic final StringAttribute name for configuration string.static final StringConstant for the "appinfo" element name itself.static final StringConstant for the "addto" appinfo attribute name.static final StringConstant for the "boost" appinfo attribute name.static final StringConstant for the "class" appinfo attribute name.static final StringConstant for the "collapse" appinfo attribute name.static final StringConstant for the "configuration" appinfo attribute name.static final StringThe exclude from index attribute.static final StringConstant for the "copyfields" appinfo attribute name.static final StringConstant for the "default" appinfo attribute name.static final StringConstant for the "description" appinfo attribute name.static final StringConstant for the "displaycompact" appinfo attribute name.static final StringConstant for the "element" appinfo attribute name.static final StringConstant for the "error" appinfo attribute name.static final StringConstant for the "invalidate" appinfo attribute name.static final StringConstant for the "key" appinfo attribute name.static final StringConstant for the "locale" appinfo attribute name.static final StringConstant for the "mapping" appinfo attribute name.static final StringConstant for the "mapto" appinfo attribute name.static final StringConstant for the "maxwidth" appinfo attribute name.static final StringConstant for the "message" appinfo attribute name.static final StringConstant for the "minwidth" appinfo attribute name.static final StringConstant for the "name" appinfo attribute name.static final StringConstant for the "nice-name" appinfo attribute name.static final StringConstant for the "params" appinfo attribute name.static final StringConstant for the "preview" appinfo attribute name.static final StringConstant for the "regex" appinfo attribute name.static final StringConstant for the "resolveMacros" attribute name.static final StringConstant for the "rule-regex" appinfo attribute name.static final StringConstant for the "rule-type" appinfo attribute name.static final StringConstant for the "scope" appinfo attribute name.static final StringConstant for the "searchcontent" appinfo attribute name.static final StringConstant for the "select-inherit" appinfo attribute name.static final StringConstant for the "sourcefield" appinfo attribute name.static final StringConstant for the "targetfield" appinfo attribute name.static final StringConstant for the "type" appinfo attribute name.static final StringConstant for the "node" appinfo attribute value.static final StringConstant for the "parent" appinfo attribute value.static final StringConstant for the "warning" appinfo attribute value.static final StringConstant for the "uri" appinfo attribute name.static final StringConstant for the "useall" appinfo attribute name.static final StringConstant for the "value" appinfo attribute name.static final StringConstant for the "widget" appinfo attribute name.static final StringConstant for the "widget-config" appinfo attribute name.static final StringConstant for formatter include resource type 'CSS'.static final StringConstant for formatter include resource type 'JAVASCRIPT'.static final StringConstant for the "bundle" appinfo element name.static final StringConstant for the "default" appinfo element name.static final StringConstant for the "defaults" appinfo element name.static final StringConstant for the "edithandler" appinfo element name.static final StringConstant for the "editorchangehandler" appinfo element name.static final StringConstant for the "editorchangehandlers" appinfo element name.static final StringConstant for the "forbidden-contexts" appinfo attribute name.static final StringConstant for the "formatter" appinfo element name.static final StringConstant for the "formatters" appinfo element name.static final StringConstant for the 'geomapping' node.static final StringConstant for the "headinclude" appinfo element name.static final StringConstant for the "headincludes" appinfo element name.static final StringConstant for the "layout" appinfo element name.static final StringConstant for the "layouts" appinfo element name.static final StringConstant for the "mapping" appinfo element name.static final StringConstant for the "mappings" appinfo element name.static final StringConstant for the 'messagekeyhandler' node.static final StringConstant for the "modelfolder" appinfo element name.static final StringConstant for the "nestedformatter" appinfo element name.static final StringConstant for the "nestedformatters" appinfo element name.static final StringConstant for the "param" appinfo attribute name.static final StringConstant for the "parameters" appinfo element name.static final StringConstant for the "preview" appinfo element name.static final StringConstant for the "propertybundle" appinfo element name.static final StringConstant for the "relation" appinfo element name.static final StringConstant for the "relations" appinfo element name.static final StringConstant for the "resource" appinfo element name.static final StringConstant for the "resourcebundle" appinfo element name.static final StringConstant for the "resourcebundles" appinfo element name.static final StringConstant for the reverse-mapping-enabled appinfo element name.static final StringConstant for the "rule" appinfo element name.static final StringThe file where the default appinfo schema is located.static final StringThe file where the default appinfo schema types are located.static final StringThe XML system id for the default appinfo schema types.static final StringThe XML system id for the default appinfo schema types.static final StringConstant for the "searchsetting" appinfo element name.static final StringConstant for the "searchsettings" appinfo element name.static final StringConstant for the "setting" appinfo element name.static final StringConstant for the "settings" appinfo element name.static final StringConstant for the "solrfield" appinfo element name.static final StringConstant for the "synchronization" appinfo element name.static final StringConstant for the "synchronizations" appinfo element name.static final StringConstant for the "tab" appinfo element name.static final StringConstant for the "tabs" appinfo element name.static final StringNode name.static final StringNode name.static final StringConstant for the "validationrule" appinfo element name.static final StringConstant for the "validationrules" appinfo element name.static final StringConstant for the "element" value of the appinfo attribute "addto".static final StringConstant for the "page" value of the appinfo attribute "addto".static final Stringversion-transformation node name.static final StringConstant for the "visibilities" appinfo element name.static final StringConstant for the "visibility" appinfo element name.static final StringConstant for the "xmlbundle" appinfo element name.static final StringAttribute name.static final StringAttribute name.static final StringAttribute name.static final StringConstant for head include type attribute: CSS.static final StringConstant for head include type attribute: java-script.static final StringField 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 CmsFormatterConfigurationThe 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 StringThe folder containing the model file(s) for the content.protected StringThe preview location (as defined in the annotations).protected StringName 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.CmsSearchContentConfig> The search settings.protected org.antlr.stringtemplate.StringTemplateGroupString 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 booleanFlag 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 StringPath to XSL transform in VFS to use for version transformation.static final StringMacro for resolving the preview URI.protected static final StringDefault message for validation errors.protected static final StringDefault message for validation warnings.static final StringNode name for change handler.static final StringConstant 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
ConstructorsConstructorDescriptionCreates a new instance of the default XML content handler. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddCheckRule(CmsXmlContentDefinition contentDefinition, String elementName, String invalidate, String type) Adds a check rule for a specified element.protected voidaddConfiguration(CmsXmlContentDefinition contentDefinition, String elementName, String configurationValue) Adds a configuration value for an element widget.protected voidaddDefault(CmsXmlContentDefinition contentDefinition, String elementName, String defaultValue, String resolveMacrosValue) Adds a default value for an element.protected voidaddDefaultCheckRules(CmsXmlContentDefinition rootContentDefinition, I_CmsXmlSchemaType schemaType, String elementPath) Adds all needed default check rules recursively for the given schema type.protected voidaddDisplayType(CmsXmlContentDefinition contentDefinition, String elementName, I_CmsXmlContentHandler.DisplayType displayType) Adds the given element to the compact view set.protected voidFinally adds the field used for geo-coordinate mapping by combining the configuration from the geomapping section and the field settings.protected voidaddMapping(CmsXmlContentDefinition contentDefinition, String elementName, String mapping, String useDefault) Adds an element mapping.protected voidaddNestedFormatter(String elementName, CmsXmlContentDefinition contentDefinition) Adds a nested formatter element.protected voidaddSearchField(CmsXmlContentDefinition contentDefinition, CmsSearchField field) Deprecated.protected voidaddSearchField(CmsXmlContentDefinition contentDefinition, CmsSearchField field, I_CmsXmlContentHandler.MappingType type) Adds a Solr field for an element.protected voidaddSearchSetting(CmsXmlContentDefinition contentDefinition, String elementName, I_CmsXmlContentValue.CmsSearchContentConfig value) Adds a search setting for an element.protected voidaddSimpleSearchSetting(CmsXmlContentDefinition contentDef, String name, String value) Adds search settings as defined by 'simple' syntax in fields.protected voidaddValidationRule(CmsXmlContentDefinition contentDefinition, String elementName, String regex, String message, boolean isWarning) Adds a validation rule for a specified element.protected voidaddWidget(CmsXmlContentDefinition contentDefinition, String elementName, String name) Adds a GUI widget for a specified element.booleanapplyReverseAvailabilityMapping(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.booleanChecks if an availability attribute should be written back to the content if the availability is changed through the availability dialog.voidclearMappings(CmsObject cms, CmsXmlContent content) We clear all potential property mappings.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.MappingInfoReturns 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 theCmsMessagesthat 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 StringgetReferencePath(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 configuration, 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 StringgetValidationMessage(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.booleanReturns true if the contents for this content handler have schema-based formatters which can be disabled or enabled.booleanReturns whether there are nested formatters configured for this content type.booleanReturns if there are locale synchronized elements configured.booleanReturns if there are visibility handlers configured for this content type.protected voidinit()Called when this content handler is initialized.protected voidinitDefaultValues(org.dom4j.Element root, CmsXmlContentDefinition contentDefinition) Initializes the default values for this content handler.protected voidinitDefaultWidget(org.dom4j.Element element) Initializes the default complex widget.protected voidinitEditHandler(org.dom4j.Element handlerElement) Initializes the edit handler.protected voidinitEditorChangeHandlers(org.dom4j.Element element) Initializes the editor change handlers.protected voidinitField(org.dom4j.Element elem, CmsXmlContentDefinition contentDef) Processes a single field definition.protected voidinitFields(org.dom4j.Element parent, CmsXmlContentDefinition contentDef) Processes all field declarations in the schema.protected voidinitFormatters(org.dom4j.Element root, CmsXmlContentDefinition contentDefinition) Initializes the formatters for this content handler.protected voidinitHeadIncludes(org.dom4j.Element root, CmsXmlContentDefinition contentDefinition) Initializes the head includes for this content handler.voidinitialize(org.dom4j.Element appInfoElement, CmsXmlContentDefinition contentDefinition) Initializes this content handler for the given XML content definition by analyzing the "appinfo" node.protected voidinitJsonRenderer(org.dom4j.Element element) Reads the JSON renderer settings.protected voidinitLayouts(org.dom4j.Element root, CmsXmlContentDefinition contentDefinition) Initializes the layout for this content handler.protected voidinitMappings(org.dom4j.Element root, CmsXmlContentDefinition contentDefinition) Initializes the element mappings for this content handler.protected voidinitModelFolder(org.dom4j.Element root, CmsXmlContentDefinition contentDefinition) Initializes the folder containing the model file(s) for this content handler.protected voidinitNestedFormatters(org.dom4j.Element element, CmsXmlContentDefinition contentDefinition) Initializes the nested formatter fields.protected voidinitParameters(org.dom4j.Element root) Initializes the parameters from the schema.protected voidinitPreview(org.dom4j.Element root, CmsXmlContentDefinition contentDefinition) Initializes the preview location for this content handler.protected voidinitRelations(org.dom4j.Element root, CmsXmlContentDefinition contentDefinition) Initializes the relation configuration for this content handler.protected voidinitResourceBundle(org.dom4j.Element root, CmsXmlContentDefinition contentDefinition, boolean single) Initializes the resource bundle to use for localized messages in this content handler.protected voidinitSearchSettings(org.dom4j.Element root, CmsXmlContentDefinition contentDefinition) Initializes the search exclusions values for this content handler.protected voidinitSettings(org.dom4j.Element root, CmsXmlContentDefinition contentDefinition) Initializes the element settings for this content handler.protected voidinitSynchronizations(org.dom4j.Element root, CmsXmlContentDefinition contentDefinition) Initializes the locale synchronizations elements.protected voidinitTabs(org.dom4j.Element root, CmsXmlContentDefinition contentDefinition) Initializes the tabs for this content handler.protected voidinitTemplates(org.dom4j.Element root, CmsXmlContentDefinition contentDefinition) Initializes the forbidden template contexts.protected voidinitValidationRules(org.dom4j.Element root, CmsXmlContentDefinition contentDefinition) Initializes the validation rules this content handler.protected voidinitVisibilities(org.dom4j.Element root, CmsXmlContentDefinition contentDefinition) Initializes the content visibility settings.voidinvalidateBrokenLinks(CmsObject cms, CmsXmlContent document) Performs a check of the given XML document.booleanReturns true if the Acacia editor is disabled for this type.booleanReturnstrueif the XML content should be indexed when it is dropped in a container page, and returnsfalseif this XML content should be indexed as 'stand-alone' document.protected booleanisInvalidateParent(String xpath) Returns the is-invalidate-parent flag for the given xpath.booleanisValueVisible(CmsObject cms, I_CmsXmlSchemaType value, String elementName, String params, CmsResource resource, Locale contentLocale) Returns the content field visibilty.booleanisVisible(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 StringReturns 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 voidremoveEmptyMappings(CmsObject cms, CmsFile file, CmsXmlContent content) Removes property values on resources for non-existing, optional elements.protected voidresolveDefaultMappings(CmsObject cms, CmsFile file, CmsXmlContent content) Resolves those mappings for which no content value exists and useDefault is set to true.voidresolveMapping(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 voidvalidateAppinfoElement(org.dom4j.Element appinfoElement) Validates if the givenappinfoelement node from the XML content definition schema is valid according the the capabilities of this content handler.protected CmsXmlContentErrorHandlervalidateCategories(CmsObject cms, I_CmsXmlContentValue value, CmsXmlContentErrorHandler errorHandler) The errorHandler parameter is optional, ifnullis given a new error handler instance must be created.protected booleanvalidateLink(CmsObject cms, I_CmsXmlContentValue value, CmsXmlContentErrorHandler errorHandler) Validates the given rules against the given value.protected CmsXmlContentErrorHandlervalidateValue(CmsObject cms, I_CmsXmlContentValue value, String valueStr, CmsXmlContentErrorHandler errorHandler, boolean isWarning) Checks the default XML schema validation rules.protected CmsXmlContentErrorHandlervalidateValue(CmsObject cms, I_CmsXmlContentValue value, CmsXmlContentErrorHandler errorHandler, Map<String, String> rules, boolean isWarning) Validates the given rules against the given value.protected CmsFilewriteCategories(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, waitMethods 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_CmsXmlContentHandlerWrites an availability date back to the content, if a mapping is defined for it.- Specified by:
applyReverseAvailabilityMappingin 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_CmsXmlContentHandlerChecks if an availability attribute should be written back to the content if the availability is changed through the availability dialog.- Specified by:
canUseReverseAvailabilityMappingin interfaceI_CmsXmlContentHandler- Parameters:
attr- the attribute to check- Returns:
- true if the attribute should be written to the content
- See Also:
-
clearMappings
We clear all potential property mappings.- Specified by:
clearMappingsin interfaceI_CmsXmlContentHandler- Parameters:
cms- the current OpenCms user contextcontent- the XML content to resolve the mappings for- Throws:
CmsException- if something goes wrong- 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_CmsXmlContentHandlerGets the list of allowed template context names.- Specified by:
getAllowedTemplatesin interfaceI_CmsXmlContentHandler- Returns:
- the list of allowed template context names
- See Also:
-
getChangeHandlerConfigs
Description copied from interface:I_CmsXmlContentHandlerGets the list of change handler configurations.- Specified by:
getChangeHandlerConfigsin interfaceI_CmsXmlContentHandler- Returns:
- the list of change handler configurations
- See Also:
-
getComplexWidget
Description copied from interface:I_CmsXmlContentHandlerGets the unconfigured complex widget defined for the given path.- Specified by:
getComplexWidgetin interfaceI_CmsXmlContentHandler- Parameters:
cms- the CMS contextpath- the value path- Returns:
- the complex widget
- See Also:
-
getConfiguration
Description copied from interface:I_CmsXmlContentHandlerReturns 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:
getConfigurationin 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_CmsXmlContentHandlerGets the widget configuration for the given sub-path.- Specified by:
getConfigurationin 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_CmsXmlContentHandlerGets the configured display type for a given path.- Specified by:
getConfiguredDisplayTypein 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_CmsXmlContentHandlerReturns the resource-independent CSS resources to include into the html-page head.- Specified by:
getCSSHeadIncludesin interfaceI_CmsXmlContentHandler- Returns:
- the CSS resources to include into the html-page head
- See Also:
-
getCSSHeadIncludes
Description copied from interface:I_CmsXmlContentHandlerReturns all the CSS resources to include into the html-page head.- Specified by:
getCSSHeadIncludesin 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_CmsXmlContentHandlerReturns 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:
getDefaultin 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_CmsXmlContentHandlerReturns 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:
getDefaultin 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_CmsXmlContentHandlerGets the default complex widget to be used for this type.- Specified by:
getDefaultComplexWidgetin interfaceI_CmsXmlContentHandler- Returns:
- the default complex widget for this type
- See Also:
-
getDefaultComplexWidgetClass
Description copied from interface:I_CmsXmlContentHandlerGets the default complex widget class name configured for this type.- Specified by:
getDefaultComplexWidgetClassin interfaceI_CmsXmlContentHandler- Returns:
- the default complex widget class name
- See Also:
-
getDefaultComplexWidgetConfiguration
Description copied from interface:I_CmsXmlContentHandlerGets the default complex widget configuration string configured for this type.- Specified by:
getDefaultComplexWidgetConfigurationin interfaceI_CmsXmlContentHandler- Returns:
- the default complex widget configuration string
- See Also:
-
getDisplayType
Description copied from interface:I_CmsXmlContentHandlerReturns if the widget for this type should be displayed in compact view.- Specified by:
getDisplayTypein 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:
getEditHandlerin interfaceI_CmsXmlContentHandler- Returns:
- the edit handler
-
getEditorChangeHandlers
Description copied from interface:I_CmsXmlContentHandlerReturns the editor change handlers.- Specified by:
getEditorChangeHandlersin 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_CmsXmlContentHandlerReturns the container page element formatter configuration for a given resource.- Specified by:
getFormatterConfigurationin 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:
getGeoMappingConfigurationin interfaceI_CmsXmlContentHandler- Returns:
- the geo mapping configuration
-
getInvalidRelationAction
Description copied from interface:I_CmsXmlContentHandlerGets 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:
getInvalidRelationActionin interfaceI_CmsXmlContentHandler- Parameters:
name- the field name- Returns:
- the action
- See Also:
-
getJSHeadIncludes
Description copied from interface:I_CmsXmlContentHandlerReturns the resource-independent javascript resources to include into the html-page head.- Specified by:
getJSHeadIncludesin interfaceI_CmsXmlContentHandler- Returns:
- the javascript resources to include into the html-page head
- See Also:
-
getJSHeadIncludes
Description copied from interface:I_CmsXmlContentHandlerReturns all the javascript resources to include into the html-page head.- Specified by:
getJSHeadIncludesin 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_CmsXmlContentHandlerGets the JSON renderer settings.- Specified by:
getJsonRendererSettingsin interfaceI_CmsXmlContentHandler- Returns:
- the JSON renderer settings
- See Also:
-
getMappings
Description copied from interface:I_CmsXmlContentHandlerGets the mappings defined in the schema.- Specified by:
getMappingsin interfaceI_CmsXmlContentHandler- Returns:
- the mappings
- See Also:
-
getMappings
Returns the all mappings defined for the given element xpath.- Specified by:
getMappingsin 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_CmsXmlContentHandlerGets the message key fallback handler.This is used to automatically provide fallbacks for missing message keys in the editor.
- Specified by:
getMessageKeyHandlerin interfaceI_CmsXmlContentHandler- Returns:
- the message key fallback handler
- See Also:
-
getMessages
Description copied from interface:I_CmsXmlContentHandlerReturns theCmsMessagesthat 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:
getMessagesin interfaceI_CmsXmlContentHandler- Parameters:
locale- the locale to get the messages for- Returns:
- the
CmsMessagesthat are used to resolve localized keys for the given locale in this content handler - See Also:
-
getModelFolder
Description copied from interface:I_CmsXmlContentHandlerReturns the folder name that contains eventual XML content model files to use for this resource type.- Specified by:
getModelFolderin 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_CmsXmlContentHandlerReturns the nested formatters for the given resource.- Specified by:
getNestedFormattersin 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_CmsXmlContentHandlerGets the parameter with the given name..- Specified by:
getParameterin 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_CmsXmlContentHandlerReturns the preview URI for the given XML content value object to be displayed in the editor.If
nullis returned, no preview is possible for contents using this handler.- Specified by:
getPreviewin 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_CmsXmlContentHandlerReturns the relation type for the given value.- Specified by:
getRelationTypein 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_CmsXmlContentHandlerReturns the relation type for the given path.- Specified by:
getRelationTypein 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_CmsXmlContentHandlerReturns the relation type for the given path.- Specified by:
getRelationTypein 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:
-
getSearchContentConfig
public I_CmsXmlContentValue.CmsSearchContentConfig getSearchContentConfig(I_CmsXmlContentValue value) Description copied from interface:I_CmsXmlContentHandlerReturns the search content configuration, 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. And additionally it is possible to adjust the value by a custom adjustment implementation before it is added.
- Specified by:
getSearchContentConfigin 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_CmsXmlContentHandlerReturns all configured Search fields for this XML content.- Specified by:
getSearchFieldsin interfaceI_CmsXmlContentHandler- Returns:
- the Search fields for this XMl content
- See Also:
-
getSearchFieldsForPage
Description copied from interface:I_CmsXmlContentHandlerReturns all configured Search fields for this XML content that should be attached to container pages the content is placed on.- Specified by:
getSearchFieldsForPagein interfaceI_CmsXmlContentHandler- Returns:
- the Search fields for this XMl content
- See Also:
-
getSearchSettings
Description copied from interface:I_CmsXmlContentHandlerReturns 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:
getSearchSettingsin interfaceI_CmsXmlContentHandler- Returns:
- the search field settings for this XML content schema
- See Also:
-
getSettings
Description copied from interface:I_CmsXmlContentHandlerReturns the element settings defined for the container page formatters.- Specified by:
getSettingsin 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_CmsXmlContentHandlerReturns the configuration for elements that require a synchronization across all locales.- Specified by:
getSynchronizationsin 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_CmsXmlContentHandlerReturns the tabs to be displayed in the editor.- Specified by:
getTabsin interfaceI_CmsXmlContentHandler- Returns:
- the tabs to be displayed in the editor
- See Also:
-
getTitleMapping
Description copied from interface:I_CmsXmlContentHandlerReturns the "Title" mapping set for the given XML content document in the given Locale.- Specified by:
getTitleMappingin 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_CmsXmlContentHandlerGets 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:
getVersionTransformationin 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_CmsXmlContentHandlerGets the widget for the given path and CMS context.- Specified by:
getWidgetin 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_CmsXmlContentHandlerReturns 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:
getWidgetin 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_CmsXmlContentHandlerReturns true if the contents for this content handler have schema-based formatters which can be disabled or enabled.- Specified by:
hasModifiableFormattersin 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_CmsXmlContentHandlerReturns whether there are nested formatters configured for this content type.- Specified by:
hasNestedFormattersin interfaceI_CmsXmlContentHandler- Returns:
trueif there are nested formatters configured for this content type- See Also:
-
hasSynchronizedElements
Description copied from interface:I_CmsXmlContentHandlerReturns if there are locale synchronized elements configured.- Specified by:
hasSynchronizedElementsin interfaceI_CmsXmlContentHandler- Returns:
trueif there are locale synchronized elements configured- See Also:
-
hasVisibilityHandlers
Description copied from interface:I_CmsXmlContentHandlerReturns if there are visibility handlers configured for this content type.- Specified by:
hasVisibilityHandlersin interfaceI_CmsXmlContentHandler- Returns:
trueif 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_CmsXmlContentHandlerInitializes this content handler for the given XML content definition by analyzing the "appinfo" node.- Specified by:
initializein 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_CmsXmlContentHandlerPerforms 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:
invalidateBrokenLinksin 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:
isAcaciaEditorDisabledin interfaceI_CmsXmlContentHandler- Returns:
- true if the acacia editor is disabled
-
isContainerPageOnly
Description copied from interface:I_CmsXmlContentHandlerReturnstrueif the XML content should be indexed when it is dropped in a container page, and returnsfalseif 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:
isContainerPageOnlyin 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:
isValueVisiblein 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:
trueif 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_CmsXmlContentHandlerReturns if the given content field should be visible to the current user.- Specified by:
isVisiblein interfaceI_CmsXmlContentHandler- Parameters:
cms- the cms contextcontentValue- the content value typevaluePath- the value pathresource- the edited resourcecontentLocale- the content locale- Returns:
trueif the given content field should be visible to the current user- See Also:
-
prepareForUse
Description copied from interface:I_CmsXmlContentHandlerPrepares 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:
prepareForUsein 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_CmsXmlContentHandlerPrepares 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:
prepareForWritein 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_CmsXmlContentHandlerResolves the value mappings of the given XML content value, according to the rules of this XML content handler.- Specified by:
resolveMappingin 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_CmsXmlContentHandlerPerforms 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
nullis given a new error handler instance must be created.- Specified by:
resolveValidationin 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 /trueornode, 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.CmsSearchContentConfig 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
CmsXmlStringValuethe default widget is theCmsInputWidget. However, certain values can also use more then one widget, for example you may also use aCmsCheckboxWidgetfor 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
widgetattribute. You can specify either a valid widget alias such asStringWidget, or the name of a Java class that implements.I_CmsWidgetConfiguration options to the widget can be passed using the
configurationattribute. 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- iftruewe 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 givenappinfoelement node from the XML content definition schema is valid according the the capabilities of this content handler.- Parameters:
appinfoElement- theappinfoelement 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, ifnullis 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
-