public class CmsXmlHtmlValue extends A_CmsXmlContentValue
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
TYPE_NAME
The name of this type as used in the XML schema.
|
m_defaultValue, m_document, m_element, m_locale, m_maxOccurs, m_minOccurs, m_nameXSI_NAMESPACE, XSI_NAMESPACE_ATTRIBUTE_NO_SCHEMA_LOCATION| Constructor and Description |
|---|
CmsXmlHtmlValue()
Creates a new, empty schema type descriptor of type "OpenCmsHtml".
|
CmsXmlHtmlValue(I_CmsXmlDocument document,
org.dom4j.Element element,
java.util.Locale locale)
Creates a new XML content value of type "OpenCmsHtml".
|
CmsXmlHtmlValue(I_CmsXmlDocument document,
org.dom4j.Element element,
java.util.Locale locale,
I_CmsXmlSchemaType type)
Creates a new XML content value of type "OpenCmsHtml".
|
CmsXmlHtmlValue(java.lang.String name,
java.lang.String minOccurs,
java.lang.String maxOccurs)
Creates a new schema type descriptor for the type "OpenCmsHtml".
|
| Modifier and Type | Method and Description |
|---|---|
I_CmsXmlContentValue |
createValue(I_CmsXmlDocument document,
org.dom4j.Element element,
java.util.Locale locale)
Creates a XML content value object for this type.
|
protected java.lang.String |
fixNullCharacters(java.lang.String jtidyOutput)
JTidy sometimes erroneouslsy produces HTML containing 'null' characters (Unicode code point 0), which are
invalid in an XML document.
|
org.dom4j.Element |
generateXml(CmsObject cms,
I_CmsXmlDocument document,
org.dom4j.Element root,
java.util.Locale locale)
Appends an XML for a new, empty node of this schema type to the given root element.
|
CmsLinkTable |
getLinkTable()
Returns the link table of this XML page element.
|
java.lang.String |
getPlainText(CmsObject cms)
Returns the value of this XML content node as a plain text String.
|
java.lang.String |
getSchemaDefinition()
Returns a String representation of the XML definition for this schema type.
|
java.lang.String |
getStringValue(CmsObject cms)
Returns the value of this XML content node as a String.
|
java.lang.String |
getTypeName()
Returns the schema type name.
|
I_CmsXmlSchemaType |
newInstance(java.lang.String name,
java.lang.String minOccurs,
java.lang.String maxOccurs)
Creates a new instance of this XML schema type initialized with the given values.
|
void |
setStringValue(CmsObject cms,
java.lang.String value)
Sets the provided String as value of this XML content node.
|
appendXmlSchema, compareTo, equals, getChoiceMaxOccurs, getContentDefinition, getDefault, getDefault, getDocument, getElement, getId, getIndex, getKey, getLocale, getMaxIndex, getMaxOccurs, getMinOccurs, getName, getPath, getRelationType, getXmlIndex, hasError, hashCode, isChoiceOption, isChoiceType, isSearchable, isSimpleType, moveDown, moveUp, moveValue, readSchemaDefinition, setContentDefinition, setDefault, setKeyPrefix, toString, validateValuepublic static final java.lang.String TYPE_NAME
public CmsXmlHtmlValue()
public CmsXmlHtmlValue(I_CmsXmlDocument document, org.dom4j.Element element, java.util.Locale locale)
document - the XML content instance this value belongs toelement - the XML element that contains this valuelocale - the locale this value is created forpublic CmsXmlHtmlValue(I_CmsXmlDocument document, org.dom4j.Element element, java.util.Locale locale, I_CmsXmlSchemaType type)
document - the XML content instance this value belongs toelement - the XML element that contains this valuelocale - the locale this value is created fortype - the type instance to create the value forpublic CmsXmlHtmlValue(java.lang.String name, java.lang.String minOccurs, java.lang.String maxOccurs)
name - the name of the XML node containing the value according to the XML schemaminOccurs - minimum number of occurrences of this type according to the XML schemamaxOccurs - maximum number of occurrences of this type according to the XML schemapublic I_CmsXmlContentValue createValue(I_CmsXmlDocument document, org.dom4j.Element element, java.util.Locale locale)
I_CmsXmlSchemaTypedocument - the XML content instance this value belongs toelement - the XML element to create the value fromlocale - the locale to create the value forI_CmsXmlSchemaType.createValue(I_CmsXmlDocument, org.dom4j.Element, Locale)public org.dom4j.Element generateXml(CmsObject cms, I_CmsXmlDocument document, org.dom4j.Element root, java.util.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 forI_CmsXmlSchemaType.generateXml(org.opencms.file.CmsObject, org.opencms.xml.I_CmsXmlDocument, org.dom4j.Element, java.util.Locale)public CmsLinkTable getLinkTable()
public java.lang.String getPlainText(CmsObject cms)
I_CmsXmlContentValue
Plain text in this context means a pure textual representation
of the content (i.e. without html tags).
The plain text may be null, too, if there is no sound or useful
textual representation (i.e. color values).
getPlainText in interface I_CmsXmlContentValuegetPlainText in class A_CmsXmlContentValuecms - an initialized instance of a CmsObjectI_CmsXmlContentValue.getPlainText(org.opencms.file.CmsObject)public java.lang.String getSchemaDefinition()
I_CmsXmlSchemaTypeI_CmsXmlSchemaType.getSchemaDefinition()public java.lang.String getStringValue(CmsObject cms)
I_CmsXmlContentValuecms - an initialized instance of a CmsObjectI_CmsXmlContentValue.getStringValue(org.opencms.file.CmsObject)public java.lang.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.
I_CmsXmlSchemaType.getTypeName()public I_CmsXmlSchemaType newInstance(java.lang.String name, java.lang.String minOccurs, java.lang.String maxOccurs)
I_CmsXmlSchemaTypename - the name to use in the xml documentminOccurs - minimum number of occurrencesmaxOccurs - maximum number of occurrencesI_CmsXmlSchemaType.newInstance(java.lang.String, java.lang.String, java.lang.String)public void setStringValue(CmsObject cms, java.lang.String value)
I_CmsXmlContentValueThis 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.
cms - an initialized instance of a CmsObjectvalue - the value to setI_CmsXmlContentValue.setStringValue(org.opencms.file.CmsObject, java.lang.String)protected java.lang.String fixNullCharacters(java.lang.String jtidyOutput)
jtidyOutput - the JTidy output