Interface I_CmsXmlContentHandler
-
- All Known Implementing Classes:
CmsCategoryXmlContentHandler
,CmsDefaultXmlContentHandler
,CmsHtmlRedirectHandler
,CmsListConfigContentHandler
,CmsXmlContainerPageHandler
,CmsXmlDynamicFunctionHandler
,CmsXmlGroupContainerHandler
,CmsXmlInheritGroupContainerHandler
public interface I_CmsXmlContentHandler
Handles special XML content livetime events, and also provides XML content editor rendering hints.- Since:
- 6.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
I_CmsXmlContentHandler.DisplayType
The available display types for element widgets.static class
I_CmsXmlContentHandler.JsonRendererSettings
Settings for a JSON renderer.static class
I_CmsXmlContentHandler.MappingType
The available mapping types.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ATTRIBUTE_DATEEXPIRED
Mapping name for the 'date expired' mapping.static java.lang.String
ATTRIBUTE_DATERELEASED
Mapping name for the 'date released' mapping.static java.util.List<java.lang.String>
ATTRIBUTES
List of all allowed attribute mapping names, for fast lookup.static java.lang.String
MAPTO_ATTRIBUTE
Prefix for attribute mappings.static java.lang.String
MAPTO_PERMISSION
Prefix for permission mappings.static java.lang.String
MAPTO_PROPERTY
Prefix for property mappings.static java.lang.String
MAPTO_PROPERTY_INDIVIDUAL
Prefix for property mappings.static java.lang.String
MAPTO_PROPERTY_LIST
Prefix for property list mappings.static java.lang.String
MAPTO_PROPERTY_LIST_INDIVIDUAL
Prefix for property list mappings.static java.lang.String
MAPTO_PROPERTY_LIST_SHARED
Prefix for property list mappings.static java.lang.String
MAPTO_PROPERTY_SHARED
Prefix for property mappings.static java.lang.String
MAPTO_URLNAME
Prefix for URL name mappings.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description boolean
applyReverseAvailabilityMapping(CmsObject cms, CmsXmlContent content, CmsMappingResolutionContext.AttributeType attr, java.util.List<java.util.Locale> locales, long value)
Writes an availability date back to the content, if a mapping is defined for it.boolean
canUseReverseAvailabilityMapping(CmsMappingResolutionContext.AttributeType attr)
Checks if an availability attribute should be written back to the content if the availability is changed through the availability dialog.CmsDefaultSet<java.lang.String>
getAllowedTemplates()
Gets the list of allowed template context names.java.util.List<CmsChangeHandlerConfig>
getChangeHandlerConfigs()
Gets the list of change handler configurations.I_CmsComplexWidget
getComplexWidget(CmsObject cms, java.lang.String path)
Gets the unconfigured complex widget defined for the given path.java.lang.String
getConfiguration(java.lang.String remainingPath)
Gets the widget configuration for the given sub-path.java.lang.String
getConfiguration(I_CmsXmlSchemaType type)
Returns the configuration String value for the widget used to edit the given XML content schema type.I_CmsXmlContentHandler.DisplayType
getConfiguredDisplayType(java.lang.String path, I_CmsXmlContentHandler.DisplayType defaultVal)
Gets the configured display type for a given path.java.util.Set<java.lang.String>
getCSSHeadIncludes()
Returns the resource-independent CSS resources to include into the html-page head.java.util.Set<java.lang.String>
getCSSHeadIncludes(CmsObject cms, CmsResource resource)
Returns all the CSS resources to include into the html-page head.java.lang.String
getDefault(CmsObject cms, CmsResource resource, I_CmsXmlSchemaType type, java.lang.String path, java.util.Locale locale)
Returns the default String value for the given XML content schema type object in the given XML content.java.lang.String
getDefault(CmsObject cms, I_CmsXmlContentValue value, java.util.Locale locale)
Returns the default String value for the given XML content schema type object in the given XML content.I_CmsComplexWidget
getDefaultComplexWidget()
Gets the default complex widget to be used for this type.java.lang.String
getDefaultComplexWidgetClass()
Gets the default complex widget class name configured for this type.java.lang.String
getDefaultComplexWidgetConfiguration()
Gets the default complex widget configuration string configured for this type.I_CmsXmlContentHandler.DisplayType
getDisplayType(I_CmsXmlSchemaType type)
Returns if the widget for this type should be displayed in compact view.I_CmsEditHandler
getEditHandler()
Returns the edit handler if configured.java.util.List<I_CmsXmlContentEditorChangeHandler>
getEditorChangeHandlers(boolean selfOnly)
Returns the editor change handlers.CmsFormatterConfiguration
getFormatterConfiguration(CmsObject cms, CmsResource res)
Returns the container page element formatter configuration for a given resource.CmsGeoMappingConfiguration
getGeoMappingConfiguration()
Gets the geo-coordinate mapping configuration.default CmsDefaultXmlContentHandler.InvalidRelationAction
getInvalidRelationAction(java.lang.String name)
Gets the action to perform if the given name refers to a link field which refers to a VFS file that no longer exists.java.util.Set<java.lang.String>
getJSHeadIncludes()
Returns the resource-independent javascript resources to include into the html-page head.java.util.Set<java.lang.String>
getJSHeadIncludes(CmsObject cms, CmsResource resource)
Returns all the javascript resources to include into the html-page head.I_CmsXmlContentHandler.JsonRendererSettings
getJsonRendererSettings()
Gets the JSON renderer settings.java.util.Map<java.lang.String,java.util.List<java.lang.String>>
getMappings()
Gets the mappings defined in the schema.java.util.List<java.lang.String>
getMappings(java.lang.String elementName)
Returns the all mappings defined for the given element xpath.CmsMultiMessages.I_KeyFallbackHandler
getMessageKeyHandler()
Gets the message key fallback handler.CmsMessages
getMessages(java.util.Locale locale)
Returns theCmsMessages
that are used to resolve localized keys for the given locale in this content handler.java.lang.String
getModelFolder()
Returns the folder name that contains eventual XML content model files to use for this resource type.java.util.List<java.lang.String>
getNestedFormatters(CmsObject cms, CmsResource res, java.util.Locale locale, javax.servlet.ServletRequest req)
Returns the nested formatters for the given resource.java.lang.String
getParameter(java.lang.String param)
Gets the parameter with the given name..java.lang.String
getPreview(CmsObject cms, CmsXmlContent content, java.lang.String resourcename)
Returns the preview URI for the given XML content value object to be displayed in the editor.CmsRelationType
getRelationType(java.lang.String path)
Returns the relation type for the given path.CmsRelationType
getRelationType(java.lang.String xpath, CmsRelationType defaultType)
Returns the relation type for the given path.CmsRelationType
getRelationType(I_CmsXmlContentValue value)
Deprecated.usegetRelationType(String)
withI_CmsXmlContentValue.getPath()
insteadI_CmsXmlContentValue.SearchContentType
getSearchContentType(I_CmsXmlContentValue value)
Returns the search content type, ie., the way how to integrate the value into full text search.java.util.Set<CmsSearchField>
getSearchFields()
Returns all configured Search fields for this XML content.java.util.Set<CmsSearchField>
getSearchFieldsForPage()
Returns all configured Search fields for this XML content that should be attached to container pages the content is placed on.java.util.Map<java.lang.String,I_CmsXmlContentValue.SearchContentType>
getSearchSettings()
Returns the search content settings defined in the annotation node of this XML content.java.util.Map<java.lang.String,CmsXmlContentProperty>
getSettings(CmsObject cms, CmsResource resource)
Returns the element settings defined for the container page formatters.java.util.List<java.lang.String>
getSynchronizations()
Returns the elements that require a synchronization across all locales.java.util.List<CmsXmlContentTab>
getTabs()
Returns the tabs to be displayed in the editor.java.lang.String
getTitleMapping(CmsObject cms, CmsXmlContent document, java.util.Locale locale)
Returns the "Title" mapping set for the given XML content document in the given Locale.java.lang.String
getVersionTransformation()
Gets the version transformation VFS path.I_CmsWidget
getWidget(CmsObject cms, java.lang.String path)
Gets the widget for the given path and CMS context.I_CmsWidget
getWidget(I_CmsXmlSchemaType value)
Deprecated.boolean
hasModifiableFormatters()
Returns true if the contents for this content handler have schema-based formatters which can be disabled or enabled.boolean
hasNestedFormatters()
Returns whether there are nested formatters configured for this content type.boolean
hasSynchronizedElements()
Returns if there are locale synchronized elements configured.boolean
hasVisibilityHandlers()
Returns if there are visibility handlers configured for this content type.void
initialize(org.dom4j.Element appInfoElement, CmsXmlContentDefinition contentDefinition)
Initializes this content handler for the given XML content definition by analyzing the "appinfo" node.void
invalidateBrokenLinks(CmsObject cms, CmsXmlContent document)
Performs a check of the given XML document.boolean
isAcaciaEditorDisabled()
Checks whether the Acacia editor is disabled for this type.boolean
isContainerPageOnly()
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.default boolean
isSearchable(I_CmsXmlContentValue value)
Deprecated.usegetSearchContentType(I_CmsXmlContentValue)
instead.boolean
isVisible(CmsObject cms, I_CmsXmlSchemaType schemaType, java.lang.String valuePath, CmsResource resource, java.util.Locale contentLocale)
Returns if the given content field should be visible to the current user.CmsXmlContent
prepareForUse(CmsObject cms, CmsXmlContent content)
Prepares the given XML content to be used after it was read from the OpenCms VFS.CmsFile
prepareForWrite(CmsObject cms, CmsXmlContent content, CmsFile file)
Prepares the given XML content to be written to the OpenCms VFS.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.CmsXmlContentErrorHandler
resolveValidation(CmsObject cms, I_CmsXmlContentValue value, CmsXmlContentErrorHandler errorHandler)
Performs a validation of the given XML content value, and saves all errors or warnings found in the provided XML content error handler.
-
-
-
Field Detail
-
ATTRIBUTE_DATEEXPIRED
static final java.lang.String ATTRIBUTE_DATEEXPIRED
Mapping name for the 'date expired' mapping.- See Also:
- Constant Field Values
-
ATTRIBUTE_DATERELEASED
static final java.lang.String ATTRIBUTE_DATERELEASED
Mapping name for the 'date released' mapping.- See Also:
- Constant Field Values
-
ATTRIBUTES
static final java.util.List<java.lang.String> ATTRIBUTES
List of all allowed attribute mapping names, for fast lookup.
-
MAPTO_ATTRIBUTE
static final java.lang.String MAPTO_ATTRIBUTE
Prefix for attribute mappings.- See Also:
- Constant Field Values
-
MAPTO_PERMISSION
static final java.lang.String MAPTO_PERMISSION
Prefix for permission mappings.- See Also:
- Constant Field Values
-
MAPTO_PROPERTY
static final java.lang.String MAPTO_PROPERTY
Prefix for property mappings.- See Also:
- Constant Field Values
-
MAPTO_PROPERTY_INDIVIDUAL
static final java.lang.String MAPTO_PROPERTY_INDIVIDUAL
Prefix for property mappings.- See Also:
- Constant Field Values
-
MAPTO_PROPERTY_LIST
static final java.lang.String MAPTO_PROPERTY_LIST
Prefix for property list mappings.- See Also:
- Constant Field Values
-
MAPTO_PROPERTY_LIST_INDIVIDUAL
static final java.lang.String MAPTO_PROPERTY_LIST_INDIVIDUAL
Prefix for property list mappings.- See Also:
- Constant Field Values
-
MAPTO_PROPERTY_LIST_SHARED
static final java.lang.String MAPTO_PROPERTY_LIST_SHARED
Prefix for property list mappings.- See Also:
- Constant Field Values
-
MAPTO_PROPERTY_SHARED
static final java.lang.String MAPTO_PROPERTY_SHARED
Prefix for property mappings.- See Also:
- Constant Field Values
-
MAPTO_URLNAME
static final java.lang.String MAPTO_URLNAME
Prefix for URL name mappings.- See Also:
- Constant Field Values
-
-
Method Detail
-
applyReverseAvailabilityMapping
boolean applyReverseAvailabilityMapping(CmsObject cms, CmsXmlContent content, CmsMappingResolutionContext.AttributeType attr, java.util.List<java.util.Locale> locales, long value) throws CmsException
Writes an availability date back to the content, if a mapping is defined for it.- Parameters:
cms
- the CMS contextcontent
- the content to write toattr
- the attribute to writelocales
- the locales of the resourcevalue
- the value to write- Throws:
CmsException
- if something goes wrong
-
canUseReverseAvailabilityMapping
boolean canUseReverseAvailabilityMapping(CmsMappingResolutionContext.AttributeType attr)
Checks if an availability attribute should be written back to the content if the availability is changed through the availability dialog.- Parameters:
attr
- the attribute to check- Returns:
- true if the attribute should be written to the content
-
getAllowedTemplates
CmsDefaultSet<java.lang.String> getAllowedTemplates()
Gets the list of allowed template context names.- Returns:
- the list of allowed template context names
-
getChangeHandlerConfigs
java.util.List<CmsChangeHandlerConfig> getChangeHandlerConfigs()
Gets the list of change handler configurations.- Returns:
- the list of change handler configurations
-
getComplexWidget
I_CmsComplexWidget getComplexWidget(CmsObject cms, java.lang.String path)
Gets the unconfigured complex widget defined for the given path.- Parameters:
cms
- the CMS contextpath
- the value path- Returns:
- the complex widget
-
getConfiguration
java.lang.String getConfiguration(I_CmsXmlSchemaType type)
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
.- 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
-
getConfiguration
java.lang.String getConfiguration(java.lang.String remainingPath)
Gets the widget configuration for the given sub-path.- Parameters:
remainingPath
- a sub-path- Returns:
- the widget configuration for the given sub-path
-
getConfiguredDisplayType
I_CmsXmlContentHandler.DisplayType getConfiguredDisplayType(java.lang.String path, I_CmsXmlContentHandler.DisplayType defaultVal)
Gets the configured display type for a given path.- Parameters:
path
- the pathdefaultVal
- the value to return if no configured display type is found- Returns:
- the configured display type (or the default value)
-
getCSSHeadIncludes
java.util.Set<java.lang.String> getCSSHeadIncludes()
Returns the resource-independent CSS resources to include into the html-page head.- Returns:
- the CSS resources to include into the html-page head
-
getCSSHeadIncludes
java.util.Set<java.lang.String> getCSSHeadIncludes(CmsObject cms, CmsResource resource) throws CmsException
Returns all the CSS resources to include into the html-page head.- 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
-
getDefault
java.lang.String getDefault(CmsObject cms, CmsResource resource, I_CmsXmlSchemaType type, java.lang.String path, java.util.Locale locale)
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
.- 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:
I_CmsXmlSchemaType.getDefault(Locale)
-
getDefault
java.lang.String getDefault(CmsObject cms, I_CmsXmlContentValue value, java.util.Locale locale)
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
.- 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:
I_CmsXmlSchemaType.getDefault(Locale)
-
getDefaultComplexWidget
I_CmsComplexWidget getDefaultComplexWidget()
Gets the default complex widget to be used for this type.- Returns:
- the default complex widget for this type
-
getDefaultComplexWidgetClass
java.lang.String getDefaultComplexWidgetClass()
Gets the default complex widget class name configured for this type.- Returns:
- the default complex widget class name
-
getDefaultComplexWidgetConfiguration
java.lang.String getDefaultComplexWidgetConfiguration()
Gets the default complex widget configuration string configured for this type.- Returns:
- the default complex widget configuration string
-
getDisplayType
I_CmsXmlContentHandler.DisplayType getDisplayType(I_CmsXmlSchemaType type)
Returns if the widget for this type should be displayed in compact view.- Parameters:
type
- the value to check the view mode for- Returns:
- the widgets display type
-
getEditHandler
I_CmsEditHandler getEditHandler()
Returns the edit handler if configured.- Returns:
- the edit handler
-
getEditorChangeHandlers
java.util.List<I_CmsXmlContentEditorChangeHandler> getEditorChangeHandlers(boolean selfOnly)
Returns the editor change handlers.- Parameters:
selfOnly
- if true, only return editor change handlers configured directly for this content handler- Returns:
- the editor change handlers
-
getFormatterConfiguration
CmsFormatterConfiguration getFormatterConfiguration(CmsObject cms, CmsResource res)
Returns the container page element formatter configuration for a given resource.- Parameters:
cms
- the current users OpenCms context, used for selecting the right projectres
- the resource for which the formatter configuration should be retrieved- Returns:
- the container page element formatter configuration for this handler
-
getGeoMappingConfiguration
CmsGeoMappingConfiguration getGeoMappingConfiguration()
Gets the geo-coordinate mapping configuration.- Returns:
- the geo-coordinate mapping configuration
-
getInvalidRelationAction
default CmsDefaultXmlContentHandler.InvalidRelationAction getInvalidRelationAction(java.lang.String name)
Gets the action to perform if the given name refers to a link field which refers to a VFS file that no longer exists.- Parameters:
name
- the field name- Returns:
- the action
-
getJSHeadIncludes
java.util.Set<java.lang.String> getJSHeadIncludes()
Returns the resource-independent javascript resources to include into the html-page head.- Returns:
- the javascript resources to include into the html-page head
-
getJSHeadIncludes
java.util.Set<java.lang.String> getJSHeadIncludes(CmsObject cms, CmsResource resource) throws CmsException
Returns all the javascript resources to include into the html-page head.- 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
-
getJsonRendererSettings
I_CmsXmlContentHandler.JsonRendererSettings getJsonRendererSettings()
Gets the JSON renderer settings.- Returns:
- the JSON renderer settings
-
getMappings
java.util.Map<java.lang.String,java.util.List<java.lang.String>> getMappings()
Gets the mappings defined in the schema.- Returns:
- the mappings
-
getMappings
java.util.List<java.lang.String> getMappings(java.lang.String elementName)
Returns the all mappings defined for the given element xpath.- Parameters:
elementName
- the element xpath to look up the mapping for- Returns:
- the mapping defined for the given element xpath
-
getMessageKeyHandler
CmsMultiMessages.I_KeyFallbackHandler getMessageKeyHandler()
Gets the message key fallback handler.This is used to automatically provide fallbacks for missing message keys in the editor.
- Returns:
- the message key fallback handler
-
getMessages
CmsMessages getMessages(java.util.Locale locale)
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
.- 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
-
getModelFolder
java.lang.String getModelFolder()
Returns the folder name that contains eventual XML content model files to use for this resource type.- Returns:
- the folder name containing eventual XML content master files
-
getNestedFormatters
java.util.List<java.lang.String> getNestedFormatters(CmsObject cms, CmsResource res, java.util.Locale locale, javax.servlet.ServletRequest req)
Returns the nested formatters for the given resource.- Parameters:
cms
- the cms contextres
- the resourcelocale
- the content localereq
- the request if available- Returns:
- the nested formatter ids
-
getParameter
java.lang.String getParameter(java.lang.String param)
Gets the parameter with the given name..- Parameters:
param
- the parameter name- Returns:
- the parameter value
-
getPreview
java.lang.String getPreview(CmsObject cms, CmsXmlContent content, java.lang.String resourcename)
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.- 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
-
getRelationType
@Deprecated CmsRelationType getRelationType(I_CmsXmlContentValue value)
Deprecated.usegetRelationType(String)
withI_CmsXmlContentValue.getPath()
insteadReturns the relation type for the given value.- Parameters:
value
- the value to get the relation type for- Returns:
- the relation type for the given value
-
getRelationType
CmsRelationType getRelationType(java.lang.String path)
Returns the relation type for the given path.- Parameters:
path
- the path to get the relation type for- Returns:
- the relation type for the given path
-
getRelationType
CmsRelationType getRelationType(java.lang.String xpath, CmsRelationType defaultType)
Returns the relation type for the given path.- 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
-
getSearchContentType
I_CmsXmlContentValue.SearchContentType getSearchContentType(I_CmsXmlContentValue value)
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.
- 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
-
getSearchFields
java.util.Set<CmsSearchField> getSearchFields()
Returns all configured Search fields for this XML content.- Returns:
- the Search fields for this XMl content
-
getSearchFieldsForPage
java.util.Set<CmsSearchField> getSearchFieldsForPage()
Returns all configured Search fields for this XML content that should be attached to container pages the content is placed on.- Returns:
- the Search fields for this XMl content
-
getSearchSettings
java.util.Map<java.lang.String,I_CmsXmlContentValue.SearchContentType> getSearchSettings()
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.
- Returns:
- the search field settings for this XML content schema
-
getSettings
java.util.Map<java.lang.String,CmsXmlContentProperty> getSettings(CmsObject cms, CmsResource resource)
Returns the element settings defined for the container page formatters.- 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
-
getSynchronizations
java.util.List<java.lang.String> getSynchronizations()
Returns the elements that require a synchronization across all locales.- Returns:
- the element paths
-
getTabs
java.util.List<CmsXmlContentTab> getTabs()
Returns the tabs to be displayed in the editor.- Returns:
- the tabs to be displayed in the editor
-
getTitleMapping
java.lang.String getTitleMapping(CmsObject cms, CmsXmlContent document, java.util.Locale locale)
Returns the "Title" mapping set for the given XML content document in the given Locale.- 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
-
getVersionTransformation
java.lang.String getVersionTransformation()
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.
- Returns:
- the VFS path to read an XSLT file for version transformation from
-
getWidget
I_CmsWidget getWidget(CmsObject cms, java.lang.String path)
Gets the widget for the given path and CMS context.- Parameters:
cms
- the current CMS contextpath
- the XML value path- Returns:
- the widget for the path
-
getWidget
@Deprecated I_CmsWidget getWidget(I_CmsXmlSchemaType value) throws CmsXmlException
Deprecated.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.
- 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
- Throws:
CmsXmlException
- if something goes wrong
-
hasModifiableFormatters
boolean hasModifiableFormatters()
Returns true if the contents for this content handler have schema-based formatters which can be disabled or enabled.- Returns:
- true if the contents for this content handler have schema-based formatters which can be disabled or enabled
-
hasNestedFormatters
boolean hasNestedFormatters()
Returns whether there are nested formatters configured for this content type.- Returns:
true
if there are nested formatters configured for this content type
-
hasSynchronizedElements
boolean hasSynchronizedElements()
Returns if there are locale synchronized elements configured.- Returns:
true
if there are locale synchronized elements configured
-
hasVisibilityHandlers
boolean hasVisibilityHandlers()
Returns if there are visibility handlers configured for this content type.- Returns:
true
if there are visibility handlers configured for this content type
-
initialize
void initialize(org.dom4j.Element appInfoElement, CmsXmlContentDefinition contentDefinition) throws CmsXmlException
Initializes this content handler for the given XML content definition by analyzing the "appinfo" node.- 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
-
invalidateBrokenLinks
void invalidateBrokenLinks(CmsObject cms, CmsXmlContent document)
Performs a check of the given XML document.The main difference to the
resolveValidation(CmsObject, I_CmsXmlContentValue, CmsXmlContentErrorHandler)
method is that this method may silently remove some values, for instance, for broken links.- Parameters:
cms
- the current OpenCms user contextdocument
- the document to resolve the check rules for
-
isAcaciaEditorDisabled
boolean isAcaciaEditorDisabled()
Checks whether the Acacia editor is disabled for this type.- Returns:
- true if the Acacia editor is disabled
-
isContainerPageOnly
boolean isContainerPageOnly()
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.- Returns:
- the container page only flag
-
isSearchable
@Deprecated default boolean isSearchable(I_CmsXmlContentValue value)
Deprecated.usegetSearchContentType(I_CmsXmlContentValue)
instead. Will be removed if plain lucene search is removed.Returnstrue
in case the given value should be searchable with the integrated 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.
- Parameters:
value
- the XML content value to check- Returns:
true
in case the given value should be searchable
-
isVisible
boolean isVisible(CmsObject cms, I_CmsXmlSchemaType schemaType, java.lang.String valuePath, CmsResource resource, java.util.Locale contentLocale)
Returns if the given content field should be visible to the current user.- Parameters:
cms
- the cms contextschemaType
- 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
-
prepareForUse
CmsXmlContent prepareForUse(CmsObject cms, CmsXmlContent content)
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.
- 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
-
prepareForWrite
CmsFile prepareForWrite(CmsObject cms, CmsXmlContent content, CmsFile file) throws CmsException
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.
- 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
-
resolveMapping
void resolveMapping(CmsObject cms, CmsXmlContent content, I_CmsXmlContentValue value) throws CmsException
Resolves the value mappings of the given XML content value, according to the rules of this XML content handler.- 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
-
resolveValidation
CmsXmlContentErrorHandler resolveValidation(CmsObject cms, I_CmsXmlContentValue value, CmsXmlContentErrorHandler errorHandler)
Performs a validation of the given XML content value, and saves all errors or warnings found in the provided XML content error handler.The errorHandler parameter is optional, if
null
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
-
-