org.opencms.widgets
Class CmsGalleryWidgetConfiguration

java.lang.Object
  extended by org.opencms.widgets.CmsGalleryWidgetConfiguration
Direct Known Subclasses:
CmsVfsImageWidgetConfiguration

public class CmsGalleryWidgetConfiguration
extends java.lang.Object

Configuration options for the gallery widget (e.g. DownloadGalleryWidget).

The configuration options are read from the configuration String of the widget. For nested XML schemas the configuration String must be defined inside the nested content.

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

Example configurations can look like this:

{type: 'gallery', startup: '/demo_en/images/'}

{type: 'category', startup: 'wurstsorten/kochwurst/'}

Since:
7.5.0

Field Summary
static java.lang.String CONFIG_KEY_CLASS
          Configuration key name for the class configuration.
static java.lang.String CONFIG_KEY_GALLERYTYPES
          Configuration key name for the gallery types configuration.
static java.lang.String CONFIG_KEY_STARTUP
          Configuration key name for the startup configuration.
static java.lang.String CONFIG_KEY_TYPE
          Configuration key name for the type configuration.
static java.lang.String CONFIG_VALUE_DYNAMIC
          Configuration value name for a dynamic configuration.
protected  java.lang.String m_className
          The optional class name for generating dynamic configurations, must implement I_CmsGalleryWidgetDynamicConfiguration.
protected  java.lang.String m_startup
          The required information for the initial item list to load.
protected  java.lang.String m_type
          The type of the initial item list to load, either gallery or category.
 
Constructor Summary
protected CmsGalleryWidgetConfiguration()
          Default constructor.
  CmsGalleryWidgetConfiguration(CmsObject cms, CmsMessages widgetDialog, I_CmsWidgetParameter param, java.lang.String configuration)
          Generates an initialized configuration for the gallery item widget using the given configuration string.
 
Method Summary
 java.lang.String getClassName()
          Returns the optional class name for generating dynamic configurations, must implement I_CmsGalleryWidgetDynamicConfiguration.
 java.lang.String getConfigString()
          Returns the values as a parameter string.
 java.lang.String getGalleryTypes()
          Returns the configured gallery types.
 java.lang.String getStartup()
          Returns the required information for the initial item list to load.
 java.lang.String getType()
          Returns the type of the initial item list to load, either gallery or category.
protected  void init(CmsObject cms, CmsMessages messages, I_CmsWidgetParameter param, java.lang.String configuration)
          Initializes the widget configuration using the given configuration string.
protected  void setClassName(java.lang.String className)
          Sets the optional class name for generating dynamic configurations, must implement I_CmsGalleryWidgetDynamicConfiguration.
protected  void setGalleryTypes(java.lang.String galleryTypes)
          Sets the configured gallery types.
protected  void setStartup(java.lang.String startup)
          Sets the required information for the initial item list to load.
protected  void setType(java.lang.String type)
          Sets the type of the initial item list to load, either gallery or category.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONFIG_KEY_CLASS

public static final java.lang.String CONFIG_KEY_CLASS
Configuration key name for the class configuration.

See Also:
Constant Field Values

CONFIG_KEY_GALLERYTYPES

public static final java.lang.String CONFIG_KEY_GALLERYTYPES
Configuration key name for the gallery types configuration.

See Also:
Constant Field Values

CONFIG_KEY_STARTUP

public static final java.lang.String CONFIG_KEY_STARTUP
Configuration key name for the startup configuration.

See Also:
Constant Field Values

CONFIG_KEY_TYPE

public static final java.lang.String CONFIG_KEY_TYPE
Configuration key name for the type configuration.

See Also:
Constant Field Values

CONFIG_VALUE_DYNAMIC

public static final java.lang.String CONFIG_VALUE_DYNAMIC
Configuration value name for a dynamic configuration.

See Also:
Constant Field Values

m_className

protected java.lang.String m_className
The optional class name for generating dynamic configurations, must implement I_CmsGalleryWidgetDynamicConfiguration.


m_startup

protected java.lang.String m_startup
The required information for the initial item list to load.


m_type

protected java.lang.String m_type
The type of the initial item list to load, either gallery or category.

Constructor Detail

CmsGalleryWidgetConfiguration

public CmsGalleryWidgetConfiguration(CmsObject cms,
                                     CmsMessages widgetDialog,
                                     I_CmsWidgetParameter param,
                                     java.lang.String configuration)
Generates an initialized configuration for the gallery item 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

CmsGalleryWidgetConfiguration

protected CmsGalleryWidgetConfiguration()
Default constructor.

Method Detail

getClassName

public java.lang.String getClassName()
Returns the optional class name for generating dynamic configurations, must implement I_CmsGalleryWidgetDynamicConfiguration.

Returns:
the optional class name for generating dynamic configurations

getGalleryTypes

public java.lang.String getGalleryTypes()
Returns the configured gallery types.

Returns:
the configured gallery types

getStartup

public java.lang.String getStartup()
Returns the required information for the initial item list to load.

If a gallery should be shown, the path to the gallery must be specified, for a category the category path (e.g wurstsorten/kochwurst/).

Returns:
the required information for the initial item list to load

getType

public java.lang.String getType()
Returns the type of the initial item list to load, either gallery or category.

Returns:
the type of the initial image list to load

init

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

Parameters:
cms - an initialized instance of a CmsObject
messages - the dialog messages
param - the widget parameter to generate the widget for
configuration - the widget configuration string

setClassName

protected void setClassName(java.lang.String className)
Sets the optional class name for generating dynamic configurations, must implement I_CmsGalleryWidgetDynamicConfiguration.

Parameters:
className - the optional class name for generating dynamic configurations

setGalleryTypes

protected void setGalleryTypes(java.lang.String galleryTypes)
Sets the configured gallery types.

Parameters:
galleryTypes - the configured gallery types

setStartup

protected void setStartup(java.lang.String startup)
Sets the required information for the initial item list to load.

If a gallery should be shown, the path to the gallery must be specified, for a category the category path.

Parameters:
startup - the required information for the initial item list to load

setType

protected void setType(java.lang.String type)
Sets the type of the initial item list to load, either gallery or category.

Parameters:
type - the type of the initial item list to load

getConfigString

public java.lang.String getConfigString()
Returns the values as a parameter string.

Returns:
the values as a parameter string