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 java.lang.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
Nested Classes Modifier and Type Class Description static class
CmsClientProperty.Mode
An enum used for addressing a specific value in a property.
-
Field Summary
Fields Modifier and Type Field Description static com.google.common.base.Function<java.lang.String,CmsClientProperty>
CREATE_PROPERTY
Construction function which creates a new property with a given name.static java.lang.String
PATH_RESOURCE_VALUE
The path component identifying a resource value.static java.lang.String
PATH_STRUCTURE_VALUE
The path component identifying a structure value.static java.lang.String
PROPERTY_COPYRIGHT
The copyright property name.static java.lang.String
PROPERTY_DEFAULTFILE
The default-file property name.static java.lang.String
PROPERTY_DESCRIPTION
The Description property name.static java.lang.String
PROPERTY_NAVINFO
The NavPos property name.static java.lang.String
PROPERTY_NAVPOS
The NavPos property name.static java.lang.String
PROPERTY_NAVTEXT
The NavText property name.static java.lang.String
PROPERTY_TEMPLATE
The NavText property name.static java.lang.String
PROPERTY_TITLE
The Title property name.
-
Constructor Summary
Constructors Modifier Constructor Description protected
CmsClientProperty()
Empty default constructor, used for serialization.CmsClientProperty(java.lang.String name, java.lang.String structureValue, java.lang.String resourceValue)
Creates a new client property bean.CmsClientProperty(CmsClientProperty property)
Copy constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.util.Map<java.lang.String,CmsClientProperty>
copyProperties(java.util.Map<java.lang.String,CmsClientProperty> props)
Helper method for copying a map of properties.java.lang.String
getEffectiveValue()
Returns the effective value of the property.java.lang.String
getName()
Returns the name of the property.java.lang.String
getOrigin()
Gets the origin of the property (might return null).CmsPathValue
getPathValue()
Returns the effective path value of the property.CmsPathValue
getPathValue(CmsClientProperty.Mode mode)
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.java.lang.String
getResourceValue()
Returns the resource value of the property.java.lang.String
getStructureValue()
Returns the structure value of the property.boolean
isEmpty()
Checks if both values of the property are empty.static boolean
isPropertyEmpty(CmsClientProperty prop)
Checks if a property is null or empty.static java.util.Map<java.lang.String,CmsClientProperty>
makeLazyCopy(java.util.Map<java.lang.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
removeEmptyProperties(java.util.Map<java.lang.String,CmsClientProperty> props)
Helper method for removing empty properties from a map.void
setOrigin(java.lang.String origin)
Sets the origin of the property.void
setResourceValue(java.lang.String resourceValue)
Sets the resource value .void
setStructureValue(java.lang.String structureValue)
Sets the structure value.static java.util.Map<java.lang.String,CmsClientProperty>
toLazyMap(java.util.Map<java.lang.String,CmsClientProperty> properties)
Creates a lazy property map which creates properties on lookup if they don'T exist.CmsClientProperty
withOrigin(java.lang.String origin)
Creates a copy of the property, but changes the origin in the copy.
-
-
-
Field Detail
-
CREATE_PROPERTY
public static final com.google.common.base.Function<java.lang.String,CmsClientProperty> CREATE_PROPERTY
Construction function which creates a new property with a given name.
-
PATH_RESOURCE_VALUE
public static final java.lang.String PATH_RESOURCE_VALUE
The path component identifying a resource value.- See Also:
- Constant Field Values
-
PATH_STRUCTURE_VALUE
public static final java.lang.String PATH_STRUCTURE_VALUE
The path component identifying a structure value.- See Also:
- Constant Field Values
-
PROPERTY_COPYRIGHT
public static final java.lang.String PROPERTY_COPYRIGHT
The copyright property name.- See Also:
- Constant Field Values
-
PROPERTY_DEFAULTFILE
public static final java.lang.String PROPERTY_DEFAULTFILE
The default-file property name.- See Also:
- Constant Field Values
-
PROPERTY_DESCRIPTION
public static final java.lang.String PROPERTY_DESCRIPTION
The Description property name.- See Also:
- Constant Field Values
-
PROPERTY_NAVINFO
public static final java.lang.String PROPERTY_NAVINFO
The NavPos property name.- See Also:
- Constant Field Values
-
PROPERTY_NAVPOS
public static final java.lang.String PROPERTY_NAVPOS
The NavPos property name.- See Also:
- Constant Field Values
-
PROPERTY_NAVTEXT
public static final java.lang.String PROPERTY_NAVTEXT
The NavText property name.- See Also:
- Constant Field Values
-
PROPERTY_TEMPLATE
public static final java.lang.String PROPERTY_TEMPLATE
The NavText property name.- See Also:
- Constant Field Values
-
PROPERTY_TITLE
public static final java.lang.String PROPERTY_TITLE
The Title property name.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CmsClientProperty
public CmsClientProperty(CmsClientProperty property)
Copy constructor.- Parameters:
property
- the object from which to copy the data
-
CmsClientProperty
public CmsClientProperty(java.lang.String name, java.lang.String structureValue, java.lang.String resourceValue)
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 Detail
-
copyProperties
public static java.util.Map<java.lang.String,CmsClientProperty> copyProperties(java.util.Map<java.lang.String,CmsClientProperty> props)
Helper method for copying a map of properties.- Parameters:
props
- the property map to copy- Returns:
- a copy of the property map
-
getPathValue
public 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.- Parameters:
property
- the property which values to accessmode
- the property access mode- Returns:
- the path value for the property and access mode
-
isPropertyEmpty
public static boolean isPropertyEmpty(CmsClientProperty prop)
Checks if a property is null or empty.- Parameters:
prop
- the property to check- Returns:
- true if the property is null or empty
-
makeLazyCopy
public static java.util.Map<java.lang.String,CmsClientProperty> makeLazyCopy(java.util.Map<java.lang.String,CmsClientProperty> properties)
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
public static void removeEmptyProperties(java.util.Map<java.lang.String,CmsClientProperty> props)
Helper method for removing empty properties from a map.- Parameters:
props
- the map from which to remove empty properties
-
toLazyMap
public static java.util.Map<java.lang.String,CmsClientProperty> toLazyMap(java.util.Map<java.lang.String,CmsClientProperty> properties)
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
public java.lang.String getEffectiveValue()
Returns the effective value of the property.- Returns:
- the effective value of the property
-
getName
public java.lang.String getName()
Returns the name of the property.- Returns:
- the name of the property
-
getOrigin
public java.lang.String getOrigin()
Gets the origin of the property (might return null).- Returns:
- the origin root path of the property, or null
-
getPathValue
public CmsPathValue getPathValue()
Returns the effective path value of the property.- Returns:
- the effective path value of the property
-
getPathValue
public CmsPathValue getPathValue(CmsClientProperty.Mode mode)
Gets the path value for a specific access mode.- Parameters:
mode
- the access mode- Returns:
- the path value for the access mode
-
getResourceValue
public java.lang.String getResourceValue()
Returns the resource value of the property.- Returns:
- the resource value
-
getStructureValue
public java.lang.String getStructureValue()
Returns the structure value of the property.- Returns:
- the structure value
-
isEmpty
public boolean isEmpty()
Checks if both values of the property are empty.- Returns:
- true if both values of the property are empty
-
setOrigin
public void setOrigin(java.lang.String origin)
Sets the origin of the property.- Parameters:
origin
- the origin root path of the property
-
setResourceValue
public void setResourceValue(java.lang.String resourceValue)
Sets the resource value .- Parameters:
resourceValue
- the new resource value
-
setStructureValue
public void setStructureValue(java.lang.String structureValue)
Sets the structure value.- Parameters:
structureValue
- the new structure value
-
withOrigin
public CmsClientProperty withOrigin(java.lang.String origin)
Creates a copy of the property, but changes the origin in the copy.- Parameters:
origin
- the new origin- Returns:
- the copy of the property
-
-