Package org.opencms.widgets
Class CmsGalleryWidgetConfiguration
java.lang.Object
org.opencms.widgets.CmsGalleryWidgetConfiguration
- Direct Known Subclasses:
CmsVfsImageWidgetConfiguration
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:
class
: optional class implementingI_CmsGalleryWidgetDynamicConfiguration
to dynamically configure startup parameters and format values.startup
: the startup folder, can be dynamically generated by the provided class, in that case, use 'dynamic' as value.type
: the startup folder type, can be 'gallery' or 'category'. Can be dynamically generated by the provided class, in that case, use 'dynamic' as value.
{type: 'gallery', startup: '/demo_en/images/'}
{type: 'category', startup: 'wurstsorten/kochwurst/'}
- Since:
- 7.5.0
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Configuration key name for the class configuration.static final String
Configuration key name for the gallery types configuration.static final String
Configuration key name for the startup configuration.static final String
Configuration key name for the type configuration.static final String
Configuration value name for a dynamic configuration.protected String
The optional class name for generating dynamic configurations, must implementI_CmsGalleryWidgetDynamicConfiguration
.protected String
The required information for the initial item list to load.protected String
The type of the initial item list to load, either gallery or category. -
Constructor Summary
ModifierConstructorDescriptionprotected
Default constructor.CmsGalleryWidgetConfiguration
(CmsObject cms, CmsMessages widgetDialog, I_CmsWidgetParameter param, String configuration) Generates an initialized configuration for the gallery item widget using the given configuration string. -
Method Summary
Modifier and TypeMethodDescriptionReturns the optional class name for generating dynamic configurations, must implementI_CmsGalleryWidgetDynamicConfiguration
.Returns the values as a parameter string.Returns the configured gallery types.Returns the required information for the initial item list to load.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, String configuration) Initializes the widget configuration using the given configuration string.protected void
setClassName
(String className) Sets the optional class name for generating dynamic configurations, must implementI_CmsGalleryWidgetDynamicConfiguration
.protected void
setGalleryTypes
(String galleryTypes) Sets the configured gallery types.protected void
setStartup
(String startup) Sets the required information for the initial item list to load.protected void
Sets the type of the initial item list to load, either gallery or category.
-
Field Details
-
CONFIG_KEY_CLASS
Configuration key name for the class configuration.- See Also:
-
CONFIG_KEY_GALLERYTYPES
Configuration key name for the gallery types configuration.- See Also:
-
CONFIG_KEY_STARTUP
Configuration key name for the startup configuration.- See Also:
-
CONFIG_KEY_TYPE
Configuration key name for the type configuration.- See Also:
-
CONFIG_VALUE_DYNAMIC
Configuration value name for a dynamic configuration.- See Also:
-
m_className
The optional class name for generating dynamic configurations, must implementI_CmsGalleryWidgetDynamicConfiguration
. -
m_startup
The required information for the initial item list to load. -
m_type
The type of the initial item list to load, either gallery or category.
-
-
Constructor Details
-
CmsGalleryWidgetConfiguration
public CmsGalleryWidgetConfiguration(CmsObject cms, CmsMessages widgetDialog, I_CmsWidgetParameter param, String configuration) Generates an initialized configuration for the gallery item widget using the given configuration string.- Parameters:
cms
- an initialized instance of a CmsObjectwidgetDialog
- the dialog where the widget is used onparam
- the widget parameter to generate the widget forconfiguration
- the widget configuration string
-
CmsGalleryWidgetConfiguration
protected CmsGalleryWidgetConfiguration()Default constructor.
-
-
Method Details
-
getClassName
Returns the optional class name for generating dynamic configurations, must implementI_CmsGalleryWidgetDynamicConfiguration
.- Returns:
- the optional class name for generating dynamic configurations
-
getGalleryTypes
Returns the configured gallery types.- Returns:
- the configured gallery types
-
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
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, String configuration) Initializes the widget configuration using the given configuration string.- Parameters:
cms
- an initialized instance of a CmsObjectmessages
- the dialog messagesparam
- the widget parameter to generate the widget forconfiguration
- the widget configuration string
-
setClassName
Sets the optional class name for generating dynamic configurations, must implementI_CmsGalleryWidgetDynamicConfiguration
.- Parameters:
className
- the optional class name for generating dynamic configurations
-
setGalleryTypes
Sets the configured gallery types.- Parameters:
galleryTypes
- the configured gallery types
-
setStartup
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
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
Returns the values as a parameter string.- Returns:
- the values as a parameter string
-