Java Doc for CmsXmlContent.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.A_CmsXmlDocument
      org.opencms.xml.content.CmsXmlContent

CmsXmlContent
public class CmsXmlContent extends A_CmsXmlDocument implements I_CmsXmlDocument(Code)
Implementation of a XML content object, used to access and manage structured content.

Use the org.opencms.xml.content.CmsXmlContentFactory to generate an instance of this class.


author:
   Alexander Kandzior
version:
   $Revision: 1.42 $
since:
   6.0.0



Field Summary
final public static  StringAUTO_CORRECTION_ATTRIBUTE
     The name of the XML content auto correction runtime attribute, this must always be a Boolean.
final public static  StringXERCES_SCHEMA_PROPERTY
     The property to set to enable xerces schema validation.
protected  booleanm_autoCorrectionEnabled
     Flag to control if auto correction is enabled when saving this XML content.
protected  CmsXmlContentDefinitionm_contentDefinition
     The XML content definition object (i.e.

Constructor Summary
protected  CmsXmlContent()
    
protected  CmsXmlContent(CmsObject cms, Document document, String encoding, EntityResolver resolver)
    
protected  CmsXmlContent(CmsObject cms, Locale locale, String modelUri)
    
protected  CmsXmlContent(CmsObject cms, Locale locale, String encoding, CmsXmlContentDefinition contentDefinition)
    

Method Summary
public  voidaddLocale(CmsObject cms, Locale locale)
    
public  I_CmsXmlContentValueaddValue(CmsObject cms, String path, Locale locale, int index)
    
protected  ObjectgetBookmark(String bookmark)
    
protected  SetgetBookmarks()
    
public  CmsXmlContentDefinitiongetContentDefinition()
    
public  CmsLinkProcessorgetLinkProcessor(CmsObject cms, CmsLinkTable linkTable)
    
protected  ElementgetLocaleNode(Locale locale)
    
public  CmsXmlContentValueSequencegetValueSequence(String name, Locale locale)
    
protected  voidinitDocument(CmsObject cms, Document document, String encoding, CmsXmlContentDefinition definition)
    
protected  voidinitDocument(Document document, String encoding, CmsXmlContentDefinition definition)
    
public  booleanisAutoCorrectionEnabled()
    
public  voidremoveValue(String name, Locale locale, int index)
    
public  voidresolveMappings(CmsObject cms)
    
public  voidsetAutoCorrectionEnabled(boolean value)
    
protected  voidsetFile(CmsFile file)
    
public  CmsXmlContentErrorHandlervalidate(CmsObject cms)
    
public  voidvisitAllValuesWith(I_CmsXmlContentValueVisitor visitor)
     Visits all values of this XML content with the given value visitor.

Please note that the order in which the values are visited may NOT be the order they apper in the XML document.


Field Detail
AUTO_CORRECTION_ATTRIBUTE
final public static String AUTO_CORRECTION_ATTRIBUTE(Code)
The name of the XML content auto correction runtime attribute, this must always be a Boolean.



XERCES_SCHEMA_PROPERTY
final public static String XERCES_SCHEMA_PROPERTY(Code)
The property to set to enable xerces schema validation.



m_autoCorrectionEnabled
protected boolean m_autoCorrectionEnabled(Code)
Flag to control if auto correction is enabled when saving this XML content.



m_contentDefinition
protected CmsXmlContentDefinition m_contentDefinition(Code)
The XML content definition object (i.e. XML schema) used by this content.




Constructor Detail
CmsXmlContent
protected CmsXmlContent()(Code)
Hides the public constructor.




CmsXmlContent
protected CmsXmlContent(CmsObject cms, Document document, String encoding, EntityResolver resolver)(Code)
Creates a new XML content based on the provided XML document.

The given encoding is used when marshalling the XML again later.


Parameters:
  cms - the cms context, if null no link validation is performed
Parameters:
  document - the document to create the xml content from
Parameters:
  encoding - the encoding of the xml content
Parameters:
  resolver - the XML entitiy resolver to use




CmsXmlContent
protected CmsXmlContent(CmsObject cms, Locale locale, String modelUri) throws CmsException(Code)
Create a new XML content based on the given default content, that will have all language nodes of the default content and ensures the presence of the given locale.

The given encoding is used when marshalling the XML again later.


Parameters:
  cms - the current users OpenCms content
Parameters:
  locale - the locale to generate the default content for
Parameters:
  modelUri - the absolute path to the XML content file acting as model
throws:
  CmsException - in case the model file is not found or not valid




CmsXmlContent
protected CmsXmlContent(CmsObject cms, Locale locale, String encoding, CmsXmlContentDefinition contentDefinition)(Code)
Create a new XML content based on the given content definiton, that will have one language node for the given locale all initialized with default values.

The given encoding is used when marshalling the XML again later.


Parameters:
  cms - the current users OpenCms content
Parameters:
  locale - the locale to generate the default content for
Parameters:
  encoding - the encoding to use when marshalling the XML content later
Parameters:
  contentDefinition - the content definiton to create the content for





Method Detail
addLocale
public void addLocale(CmsObject cms, Locale locale) throws CmsXmlException(Code)

See Also:   org.opencms.xml.I_CmsXmlDocument.addLocale(org.opencms.file.CmsObjectjava.util.Locale)



addValue
public I_CmsXmlContentValue addValue(CmsObject cms, String path, Locale locale, int index) throws CmsIllegalArgumentException, CmsRuntimeException(Code)
Adds a new XML content value for the given element name and locale at the given index position to this XML content document.


Parameters:
  cms - the current users OpenCms context
Parameters:
  path - the path to the XML content value element
Parameters:
  locale - the locale where to add the new value
Parameters:
  index - the index where to add the value (relative to all other values of this type) the created XML content value
throws:
  CmsIllegalArgumentException - if the given path is invalid
throws:
  CmsRuntimeException - if the element identified by the path already occured I_CmsXmlSchemaType.getMaxOccurs or the given index is invalid (too high).




getBookmark
protected Object getBookmark(String bookmark)(Code)

See Also:   org.opencms.xml.A_CmsXmlDocument.getBookmark(java.lang.String)



getBookmarks
protected Set getBookmarks()(Code)

See Also:   org.opencms.xml.A_CmsXmlDocument.getBookmarks



getContentDefinition
public CmsXmlContentDefinition getContentDefinition()(Code)

See Also:   org.opencms.xml.I_CmsXmlDocument.getContentDefinition



getLinkProcessor
public CmsLinkProcessor getLinkProcessor(CmsObject cms, CmsLinkTable linkTable)(Code)

See Also:   org.opencms.xml.A_CmsXmlDocument.getLinkProcessor(org.opencms.file.CmsObjectorg.opencms.staticexport.CmsLinkTable)



getLocaleNode
protected Element getLocaleNode(Locale locale) throws CmsRuntimeException(Code)
Returns the XML root element node for the given locale.


Parameters:
  locale - the locale to get the root element for the XML root element node for the given locale
throws:
  CmsRuntimeException - if no language element is found in the document




getValueSequence
public CmsXmlContentValueSequence getValueSequence(String name, Locale locale)(Code)
Returns the value sequence for the selected element name in this XML content.

If the given element name is not valid according to the schema of this XML content, null is returned.


Parameters:
  name - the element name (XML node name) to the the value sequence for
Parameters:
  locale - the locale to get the value sequence for the value sequence for the selected element name in this XML content




initDocument
protected void initDocument(CmsObject cms, Document document, String encoding, CmsXmlContentDefinition definition)(Code)
Initializes an XML document based on the provided document, encoding and content definition.

Checks the links and removes invalid ones in the initialized document.


Parameters:
  cms - the current users OpenCms content
Parameters:
  document - the base XML document to use for initializing
Parameters:
  encoding - the encoding to use when marshalling the document later
Parameters:
  definition - the content definition to use




initDocument
protected void initDocument(Document document, String encoding, CmsXmlContentDefinition definition)(Code)

See Also:   org.opencms.xml.A_CmsXmlDocument.initDocument(org.dom4j.Documentjava.lang.Stringorg.opencms.xml.CmsXmlContentDefinition)



isAutoCorrectionEnabled
public boolean isAutoCorrectionEnabled()(Code)

See Also:   org.opencms.xml.A_CmsXmlDocument.isAutoCorrectionEnabled



removeValue
public void removeValue(String name, Locale locale, int index)(Code)
Removes an existing XML content value of the given element name and locale at the given index position from this XML content document.


Parameters:
  name - the name of the XML content value element
Parameters:
  locale - the locale where to remove the value
Parameters:
  index - the index where to remove the value (relative to all other values of this type)




resolveMappings
public void resolveMappings(CmsObject cms)(Code)
Resolves the mappings for all values of this XML content.


Parameters:
  cms - the current users OpenCms context




setAutoCorrectionEnabled
public void setAutoCorrectionEnabled(boolean value)(Code)
Sets the flag to control if auto correction is enabled when saving this XML content.


Parameters:
  value - the flag to control if auto correction is enabled when saving this XML content




setFile
protected void setFile(CmsFile file)(Code)
Sets the file this XML content is written to.


Parameters:
  file - the file this XML content content is written to




validate
public CmsXmlContentErrorHandler validate(CmsObject cms)(Code)

See Also:   org.opencms.xml.I_CmsXmlDocument.validate(org.opencms.file.CmsObject)



visitAllValuesWith
public void visitAllValuesWith(I_CmsXmlContentValueVisitor visitor)(Code)
Visits all values of this XML content with the given value visitor.

Please note that the order in which the values are visited may NOT be the order they apper in the XML document. It is ensured that the the parent of a nested value is visited before the element it contains.


Parameters:
  visitor - the value visitor implementation to visit the values with




Fields inherited from org.opencms.xml.A_CmsXmlDocument
protected String m_conversion(Code)(Java Doc)
protected Document m_document(Code)(Java Doc)
protected Map m_elementLocales(Code)(Java Doc)
protected Map m_elementNames(Code)(Java Doc)
protected String m_encoding(Code)(Java Doc)
protected CmsFile m_file(Code)(Java Doc)
protected Set m_locales(Code)(Java Doc)

Methods inherited from org.opencms.xml.A_CmsXmlDocument
protected void addBookmark(String path, Locale locale, boolean enabled, Object value)(Code)(Java Doc)
protected void addLocale(Locale locale)(Code)(Java Doc)
protected void clearBookmarks()(Code)(Java Doc)
public void copyLocale(List possibleSources, Locale destination) throws CmsXmlException(Code)(Java Doc)
public void copyLocale(Locale source, Locale destination) throws CmsXmlException(Code)(Java Doc)
public CmsFile correctXmlStructure(CmsObject cms) throws CmsXmlException(Code)(Java Doc)
protected Object getBookmark(String bookmark)(Code)(Java Doc)
protected Object getBookmark(String path, Locale locale)(Code)(Java Doc)
final protected static String getBookmarkName(String name, Locale locale)(Code)(Java Doc)
protected Set getBookmarks()(Code)(Java Doc)
public String getConversion()(Code)(Java Doc)
public String getEncoding()(Code)(Java Doc)
public CmsFile getFile()(Code)(Java Doc)
public int getIndexCount(String path, Locale locale)(Code)(Java Doc)
public List getLocales()(Code)(Java Doc)
public List getLocales(String path)(Code)(Java Doc)
public List getNames(Locale locale)(Code)(Java Doc)
public String getStringValue(CmsObject cms, String path, Locale locale)(Code)(Java Doc)
public String getStringValue(CmsObject cms, String path, Locale locale, int index)(Code)(Java Doc)
public I_CmsXmlContentValue getValue(String path, Locale locale)(Code)(Java Doc)
public I_CmsXmlContentValue getValue(String path, Locale locale, int index)(Code)(Java Doc)
public List getValues(Locale locale)(Code)(Java Doc)
public List getValues(String path, Locale locale)(Code)(Java Doc)
public boolean hasLocale(Locale locale)(Code)(Java Doc)
public boolean hasValue(String path, Locale locale)(Code)(Java Doc)
public boolean hasValue(String path, Locale locale, int index)(Code)(Java Doc)
public void initDocument()(Code)(Java Doc)
abstract protected void initDocument(Document document, String encoding, CmsXmlContentDefinition contentDefinition)(Code)(Java Doc)
protected boolean isAutoCorrectionEnabled()(Code)(Java Doc)
public boolean isEnabled(String path, Locale locale)(Code)(Java Doc)
public boolean isEnabled(String path, Locale locale, int index)(Code)(Java Doc)
public byte[] marshal() throws CmsXmlException(Code)(Java Doc)
protected OutputStream marshal(OutputStream out, String encoding) throws CmsXmlException(Code)(Java Doc)
public void moveLocale(Locale source, Locale destination) throws CmsXmlException(Code)(Java Doc)
protected I_CmsXmlContentValue removeBookmark(String path, Locale locale)(Code)(Java Doc)
public void removeLocale(Locale locale) throws CmsXmlException(Code)(Java Doc)
public void setConversion(String conversion)(Code)(Java Doc)
public String toString()(Code)(Java Doc)
public void validateXmlStructure(EntityResolver resolver) throws CmsXmlException(Code)(Java Doc)

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.