|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface I_CmsXmlContentHandler
Handles special XML content livetime events, and also provides XML content editor rendering hints.
| Field Summary | |
|---|---|
static String[] |
ATTRIBUTE_ARRAY
Array of all allowed attribute mapping names. |
static List |
ATTRIBUTES
List of all allowed attribute mapping names, for fast lookup. |
static String |
MAPTO_ATTRIBUTE
Prefix for attribute mappings. |
static String |
MAPTO_PROPERTY
Prefix for property mappings. |
static String |
MAPTO_PROPERTY_LIST
Prefix for property list mappings. |
| Method Summary | |
|---|---|
String |
getConfiguration(I_CmsXmlSchemaType type)
Returns the configuration String value for the widget used to edit the given XML content schema type. |
String |
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. |
CmsMessages |
getMessages(Locale locale)
Returns the CmsMessages that are used to resolve localized keys
for the given locale in this content handler. |
String |
getPreview(CmsObject cms,
CmsXmlContent content,
String resourcename)
Returns the preview URI for the given XML content value object to be displayed in the editor. |
I_CmsWidget |
getWidget(I_CmsXmlContentValue value)
Returns the editor widget that should be used for the given XML content value. |
void |
initialize(Element appInfoElement,
CmsXmlContentDefinition contentDefinition)
Initializes this content handler for the given XML content definition by analyzing the "appinfo" node. |
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 |
|---|
static final String[] ATTRIBUTE_ARRAY
static final List ATTRIBUTES
static final String MAPTO_ATTRIBUTE
static final String MAPTO_PROPERTY
static final String MAPTO_PROPERTY_LIST
| Method Detail |
|---|
String getConfiguration(I_CmsXmlSchemaType type)
If no configuration value is available, this method must return null.
type - the value to get the widget configuration for
String getDefault(CmsObject cms,
I_CmsXmlContentValue value,
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 value
I_CmsXmlSchemaType.getDefault(Locale)CmsMessages getMessages(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 for
CmsMessages that are used to resolve localized keys
for the given locale in this content handler
String getPreview(CmsObject cms,
CmsXmlContent content,
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
I_CmsWidget getWidget(I_CmsXmlContentValue 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 for
CmsXmlException - if something goes wrong
void initialize(Element appInfoElement,
CmsXmlContentDefinition contentDefinition)
throws CmsXmlException
appInfoElement - the "appinfo" element root node to analyzecontentDefinition - the XML content definition that XML content handler belongs to
CmsXmlException - if something goes wrong
CmsFile prepareForWrite(CmsObject cms,
CmsXmlContent content,
CmsFile file)
throws CmsException
This method is alway 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 from
CmsException - in case something goes wrong
void 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 for
CmsException - if something goes wrong
CmsXmlContentErrorHandler 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
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||