public interface I_CmsXmlContentHandler
限定符和类型 | 接口和说明 |
---|---|
static class |
I_CmsXmlContentHandler.DisplayType
The available display types for element widgets.
|
限定符和类型 | 字段和说明 |
---|---|
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.
|
限定符和类型 | 方法和说明 |
---|---|
CmsDefaultSet<java.lang.String> |
getAllowedTemplates()
Gets the list of allowed template context names.
|
I_CmsComplexWidget |
getComplexWidget(I_CmsXmlSchemaType value)
Gets the complex widget for the given schema type.
|
java.lang.String |
getConfiguration(I_CmsXmlSchemaType type)
Returns the configuration String value for the widget used to edit the given XML content schema type.
|
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.
|
CmsFormatterConfiguration |
getFormatterConfiguration(CmsObject cms,
CmsResource res)
Returns the container page element formatter configuration for a given resource.
|
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.
|
java.util.List<java.lang.String> |
getMappings(java.lang.String elementName)
Returns the all mappings defined for the given element xpath.
|
CmsMessages |
getMessages(java.util.Locale locale)
Returns the
CmsMessages 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.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(I_CmsXmlContentValue value)
已过时。
use
getRelationType(String) with I_CmsXmlContentValue.getPath() instead |
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.
|
java.util.Set<CmsSearchField> |
getSearchFields()
Returns all configured Search fields for this XML content.
|
java.util.Map<java.lang.String,java.lang.Boolean> |
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<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.
|
I_CmsWidget |
getWidget(I_CmsXmlSchemaType value)
Returns the editor widget that should be used for the given XML content value.
|
boolean |
hasModifiableFormatters()
Returns true if the contents for this content handler have schema-based formatters which can be disabled or enabled.
|
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()
Returns
true if the XML content should be indexed when it is dropped in a container page,
and returns false if this XML content should be indexed as 'stand-alone' document. |
boolean |
isSearchable(I_CmsXmlContentValue value)
Returns
true in case the given value should be searchable with
the integrated full text search. |
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.
|
static final java.lang.String ATTRIBUTE_DATEEXPIRED
static final java.lang.String ATTRIBUTE_DATERELEASED
static final java.util.List<java.lang.String> ATTRIBUTES
static final java.lang.String MAPTO_ATTRIBUTE
static final java.lang.String MAPTO_PERMISSION
static final java.lang.String MAPTO_PROPERTY
static final java.lang.String MAPTO_PROPERTY_INDIVIDUAL
static final java.lang.String MAPTO_PROPERTY_LIST
static final java.lang.String MAPTO_PROPERTY_LIST_INDIVIDUAL
static final java.lang.String MAPTO_PROPERTY_LIST_SHARED
static final java.lang.String MAPTO_PROPERTY_SHARED
static final java.lang.String MAPTO_URLNAME
CmsDefaultSet<java.lang.String> getAllowedTemplates()
I_CmsComplexWidget getComplexWidget(I_CmsXmlSchemaType value)
value
- the schema type for which we want the complex widgetjava.lang.String getConfiguration(I_CmsXmlSchemaType type)
If no configuration value is available, this method must return null
.
type
- the value to get the widget configuration forjava.util.Set<java.lang.String> getCSSHeadIncludes()
java.util.Set<java.lang.String> getCSSHeadIncludes(CmsObject cms, CmsResource resource) throws CmsException
cms
- the current CMS contextresource
- the resource from which to get the head includesCmsException
- if something goes wrongjava.lang.String getDefault(CmsObject cms, CmsResource resource, I_CmsXmlSchemaType type, java.lang.String path, java.util.Locale locale)
If a schema type does not have a default value, this method must return null
.
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 valueI_CmsXmlSchemaType.getDefault(Locale)
java.lang.String getDefault(CmsObject cms, I_CmsXmlContentValue value, java.util.Locale locale)
If a schema type does not have a default value, this method must return null
.
cms
- the current users OpenCms contextvalue
- the value to get the default forlocale
- the currently selected locale for the valueI_CmsXmlSchemaType.getDefault(Locale)
I_CmsComplexWidget getDefaultComplexWidget()
java.lang.String getDefaultComplexWidgetClass()
java.lang.String getDefaultComplexWidgetConfiguration()
I_CmsXmlContentHandler.DisplayType getDisplayType(I_CmsXmlSchemaType type)
type
- the value to check the view mode forCmsFormatterConfiguration getFormatterConfiguration(CmsObject cms, CmsResource res)
cms
- the current users OpenCms context, used for selecting the right projectres
- the resource for which the formatter configuration should be retrievedjava.util.Set<java.lang.String> getJSHeadIncludes()
java.util.Set<java.lang.String> getJSHeadIncludes(CmsObject cms, CmsResource resource) throws CmsException
cms
- the current CMS contextresource
- the resource for which the head includes should be retrievedCmsException
- if something goes wrongjava.util.List<java.lang.String> getMappings(java.lang.String elementName)
elementName
- the element xpath to look up the mapping forCmsMessages getMessages(java.util.Locale locale)
CmsMessages
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
.
locale
- the locale to get the messages forCmsMessages
that are used to resolve localized keys
for the given locale in this content handlerjava.lang.String getModelFolder()
java.lang.String getPreview(CmsObject cms, CmsXmlContent content, java.lang.String resourcename)
If null
is returned, no preview is possible for contents using this handler.
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@Deprecated CmsRelationType getRelationType(I_CmsXmlContentValue value)
value
- the value to get the relation type forCmsRelationType getRelationType(java.lang.String path)
path
- the path to get the relation type forCmsRelationType getRelationType(java.lang.String xpath, CmsRelationType defaultType)
xpath
- the path to get the relation type fordefaultType
- the default type if none is setjava.util.Set<CmsSearchField> getSearchFields()
java.util.Map<java.lang.String,java.lang.Boolean> getSearchSettings()
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.
java.util.Map<java.lang.String,CmsXmlContentProperty> getSettings(CmsObject cms, CmsResource resource)
cms
- the current CMS contextresource
- the resource for which to get the setting definitionsjava.util.List<CmsXmlContentTab> getTabs()
java.lang.String getTitleMapping(CmsObject cms, CmsXmlContent document, java.util.Locale locale)
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 forI_CmsWidget getWidget(I_CmsXmlSchemaType value) throws CmsXmlException
The handler implementations should use the "appinfo" node of the XML content definition schema to define the mappings of elements to widgets.
value
- the XML content value to get the widget forCmsXmlException
- if something goes wrongboolean hasModifiableFormatters()
void initialize(org.dom4j.Element appInfoElement, CmsXmlContentDefinition contentDefinition) throws CmsXmlException
appInfoElement
- the "appinfo" element root node to analyzecontentDefinition
- the XML content definition that XML content handler belongs toCmsXmlException
- if something goes wrongvoid invalidateBrokenLinks(CmsObject cms, CmsXmlContent 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.
cms
- the current OpenCms user contextdocument
- the document to resolve the check rules forboolean isAcaciaEditorDisabled()
boolean isContainerPageOnly()
true
if the XML content should be indexed when it is dropped in a container page,
and returns false
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.
boolean isSearchable(I_CmsXmlContentValue value)
true
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.
value
- the XML content value to checktrue
in case the given value should be searchableCmsXmlContent prepareForUse(CmsObject cms, CmsXmlContent content)
This method is always called after any content is unmarshalled. It can be used to perform customized actions on the given XML content.
cms
- the current OpenCms user contextcontent
- the XML content to be used as read from the VFSCmsFile prepareForWrite(CmsObject cms, CmsXmlContent content, CmsFile file) throws CmsException
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.
cms
- the current OpenCms user contextcontent
- the XML content to be writtenfile
- the resource the XML content in it's current state was unmarshalled fromCmsException
- in case something goes wrongvoid resolveMapping(CmsObject cms, CmsXmlContent content, I_CmsXmlContentValue value) throws CmsException
cms
- the current OpenCms user contextcontent
- the XML content to resolve the mappings forvalue
- the value to resolve the mappings forCmsException
- if something goes wrongCmsXmlContentErrorHandler resolveValidation(CmsObject cms, I_CmsXmlContentValue value, CmsXmlContentErrorHandler errorHandler)
The errorHandler parameter is optional, if null
is given a new error handler
instance must be created.
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