org.opencms.widgets
Class CmsVfsImageWidgetConfiguration

java.lang.Object
  extended by org.opencms.widgets.CmsGalleryWidgetConfiguration
      extended by org.opencms.widgets.CmsVfsImageWidgetConfiguration

public class CmsVfsImageWidgetConfiguration
extends CmsGalleryWidgetConfiguration

Configuration options for the VFS image widget.

The configuration options are read from the configuration String of the widget.

The configuration String has to be formatted as JSON object, with the following possible keys:

An example configuration can look like this:

{scaleparams: 'q:70,r:2,c:CCCC00', type: 'gallery', startup: '/demo_en/images/', usedescription: true, useformat: true, formatnames: 'imageleft:Image left|imageright:Image right|imagetop:Image top', formatvalues: ['150x?', '250x300', '?x250']}

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

Field Summary
static java.lang.String CONFIG_KEY_FORMATNAMES
          Configuration key name for the formatnames configuration.
static java.lang.String CONFIG_KEY_FORMATVALUES
          Configuration key name for the formatvalues configuration.
static java.lang.String CONFIG_KEY_SCALEPARAMS
          Configuration key name for the scaleparams configuration.
static java.lang.String CONFIG_KEY_USEDESCRIPTION
          Configuration key name for the usedescription configuration.
static java.lang.String CONFIG_KEY_USEFORMAT
          Configuration key name for the useformat configuration.
static java.lang.String TYPE_CATEGORY
          The type "category" for the initial image list to load.
static java.lang.String TYPE_GALLERY
          The type "gallery" for the initial image list to load.
 
Fields inherited from class org.opencms.widgets.CmsGalleryWidgetConfiguration
CONFIG_KEY_CLASS, CONFIG_KEY_STARTUP, CONFIG_KEY_TYPE, CONFIG_VALUE_DYNAMIC, m_className, m_startup, m_type
 
Constructor Summary
CmsVfsImageWidgetConfiguration(CmsObject cms, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param, java.lang.String configuration)
          Generates an initialized configuration for the image widget using the given configuration string.
 
Method Summary
 java.util.List getFormatValues()
          Returns the list of image format values matching the options for the format select box.
 java.lang.String getScaleParams()
          Returns the scale parameters to apply to a scaled image (e.g. quality, type).
 java.util.List getSelectFormat()
          Returns the list of select options for the format select box, must contain CmsSelectWidgetOption objects.
 java.lang.String getSelectFormatString()
          Returns the select options for the format select box as String.
protected  void init(CmsObject cms, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param, java.lang.String configuration)
          Initializes the widget configuration using the given configuration string.
 boolean isShowDescription()
          Returns if the description field should be shown.
 boolean isShowFormat()
          Returns if the format select box should be shown.
 
Methods inherited from class org.opencms.widgets.CmsGalleryWidgetConfiguration
getClassName, getStartup, getType, setClassName, setStartup, setType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONFIG_KEY_FORMATNAMES

public static final java.lang.String CONFIG_KEY_FORMATNAMES
Configuration key name for the formatnames configuration.

See Also:
Constant Field Values

CONFIG_KEY_FORMATVALUES

public static final java.lang.String CONFIG_KEY_FORMATVALUES
Configuration key name for the formatvalues configuration.

See Also:
Constant Field Values

CONFIG_KEY_SCALEPARAMS

public static final java.lang.String CONFIG_KEY_SCALEPARAMS
Configuration key name for the scaleparams configuration.

See Also:
Constant Field Values

CONFIG_KEY_USEDESCRIPTION

public static final java.lang.String CONFIG_KEY_USEDESCRIPTION
Configuration key name for the usedescription configuration.

See Also:
Constant Field Values

CONFIG_KEY_USEFORMAT

public static final java.lang.String CONFIG_KEY_USEFORMAT
Configuration key name for the useformat configuration.

See Also:
Constant Field Values

TYPE_CATEGORY

public static final java.lang.String TYPE_CATEGORY
The type "category" for the initial image list to load.

See Also:
Constant Field Values

TYPE_GALLERY

public static final java.lang.String TYPE_GALLERY
The type "gallery" for the initial image list to load.

See Also:
Constant Field Values
Constructor Detail

CmsVfsImageWidgetConfiguration

public CmsVfsImageWidgetConfiguration(CmsObject cms,
                                      I_CmsWidgetDialog widgetDialog,
                                      I_CmsWidgetParameter param,
                                      java.lang.String configuration)
Generates an initialized configuration for the image widget using the given configuration string.

Parameters:
cms - an initialized instance of a CmsObject
widgetDialog - the dialog where the widget is used on
param - the widget parameter to generate the widget for
configuration - the widget configuration string
Method Detail

getFormatValues

public java.util.List getFormatValues()
Returns the list of image format values matching the options for the format select box.

Returns:
the list of image format values matching the options for the format select box

getScaleParams

public java.lang.String getScaleParams()
Returns the scale parameters to apply to a scaled image (e.g. quality, type).

Returns:
scale the parameters to apply to a scaled image

getSelectFormat

public java.util.List getSelectFormat()
Returns the list of select options for the format select box, must contain CmsSelectWidgetOption objects.

Returns:
the list of select options for the format select box

getSelectFormatString

public java.lang.String getSelectFormatString()
Returns the select options for the format select box as String.

The String has the following structure format name 1:localized name 1|format name 2:localized name 2|....

Returns:
the select options for the format select box

isShowDescription

public boolean isShowDescription()
Returns if the description field should be shown.

Returns:
true if the description field should be shown, otherwise false

isShowFormat

public boolean isShowFormat()
Returns if the format select box should be shown.

Returns:
true if the format select box should be shown, otherwise false

init

protected void init(CmsObject cms,
                    I_CmsWidgetDialog widgetDialog,
                    I_CmsWidgetParameter param,
                    java.lang.String configuration)
Initializes the widget configuration using the given configuration string.

Overrides:
init in class CmsGalleryWidgetConfiguration
Parameters:
cms - an initialized instance of a CmsObject
widgetDialog - the dialog where the widget is used on
param - the widget parameter to generate the widget for
configuration - the widget configuration string