lumis.portal.structure
Class StructureElement

Package class diagram package StructureElement
java.lang.Object
  extended by lumis.portal.structure.StructureElement
Direct Known Subclasses:
ChannelConfig, PageConfig, ServiceInstanceConfig

public abstract class StructureElement
extends Object

The base class for portal structure elements.

Since:
5.6.0

Constructor Summary
StructureElement()
           
 
Method Summary
protected  void applyPropertyBagChanges()
          Apply the changes made to the properties managed by this element to the property bag persistence entities.
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 abstract  Pattern getManagedPropertiesPattern()
          Returns the property name spaces.
protected abstract  String getPropertyBagId()
          Returns the property bag identifier.
protected  String getPropertyValue(String propertyName)
          Returns the property value 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  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  String stripAccents(String value)
          Removes accents from characters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StructureElement

public StructureElement()
Method Detail

getPropertyBagId

protected abstract String getPropertyBagId()
Returns the property bag identifier.

Returns:
The propertyBagId.
Since:
5.6.0

getManagedPropertiesPattern

protected abstract Pattern getManagedPropertiesPattern()
Returns the property name spaces. Used to decides if a property can be updated.

Returns:
property name spaces
Since:
5.6.0

isManagedProperty

protected boolean isManagedProperty(String propertyName)
Returns whether a property can be edited in this element.

This implementation is based on the getManagedPropertiesPattern().

Parameters:
propertyName - the property name.
Returns:
true if a property can be edited in this element, else returns false.
Since:
5.6.0

getPropertyValue

protected String getPropertyValue(String propertyName)
Returns the property value for a given property name. The property value could be local or inherited.

Parameters:
propertyName - the property name.
Returns:
the property value.
Since:
5.6.0

setPropertyValue

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.

Parameters:
propertyName - the property name.
propertyValue - the property value.
Since:
5.6.0

removeProperty

protected void removeProperty(String propertyName)
Removes a property for a given property name from the local property structure map.

Parameters:
propertyName - the name of the property to be removed.
Since:
5.6.0

loadPropertyBagValues

protected void loadPropertyBagValues()
                              throws PortalException
Loads the values of the property bag of this element.

Only the properties that can be changed are actually loaded.

Throws:
PortalException
Since:
5.6.0
See Also:
isManagedProperty(String)

applyPropertyBagChanges

protected void applyPropertyBagChanges()
                                throws PortalException
Apply the changes made to the properties managed by this element to the property bag persistence entities.

Throws:
PortalException
Since:
5.6.0
See Also:
isManagedProperty(String)

serializePropertyBag

protected String serializePropertyBag()
                               throws PortalException
Serialize the property bags.

Returns the serialized property bags in the following format:

<propertyBag> <p> <n>propertyName</n> <pvt>isPrivate</pvt> <vs> <v>propertyValue 1</v> <v>propertyValue 2</v> ... </vs> </p> <p> ... </p> ... </propertyBag>

Returns:
Serialized property bags.
Throws:
PortalException
Since:
5.6.0

getAutomaticFriendlyId

protected String getAutomaticFriendlyId(String value)
                                 throws PortalException
Generates a friendly identifier for the element based on the given value.

Parameters:
value - the value to use to generate friendly identifier.
Returns:
the generated friendly identifier.
Throws:
PortalException
Since:
6.0.0

mayUseFriendlyId

protected abstract boolean mayUseFriendlyId(String friendlyId)
                                     throws PortalException
Indicates if the element may use the given friendly identifier.

Parameters:
friendlyId - the friendly identifier.
Returns:
true if the element may use the given friendly identifier, false otherwise.
Throws:
PortalException
Since:
6.0.0

getFriendlyIdBaseValue

protected String getFriendlyIdBaseValue(String value)
                                 throws PortalException
Returns the base value from the given value. The base value should replace the forbidden characters, truncate the value to the maximum length allowed and do any other necessary processing.

Parameters:
value - the original value.
Returns:
the processed base value.
Throws:
PortalException
Since:
6.0.0

stripAccents

protected String stripAccents(String value)
                       throws PortalException
Removes accents from characters.

Parameters:
value - the original value.
Returns:
the processed value.
Throws:
PortalException
Since:
6.0.0

getFriendlyIdValueForCounter

protected String getFriendlyIdValueForCounter(String baseValue,
                                              Integer counter)
                                       throws PortalException
Returns the result of base value inserting the given counter.

If the counter is null then no counter should be used.

Parameters:
baseValue - the base value.
counter - the counter.
Returns:
the base value with the given counter inserted.
Throws:
PortalException
Since:
6.0.0

getFriendlyIdMaxLength

protected int getFriendlyIdMaxLength()
Returns the maximum length of friendly identifier.

Returns:
the maximum length of friendly identifier.
Since:
6.0.0


Lumisportal  6.2.0.120405 - Copyright © 2006–2012 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.