Package org.opencms.xml.types
Class CmsXmlVfsImageValue
java.lang.Object
org.opencms.xml.types.A_CmsXmlContentValue
org.opencms.xml.types.CmsXmlVfsFileValue
org.opencms.xml.types.CmsXmlVfsImageValue
- All Implemented Interfaces:
Comparable<I_CmsXmlSchemaType>
,I_CmsWidgetParameter
,I_CmsXmlContentValue
,I_CmsXmlSchemaType
,I_CmsJsonFormattableValue
Describes the XML content type "OpenCmsVfsImage".
This type allows links to internal VFS images only.
- Since:
- 7.5.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.opencms.xml.types.I_CmsXmlContentValue
I_CmsXmlContentValue.SearchContentType
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Node name for the scale element.static final String
Request parameter name for the description parameter.static final String
Request parameter name for the format parameter.static final String
The name of this type as used in the XML schema.Fields inherited from class org.opencms.xml.types.CmsXmlVfsFileValue
NO_LINK, TYPE_NAME, TYPE_VFS_LINK
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
ConstructorDescriptionCreates a new, empty schema type descriptor of type "OpenCmsVfsImage".CmsXmlVfsImageValue
(String name, String minOccurs, String maxOccurs) Creates a new schema type descriptor for the type "OpenCmsVfsImage".CmsXmlVfsImageValue
(I_CmsXmlDocument document, org.dom4j.Element element, Locale locale, I_CmsXmlSchemaType type) Creates a new XML content value of type "OpenCmsVfsImage". -
Method Summary
Modifier and TypeMethodDescriptioncreateValue
(I_CmsXmlDocument document, org.dom4j.Element element, Locale locale) Creates a XML content value object for this type.getDescription
(CmsObject cms) Returns the description of the image.Returns the format information of the image.getRequestLink
(CmsObject cms) Returns the link without parameters from the string value.getScaleOptions
(CmsObject cms) Returns the scale options of the image.Returns a String representation of the XML definition for this schema type.Returns the schema type name.newInstance
(String name, String minOccurs, String maxOccurs) Creates a new instance of this XML schema type initialized with the given values.void
setDescription
(CmsObject cms, String description) Sets the description of the image.void
Sets the format information of the image.void
setScaleOptions
(CmsObject cms, String scaleOptions) Sets the scale options of the image.void
setStringValue
(CmsObject cms, String value) Sets the provided String as value of this XML content node.Methods inherited from class org.opencms.xml.types.CmsXmlVfsFileValue
fillEntry, generateXml, getLink, getPlainText, getStringValue, getUncheckedLink, isSearchable, setIdValue, toJson
Methods inherited from class org.opencms.xml.types.A_CmsXmlContentValue
appendXmlSchema, compareTo, equals, getChoiceMaxOccurs, getContentDefinition, getDefault, getDefault, getDocument, getElement, getId, getIndex, getKey, getLocale, getMaxIndex, getMaxOccurs, getMinOccurs, getName, getPath, getRelationType, getXmlIndex, hasError, hashCode, isChoiceOption, isChoiceType, isSimpleType, 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_CmsXmlContentValue
getSearchContentType
-
Field Details
-
NODE_SCALE
Node name for the scale element.- See Also:
-
PARAM_DESCRIPTION
Request parameter name for the description parameter.- See Also:
-
PARAM_FORMAT
Request parameter name for the format parameter.- See Also:
-
TYPE_NAME_IMAGE
The name of this type as used in the XML schema.- See Also:
-
-
Constructor Details
-
CmsXmlVfsImageValue
public CmsXmlVfsImageValue()Creates a new, empty schema type descriptor of type "OpenCmsVfsImage". -
CmsXmlVfsImageValue
public CmsXmlVfsImageValue(I_CmsXmlDocument document, org.dom4j.Element element, Locale locale, I_CmsXmlSchemaType type) Creates a new XML content value of type "OpenCmsVfsImage".- Parameters:
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 for
-
CmsXmlVfsImageValue
Creates a new schema type descriptor for the type "OpenCmsVfsImage".- Parameters:
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 schema
-
-
Method Details
-
createValue
public I_CmsXmlContentValue createValue(I_CmsXmlDocument document, org.dom4j.Element element, Locale locale) Description copied from interface:I_CmsXmlSchemaType
Creates a XML content value object for this type.- Specified by:
createValue
in interfaceI_CmsXmlSchemaType
- Overrides:
createValue
in classCmsXmlVfsFileValue
- Parameters:
document
- the XML content instance this value belongs toelement
- the XML element to create the value fromlocale
- the locale to create the value for- Returns:
- the created XML content value object
- See Also:
-
getDescription
Returns the description of the image.- Parameters:
cms
- the current users context- Returns:
- the description of the image or an empty String
-
getFormat
Returns the format information of the image.- Parameters:
cms
- the current users context- Returns:
- the format information of the image or an empty String
-
getRequestLink
Returns the link without parameters from the string value.- Parameters:
cms
- the current users context- Returns:
- the link without parameters
-
getScaleOptions
Returns the scale options of the image.- Parameters:
cms
- the current users context- Returns:
- the scale options of the image or an empty String
-
getSchemaDefinition
Description copied from interface:I_CmsXmlSchemaType
Returns a String representation of the XML definition for this schema type.- Specified by:
getSchemaDefinition
in interfaceI_CmsXmlSchemaType
- Overrides:
getSchemaDefinition
in classCmsXmlVfsFileValue
- Returns:
- a String representation of the XML definition for this schema type
- See Also:
-
getTypeName
Description copied from interface:I_CmsXmlSchemaType
Returns the schema type name.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.
- Specified by:
getTypeName
in interfaceI_CmsXmlSchemaType
- Overrides:
getTypeName
in classCmsXmlVfsFileValue
- Returns:
- the schema type name
- See Also:
-
newInstance
Description copied from interface:I_CmsXmlSchemaType
Creates a new instance of this XML schema type initialized with the given values.- Specified by:
newInstance
in interfaceI_CmsXmlSchemaType
- Overrides:
newInstance
in classCmsXmlVfsFileValue
- Parameters:
name
- the name to use in the xml documentminOccurs
- minimum number of occurrencesmaxOccurs
- maximum number of occurrences- Returns:
- a new instance of this XML content type initialized with the given values
- See Also:
-
setDescription
Sets the description of the image.- Parameters:
cms
- the current users contextdescription
- the description of the image
-
setFormat
Sets the format information of the image.- Parameters:
cms
- the current users contextsformat
- the format information of the image
-
setScaleOptions
Sets the scale options of the image.- Parameters:
cms
- the current users contextscaleOptions
- the scale options of the image
-
setStringValue
Description copied from interface:I_CmsXmlContentValue
Sets the provided String as value of this XML content node.This 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.
- Specified by:
setStringValue
in interfaceI_CmsWidgetParameter
- Specified by:
setStringValue
in interfaceI_CmsXmlContentValue
- Overrides:
setStringValue
in classCmsXmlVfsFileValue
- Parameters:
cms
- an initialized instance of a CmsObjectvalue
- the value to set- Throws:
CmsIllegalArgumentException
- See Also:
-