org.opencms.xml.types
Class CmsXmlVfsImageValue

java.lang.Object
  extended by org.opencms.xml.types.A_CmsXmlContentValue
      extended by org.opencms.xml.types.CmsXmlVfsFileValue
          extended by org.opencms.xml.types.CmsXmlVfsImageValue
All Implemented Interfaces:
java.lang.Comparable<I_CmsXmlSchemaType>, I_CmsWidgetParameter, I_CmsXmlContentValue, I_CmsXmlSchemaType

public class CmsXmlVfsImageValue
extends CmsXmlVfsFileValue

Describes the XML content type "OpenCmsVfsImage".

This type allows links to internal VFS images only.

Since:
7.5.0
Version:
$Revision: 1.12 $
Author:
Andreas Zahner

Field Summary
static java.lang.String NODE_SCALE
          Node name for the scale element.
static java.lang.String PARAM_DESCRIPTION
          Request parameter name for the description parameter.
static java.lang.String PARAM_FORMAT
          Request parameter name for the format parameter.
static java.lang.String TYPE_NAME_IMAGE
          The name of this type as used in the XML schema.
 
Fields inherited from class org.opencms.xml.types.CmsXmlVfsFileValue
NO_LINK, TYPE_NAME
 
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
CmsXmlVfsImageValue()
          Creates a new, empty schema type descriptor of type "OpenCmsVfsImage".
CmsXmlVfsImageValue(I_CmsXmlDocument document, org.dom4j.Element element, java.util.Locale locale, I_CmsXmlSchemaType type)
          Creates a new XML content value of type "OpenCmsVfsImage".
CmsXmlVfsImageValue(java.lang.String name, java.lang.String minOccurs, java.lang.String maxOccurs)
          Creates a new schema type descriptor for the type "OpenCmsVfsImage".
 
Method Summary
 I_CmsXmlContentValue createValue(I_CmsXmlDocument document, org.dom4j.Element element, java.util.Locale locale)
          Creates a XML content value object for this type.
 java.lang.String getDescription(CmsObject cms)
          Returns the description of the image.
 java.lang.String getFormat(CmsObject cms)
          Returns the format information of the image.
 java.lang.String getRequestLink(CmsObject cms)
          Returns the link without parameters from the string value.
 java.lang.String getScaleOptions(CmsObject cms)
          Returns the scale options of the image.
 java.lang.String getSchemaDefinition()
          Returns a String representation of the XML definition for this schema type.
 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 setDescription(CmsObject cms, java.lang.String description)
          Sets the description of the image.
 void setFormat(CmsObject cms, java.lang.String format)
          Sets the format information of the image.
 void setScaleOptions(CmsObject cms, java.lang.String scaleOptions)
          Sets the scale options of the image.
 void setStringValue(CmsObject cms, java.lang.String value)
          Sets the provided String as value of this XML content node.
 
Methods inherited from class org.opencms.xml.types.CmsXmlVfsFileValue
generateXml, getLink, getPlainText, getStringValue, isSearchable
 
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, hasError, hashCode, 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
 

Field Detail

NODE_SCALE

public static final java.lang.String NODE_SCALE
Node name for the scale element.

See Also:
Constant Field Values

PARAM_DESCRIPTION

public static final java.lang.String PARAM_DESCRIPTION
Request parameter name for the description parameter.

See Also:
Constant Field Values

PARAM_FORMAT

public static final java.lang.String PARAM_FORMAT
Request parameter name for the format parameter.

See Also:
Constant Field Values

TYPE_NAME_IMAGE

public static final java.lang.String TYPE_NAME_IMAGE
The name of this type as used in the XML schema.

See Also:
Constant Field Values
Constructor Detail

CmsXmlVfsImageValue

public CmsXmlVfsImageValue()
Creates a new, empty schema type descriptor of type "OpenCmsVfsImage".


CmsXmlVfsImageValue

public CmsXmlVfsImageValue(I_CmsXmlDocument document,
                           org.dom4j.Element element,
                           java.util.Locale locale,
                           I_CmsXmlSchemaType type)
Creates a new XML content value of type "OpenCmsVfsImage".

Parameters:
document - the XML content instance this value belongs to
element - the XML element that contains this value
locale - the locale this value is created for
type - the type instance to create the value for

CmsXmlVfsImageValue

public CmsXmlVfsImageValue(java.lang.String name,
                           java.lang.String minOccurs,
                           java.lang.String maxOccurs)
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 schema
minOccurs - minimum number of occurrences of this type according to the XML schema
maxOccurs - maximum number of occurrences of this type according to the XML schema
Method Detail

createValue

public I_CmsXmlContentValue createValue(I_CmsXmlDocument document,
                                        org.dom4j.Element element,
                                        java.util.Locale locale)
Description copied from interface: I_CmsXmlSchemaType
Creates a XML content value object for this type.

Specified by:
createValue in interface I_CmsXmlSchemaType
Overrides:
createValue in class CmsXmlVfsFileValue
Parameters:
document - the XML content instance this value belongs to
element - the XML element to create the value from
locale - the locale to create the value for
Returns:
the created XML content value object
See Also:
I_CmsXmlSchemaType.createValue(I_CmsXmlDocument, org.dom4j.Element, Locale)

getDescription

public java.lang.String getDescription(CmsObject cms)
Returns the description of the image.

Parameters:
cms - the current users context
Returns:
the description of the image or an empty String

getFormat

public java.lang.String getFormat(CmsObject cms)
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

public java.lang.String getRequestLink(CmsObject cms)
Returns the link without parameters from the string value.

Parameters:
cms - the current users context
Returns:
the link without parameters

getScaleOptions

public java.lang.String getScaleOptions(CmsObject cms)
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

public java.lang.String getSchemaDefinition()
Description copied from interface: I_CmsXmlSchemaType
Returns a String representation of the XML definition for this schema type.

Specified by:
getSchemaDefinition in interface I_CmsXmlSchemaType
Overrides:
getSchemaDefinition in class CmsXmlVfsFileValue
Returns:
a String representation of the XML definition for this schema type
See Also:
I_CmsXmlSchemaType.getSchemaDefinition()

getTypeName

public java.lang.String 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 interface I_CmsXmlSchemaType
Overrides:
getTypeName in class CmsXmlVfsFileValue
Returns:
the schema type name
See Also:
I_CmsXmlSchemaType.getTypeName()

newInstance

public I_CmsXmlSchemaType newInstance(java.lang.String name,
                                      java.lang.String minOccurs,
                                      java.lang.String maxOccurs)
Description copied from interface: I_CmsXmlSchemaType
Creates a new instance of this XML schema type initialized with the given values.

Specified by:
newInstance in interface I_CmsXmlSchemaType
Overrides:
newInstance in class CmsXmlVfsFileValue
Parameters:
name - the name to use in the xml document
minOccurs - minimum number of occurrences
maxOccurs - maximum number of occurrences
Returns:
a new instance of this XML content type initialized with the given values
See Also:
I_CmsXmlSchemaType.newInstance(java.lang.String, java.lang.String, java.lang.String)

setDescription

public void setDescription(CmsObject cms,
                           java.lang.String description)
Sets the description of the image.

Parameters:
cms - the current users context
description - the description of the image

setFormat

public void setFormat(CmsObject cms,
                      java.lang.String format)
Sets the format information of the image.

Parameters:
cms - the current users contexts
format - the format information of the image

setScaleOptions

public void setScaleOptions(CmsObject cms,
                            java.lang.String scaleOptions)
Sets the scale options of the image.

Parameters:
cms - the current users context
scaleOptions - the scale options of the image

setStringValue

public void setStringValue(CmsObject cms,
                           java.lang.String value)
                    throws CmsIllegalArgumentException
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 interface I_CmsWidgetParameter
Specified by:
setStringValue in interface I_CmsXmlContentValue
Overrides:
setStringValue in class CmsXmlVfsFileValue
Parameters:
cms - an initialized instance of a CmsObject
value - the value to set
Throws:
CmsIllegalArgumentException
See Also:
I_CmsXmlContentValue.setStringValue(org.opencms.file.CmsObject, java.lang.String)