Class CmsXmlContentDefinition
- java.lang.Object
-
- org.opencms.xml.CmsXmlContentDefinition
-
- All Implemented Interfaces:
java.lang.Cloneable
public class CmsXmlContentDefinition extends java.lang.Object implements java.lang.Cloneable
Describes the structure definition of an XML content object.- Since:
- 6.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCmsXmlContentDefinition.SequenceTypeEnumeration of possible sequence types in a content definition.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringXSD_ATTRIBUTE_DEFAULTConstant for the XML schema attribute "mapto".static java.lang.StringXSD_ATTRIBUTE_ELEMENT_FORM_DEFAULTConstant for the XML schema attribute "elementFormDefault".static java.lang.StringXSD_ATTRIBUTE_MAX_OCCURSConstant for the XML schema attribute "maxOccurs".static java.lang.StringXSD_ATTRIBUTE_MIN_OCCURSConstant for the XML schema attribute "minOccurs".static java.lang.StringXSD_ATTRIBUTE_NAMEConstant for the XML schema attribute "name".static java.lang.StringXSD_ATTRIBUTE_SCHEMA_LOCATIONConstant for the XML schema attribute "schemaLocation".static java.lang.StringXSD_ATTRIBUTE_TYPEConstant for the XML schema attribute "type".static java.lang.StringXSD_ATTRIBUTE_USEConstant for the XML schema attribute "use".static java.lang.StringXSD_ATTRIBUTE_VALUE_LANGUAGEConstant for the XML schema attribute value "language".static java.lang.StringXSD_ATTRIBUTE_VALUE_ONEConstant for the XML schema attribute value "1".static java.lang.StringXSD_ATTRIBUTE_VALUE_OPTIONALConstant for the XML schema attribute value "optional".static java.lang.StringXSD_ATTRIBUTE_VALUE_QUALIFIEDConstant for the XML schema attribute value "qualified".static java.lang.StringXSD_ATTRIBUTE_VALUE_REQUIREDConstant for the XML schema attribute value "required".static java.lang.StringXSD_ATTRIBUTE_VALUE_UNBOUNDEDConstant for the XML schema attribute value "unbounded".static java.lang.StringXSD_ATTRIBUTE_VALUE_ZEROConstant for the XML schema attribute value "0".static java.lang.StringXSD_INCLUDE_OPENCMSThe opencms default type definition include.static org.dom4j.NamespaceXSD_NAMESPACEThe schema definition namespace.static org.dom4j.QNameXSD_NODE_ANNOTATIONConstant for the "annotation" node in the XML schema namespace.static org.dom4j.QNameXSD_NODE_APPINFOConstant for the "appinfo" node in the XML schema namespace.static org.dom4j.QNameXSD_NODE_ATTRIBUTEConstant for the "attribute" node in the XML schema namespace.static org.dom4j.QNameXSD_NODE_CHOICEConstant for the "choice" node in the XML schema namespace.static org.dom4j.QNameXSD_NODE_COMPLEXTYPEConstant for the "complexType" node in the XML schema namespace.static org.dom4j.QNameXSD_NODE_ELEMENTConstant for the "element" node in the XML schema namespace.static org.dom4j.QNameXSD_NODE_INCLUDEConstant for the "include" node in the XML schema namespace.static org.dom4j.QNameXSD_NODE_SCHEMAConstant for the "schema" node in the XML schema namespace.static org.dom4j.QNameXSD_NODE_SEQUENCEConstant for the "sequence" node in the XML schema namespace.
-
Constructor Summary
Constructors Modifier Constructor Description protectedCmsXmlContentDefinition()Required empty constructor for clone operation.CmsXmlContentDefinition(java.lang.String innerName, java.lang.String schemaLocation)Creates a new XML content definition.CmsXmlContentDefinition(java.lang.String outerName, java.lang.String innerName, java.lang.String schemaLocation)Creates a new XML content definition.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.dom4j.ElementaddDefaultXml(CmsObject cms, I_CmsXmlDocument document, org.dom4j.Element root, java.util.Locale locale)Adds the missing default XML according to this content definition to the given document element.voidaddInclude(CmsXmlContentDefinition nestedSchema)Adds a nested (included) XML content definition.voidaddType(I_CmsXmlSchemaType type)Adds the given content type.java.lang.Objectclone()Creates a clone of this XML content definition.org.dom4j.ElementcreateDefaultXml(CmsObject cms, I_CmsXmlDocument document, org.dom4j.Element root, java.util.Locale locale)Generates the default XML content for this content definition, and append it to the given root element.org.dom4j.DocumentcreateDocument(CmsObject cms, I_CmsXmlDocument document, java.util.Locale locale)Generates a valid XML document according to the XML schema of this content definition.org.dom4j.ElementcreateLocale(CmsObject cms, I_CmsXmlDocument document, org.dom4j.Element root, java.util.Locale locale)Generates a valid locale (language) element for the XML schema of this content definition.protected static java.lang.StringcreateTypeName(java.lang.String name)Creates the name of the type attribute from the given content name.booleanequals(java.lang.Object obj)booleanfindSchemaTypesForPath(java.lang.String path, java.util.function.BiConsumer<I_CmsXmlSchemaType,java.lang.String> consumer)Iterates over all schema types along a given xpath, starting from a root content definition.voidfreeze()Freezes this content definition, making all internal data structures unmodifiable.intgetChoiceMaxOccurs()Returns the maxOccurs value for the choice in case this is axsd:choicecontent definition.static CmsXmlContentDefinitiongetContentDefinitionForResource(CmsObject cms, CmsResource resource)Factory method that returns the XML content definition instance for a given resource.static CmsXmlContentDefinitiongetContentDefinitionForType(CmsObject cms, java.lang.String typeName)Reads the content definition which is configured for a resource type.I_CmsXmlContentHandlergetContentHandler()Returns the selected XML content handler for this XML content definition.static I_CmsXmlContentHandlergetContentHandlerForResource(CmsObject cms, CmsResource resource)Returns a content handler instance for the given resource.java.util.Set<CmsXmlContentDefinition>getIncludes()Returns the set of nested (included) XML content definitions.java.lang.StringgetInnerName()Returns the inner element name of this content definition.java.lang.StringgetOuterName()Returns the outer element name of this content definition.org.dom4j.DocumentgetSchema()Generates an XML schema for the content definition.java.lang.StringgetSchemaLocation()Returns the location from which the XML schema was read (XML system id).I_CmsXmlSchemaTypegetSchemaType(java.lang.String elementPath)Returns the schema type for the given element name, ornullif no node is defined with this name.java.util.Set<java.lang.String>getSchemaTypes()Returns the internal set of schema type names.CmsXmlContentDefinition.SequenceTypegetSequenceType()Returns the sequence type of this content definition.java.lang.StringgetTypeName()Returns the main type name of this XML content definition.java.util.List<I_CmsXmlSchemaType>getTypeSequence()Returns the type sequence, contains instances ofI_CmsXmlSchemaType.inthashCode()protected voidsetInnerName(java.lang.String innerName)Sets the inner element name to use for the content definition.protected voidsetOuterName(java.lang.String outerName)Sets the outer element name to use for the content definition.java.lang.StringtoString()static CmsXmlContentDefinitionunmarshal(byte[] xmlData, java.lang.String schemaLocation, org.xml.sax.EntityResolver resolver)Factory method to unmarshal (read) a XML content definition instance from a byte array that contains XML data.static CmsXmlContentDefinitionunmarshal(java.lang.String xmlData, java.lang.String schemaLocation, org.xml.sax.EntityResolver resolver)Factory method to unmarshal (read) a XML content definition instance from a String that contains XML data.static CmsXmlContentDefinitionunmarshal(java.lang.String schemaLocation, org.xml.sax.EntityResolver resolver)Factory method to unmarshal (read) a XML content definition instance from a given XML schema location.static CmsXmlContentDefinitionunmarshal(org.dom4j.Document document, java.lang.String schemaLocation)Factory method to unmarshal (read) a XML content definition instance from a XML document.static CmsXmlContentDefinitionunmarshal(CmsObject cms, java.lang.String resourcename)Factory method to unmarshal (read) a XML content definition instance from the OpenCms VFS resource name.static CmsXmlContentDefinitionunmarshal(org.xml.sax.InputSource source, java.lang.String schemaLocation, org.xml.sax.EntityResolver resolver)Factory method to unmarshal (read) a XML content definition instance from a XML InputSource.protected static java.lang.StringvalidateAttribute(org.dom4j.Element element, java.lang.String attributeName, java.lang.String requiredValue)Validates if a given attribute exists at the given element with an (optional) specified value.protected static voidvalidateAttributesExists(org.dom4j.Element element, java.lang.String[] requiredAttributes, java.lang.String[] optionalAttributes)Validates if a given element has exactly the required attributes set.protected static org.opencms.xml.CmsXmlComplexTypeSequencevalidateComplexTypeSequence(org.dom4j.Element element, java.util.Set<CmsXmlContentDefinition> includes)Validates the given element as a complex type sequence.
-
-
-
Field Detail
-
XSD_ATTRIBUTE_DEFAULT
public static final java.lang.String XSD_ATTRIBUTE_DEFAULT
Constant for the XML schema attribute "mapto".- See Also:
- Constant Field Values
-
XSD_ATTRIBUTE_ELEMENT_FORM_DEFAULT
public static final java.lang.String XSD_ATTRIBUTE_ELEMENT_FORM_DEFAULT
Constant for the XML schema attribute "elementFormDefault".- See Also:
- Constant Field Values
-
XSD_ATTRIBUTE_MAX_OCCURS
public static final java.lang.String XSD_ATTRIBUTE_MAX_OCCURS
Constant for the XML schema attribute "maxOccurs".- See Also:
- Constant Field Values
-
XSD_ATTRIBUTE_MIN_OCCURS
public static final java.lang.String XSD_ATTRIBUTE_MIN_OCCURS
Constant for the XML schema attribute "minOccurs".- See Also:
- Constant Field Values
-
XSD_ATTRIBUTE_NAME
public static final java.lang.String XSD_ATTRIBUTE_NAME
Constant for the XML schema attribute "name".- See Also:
- Constant Field Values
-
XSD_ATTRIBUTE_SCHEMA_LOCATION
public static final java.lang.String XSD_ATTRIBUTE_SCHEMA_LOCATION
Constant for the XML schema attribute "schemaLocation".- See Also:
- Constant Field Values
-
XSD_ATTRIBUTE_TYPE
public static final java.lang.String XSD_ATTRIBUTE_TYPE
Constant for the XML schema attribute "type".- See Also:
- Constant Field Values
-
XSD_ATTRIBUTE_USE
public static final java.lang.String XSD_ATTRIBUTE_USE
Constant for the XML schema attribute "use".- See Also:
- Constant Field Values
-
XSD_ATTRIBUTE_VALUE_LANGUAGE
public static final java.lang.String XSD_ATTRIBUTE_VALUE_LANGUAGE
Constant for the XML schema attribute value "language".- See Also:
- Constant Field Values
-
XSD_ATTRIBUTE_VALUE_ONE
public static final java.lang.String XSD_ATTRIBUTE_VALUE_ONE
Constant for the XML schema attribute value "1".- See Also:
- Constant Field Values
-
XSD_ATTRIBUTE_VALUE_OPTIONAL
public static final java.lang.String XSD_ATTRIBUTE_VALUE_OPTIONAL
Constant for the XML schema attribute value "optional".- See Also:
- Constant Field Values
-
XSD_ATTRIBUTE_VALUE_QUALIFIED
public static final java.lang.String XSD_ATTRIBUTE_VALUE_QUALIFIED
Constant for the XML schema attribute value "qualified".- See Also:
- Constant Field Values
-
XSD_ATTRIBUTE_VALUE_REQUIRED
public static final java.lang.String XSD_ATTRIBUTE_VALUE_REQUIRED
Constant for the XML schema attribute value "required".- See Also:
- Constant Field Values
-
XSD_ATTRIBUTE_VALUE_UNBOUNDED
public static final java.lang.String XSD_ATTRIBUTE_VALUE_UNBOUNDED
Constant for the XML schema attribute value "unbounded".- See Also:
- Constant Field Values
-
XSD_ATTRIBUTE_VALUE_ZERO
public static final java.lang.String XSD_ATTRIBUTE_VALUE_ZERO
Constant for the XML schema attribute value "0".- See Also:
- Constant Field Values
-
XSD_INCLUDE_OPENCMS
public static final java.lang.String XSD_INCLUDE_OPENCMS
The opencms default type definition include.- See Also:
- Constant Field Values
-
XSD_NAMESPACE
public static final org.dom4j.Namespace XSD_NAMESPACE
The schema definition namespace.
-
XSD_NODE_ANNOTATION
public static final org.dom4j.QName XSD_NODE_ANNOTATION
Constant for the "annotation" node in the XML schema namespace.
-
XSD_NODE_APPINFO
public static final org.dom4j.QName XSD_NODE_APPINFO
Constant for the "appinfo" node in the XML schema namespace.
-
XSD_NODE_ATTRIBUTE
public static final org.dom4j.QName XSD_NODE_ATTRIBUTE
Constant for the "attribute" node in the XML schema namespace.
-
XSD_NODE_CHOICE
public static final org.dom4j.QName XSD_NODE_CHOICE
Constant for the "choice" node in the XML schema namespace.
-
XSD_NODE_COMPLEXTYPE
public static final org.dom4j.QName XSD_NODE_COMPLEXTYPE
Constant for the "complexType" node in the XML schema namespace.
-
XSD_NODE_ELEMENT
public static final org.dom4j.QName XSD_NODE_ELEMENT
Constant for the "element" node in the XML schema namespace.
-
XSD_NODE_INCLUDE
public static final org.dom4j.QName XSD_NODE_INCLUDE
Constant for the "include" node in the XML schema namespace.
-
XSD_NODE_SCHEMA
public static final org.dom4j.QName XSD_NODE_SCHEMA
Constant for the "schema" node in the XML schema namespace.
-
XSD_NODE_SEQUENCE
public static final org.dom4j.QName XSD_NODE_SEQUENCE
Constant for the "sequence" node in the XML schema namespace.
-
-
Constructor Detail
-
CmsXmlContentDefinition
public CmsXmlContentDefinition(java.lang.String innerName, java.lang.String schemaLocation)
Creates a new XML content definition.- Parameters:
innerName- the inner element name to use for the content definitonschemaLocation- the location from which the XML schema was read (system id)
-
CmsXmlContentDefinition
public CmsXmlContentDefinition(java.lang.String outerName, java.lang.String innerName, java.lang.String schemaLocation)
Creates a new XML content definition.- Parameters:
outerName- the outer element name to use for the content definitioninnerName- the inner element name to use for the content definitionschemaLocation- the location from which the XML schema was read (system id)
-
CmsXmlContentDefinition
protected CmsXmlContentDefinition()
Required empty constructor for clone operation.
-
-
Method Detail
-
getContentDefinitionForResource
public static CmsXmlContentDefinition getContentDefinitionForResource(CmsObject cms, CmsResource resource) throws CmsException
Factory method that returns the XML content definition instance for a given resource.- Parameters:
cms- the cms-objectresource- the resource- Returns:
- the XML content definition
- Throws:
CmsException- if something goes wrong
-
getContentDefinitionForType
public static CmsXmlContentDefinition getContentDefinitionForType(CmsObject cms, java.lang.String typeName) throws CmsException
Reads the content definition which is configured for a resource type.- Parameters:
cms- the current CMS contexttypeName- the type name- Returns:
- the content definition
- Throws:
CmsException- if something goes wrong
-
getContentHandlerForResource
public static I_CmsXmlContentHandler getContentHandlerForResource(CmsObject cms, CmsResource resource) throws CmsException
Returns a content handler instance for the given resource.- Parameters:
cms- the cms-objectresource- the resource- Returns:
- the content handler
- Throws:
CmsException- if something goes wrong
-
unmarshal
public static CmsXmlContentDefinition unmarshal(byte[] xmlData, java.lang.String schemaLocation, org.xml.sax.EntityResolver resolver) throws CmsXmlException
Factory method to unmarshal (read) a XML content definition instance from a byte array that contains XML data.- Parameters:
xmlData- the XML data in a byte arrayschemaLocation- the location from which the XML schema was read (system id)resolver- the XML entity resolver to use- Returns:
- a XML content definition instance unmarshalled from the byte array
- Throws:
CmsXmlException- if something goes wrong
-
unmarshal
public static CmsXmlContentDefinition unmarshal(CmsObject cms, java.lang.String resourcename) throws CmsXmlException
Factory method to unmarshal (read) a XML content definition instance from the OpenCms VFS resource name.- Parameters:
cms- the current users CmsObjectresourcename- the resource name to unmarshal the XML content definition from- Returns:
- a XML content definition instance unmarshalled from the VFS resource
- Throws:
CmsXmlException- if something goes wrong
-
unmarshal
public static CmsXmlContentDefinition unmarshal(org.dom4j.Document document, java.lang.String schemaLocation) throws CmsXmlException
Factory method to unmarshal (read) a XML content definition instance from a XML document.This method does additional validation to ensure the document has the required XML structure for a OpenCms content definition schema.
- Parameters:
document- the XML document to generate a XML content definition fromschemaLocation- the location from which the XML schema was read (system id)- Returns:
- a XML content definition instance unmarshalled from the XML document
- Throws:
CmsXmlException- if something goes wrong
-
unmarshal
public static CmsXmlContentDefinition unmarshal(org.xml.sax.InputSource source, java.lang.String schemaLocation, org.xml.sax.EntityResolver resolver) throws CmsXmlException
Factory method to unmarshal (read) a XML content definition instance from a XML InputSource.- Parameters:
source- the XML InputSource to useschemaLocation- the location from which the XML schema was read (system id)resolver- the XML entity resolver to use- Returns:
- a XML content definition instance unmarshalled from the InputSource
- Throws:
CmsXmlException- if something goes wrong
-
unmarshal
public static CmsXmlContentDefinition unmarshal(java.lang.String schemaLocation, org.xml.sax.EntityResolver resolver) throws CmsXmlException, org.xml.sax.SAXException, java.io.IOException
Factory method to unmarshal (read) a XML content definition instance from a given XML schema location.The XML content definition data to unmarshal will be read from the provided schema location using an XML InputSource.
- Parameters:
schemaLocation- the location from which to read the XML schema (system id)resolver- the XML entity resolver to use- Returns:
- a XML content definition instance unmarshalled from the InputSource
- Throws:
CmsXmlException- if something goes wrongorg.xml.sax.SAXException- if the XML schema location could not be converted to an XML InputSourcejava.io.IOException- if the XML schema location could not be converted to an XML InputSource
-
unmarshal
public static CmsXmlContentDefinition unmarshal(java.lang.String xmlData, java.lang.String schemaLocation, org.xml.sax.EntityResolver resolver) throws CmsXmlException
Factory method to unmarshal (read) a XML content definition instance from a String that contains XML data.- Parameters:
xmlData- the XML data in a StringschemaLocation- the location from which the XML schema was read (system id)resolver- the XML entity resolver to use- Returns:
- a XML content definition instance unmarshalled from the byte array
- Throws:
CmsXmlException- if something goes wrong
-
createTypeName
protected static java.lang.String createTypeName(java.lang.String name)
Creates the name of the type attribute from the given content name.- Parameters:
name- the name to use- Returns:
- the name of the type attribute
-
validateAttribute
protected static java.lang.String validateAttribute(org.dom4j.Element element, java.lang.String attributeName, java.lang.String requiredValue) throws CmsXmlException
Validates if a given attribute exists at the given element with an (optional) specified value.If the required value is not
null, the attribute must have exactly this value set.If no value is required, some simple validation is performed on the attribute value, like a check that the value does not have leading or trailing white spaces.
- Parameters:
element- the element to validateattributeName- the attribute to check forrequiredValue- the required value of the attribute, ornullif any value is allowed- Returns:
- the value of the attribute
- Throws:
CmsXmlException- if the element does not have the required attribute set, or if the validation fails
-
validateAttributesExists
protected static void validateAttributesExists(org.dom4j.Element element, java.lang.String[] requiredAttributes, java.lang.String[] optionalAttributes) throws CmsXmlException
Validates if a given element has exactly the required attributes set.- Parameters:
element- the element to validaterequiredAttributes- the list of required attributesoptionalAttributes- the list of optional attributes- Throws:
CmsXmlException- if the validation fails
-
validateComplexTypeSequence
protected static org.opencms.xml.CmsXmlComplexTypeSequence validateComplexTypeSequence(org.dom4j.Element element, java.util.Set<CmsXmlContentDefinition> includes) throws CmsXmlException
Validates the given element as a complex type sequence.- Parameters:
element- the element to validateincludes- the XML schema includes- Returns:
- a data structure containing the validated complex type sequence data
- Throws:
CmsXmlException- if the validation fails
-
addDefaultXml
public org.dom4j.Element addDefaultXml(CmsObject cms, I_CmsXmlDocument document, org.dom4j.Element root, java.util.Locale locale)
Adds the missing default XML according to this content definition to the given document element.In case the root element already contains sub nodes, only missing sub nodes are added.
- Parameters:
cms- the current users OpenCms contextdocument- the document where the XML is added in (required for default XML generation)root- the root node to add the missing XML forlocale- the locale to add the XML for- Returns:
- the given root element with the missing content added
-
addInclude
public void addInclude(CmsXmlContentDefinition nestedSchema)
Adds a nested (included) XML content definition.- Parameters:
nestedSchema- the nested (included) XML content definition to add
-
addType
public void addType(I_CmsXmlSchemaType type) throws CmsXmlException
Adds the given content type.- Parameters:
type- the content type to add- Throws:
CmsXmlException- in case an unregistered type is added
-
clone
public java.lang.Object clone()
Creates a clone of this XML content definition.- Overrides:
clonein classjava.lang.Object- Returns:
- a clone of this XML content definition
-
createDefaultXml
public org.dom4j.Element createDefaultXml(CmsObject cms, I_CmsXmlDocument document, org.dom4j.Element root, java.util.Locale locale)
Generates the default XML content for this content definition, and append it to the given root element.Please note: The default values for the annotations are read from the content definition of the given document. For a nested content definitions, this means that all defaults are set in the annotations of the "outer" or "main" content definition.
- Parameters:
cms- the current users OpenCms contextdocument- the OpenCms XML document the XML is created forroot- the node of the document where to append the generated XML tolocale- the locale to create the default element in the document with- Returns:
- the default XML content for this content definition, and append it to the given root element
-
createDocument
public org.dom4j.Document createDocument(CmsObject cms, I_CmsXmlDocument document, java.util.Locale locale)
Generates a valid XML document according to the XML schema of this content definition.- Parameters:
cms- the current users OpenCms contextdocument- the OpenCms XML document the XML is created forlocale- the locale to create the default element in the document with- Returns:
- a valid XML document according to the XML schema of this content definition
-
createLocale
public org.dom4j.Element createLocale(CmsObject cms, I_CmsXmlDocument document, org.dom4j.Element root, java.util.Locale locale)
Generates a valid locale (language) element for the XML schema of this content definition.- Parameters:
cms- the current users OpenCms contextdocument- the OpenCms XML document the XML is created forroot- the root node of the document where to append the locale tolocale- the locale to create the default element in the document with- Returns:
- a valid XML element for the locale according to the XML schema of this content definition
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object- See Also:
Object.equals(java.lang.Object)
-
findSchemaTypesForPath
public boolean findSchemaTypesForPath(java.lang.String path, java.util.function.BiConsumer<I_CmsXmlSchemaType,java.lang.String> consumer)
Iterates over all schema types along a given xpath, starting from a root content definition.- Parameters:
path- the pathconsumer- a handler that consumes both the schema type and the remaining suffix of the path, relative to the schema type- Returns:
- true if for all path components a schema type could be found
-
freeze
public void freeze()
Freezes this content definition, making all internal data structures unmodifiable.This is required to prevent modification of a cached content definition.
-
getChoiceMaxOccurs
public int getChoiceMaxOccurs()
Returns the maxOccurs value for the choice in case this is axsd:choicecontent definition.This content definition is a
xsd:choicesequence if the returned value is larger then 0.- Returns:
- the maxOccurs value for the choice in case this is a
xsd:choicecontent definition
-
getContentHandler
public I_CmsXmlContentHandler getContentHandler()
Returns the selected XML content handler for this XML content definition.If no specific XML content handler was provided in the "appinfo" node of the XML schema, the default XML content handler
is used.CmsDefaultXmlContentHandler- Returns:
- the contentHandler
-
getIncludes
public java.util.Set<CmsXmlContentDefinition> getIncludes()
Returns the set of nested (included) XML content definitions.- Returns:
- the set of nested (included) XML content definitions
-
getInnerName
public java.lang.String getInnerName()
Returns the inner element name of this content definition.- Returns:
- the inner element name of this content definition
-
getOuterName
public java.lang.String getOuterName()
Returns the outer element name of this content definition.- Returns:
- the outer element name of this content definition
-
getSchema
public org.dom4j.Document getSchema()
Generates an XML schema for the content definition.- Returns:
- the generated XML schema
-
getSchemaLocation
public java.lang.String getSchemaLocation()
Returns the location from which the XML schema was read (XML system id).- Returns:
- the location from which the XML schema was read (XML system id)
-
getSchemaType
public I_CmsXmlSchemaType getSchemaType(java.lang.String elementPath)
Returns the schema type for the given element name, ornullif no node is defined with this name.- Parameters:
elementPath- the element xpath to look up the type for- Returns:
- the type for the given element name, or
nullif no node is defined with this name
-
getSchemaTypes
public java.util.Set<java.lang.String> getSchemaTypes()
Returns the internal set of schema type names.- Returns:
- the internal set of schema type names
-
getSequenceType
public CmsXmlContentDefinition.SequenceType getSequenceType()
Returns the sequence type of this content definition.- Returns:
- the sequence type of this content definition
-
getTypeName
public java.lang.String getTypeName()
Returns the main type name of this XML content definition.- Returns:
- the main type name of this XML content definition
-
getTypeSequence
public java.util.List<I_CmsXmlSchemaType> getTypeSequence()
Returns the type sequence, contains instances ofI_CmsXmlSchemaType.- Returns:
- the type sequence, contains instances of
I_CmsXmlSchemaType
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object- See Also:
Object.hashCode()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object- See Also:
Object.toString()
-
setInnerName
protected void setInnerName(java.lang.String innerName)
Sets the inner element name to use for the content definition.- Parameters:
innerName- the inner element name to set
-
setOuterName
protected void setOuterName(java.lang.String outerName)
Sets the outer element name to use for the content definition.- Parameters:
outerName- the outer element name to set
-
-