Package org.opencms.gwt.shared.property
Class CmsClientProperty
java.lang.Object
org.opencms.gwt.shared.property.CmsClientProperty
- All Implemented Interfaces:
com.google.gwt.user.client.rpc.IsSerializable
public class CmsClientProperty
extends Object
implements com.google.gwt.user.client.rpc.IsSerializable
A client-side bean for representing an OpenCms property.
- Since:
- 8.0.0
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
An enum used for addressing a specific value in a property. -
Field Summary
Modifier and TypeFieldDescriptionstatic final com.google.common.base.Function<String,
CmsClientProperty> Construction function which creates a new property with a given name.static final String
The path component identifying a resource value.static final String
The path component identifying a structure value.static final String
The copyright property name.static final String
The default-file property name.static final String
The Description property name.static final String
The NavPos property name.static final String
The NavPos property name.static final String
The NavText property name.static final String
The NavText property name.static final String
The Title property name. -
Constructor Summary
ModifierConstructorDescriptionprotected
Empty default constructor, used for serialization.CmsClientProperty
(String name, String structureValue, String resourceValue) Creates a new client property bean.CmsClientProperty
(CmsClientProperty property) Copy constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic Map<String,
CmsClientProperty> copyProperties
(Map<String, CmsClientProperty> props) Helper method for copying a map of properties.Returns the effective value of the property.getName()
Returns the name of the property.Gets the origin of the property (might return null).Returns the effective path value of the property.Gets the path value for a specific access mode.static CmsPathValue
getPathValue
(CmsClientProperty property, CmsClientProperty.Mode mode) Gets the path value for a property object (which may be null) and a property access mode.Returns the resource value of the property.Returns the structure value of the property.boolean
isEmpty()
Checks if both values of the property are empty.static boolean
Checks if a property is null or empty.static Map<String,
CmsClientProperty> makeLazyCopy
(Map<String, CmsClientProperty> properties) Makes a "lazy copy" of a map of properties, which will create properties on lookup if they don't already exist.static void
Helper method for removing empty properties from a map.void
Sets the origin of the property.void
setResourceValue
(String resourceValue) Sets the resource value .void
setStructureValue
(String structureValue) Sets the structure value.static Map<String,
CmsClientProperty> toLazyMap
(Map<String, CmsClientProperty> properties) Creates a lazy property map which creates properties on lookup if they don'T exist.withOrigin
(String origin) Creates a copy of the property, but changes the origin in the copy.
-
Field Details
-
CREATE_PROPERTY
Construction function which creates a new property with a given name. -
PATH_RESOURCE_VALUE
The path component identifying a resource value.- See Also:
-
PATH_STRUCTURE_VALUE
The path component identifying a structure value.- See Also:
-
PROPERTY_COPYRIGHT
The copyright property name.- See Also:
-
PROPERTY_DEFAULTFILE
The default-file property name.- See Also:
-
PROPERTY_DESCRIPTION
The Description property name.- See Also:
-
PROPERTY_NAVINFO
The NavPos property name.- See Also:
-
PROPERTY_NAVPOS
The NavPos property name.- See Also:
-
PROPERTY_NAVTEXT
The NavText property name.- See Also:
-
PROPERTY_TEMPLATE
The NavText property name.- See Also:
-
PROPERTY_TITLE
The Title property name.- See Also:
-
-
Constructor Details
-
CmsClientProperty
Creates a new client property bean.- Parameters:
name
- the property namestructureValue
- the structure valueresourceValue
- the resource value
-
CmsClientProperty
protected CmsClientProperty()Empty default constructor, used for serialization.
-
Method Details
-
copyProperties
Helper method for copying a map of properties.- Parameters:
props
- the property map to copy- Returns:
- a copy of the property map
-
makeLazyCopy
Makes a "lazy copy" of a map of properties, which will create properties on lookup if they don't already exist.- Parameters:
properties
- the properties to copy- Returns:
- the lazy copy of the properties
-
removeEmptyProperties
Helper method for removing empty properties from a map.- Parameters:
props
- the map from which to remove empty properties
-
toLazyMap
Creates a lazy property map which creates properties on lookup if they don'T exist.- Parameters:
properties
- the properties which should be initially put into the map- Returns:
- the lazy property map
-
getEffectiveValue
Returns the effective value of the property.- Returns:
- the effective value of the property
-
getName
Returns the name of the property.- Returns:
- the name of the property
-
getOrigin
Gets the origin of the property (might return null).- Returns:
- the origin root path of the property, or null
-
getPathValue
Returns the effective path value of the property.- Returns:
- the effective path value of the property
-
getResourceValue
Returns the resource value of the property.- Returns:
- the resource value
-
getStructureValue
Returns the structure value of the property.- Returns:
- the structure value
-
isEmpty
Checks if both values of the property are empty.- Returns:
- true if both values of the property are empty
-
setOrigin
Sets the origin of the property.- Parameters:
origin
- the origin root path of the property
-
setResourceValue
Sets the resource value .- Parameters:
resourceValue
- the new resource value
-
setStructureValue
Sets the structure value.- Parameters:
structureValue
- the new structure value
-
withOrigin
Creates a copy of the property, but changes the origin in the copy.- Parameters:
origin
- the new origin- Returns:
- the copy of the property
-