Java Doc for CmsDefaultXmlContentHandler.java in  » Content-Management-System » opencms » org » opencms » xml » content » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Content Management System » opencms » org.opencms.xml.content 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.opencms.xml.content.CmsDefaultXmlContentHandler

All known Subclasses:   com.alkacon.opencms.registration.CmsProfileXmlContentHandler,  com.alkacon.opencms.registration.CmsRegistrationXmlContentHandler,  com.alkacon.opencms.newsletter.CmsNewsletterXmlContentHandler,  com.alkacon.opencms.feeder.CmsFeedXmlContentHandler,  org.opencms.frontend.templateone.modules.CmsLayoutXmlContentHandler,
CmsDefaultXmlContentHandler
public class CmsDefaultXmlContentHandler implements I_CmsXmlContentHandler(Code)
Default implementation for the XML content handler, will be used by all XML contents that do not provide their own handler.


author:
   Alexander Kandzior
author:
   Michael Moossen
version:
   $Revision: 1.58 $
since:
   6.0.0



Field Summary
final public static  StringAPPINFO_APPINFO
     Constant for the "appinfo" element name itself.
final public static  StringAPPINFO_ATTR_CONFIGURATION
     Constant for the "configuration" appinfo attribute name.
final public static  StringAPPINFO_ATTR_ELEMENT
     Constant for the "element" appinfo attribute name.
final public static  StringAPPINFO_ATTR_INVALIDATE
     Constant for the "invalidate" appinfo attribute name.
final public static  StringAPPINFO_ATTR_MAPTO
     Constant for the "mapto" appinfo attribute name.
final public static  StringAPPINFO_ATTR_MESSAGE
     Constant for the "message" appinfo attribute name.
final public static  StringAPPINFO_ATTR_NAME
     Constant for the "name" appinfo attribute name.
final public static  StringAPPINFO_ATTR_REGEX
     Constant for the "regex" appinfo attribute name.
final public static  StringAPPINFO_ATTR_SEARCHCONTENT
     Constant for the "searchcontent" appinfo attribute name.
final public static  StringAPPINFO_ATTR_TYPE
     Constant for the "type" appinfo attribute name.
final public static  StringAPPINFO_ATTR_TYPE_NODE
     Constant for the "node" appinfo attribute value.
final public static  StringAPPINFO_ATTR_TYPE_PARENT
     Constant for the "parent" appinfo attribute value.
final public static  StringAPPINFO_ATTR_TYPE_WARNING
     Constant for the "warning" appinfo attribute value.
final public static  StringAPPINFO_ATTR_URI
     Constant for the "uri" appinfo attribute name.
final public static  StringAPPINFO_ATTR_VALUE
     Constant for the "value" appinfo attribute name.
final public static  StringAPPINFO_ATTR_WIDGET
     Constant for the "widget" appinfo attribute name.
final public static  StringAPPINFO_DEFAULT
     Constant for the "default" appinfo element name.
final public static  StringAPPINFO_DEFAULTS
     Constant for the "defaults" appinfo element name.
final public static  StringAPPINFO_LAYOUT
     Constant for the "layout" appinfo element name.
final public static  StringAPPINFO_LAYOUTS
     Constant for the "layouts" appinfo element name.
final public static  StringAPPINFO_MAPPING
     Constant for the "mapping" appinfo element name.
final public static  StringAPPINFO_MAPPINGS
     Constant for the "mappings" appinfo element name.
final public static  StringAPPINFO_MODELFOLDER
     Constant for the "modelfolder" appinfo element name.
final public static  StringAPPINFO_PREVIEW
     Constant for the "preview" appinfo element name.
final public static  StringAPPINFO_RELATION
     Constant for the "relation" appinfo element name.
final public static  StringAPPINFO_RELATIONS
     Constant for the "relations" appinfo element name.
final public static  StringAPPINFO_RESOURCEBUNDLE
     Constant for the "searchexclusions" appinfo element name.
final public static  StringAPPINFO_RULE
     Constant for the "rule" appinfo element name.
final public static  StringAPPINFO_SCHEMA_FILE
     The file where the default appinfo schema is located.
final public static  StringAPPINFO_SCHEMA_FILE_TYPES
     The file where the default appinfo schema types are located.
final public static  StringAPPINFO_SCHEMA_SYSTEM_ID
     The XML system id for the default appinfo schema types.
final public static  StringAPPINFO_SCHEMA_TYPES_SYSTEM_ID
     The XML system id for the default appinfo schema types.
final public static  StringAPPINFO_SEARCHSETTING
     Constant for the "searchsetting" appinfo element name.
final public static  StringAPPINFO_SEARCHSETTINGS
     Constant for the "searchsettings" appinfo element name.
final public static  StringAPPINFO_VALIDATIONRULE
     Constant for the "validationrule" appinfo element name.
final public static  StringAPPINFO_VALIDATIONRULES
     Constant for the "validationrules" appinfo element name.
final public static  StringMACRO_PREVIEW_TEMPFILE
     Macro for resolving the preview URI.
final protected static  StringMESSAGE_VALIDATION_DEFAULT_ERROR
     Default message for validation errors.
final protected static  StringMESSAGE_VALIDATION_DEFAULT_WARNING
     Default message for validation warnings.
protected  Mapm_configurationValues
     The configuration values for the element widgets (as defined in the annotations).
protected  Mapm_defaultValues
     The default values for the elements (as defined in the annotations).
protected  Mapm_elementMappings
     The element mappings (as defined in the annotations).
protected  Mapm_elementWidgets
     The widgets used for the elements (as defined in the annotations).
protected  Stringm_messageBundleName
     The resource bundle name to be used for localization of this content handler.
protected  Stringm_modelFolder
     The folder containing the model file(s) for the content.
protected  Stringm_previewLocation
     The preview location (as defined in the annotations).
protected  Mapm_relations
     The relation check rules.
protected  Mapm_searchSettings
     The search settings.
protected  Mapm_validationErrorMessages
     The messages for the error validation rules.
protected  Mapm_validationErrorRules
     The validation rules that cause an error (as defined in the annotations).
protected  Mapm_validationWarningMessages
     The messages for the warning validation rules.
protected  Mapm_validationWarningRules
     The validation rules that cause a warning (as defined in the annotations).

Constructor Summary
public  CmsDefaultXmlContentHandler()
    

Method Summary
protected  voidaddCheckRule(CmsXmlContentDefinition contentDefinition, String elementName, String invalidate, String type)
    
protected  voidaddConfiguration(CmsXmlContentDefinition contentDefinition, String elementName, String configurationValue)
    
protected  voidaddDefault(CmsXmlContentDefinition contentDefinition, String elementName, String defaultValue)
    
protected  voidaddDefaultCheckRules(CmsXmlContentDefinition rootContentDefinition, I_CmsXmlSchemaType schemaType, String elementPath)
    
protected  voidaddMapping(CmsXmlContentDefinition contentDefinition, String elementName, String mapping)
    
protected  voidaddSearchSetting(CmsXmlContentDefinition contentDefinition, String elementName, Boolean value)
    
protected  voidaddValidationRule(CmsXmlContentDefinition contentDefinition, String elementName, String regex, String message, boolean isWarning)
    
protected  voidaddWidget(CmsXmlContentDefinition contentDefinition, String elementName, String widgetClassOrAlias)
    
public  StringgetConfiguration(I_CmsXmlSchemaType type)
    
public  StringgetDefault(CmsObject cms, I_CmsXmlContentValue value, Locale locale)
    
public  StringgetMapping(String elementName)
    
public  String[]getMappings(String elementName)
    
public  CmsMessagesgetMessages(Locale locale)
    
public  StringgetModelFolder(CmsObject cms, String currentFolder)
    
public  StringgetPreview(CmsObject cms, CmsXmlContent content, String resourcename)
    
public  CmsRelationTypegetRelationType(I_CmsXmlContentValue value)
    
protected  StringgetValidationMessage(CmsObject cms, I_CmsXmlContentValue value, String regex, String valueStr, boolean matchResult, boolean isWarning)
    
public  I_CmsWidgetgetWidget(I_CmsXmlContentValue value)
    
protected  voidinit()
    
protected  voidinitDefaultValues(Element root, CmsXmlContentDefinition contentDefinition)
    
protected  voidinitLayouts(Element root, CmsXmlContentDefinition contentDefinition)
     Initializes the layout for this content handler.

Unless otherwise instructed, the editor uses one specific GUI widget for each XML value schema type.

protected  voidinitMappings(Element root, CmsXmlContentDefinition contentDefinition)
     Initializes the element mappings for this content handler.

Element mappings allow storing values from the XML content in other locations.

protected  voidinitModelFolder(Element root, CmsXmlContentDefinition contentDefinition)
    
protected  voidinitPreview(Element root, CmsXmlContentDefinition contentDefinition)
    
protected  voidinitRelations(Element root, CmsXmlContentDefinition contentDefinition)
     Initializes the relation configuration for this content handler.

OpenCms performs link checks for all OPTIONAL links defined in XML content values of type OpenCmsVfsFile.

protected  voidinitResourceBundle(Element root, CmsXmlContentDefinition contentDefinition)
    
protected  voidinitSearchSettings(Element root, CmsXmlContentDefinition contentDefinition)
     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.

protected  voidinitValidationRules(Element root, CmsXmlContentDefinition contentDefinition)
     Initializes the validation rules this content handler.

OpenCms always performs XML schema validation for all XML contents.

public synchronized  voidinitialize(Element appInfoElement, CmsXmlContentDefinition contentDefinition)
    
public  voidinvalidateBrokenLinks(CmsObject cms, CmsXmlContent document)
    
protected  booleanisInvalidateParent(String xpath)
    
public  booleanisSearchable(I_CmsXmlContentValue value)
    
protected  Stringkey(String keyName, Locale locale)
    
public  CmsXmlContentprepareForUse(CmsObject cms, CmsXmlContent content)
    
public  CmsFileprepareForWrite(CmsObject cms, CmsXmlContent content, CmsFile file)
    
protected  voidremoveEmptyMappings(CmsObject cms, CmsXmlContent content)
    
public  voidresolveMapping(CmsObject cms, CmsXmlContent content, I_CmsXmlContentValue value)
    
public  CmsXmlContentErrorHandlerresolveValidation(CmsObject cms, I_CmsXmlContentValue value, CmsXmlContentErrorHandler errorHandler)
    
protected  voidvalidateAppinfoElement(Element appinfoElement)
    
protected  booleanvalidateLink(CmsObject cms, I_CmsXmlContentValue value, CmsXmlContentErrorHandler errorHandler)
    
protected  CmsXmlContentErrorHandlervalidateValue(CmsObject cms, I_CmsXmlContentValue value, CmsXmlContentErrorHandler errorHandler, Map rules, boolean isWarning)
    
protected  CmsXmlContentErrorHandlervalidateValue(CmsObject cms, I_CmsXmlContentValue value, String valueStr, CmsXmlContentErrorHandler errorHandler, boolean isWarning)
    

Field Detail
APPINFO_APPINFO
final public static String APPINFO_APPINFO(Code)
Constant for the "appinfo" element name itself.



APPINFO_ATTR_CONFIGURATION
final public static String APPINFO_ATTR_CONFIGURATION(Code)
Constant for the "configuration" appinfo attribute name.



APPINFO_ATTR_ELEMENT
final public static String APPINFO_ATTR_ELEMENT(Code)
Constant for the "element" appinfo attribute name.



APPINFO_ATTR_INVALIDATE
final public static String APPINFO_ATTR_INVALIDATE(Code)
Constant for the "invalidate" appinfo attribute name.



APPINFO_ATTR_MAPTO
final public static String APPINFO_ATTR_MAPTO(Code)
Constant for the "mapto" appinfo attribute name.



APPINFO_ATTR_MESSAGE
final public static String APPINFO_ATTR_MESSAGE(Code)
Constant for the "message" appinfo attribute name.



APPINFO_ATTR_NAME
final public static String APPINFO_ATTR_NAME(Code)
Constant for the "name" appinfo attribute name.



APPINFO_ATTR_REGEX
final public static String APPINFO_ATTR_REGEX(Code)
Constant for the "regex" appinfo attribute name.



APPINFO_ATTR_SEARCHCONTENT
final public static String APPINFO_ATTR_SEARCHCONTENT(Code)
Constant for the "searchcontent" appinfo attribute name.



APPINFO_ATTR_TYPE
final public static String APPINFO_ATTR_TYPE(Code)
Constant for the "type" appinfo attribute name.



APPINFO_ATTR_TYPE_NODE
final public static String APPINFO_ATTR_TYPE_NODE(Code)
Constant for the "node" appinfo attribute value.



APPINFO_ATTR_TYPE_PARENT
final public static String APPINFO_ATTR_TYPE_PARENT(Code)
Constant for the "parent" appinfo attribute value.



APPINFO_ATTR_TYPE_WARNING
final public static String APPINFO_ATTR_TYPE_WARNING(Code)
Constant for the "warning" appinfo attribute value.



APPINFO_ATTR_URI
final public static String APPINFO_ATTR_URI(Code)
Constant for the "uri" appinfo attribute name.



APPINFO_ATTR_VALUE
final public static String APPINFO_ATTR_VALUE(Code)
Constant for the "value" appinfo attribute name.



APPINFO_ATTR_WIDGET
final public static String APPINFO_ATTR_WIDGET(Code)
Constant for the "widget" appinfo attribute name.



APPINFO_DEFAULT
final public static String APPINFO_DEFAULT(Code)
Constant for the "default" appinfo element name.



APPINFO_DEFAULTS
final public static String APPINFO_DEFAULTS(Code)
Constant for the "defaults" appinfo element name.



APPINFO_LAYOUT
final public static String APPINFO_LAYOUT(Code)
Constant for the "layout" appinfo element name.



APPINFO_LAYOUTS
final public static String APPINFO_LAYOUTS(Code)
Constant for the "layouts" appinfo element name.



APPINFO_MAPPING
final public static String APPINFO_MAPPING(Code)
Constant for the "mapping" appinfo element name.



APPINFO_MAPPINGS
final public static String APPINFO_MAPPINGS(Code)
Constant for the "mappings" appinfo element name.



APPINFO_MODELFOLDER
final public static String APPINFO_MODELFOLDER(Code)
Constant for the "modelfolder" appinfo element name.



APPINFO_PREVIEW
final public static String APPINFO_PREVIEW(Code)
Constant for the "preview" appinfo element name.



APPINFO_RELATION
final public static String APPINFO_RELATION(Code)
Constant for the "relation" appinfo element name.



APPINFO_RELATIONS
final public static String APPINFO_RELATIONS(Code)
Constant for the "relations" appinfo element name.



APPINFO_RESOURCEBUNDLE
final public static String APPINFO_RESOURCEBUNDLE(Code)
Constant for the "searchexclusions" appinfo element name.



APPINFO_RULE
final public static String APPINFO_RULE(Code)
Constant for the "rule" appinfo element name.



APPINFO_SCHEMA_FILE
final public static String APPINFO_SCHEMA_FILE(Code)
The file where the default appinfo schema is located.



APPINFO_SCHEMA_FILE_TYPES
final public static String APPINFO_SCHEMA_FILE_TYPES(Code)
The file where the default appinfo schema types are located.



APPINFO_SCHEMA_SYSTEM_ID
final public static String APPINFO_SCHEMA_SYSTEM_ID(Code)
The XML system id for the default appinfo schema types.



APPINFO_SCHEMA_TYPES_SYSTEM_ID
final public static String APPINFO_SCHEMA_TYPES_SYSTEM_ID(Code)
The XML system id for the default appinfo schema types.



APPINFO_SEARCHSETTING
final public static String APPINFO_SEARCHSETTING(Code)
Constant for the "searchsetting" appinfo element name.



APPINFO_SEARCHSETTINGS
final public static String APPINFO_SEARCHSETTINGS(Code)
Constant for the "searchsettings" appinfo element name.



APPINFO_VALIDATIONRULE
final public static String APPINFO_VALIDATIONRULE(Code)
Constant for the "validationrule" appinfo element name.



APPINFO_VALIDATIONRULES
final public static String APPINFO_VALIDATIONRULES(Code)
Constant for the "validationrules" appinfo element name.



MACRO_PREVIEW_TEMPFILE
final public static String MACRO_PREVIEW_TEMPFILE(Code)
Macro for resolving the preview URI.



MESSAGE_VALIDATION_DEFAULT_ERROR
final protected static String MESSAGE_VALIDATION_DEFAULT_ERROR(Code)
Default message for validation errors.



MESSAGE_VALIDATION_DEFAULT_WARNING
final protected static String MESSAGE_VALIDATION_DEFAULT_WARNING(Code)
Default message for validation warnings.



m_configurationValues
protected Map m_configurationValues(Code)
The configuration values for the element widgets (as defined in the annotations).



m_defaultValues
protected Map m_defaultValues(Code)
The default values for the elements (as defined in the annotations).



m_elementMappings
protected Map m_elementMappings(Code)
The element mappings (as defined in the annotations).



m_elementWidgets
protected Map m_elementWidgets(Code)
The widgets used for the elements (as defined in the annotations).



m_messageBundleName
protected String m_messageBundleName(Code)
The resource bundle name to be used for localization of this content handler.



m_modelFolder
protected String m_modelFolder(Code)
The folder containing the model file(s) for the content.



m_previewLocation
protected String m_previewLocation(Code)
The preview location (as defined in the annotations).



m_relations
protected Map m_relations(Code)
The relation check rules.



m_searchSettings
protected Map m_searchSettings(Code)
The search settings.



m_validationErrorMessages
protected Map m_validationErrorMessages(Code)
The messages for the error validation rules.



m_validationErrorRules
protected Map m_validationErrorRules(Code)
The validation rules that cause an error (as defined in the annotations).



m_validationWarningMessages
protected Map m_validationWarningMessages(Code)
The messages for the warning validation rules.



m_validationWarningRules
protected Map m_validationWarningRules(Code)
The validation rules that cause a warning (as defined in the annotations).




Constructor Detail
CmsDefaultXmlContentHandler
public CmsDefaultXmlContentHandler()(Code)
Creates a new instance of the default XML content handler.





Method Detail
addCheckRule
protected void addCheckRule(CmsXmlContentDefinition contentDefinition, String elementName, String invalidate, String type) throws CmsXmlException(Code)
Adds a check rule for a specified element.


Parameters:
  contentDefinition - the XML content definition this XML content handler belongs to
Parameters:
  elementName - the element name to add the rule to
Parameters:
  invalidate - false, to disable link checktrue or node, to invalidate just the single node if the link is broken parent, if this rule will invalidate the whole parent node in nested content
Parameters:
  type - 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(Code)
Adds a configuration value for an element widget.


Parameters:
  contentDefinition - the XML content definition this XML content handler belongs to
Parameters:
  elementName - the element name to map
Parameters:
  configurationValue - 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) throws CmsXmlException(Code)
Adds a default value for an element.


Parameters:
  contentDefinition - the XML content definition this XML content handler belongs to
Parameters:
  elementName - the element name to map
Parameters:
  defaultValue - the default value to use
throws:
  CmsXmlException - in case an unknown element name is used




addDefaultCheckRules
protected void addDefaultCheckRules(CmsXmlContentDefinition rootContentDefinition, I_CmsXmlSchemaType schemaType, String elementPath) throws CmsXmlException(Code)
Adds all needed default check rules recursively for the given schema type.


Parameters:
  rootContentDefinition - the root content definition
Parameters:
  schemaType - the schema type to check
Parameters:
  elementPath - the current element path
throws:
  CmsXmlException - if something goes wrong




addMapping
protected void addMapping(CmsXmlContentDefinition contentDefinition, String elementName, String mapping) throws CmsXmlException(Code)
Adds an element mapping.


Parameters:
  contentDefinition - the XML content definition this XML content handler belongs to
Parameters:
  elementName - the element name to map
Parameters:
  mapping - the mapping to use
throws:
  CmsXmlException - in case an unknown element name is used




addSearchSetting
protected void addSearchSetting(CmsXmlContentDefinition contentDefinition, String elementName, Boolean value) throws CmsXmlException(Code)
Adds a search setting for an element.


Parameters:
  contentDefinition - the XML content definition this XML content handler belongs to
Parameters:
  elementName - the element name to map
Parameters:
  value - the search setting value to store
throws:
  CmsXmlException - in case an unknown element name is used




addValidationRule
protected void addValidationRule(CmsXmlContentDefinition contentDefinition, String elementName, String regex, String message, boolean isWarning) throws CmsXmlException(Code)
Adds a validation rule for a specified element.


Parameters:
  contentDefinition - the XML content definition this XML content handler belongs to
Parameters:
  elementName - the element name to add the rule to
Parameters:
  regex - the validation rule regular expression
Parameters:
  message - the message in case validation fails (may be null)
Parameters:
  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 widgetClassOrAlias) throws CmsXmlException(Code)
Adds a GUI widget for a specified element.


Parameters:
  contentDefinition - the XML content definition this XML content handler belongs to
Parameters:
  elementName - the element name to map
Parameters:
  widgetClassOrAlias - the widget to use as GUI for the element (registered alias or class name)
throws:
  CmsXmlException - in case an unknown element name is used




getConfiguration
public String getConfiguration(I_CmsXmlSchemaType type)(Code)

See Also:   org.opencms.xml.content.I_CmsXmlContentHandler.getConfiguration(org.opencms.xml.types.I_CmsXmlSchemaType)



getDefault
public String getDefault(CmsObject cms, I_CmsXmlContentValue value, Locale locale)(Code)

See Also:   org.opencms.xml.content.I_CmsXmlContentHandler.getDefault(org.opencms.file.CmsObjectI_CmsXmlContentValuejava.util.Locale)



getMapping
public String getMapping(String elementName)(Code)
Returns the first mapping defined for the given element xpath.

Since OpenCms version 7.0.2, multiple mappings for an element are possible, so use CmsDefaultXmlContentHandler.getMapping(String) instead.


Parameters:
  elementName - the element xpath to look up the mapping for the mapping defined for the given element xpathCmsDefaultXmlContentHandler.getMappings(String)




getMappings
public String[] getMappings(String elementName)(Code)
Returns the all mappings defined for the given element xpath.


since:
   7.0.2
Parameters:
  elementName - the element xpath to look up the mapping for the mapping defined for the given element xpath




getMessages
public CmsMessages getMessages(Locale locale)(Code)

See Also:   org.opencms.xml.content.I_CmsXmlContentHandler.getMessages(java.util.Locale)



getModelFolder
public String getModelFolder(CmsObject cms, String currentFolder)(Code)

See Also:   org.opencms.xml.content.I_CmsXmlContentHandler.getModelFolder(org.opencms.file.CmsObjectjava.lang.String)



getPreview
public String getPreview(CmsObject cms, CmsXmlContent content, String resourcename)(Code)

See Also:   org.opencms.xml.content.I_CmsXmlContentHandler.getPreview(org.opencms.file.CmsObjectorg.opencms.xml.content.CmsXmlContentjava.lang.String)



getRelationType
public CmsRelationType getRelationType(I_CmsXmlContentValue value)(Code)

See Also:   I_CmsXmlContentHandler.getRelationType(I_CmsXmlContentValue)



getValidationMessage
protected String getValidationMessage(CmsObject cms, I_CmsXmlContentValue value, String regex, String valueStr, boolean matchResult, boolean isWarning)(Code)
Returns the validation message to be displayed if a certain rule was violated.


Parameters:
  cms - the current users OpenCms context
Parameters:
  value - the value to validate
Parameters:
  regex - the rule that was violated
Parameters:
  valueStr - the string value of the given value
Parameters:
  matchResult - if false, the rule was negated
Parameters:
  isWarning - if true, this validation indicate a warning, otherwise an error the validation message to be displayed




getWidget
public I_CmsWidget getWidget(I_CmsXmlContentValue value)(Code)

See Also:   org.opencms.xml.content.I_CmsXmlContentHandler.getWidget(org.opencms.xml.types.I_CmsXmlContentValue)



init
protected void init()(Code)
Called when this content handler is initialized.




initDefaultValues
protected void initDefaultValues(Element root, CmsXmlContentDefinition contentDefinition) throws CmsXmlException(Code)
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 definition
Parameters:
  contentDefinition - the content definition the default values belong to
throws:
  CmsXmlException - if something goes wrong




initLayouts
protected void initLayouts(Element root, CmsXmlContentDefinition contentDefinition) throws CmsXmlException(Code)
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 org.opencms.xml.types.CmsXmlStringValue the default widget is the org.opencms.widgets.CmsInputWidget . However, certain values can also use more then one widget, for example you may also use a org.opencms.widgets.CmsCheckboxWidget for a String value, and as a result the Strings possible values would be eithe "false" or "true", but nevertheless be a String.

The widget to use can further be controlled using the widget attribute. You can specify either a valid widget alias such as StringWidget, or the name of a Java class that implements I_CmsWidget .

Configuration options to the widget can be passed using the configuration attribute. You can specify any String as configuration. This String is then passed to the widget during initialization. It's up to the individual widget implementation to interpret this configuration String.


Parameters:
  root - the "layouts" element from the appinfo node of the XML content definition
Parameters:
  contentDefinition - the content definition the layout belongs to
throws:
  CmsXmlException - if something goes wrong




initMappings
protected void initMappings(Element root, CmsXmlContentDefinition contentDefinition) throws CmsXmlException(Code)
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 definition
Parameters:
  contentDefinition - the content definition the mappings belong to
throws:
  CmsXmlException - if something goes wrong




initModelFolder
protected void initModelFolder(Element root, CmsXmlContentDefinition contentDefinition) throws CmsXmlException(Code)
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 definition
Parameters:
  contentDefinition - the content definition the model folder belongs to
throws:
  CmsXmlException - if something goes wrong




initPreview
protected void initPreview(Element root, CmsXmlContentDefinition contentDefinition) throws CmsXmlException(Code)
Initializes the preview location for this content handler.


Parameters:
  root - the "preview" element from the appinfo node of the XML content definition
Parameters:
  contentDefinition - the content definition the validation rules belong to
throws:
  CmsXmlException - if something goes wrong




initRelations
protected void initRelations(Element root, CmsXmlContentDefinition contentDefinition) throws CmsXmlException(Code)
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 definition
Parameters:
  contentDefinition - the content definition the check rules belong to
throws:
  CmsXmlException - if something goes wrong




initResourceBundle
protected void initResourceBundle(Element root, CmsXmlContentDefinition contentDefinition) throws CmsXmlException(Code)
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 definition
Parameters:
  contentDefinition - the content definition the validation rules belong to
throws:
  CmsXmlException - if something goes wrong




initSearchSettings
protected void initSearchSettings(Element root, CmsXmlContentDefinition contentDefinition) throws CmsXmlException(Code)
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 definition
Parameters:
  contentDefinition - the content definition the default values belong to
throws:
  CmsXmlException - if something goes wrong




initValidationRules
protected void initValidationRules(Element root, CmsXmlContentDefinition contentDefinition) throws CmsXmlException(Code)
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 definition
Parameters:
  contentDefinition - the content definition the validation rules belong to
throws:
  CmsXmlException - if something goes wrong




initialize
public synchronized void initialize(Element appInfoElement, CmsXmlContentDefinition contentDefinition) throws CmsXmlException(Code)

See Also:   org.opencms.xml.content.I_CmsXmlContentHandler.initialize(org.dom4j.Elementorg.opencms.xml.CmsXmlContentDefinition)



invalidateBrokenLinks
public void invalidateBrokenLinks(CmsObject cms, CmsXmlContent document)(Code)

See Also:   org.opencms.xml.content.I_CmsXmlContentHandler.invalidateBrokenLinks(CmsObjectCmsXmlContent)



isInvalidateParent
protected boolean isInvalidateParent(String xpath)(Code)
Returns the is-invalidate-parent flag for the given xpath.


Parameters:
  xpath - the path to get the check rule for the configured is-invalidate-parent flag for the given xpath




isSearchable
public boolean isSearchable(I_CmsXmlContentValue value)(Code)

See Also:   org.opencms.xml.content.I_CmsXmlContentHandler.isSearchable(org.opencms.xml.types.I_CmsXmlContentValue)



key
protected String key(String keyName, Locale locale)(Code)
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 string
Parameters:
  locale - the locale to get the key from the resource string for the given key
See Also:   CmsMessages.formatUnknownKey(String)
See Also:   CmsMessages.isUnknownKey(String)




prepareForUse
public CmsXmlContent prepareForUse(CmsObject cms, CmsXmlContent content)(Code)

See Also:   org.opencms.xml.content.I_CmsXmlContentHandler.prepareForUse(org.opencms.file.CmsObjectorg.opencms.xml.content.CmsXmlContent)



prepareForWrite
public CmsFile prepareForWrite(CmsObject cms, CmsXmlContent content, CmsFile file) throws CmsException(Code)

See Also:   org.opencms.xml.content.I_CmsXmlContentHandler.prepareForWrite(org.opencms.file.CmsObjectorg.opencms.xml.content.CmsXmlContentorg.opencms.file.CmsFile)



removeEmptyMappings
protected void removeEmptyMappings(CmsObject cms, CmsXmlContent content) throws CmsException(Code)
Removes property values on resources for non-existing, optional elements.


Parameters:
  cms - the current users OpenCms context
Parameters:
  content - the XML content to remove the property values for
throws:
  CmsException - in case of read/write errors accessing the OpenCms VFS




resolveMapping
public void resolveMapping(CmsObject cms, CmsXmlContent content, I_CmsXmlContentValue value) throws CmsException(Code)

See Also:   org.opencms.xml.content.I_CmsXmlContentHandler.resolveMapping(org.opencms.file.CmsObjectorg.opencms.xml.content.CmsXmlContentorg.opencms.xml.types.I_CmsXmlContentValue)



resolveValidation
public CmsXmlContentErrorHandler resolveValidation(CmsObject cms, I_CmsXmlContentValue value, CmsXmlContentErrorHandler errorHandler)(Code)

See Also:   org.opencms.xml.content.I_CmsXmlContentHandler.resolveValidation(org.opencms.file.CmsObjectorg.opencms.xml.types.I_CmsXmlContentValueorg.opencms.xml.content.CmsXmlContentErrorHandler)



validateAppinfoElement
protected void validateAppinfoElement(Element appinfoElement) throws CmsXmlException(Code)
Validates if the given appinfo element node from the XML content definition schema is valid according the the capabilities of this content handler.


Parameters:
  appinfoElement - the appinfo element node to validate
throws:
  CmsXmlException - in case the element validation fails




validateLink
protected boolean validateLink(CmsObject cms, I_CmsXmlContentValue value, CmsXmlContentErrorHandler errorHandler)(Code)
Validates the given rules against the given value.


Parameters:
  cms - the current users OpenCms context
Parameters:
  value - the value to validate
Parameters:
  errorHandler - the error handler to use in case errors or warnings are detected if a broken link has been found




validateValue
protected CmsXmlContentErrorHandler validateValue(CmsObject cms, I_CmsXmlContentValue value, CmsXmlContentErrorHandler errorHandler, Map rules, boolean isWarning)(Code)
Validates the given rules against the given value.


Parameters:
  cms - the current users OpenCms context
Parameters:
  value - the value to validate
Parameters:
  errorHandler - the error handler to use in case errors or warnings are detected
Parameters:
  rules - the rules to validate the value against
Parameters:
  isWarning - if true, this validation should be stored as a warning, otherwise as an error the updated error handler




validateValue
protected CmsXmlContentErrorHandler validateValue(CmsObject cms, I_CmsXmlContentValue value, String valueStr, CmsXmlContentErrorHandler errorHandler, boolean isWarning)(Code)
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 context
Parameters:
  value - the value to validate
Parameters:
  valueStr - the string value of the given value
Parameters:
  errorHandler - the error handler to use in case errors or warnings are detected
Parameters:
  isWarning - if true, this validation should be stored as a warning, otherwise as an error the updated error handler




Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.