Class CmsXmlContentProperty
- java.lang.Object
-
- org.opencms.xml.content.CmsXmlContentProperty
-
- All Implemented Interfaces:
java.io.Serializable
public class CmsXmlContentProperty extends java.lang.Object implements java.io.Serializable
Describes both VFS properties and Container Page Element settings, used by the GWT client.Warning: This class is used by GWT client-side code (See GwtBase.gwt.xml for a list of classes used by GWT client-side code). If you change this class, either make sure that your changes are compatible with GWT, or write a separate client version of the class and put it into super_src.
- Since:
- 8.0.0
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CmsXmlContentProperty.PropType
Type constants.static class
CmsXmlContentProperty.Visibility
The property visibility options.static class
CmsXmlContentProperty.XmlNode
XML node name constants.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PROP_SEPARATOR
IDs separator constant.
-
Constructor Summary
Constructors Modifier Constructor Description protected
CmsXmlContentProperty()
Serialization constructor.CmsXmlContentProperty(java.lang.String name, java.lang.String type, java.lang.String widget, java.lang.String widgetConfiguration, java.lang.String ruleRegex, java.lang.String ruleType, java.lang.String default1, java.lang.String niceName, java.lang.String description, java.lang.String error, java.lang.String preferFolder)
Public constructor.CmsXmlContentProperty(java.lang.String name, java.lang.String type, CmsXmlContentProperty.Visibility visibility, java.lang.String widget, java.lang.String widgetConfiguration, java.lang.String ruleRegex, java.lang.String ruleType, java.lang.String default1, java.lang.String niceName, java.lang.String description, java.lang.String error, java.lang.String preferFolder)
Public constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CmsXmlContentProperty
copy()
Copies this property definition.CmsXmlContentProperty.Visibility
getConfiguredVisibility()
Gets the configured visibility, without using a default value.java.lang.String
getConfiguredWidget()
Gets the configured widget, without using a default if it is null.java.lang.String
getDefault()
Returns the default.java.lang.String
getDescription()
Returns the description.java.lang.String
getError()
Returns the error.java.lang.String
getIncludeName(java.lang.String defaultValue)
Gets the include name.java.lang.String
getName()
Returns the property name.java.lang.String
getNiceName()
Returns the niceName.java.lang.String
getRuleRegex()
Returns the ruleRegex.java.lang.String
getRuleType()
Returns the rule type.java.lang.String
getSelectInherit()
Returns a value which indicates whether the user can control the inheritance of this property.java.lang.String
getType()
Returns the property type.CmsXmlContentProperty.Visibility
getVisibility(CmsXmlContentProperty.Visibility defaultValue)
Returns the visibility of the property, used in the container page element context.java.lang.String
getWidget()
Returns the widget.java.lang.String
getWidgetConfiguration()
Returns the widgetConfiguration.boolean
isPreferFolder()
Returns the value of the "prefer folder" option.CmsXmlContentProperty
mergeDefaults(CmsXmlContentProperty defaults)
Merges this object with another one containing default values.CmsXmlContentProperty
withConfig(java.lang.String config)
Returns a modified copy of this bean with a different widget configuration.CmsXmlContentProperty
withDefaultWidget(java.lang.String defaultWidget)
Copies a property definition, but replaces an empty widget with a given widget.CmsXmlContentProperty
withIncludeName(java.lang.String includeName)
Creates a copy of this object with its include name set to a specific value.CmsXmlContentProperty
withName(java.lang.String name)
Copies a property definition, but replaces the nice name attribute.CmsXmlContentProperty
withNiceName(java.lang.String niceName)
Copies a property definition, but replaces the nice name attribute.CmsXmlContentProperty
withValidation(java.lang.String pattern, java.lang.String type, java.lang.String error)
Copies the property definition, but replaces the fields related to validation.
-
-
-
Field Detail
-
PROP_SEPARATOR
public static final java.lang.String PROP_SEPARATOR
IDs separator constant.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CmsXmlContentProperty
public CmsXmlContentProperty(java.lang.String name, java.lang.String type, java.lang.String widget, java.lang.String widgetConfiguration, java.lang.String ruleRegex, java.lang.String ruleType, java.lang.String default1, java.lang.String niceName, java.lang.String description, java.lang.String error, java.lang.String preferFolder)
Public constructor.- Parameters:
name
- the property nametype
- the property type (string|uri)widget
- the widgetwidgetConfiguration
- the widget configurationruleRegex
- the validation rule regexruleType
- the validation rule typedefault1
- the default valueniceName
- the nice-namedescription
- the descriptionerror
- the error messagepreferFolder
- the "prefer folder" option
-
CmsXmlContentProperty
public CmsXmlContentProperty(java.lang.String name, java.lang.String type, CmsXmlContentProperty.Visibility visibility, java.lang.String widget, java.lang.String widgetConfiguration, java.lang.String ruleRegex, java.lang.String ruleType, java.lang.String default1, java.lang.String niceName, java.lang.String description, java.lang.String error, java.lang.String preferFolder)
Public constructor.- Parameters:
name
- the property nametype
- the property type (string|uri)visibility
- the visibility of the property, used in the container page element contextwidget
- the widgetwidgetConfiguration
- the widget configurationruleRegex
- the validation rule regexruleType
- the validation rule typedefault1
- the default valueniceName
- the nice-namedescription
- the descriptionerror
- the error messagepreferFolder
- the "prefer folder" option
-
CmsXmlContentProperty
protected CmsXmlContentProperty()
Serialization constructor.
-
-
Method Detail
-
copy
public CmsXmlContentProperty copy()
Copies this property definition.- Returns:
- a new copy of the current property definition
-
getConfiguredVisibility
public CmsXmlContentProperty.Visibility getConfiguredVisibility()
Gets the configured visibility, without using a default value.- Returns:
- the configured visibility
-
getConfiguredWidget
public java.lang.String getConfiguredWidget()
Gets the configured widget, without using a default if it is null.- Returns:
- the configured widget
-
getDefault
public java.lang.String getDefault()
Returns the default.- Returns:
- the default
-
getDescription
public java.lang.String getDescription()
Returns the description.- Returns:
- the description
-
getError
public java.lang.String getError()
Returns the error.- Returns:
- the error
-
getIncludeName
public java.lang.String getIncludeName(java.lang.String defaultValue)
Gets the include name.This is only used for element settings in formatters, where defaults from setting configuration files can be imported. The returned value is used to look up the setting name to look up for such an import in the setting configuration file.
- Parameters:
defaultValue
- the value that should be returned if no include name is configured- Returns:
- the include name
-
getName
public java.lang.String getName()
Returns the property name.- Returns:
- the property name
-
getNiceName
public java.lang.String getNiceName()
Returns the niceName.- Returns:
- the niceName
-
getRuleRegex
public java.lang.String getRuleRegex()
Returns the ruleRegex.- Returns:
- the ruleRegex
-
getRuleType
public java.lang.String getRuleType()
Returns the rule type.- Returns:
- the rule type
-
getSelectInherit
public java.lang.String getSelectInherit()
Returns a value which indicates whether the user can control the inheritance of this property.- Returns:
- the "select-inherit" property
-
getType
public java.lang.String getType()
Returns the property type.- Returns:
- the property type
-
getVisibility
public CmsXmlContentProperty.Visibility getVisibility(CmsXmlContentProperty.Visibility defaultValue)
Returns the visibility of the property, used in the container page element context.- Parameters:
defaultValue
- the default value to return if the visibility is not set- Returns:
- the visibility of the property
-
getWidget
public java.lang.String getWidget()
Returns the widget.- Returns:
- the widget
-
getWidgetConfiguration
public java.lang.String getWidgetConfiguration()
Returns the widgetConfiguration.- Returns:
- the widgetConfiguration
-
isPreferFolder
public boolean isPreferFolder()
Returns the value of the "prefer folder" option.This flag determines whether a property entered in the sitemap entry editor should be stored by default at the folder or at the default file of a sitemap entry. It only has an effect if the sitemap entry being edited doesn't already have a value for that property at either location.
- Returns:
- the "prefer folder" flag
-
mergeDefaults
public CmsXmlContentProperty mergeDefaults(CmsXmlContentProperty defaults)
Merges this object with another one containing default values.This method does not modify this object or the object passed as a parameter. The resulting object's fields will be filled with the values from the default if they're null in this object.
- Parameters:
defaults
- the object with the defaults- Returns:
- the result of merging this object with the defaults
-
withConfig
public CmsXmlContentProperty withConfig(java.lang.String config)
Returns a modified copy of this bean with a different widget configuration.- Parameters:
config
- the new widget configuration- Returns:
- the copy with the modified widget configuration
-
withDefaultWidget
public CmsXmlContentProperty withDefaultWidget(java.lang.String defaultWidget)
Copies a property definition, but replaces an empty widget with a given widget.- Parameters:
defaultWidget
- the widget to use if the set widget is empty- Returns:
- the copied property definition
-
withIncludeName
public CmsXmlContentProperty withIncludeName(java.lang.String includeName)
Creates a copy of this object with its include name set to a specific value.- Parameters:
includeName
- the include name to use- Returns:
- the copy with the include name set
-
withName
public CmsXmlContentProperty withName(java.lang.String name)
Copies a property definition, but replaces the nice name attribute.- Parameters:
name
- the new nice name attribute- Returns:
- the copied property definition
-
withNiceName
public CmsXmlContentProperty withNiceName(java.lang.String niceName)
Copies a property definition, but replaces the nice name attribute.- Parameters:
niceName
- the new nice name attribute- Returns:
- the copied property definition
-
withValidation
public CmsXmlContentProperty withValidation(java.lang.String pattern, java.lang.String type, java.lang.String error)
Copies the property definition, but replaces the fields related to validation.- Parameters:
pattern
- the validation patterntype
- the validation typeerror
- the validation error message- Returns:
- the copied property definition
-
-