public abstract class StructureElement extends Object
Constructor and Description |
---|
StructureElement() |
Modifier and Type | Method and Description |
---|---|
protected void |
applyPropertyBagChanges()
Apply the changes made to the properties managed by this element to the property
bag persistence entities.
|
protected void |
deserializePropertyBag(Node propertyBagNode)
Updates this element's property bag according to the given serialized
property bag node.
|
protected String |
getAutomaticFriendlyId(String value)
Generates a friendly identifier for the element based on the given value.
|
protected String |
getFriendlyIdBaseValue(String value)
Returns the base value from the given value.
|
protected int |
getFriendlyIdMaxLength()
Returns the maximum length of friendly identifier.
|
protected String |
getFriendlyIdValueForCounter(String baseValue,
Integer counter)
Returns the result of base value inserting the given counter.
|
protected String |
getLocalPropertyValue(String propertyName)
Gets the property for a given property name from local properties.
|
protected List<String> |
getLocalPropertyValues(String propertyName)
Gets the property values for a given property name from local properties.
|
protected abstract Pattern |
getManagedPropertiesPattern()
Returns the property name spaces.
|
abstract String |
getPropertyBagId()
Returns the property bag identifier.
|
protected String |
getPropertyValue(String propertyName)
Returns the property value for a given property name.
|
protected List<String> |
getPropertyValues(String propertyName)
Returns the property values for a given property name.
|
protected boolean |
isManagedProperty(String propertyName)
Returns whether a property can be edited in this element.
|
protected void |
loadPropertyBagValues()
Loads the values of the property bag of this element.
|
protected abstract boolean |
mayUseFriendlyId(String friendlyId)
Indicates if the element may use the given friendly identifier.
|
protected String |
normalizeFriendlyId(String friendlyId)
Normalizes and return the friendly identifier for the given friendly identifier.
|
protected void |
removeProperty(String propertyName)
Removes a property for a given property name from the local property structure map.
|
protected String |
serializePropertyBag()
Serialize the property bags.
|
protected void |
setPropertyValue(String propertyName,
String propertyValue)
Sets on the local property structure map a given
propertyValue
property value for a given propertyName property name. |
protected void |
setPropertyValues(String propertyName,
List<String> propertyValues)
Sets on the local property structure map a given
propertyValues property values for a given
propertyName property name. |
protected String |
stripAccents(String value)
Removes accents from characters.
|
public abstract String getPropertyBagId()
protected abstract Pattern getManagedPropertiesPattern()
protected boolean isManagedProperty(String propertyName)
This implementation is based on the getManagedPropertiesPattern()
.
propertyName
- the property name.true
if a property can be edited in this element, else returns false
.protected String getPropertyValue(String propertyName)
propertyName
- the property name.protected List<String> getPropertyValues(String propertyName)
propertyName
- the property name.protected String getLocalPropertyValue(String propertyName)
propertyName
- the property name.protected List<String> getLocalPropertyValues(String propertyName)
propertyName
- the property name.protected void setPropertyValue(String propertyName, String propertyValue)
propertyValue
property value for a given propertyName
property name.propertyName
- the property name.propertyValue
- the property value.protected void setPropertyValues(String propertyName, List<String> propertyValues)
propertyValues
property values for a given
propertyName
property name.propertyName
- the property name.propertyValues
- the property values.protected void removeProperty(String propertyName)
propertyName
- the name of the property to be removed.protected void loadPropertyBagValues() throws PortalException
Only the properties that can be changed are actually loaded.
PortalException
isManagedProperty(String)
protected void applyPropertyBagChanges() throws PortalException
PortalException
isManagedProperty(String)
protected String serializePropertyBag() throws PortalException
Returns the serialized property bags in the following format:
...
...PortalException
protected void deserializePropertyBag(Node propertyBagNode) throws PortalException
propertyBagNode
- the property bag serialized node, in the same
syntax as generated by serializePropertyBag()
.PortalException
- if an error occurred during deserialization.protected String getAutomaticFriendlyId(String value) throws PortalException
value
- the value to use to generate friendly identifier.PortalException
protected abstract boolean mayUseFriendlyId(String friendlyId) throws PortalException
friendlyId
- the friendly identifier.PortalException
protected String getFriendlyIdBaseValue(String value) throws PortalException
value
- the original value.PortalException
protected String stripAccents(String value)
value
- the original value.protected String getFriendlyIdValueForCounter(String baseValue, Integer counter) throws PortalException
If the counter is null
then no counter should be used.
baseValue
- the base value.counter
- the counter.PortalException
protected int getFriendlyIdMaxLength()
protected String normalizeFriendlyId(String friendlyId)
friendlyId
- the friendly identifier.IllegalArgumentException
- if friendly identifier is a reserved name.LumisXP 12.4.0.200625 - Copyright © 2006–2020 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.