Package org.opencms.widgets
Class CmsSelectGroupWidget
- java.lang.Object
-
- org.opencms.widgets.A_CmsWidget
-
- org.opencms.widgets.A_CmsSelectWidget
-
- org.opencms.widgets.CmsSelectWidget
-
- org.opencms.widgets.CmsSelectGroupWidget
-
- All Implemented Interfaces:
I_CmsADEWidget
,I_CmsWidget
- Direct Known Subclasses:
CmsMultiSelectGroupWidget
public class CmsSelectGroupWidget extends CmsSelectWidget
Provides a widget for group selection select boxes.This widget is configurable with the following options:
groupfilter
: regular expression to filter available groupsgroups
: comma separated list of group names to show in the select box. Note: if this configuration option if used,groupfilter
andincludesubous
are not considered anymore.includesubous
: boolean flag to indicate if sub OUs should be scanned for groups to selectoufqn
: the fully qualified name of the OU to read the groups from
<mapping element="..." mapto="permission:GROUP:+r+v|GROUP.ALL_OTHERS:|GROUP.Projectmanagers:+r+v+w+c" />
This means that the +r+v permission is written for the principal
GROUP
on the resource. Additionally two permissions are written as default: forALL_OTHERS
, no allowed permission is set, forProjectmanagers
, "+r+v+w+c" is set.- Since:
- 8.0.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.opencms.widgets.A_CmsWidget
A_CmsWidget.CmsDummyWidgetDialog
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.String
CONFIGURATION_GROUPFILTER
Configuration option key: group filter.protected static java.lang.String
CONFIGURATION_GROUPS
Configuration option key: groups.protected static java.lang.String
CONFIGURATION_INCLUDESUBOUS
Configuration option key: include sub OUs.protected static java.lang.String
CONFIGURATION_OUFQN
Configuration option key: OU fully qualified name.-
Fields inherited from class org.opencms.widgets.A_CmsSelectWidget
CONFIGURATION_HEIGHT
-
Fields inherited from class org.opencms.widgets.A_CmsWidget
HELP_POSTFIX, LABEL_PREFIX
-
-
Constructor Summary
Constructors Constructor Description CmsSelectGroupWidget()
Creates a new group select widget.CmsSelectGroupWidget(java.lang.String configuration)
Creates a group select widget with the specified select options.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getConfiguration(CmsObject cms, A_CmsXmlContentValue schemaType, CmsMessages messages, CmsResource resource, java.util.Locale contentLocale)
Returns the configuration string for the ADE content editor widget.java.util.List<java.lang.String>
getCssResourceLinks(CmsObject cms)
Returns a list of CSS resources required by the widget.java.lang.String
getInitCall()
Returns the java script initialization call.java.util.List<java.lang.String>
getJavaScriptResourceLinks(CmsObject cms)
Returns a list of java script resources required by the widget.boolean
isInternal()
Returns if this is an internal widget.I_CmsWidget
newInstance()
Creates a duplicate of this widget instance.protected java.util.List<CmsSelectWidgetOption>
parseSelectOptions(CmsObject cms, CmsMessages messages, I_CmsWidgetParameter param)
Returns the list of configured select options, parsing the configuration String if required.protected java.util.List<CmsSelectWidgetOption>
parseSelectOptions(CmsObject cms, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param)
Returns the list of configured select options, parsing the configuration String if required.-
Methods inherited from class org.opencms.widgets.CmsSelectWidget
getDialogWidget, getWidgetName, getWidgetStringValue
-
Methods inherited from class org.opencms.widgets.A_CmsSelectWidget
addSelectOption, getConfiguration, getDefaultDisplayType, getHeight, getResourcePath, getSelectedValue, getSelectedValues, getSelectOptions, setConfiguration, setSelectOptions
-
Methods inherited from class org.opencms.widgets.A_CmsWidget
equals, getDialogHtmlEnd, getDialogIncludes, getDialogInitCall, getDialogInitMethod, getHelpBubble, getHelpKey, getHelpText, getJsHelpMouseHandler, getJSIncludeFile, getLabelKey, hashCode, isCompactViewEnabled, setEditorValue
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.opencms.widgets.I_CmsWidget
getDialogHtmlEnd, getDialogIncludes, getDialogInitCall, getDialogInitMethod, getHelpBubble, getHelpText, isCompactViewEnabled, setEditorValue
-
-
-
-
Field Detail
-
CONFIGURATION_GROUPFILTER
protected static final java.lang.String CONFIGURATION_GROUPFILTER
Configuration option key: group filter.- See Also:
- Constant Field Values
-
CONFIGURATION_GROUPS
protected static final java.lang.String CONFIGURATION_GROUPS
Configuration option key: groups.- See Also:
- Constant Field Values
-
CONFIGURATION_INCLUDESUBOUS
protected static final java.lang.String CONFIGURATION_INCLUDESUBOUS
Configuration option key: include sub OUs.- See Also:
- Constant Field Values
-
CONFIGURATION_OUFQN
protected static final java.lang.String CONFIGURATION_OUFQN
Configuration option key: OU fully qualified name.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CmsSelectGroupWidget
public CmsSelectGroupWidget()
Creates a new group select widget.
-
CmsSelectGroupWidget
public CmsSelectGroupWidget(java.lang.String configuration)
Creates a group select widget with the specified select options.- Parameters:
configuration
- the configuration (possible options) for the group select box
-
-
Method Detail
-
getConfiguration
public java.lang.String getConfiguration(CmsObject cms, A_CmsXmlContentValue schemaType, CmsMessages messages, CmsResource resource, java.util.Locale contentLocale)
Description copied from interface:I_CmsADEWidget
Returns the configuration string for the ADE content editor widget.- Specified by:
getConfiguration
in interfaceI_CmsADEWidget
- Overrides:
getConfiguration
in classA_CmsSelectWidget
- Parameters:
cms
- the OpenCms contextschemaType
- the schema typemessages
- the messagesresource
- the edited resourcecontentLocale
- the content locale- Returns:
- the configuration string
- See Also:
I_CmsADEWidget.getConfiguration(org.opencms.file.CmsObject, org.opencms.xml.types.A_CmsXmlContentValue, org.opencms.i18n.CmsMessages, org.opencms.file.CmsResource, java.util.Locale)
-
getCssResourceLinks
public java.util.List<java.lang.String> getCssResourceLinks(CmsObject cms)
Description copied from class:A_CmsSelectWidget
Returns a list of CSS resources required by the widget.- Specified by:
getCssResourceLinks
in interfaceI_CmsADEWidget
- Overrides:
getCssResourceLinks
in classA_CmsSelectWidget
- Parameters:
cms
- the current OpenCms context- Returns:
- the required CSS resource links
- See Also:
I_CmsADEWidget.getCssResourceLinks(org.opencms.file.CmsObject)
-
getInitCall
public java.lang.String getInitCall()
Description copied from class:A_CmsSelectWidget
Returns the java script initialization call.- Specified by:
getInitCall
in interfaceI_CmsADEWidget
- Overrides:
getInitCall
in classA_CmsSelectWidget
- Returns:
- the java script initialization call
- See Also:
I_CmsADEWidget.getInitCall()
-
getJavaScriptResourceLinks
public java.util.List<java.lang.String> getJavaScriptResourceLinks(CmsObject cms)
Description copied from class:A_CmsSelectWidget
Returns a list of java script resources required by the widget.- Specified by:
getJavaScriptResourceLinks
in interfaceI_CmsADEWidget
- Overrides:
getJavaScriptResourceLinks
in classA_CmsSelectWidget
- Parameters:
cms
- the current OpenCms context- Returns:
- the required java script resource links
- See Also:
I_CmsADEWidget.getJavaScriptResourceLinks(org.opencms.file.CmsObject)
-
isInternal
public boolean isInternal()
Description copied from class:A_CmsSelectWidget
Returns if this is an internal widget.Only widgets belonging to the OpenCms core should be marked as internal.
- Specified by:
isInternal
in interfaceI_CmsADEWidget
- Overrides:
isInternal
in classA_CmsSelectWidget
- Returns:
true
if this is an internal widget- See Also:
I_CmsADEWidget.isInternal()
-
newInstance
public I_CmsWidget newInstance()
Description copied from interface:I_CmsWidget
Creates a duplicate of this widget instance.- Specified by:
newInstance
in interfaceI_CmsWidget
- Overrides:
newInstance
in classCmsSelectWidget
- Returns:
- a duplicate of this widget instance
- See Also:
I_CmsWidget.newInstance()
-
parseSelectOptions
protected java.util.List<CmsSelectWidgetOption> parseSelectOptions(CmsObject cms, CmsMessages messages, I_CmsWidgetParameter param)
Returns the list of configured select options, parsing the configuration String if required.The list elements are of type
. The configuration String is parsed only once and then stored internally.CmsSelectWidgetOption
- Parameters:
cms
- the current users OpenCms contextmessages
- the messages of this dialogparam
- the widget parameter of this dialog- Returns:
- the list of select options
- See Also:
CmsSelectWidgetOption
-
parseSelectOptions
protected java.util.List<CmsSelectWidgetOption> parseSelectOptions(CmsObject cms, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param)
Description copied from class:A_CmsSelectWidget
Returns the list of configured select options, parsing the configuration String if required.The list elements are of type
. The configuration String is parsed only once and then stored internally.CmsSelectWidgetOption
- Overrides:
parseSelectOptions
in classA_CmsSelectWidget
- Parameters:
cms
- the current users OpenCms contextwidgetDialog
- the dialog of this widgetparam
- the widget parameter of this dialog- Returns:
- the list of select options
- See Also:
A_CmsSelectWidget.parseSelectOptions(org.opencms.file.CmsObject, org.opencms.widgets.I_CmsWidgetDialog, org.opencms.widgets.I_CmsWidgetParameter)
-
-