|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.opencms.xml.types.A_CmsXmlContentValue
org.opencms.xml.types.CmsXmlNestedContentDefinition
public class CmsXmlNestedContentDefinition
A nested content XML definition that is included by another XML content definition.
| Field Summary |
|---|
| Fields inherited from class org.opencms.xml.types.A_CmsXmlContentValue |
|---|
m_defaultValue, m_document, m_element, m_locale, m_maxOccurs, m_minOccurs, m_name |
| Fields inherited from interface org.opencms.xml.types.I_CmsXmlSchemaType |
|---|
XSI_NAMESPACE, XSI_NAMESPACE_ATTRIBUTE_NO_SCHEMA_LOCATION |
| Constructor Summary | |
|---|---|
CmsXmlNestedContentDefinition(CmsXmlContentDefinition contentDefinition,
I_CmsXmlDocument document,
Element element,
Locale locale,
I_CmsXmlSchemaType type)
Creates a new XML content value for the nested content definition. |
|
CmsXmlNestedContentDefinition(CmsXmlContentDefinition contentDefinition,
String name,
String minOccurs,
String maxOccurs)
Creates a new nested content definition. |
|
| Method Summary | |
|---|---|
I_CmsXmlContentValue |
createValue(I_CmsXmlDocument document,
Element element,
Locale locale)
Creates a XML content value object for this type. |
Element |
generateXml(CmsObject cms,
I_CmsXmlDocument document,
Element root,
Locale locale)
Appends an XML for a new, empty node of this schema type to the given root element. |
CmsXmlContentDefinition |
getNestedContentDefinition()
Returns the nested content definition. |
String |
getSchemaDefinition()
Returns a String representation of the XML definition for this schema type. |
String |
getStringValue(CmsObject cms)
Returns the value of this parameter. |
String |
getTypeName()
Returns the schema type name. |
boolean |
isSimpleType()
Returns false, since nested content definitions are never simple. |
I_CmsXmlSchemaType |
newInstance(String name,
String minOccurs,
String maxOccurs)
Creates a new instance of this XML schema type initialized with the given values. |
void |
setStringValue(CmsObject cms,
String value)
Sets the value of this parameter. |
| Methods inherited from class org.opencms.xml.types.A_CmsXmlContentValue |
|---|
appendXmlSchema, compareTo, equals, getContentDefinition, getDefault, getDefault, getDocument, getElement, getId, getIndex, getKey, getLocale, getMaxIndex, getMaxOccurs, getMinOccurs, getName, getPath, getPlainText, hasError, hashCode, moveDown, moveUp, moveValue, readSchemaDefinition, setContentDefinition, setDefault, setKeyPrefix, toString, validateValue |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.opencms.xml.types.I_CmsXmlSchemaType |
|---|
appendXmlSchema, getContentDefinition, getDefault, getMaxOccurs, getMinOccurs, getName, setContentDefinition, setDefault, validateValue |
| Methods inherited from interface java.lang.Comparable |
|---|
compareTo |
| Constructor Detail |
|---|
public CmsXmlNestedContentDefinition(CmsXmlContentDefinition contentDefinition,
I_CmsXmlDocument document,
Element element,
Locale locale,
I_CmsXmlSchemaType type)
document - the XML content instance this value belongs tocontentDefinition - the nested XML content definitionelement - the XML element that contains this valuelocale - the locale this value is created fortype - the type instance to create the value for
public CmsXmlNestedContentDefinition(CmsXmlContentDefinition contentDefinition,
String name,
String minOccurs,
String maxOccurs)
contentDefinition - the content definition to nestname - the name of the XML node containing the value according to the XML schemaminOccurs - minimum number of occurences of this type according to the XML schemamaxOccurs - maximum number of occurences of this type according to the XML schema| Method Detail |
|---|
public I_CmsXmlContentValue createValue(I_CmsXmlDocument document,
Element element,
Locale locale)
I_CmsXmlSchemaType
createValue in interface I_CmsXmlSchemaTypedocument - the XML content instance this value belongs toelement - the XML element to create the value fromlocale - the locale to create the value for
I_CmsXmlSchemaType.createValue(I_CmsXmlDocument, org.dom4j.Element, Locale)
public Element generateXml(CmsObject cms,
I_CmsXmlDocument document,
Element root,
Locale locale)
I_CmsXmlSchemaType
This is used to dynamically build a vaild XML content object from an initialized
CmsXmlContentDefinition class.
Important: This method can only be used during initialization of a XML content object,
not to add values to an already initialized XML content. To add values after initialization,
use CmsXmlContent.addValue(CmsObject, String, Locale, int).
generateXml in interface I_CmsXmlSchemaTypegenerateXml in class A_CmsXmlContentValuecms - the current users OpenCms contextdocument - the document the XML is generated forroot - the element to append the XML tolocale - the locale to generate the element default content for
I_CmsXmlSchemaType.generateXml(org.opencms.file.CmsObject, org.opencms.xml.I_CmsXmlDocument, org.dom4j.Element, java.util.Locale)public CmsXmlContentDefinition getNestedContentDefinition()
public String getSchemaDefinition()
I_CmsXmlSchemaType
getSchemaDefinition in interface I_CmsXmlSchemaTypeI_CmsXmlSchemaType.getSchemaDefinition()
public String getStringValue(CmsObject cms)
throws CmsRuntimeException
I_CmsWidgetParameter
getStringValue in interface I_CmsWidgetParametergetStringValue in interface I_CmsXmlContentValuecms - an initialized instance of an OpenCms user context
CmsRuntimeExceptionI_CmsXmlContentValue.getStringValue(org.opencms.file.CmsObject)public String getTypeName()
I_CmsXmlSchemaType
By convention, a XML schema type name has the form
"OpenCms + ${name}". Examples are
"OpenCmsString" or "OpenCmsBoolean".
The schema type name is fixed by the implementation.
getTypeName in interface I_CmsXmlSchemaTypeI_CmsXmlSchemaType.getTypeName()public boolean isSimpleType()
false, since nested content definitions are never simple.
isSimpleType in interface I_CmsXmlSchemaTypeisSimpleType in class A_CmsXmlContentValueI_CmsXmlSchemaType.isSimpleType()
public I_CmsXmlSchemaType newInstance(String name,
String minOccurs,
String maxOccurs)
I_CmsXmlSchemaType
newInstance in interface I_CmsXmlSchemaTypename - the name to use in the xml documentminOccurs - minimum number of occurencesmaxOccurs - maximum number of occurences
I_CmsXmlSchemaType.newInstance(java.lang.String, java.lang.String, java.lang.String)
public void setStringValue(CmsObject cms,
String value)
I_CmsWidgetParameterThis method does provide processing of the content based on the users current OpenCms context. This can be used e.g. for link extraction and replacement in the content.
setStringValue in interface I_CmsWidgetParametersetStringValue in interface I_CmsXmlContentValuecms - an initialized instance of an OpenCms user contextvalue - the value to setI_CmsXmlContentValue.setStringValue(org.opencms.file.CmsObject, java.lang.String)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||