org.hippoecm.hst.configuration.components
Class HstComponentConfigurationService

java.lang.Object
  extended by org.hippoecm.hst.configuration.components.HstComponentConfigurationService
All Implemented Interfaces:
HstComponentConfiguration, HstComponentInfo

public class HstComponentConfigurationService
extends Object
implements HstComponentConfiguration


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.hippoecm.hst.configuration.components.HstComponentConfiguration
HstComponentConfiguration.Type
 
Field Summary
 
Fields inherited from interface org.hippoecm.hst.configuration.components.HstComponentConfiguration
PARAMETER_PREFIX_NAME_DELIMITER
 
Constructor Summary
HstComponentConfigurationService(HstNode node, HstComponentConfiguration parent, String rootNodeName)
           
HstComponentConfigurationService(HstNode node, HstComponentConfiguration parent, String rootNodeName, boolean traverseDescendants)
           
 
Method Summary
protected  void autocreateReferenceNames()
           
 String getCanonicalIdentifier()
          Returns the identifier of the backing stored component configuration.
 String getCanonicalStoredLocation()
          Returns the canonical (real physical) location of the stored configuration of this HstComponentConfiguration
 HstComponentConfiguration getChildByName(String name)
          Returns the child HstComponentConfiguration by its name, or null if it doens't exist
 Map<String,HstComponentConfiguration> getChildren()
          Implementations should return an unmodifiable linked map, for example Collections.UnmodifiableMap to avoid client code changing configuration
 String getComponentClassName()
           
 String getComponentFilterTag()
          The filter tag (see HstRequestContext.getComponentFilterTags()) for this component.
 HstComponentConfiguration.Type getComponentType()
           
 String getDummyContent()
          Deprecated. 
 String getHstResourceTemplate()
           
 String getHstTemplate()
           
 String getIconPath()
           
 String getId()
          Returns the id for this component configuration.
 String getLabel()
           
 String getLocalParameter(String name)
          Returns the parameter value without inheritance for the parameter name and null if not present.
 Map<String,String> getLocalParameters()
          see HstComponentConfiguration.getParameter(String), but now only parameters directly present on the HstConfigurationItem are returned.
 String getName()
          Return the name of this component configuration.
 String getNamedRenderer()
           
 String getNamedResourceServer()
           
 String getPageErrorHandlerClassName()
           
 String getParameter(String name)
          Returns the parameter value for the parameter name and null if not present.
 Map<String,String> getParameters()
          Returns the map of all parameters.
 HstComponentConfiguration getParent()
          Returns the parent HstComponentConfiguration for this this component or null if a root component.
 String getReferenceComponent()
           
 String getReferenceName()
          Return the referenceName of this HstComponentConfiguration.
 String getRenderPath()
           
 String getServeResourcePath()
           
 String getXType()
           
protected  void inheritParameters()
           
 boolean isInherited()
           
 boolean isStandalone()
           
protected  void populateComponentReferences(Map<String,HstComponentConfiguration> rootComponentConfigurations, List<HstComponentConfiguration> populated)
           
 void setReferenceName(String referenceName)
           
protected  void setRenderPath(Map<String,HstNode> templateResourceMap)
           
protected  void setServeResourcePath(Map<String,HstNode> templateResourceMap)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HstComponentConfigurationService

public HstComponentConfigurationService(HstNode node,
                                        HstComponentConfiguration parent,
                                        String rootNodeName)
                                 throws ServiceException
Throws:
ServiceException

HstComponentConfigurationService

public HstComponentConfigurationService(HstNode node,
                                        HstComponentConfiguration parent,
                                        String rootNodeName,
                                        boolean traverseDescendants)
                                 throws ServiceException
Throws:
ServiceException
Method Detail

getParent

public HstComponentConfiguration getParent()
Description copied from interface: HstComponentConfiguration
Returns the parent HstComponentConfiguration for this this component or null if a root component.

Specified by:
getParent in interface HstComponentConfiguration

getComponentClassName

public String getComponentClassName()
Specified by:
getComponentClassName in interface HstComponentInfo
Returns:
the fully-qualified class name of the class implementing the HstComponent interface

getXType

public String getXType()
Specified by:
getXType in interface HstComponentConfiguration
Returns:
the xtype of this ComponentConfiguration and null if the component does not have an xtype

getComponentType

public HstComponentConfiguration.Type getComponentType()
Specified by:
getComponentType in interface HstComponentConfiguration
Returns:
the HstComponentConfiguration.Type of this component

getHstTemplate

public String getHstTemplate()

getRenderPath

public String getRenderPath()
Specified by:
getRenderPath in interface HstComponentConfiguration
Returns:
the location of the view renderer. Returns null when HstComponentConfiguration.getNamedRenderer() does not return null
See Also:
HstComponentConfiguration.getNamedRenderer()

getNamedRenderer

public String getNamedRenderer()
Specified by:
getNamedRenderer in interface HstComponentConfiguration
Returns:
the name of the renderer, when using named servlet. Returns null when HstComponentConfiguration.getRenderPath() does not return null
See Also:
HstComponentConfiguration.getRenderPath()

getHstResourceTemplate

public String getHstResourceTemplate()

getServeResourcePath

public String getServeResourcePath()
Specified by:
getServeResourcePath in interface HstComponentConfiguration
Returns:
return the servletpath of the servlet that must serve the resources for this HstComponent

getNamedResourceServer

public String getNamedResourceServer()
Specified by:
getNamedResourceServer in interface HstComponentConfiguration
Returns:
the name of the resource server, when using named servlet. Returns null when HstComponentConfiguration.getServeResourcePath() does not return null
See Also:
HstComponentConfiguration.getServeResourcePath()

getParameter

public String getParameter(String name)
Description copied from interface: HstComponentConfiguration
Returns the parameter value for the parameter name and null if not present. Note that from the HstComponentConfiguration always 'raw' parameters are returned. 'Raw' as in unresolved with respect to property placeholders. So, a value might be ${year} or ${1}. In a HstComponent instance, the implementation might have implemented some resolving for these values. Parameters are inherited from ancestor configurations. Parameters that are configured in an ancestor override parameters configured in this component. Ancestors have precedence. Note that this is opposite to HstSiteMapItem.getParameter(String)

Specified by:
getParameter in interface HstComponentConfiguration
Parameters:
name - the name of the parameter
Returns:
the configured parameter value for this name and null if not existing

getParameters

public Map<String,String> getParameters()
Description copied from interface: HstComponentConfiguration
Returns the map of all parameters. Also see HstComponentConfiguration.getParameter(String). Implementations should return an unmodifiable map, for example Collections.UnmodifiableMap to avoid client code changing configuration Parameters are inherited from ancestor configurations. Parameters that are configured in an ancestor override parameters configured in this component. Ancestors have precedence. Note that this is opposite to HstSiteMapItem.getParameters()

Specified by:
getParameters in interface HstComponentConfiguration
Returns:
the map of all configured parameters, and an empty map if no parameters present

getLocalParameter

public String getLocalParameter(String name)
Description copied from interface: HstComponentConfiguration
Returns the parameter value without inheritance for the parameter name and null if not present. It returns the parameters configured directly on this HstComponentConfiguration, without the merged parameters from parent components (which have precedence, see HstComponentConfiguration.getParameter(String))

Specified by:
getLocalParameter in interface HstComponentConfiguration
Parameters:
name - the name of the parameter
Returns:
the configured parameter value for this name and null if not existing

getLocalParameters

public Map<String,String> getLocalParameters()
Description copied from interface: HstComponentConfiguration
see HstComponentConfiguration.getParameter(String), but now only parameters directly present on the HstConfigurationItem are returned. Thus, no inheritance by parents involved

Specified by:
getLocalParameters in interface HstComponentConfiguration
Returns:
the map of all configured parameters, and an empty map if no parameters present

getId

public String getId()
Description copied from interface: HstComponentInfo
Returns the id for this component configuration. The id must be unique within the container HstComponentsConfiguration, or null if it is not needed to be directly accessed by the HstComponentsConfiguration through HstComponentsConfiguration.getComponentConfiguration(String). Every HstComponentConfiguration that can be referred to from within a HstSiteMapItem must have an id.

Specified by:
getId in interface HstComponentInfo
Returns:
the id of this component configuration or null if no id set

getName

public String getName()
Description copied from interface: HstComponentInfo
Return the name of this component configuration. It must be unique amongst siblings. The value returned by this method, is the value that must be used in rendering code (jsp/velocity/freemarker) to include the output of a child HstComponent instance.

Specified by:
getName in interface HstComponentInfo
Returns:
the logical name this component configuration, unique amongst its siblings

getReferenceName

public String getReferenceName()
Description copied from interface: HstComponentConfiguration
Return the referenceName of this HstComponentConfiguration. It must be unique amongst sibling HstComponentConfiguration's. The value returned by this method, is the value that will occur as part of the referencePath in request parameter names

Specified by:
getReferenceName in interface HstComponentConfiguration
Returns:
the referenceName this HstComponentConfiguration, unique amongst its siblings

setReferenceName

public void setReferenceName(String referenceName)

getReferenceComponent

public String getReferenceComponent()

getPageErrorHandlerClassName

public String getPageErrorHandlerClassName()
Specified by:
getPageErrorHandlerClassName in interface HstComponentConfiguration
Returns:
the fully classified className of the class implementing PageErrorHandler or null when not configured

getDummyContent

@Deprecated
public String getDummyContent()
Deprecated. 


getComponentFilterTag

public String getComponentFilterTag()
Description copied from interface: HstComponentConfiguration
The filter tag (see HstRequestContext.getComponentFilterTags()) for this component.

Specified by:
getComponentFilterTag in interface HstComponentConfiguration
Returns:
the filter tag of this component, or null if no tag is available.

getChildren

public Map<String,HstComponentConfiguration> getChildren()
Description copied from interface: HstComponentConfiguration
Implementations should return an unmodifiable linked map, for example Collections.UnmodifiableMap to avoid client code changing configuration

Specified by:
getChildren in interface HstComponentConfiguration
Returns:
all HstComponentConfiguration children in order they were added, and an empty Map if no children present

getChildByName

public HstComponentConfiguration getChildByName(String name)
Description copied from interface: HstComponentConfiguration
Returns the child HstComponentConfiguration by its name, or null if it doens't exist

Specified by:
getChildByName in interface HstComponentConfiguration
Parameters:
name - the name of the child HstComponentConfiguration

getCanonicalStoredLocation

public String getCanonicalStoredLocation()
Description copied from interface: HstComponentConfiguration
Returns the canonical (real physical) location of the stored configuration of this HstComponentConfiguration

Specified by:
getCanonicalStoredLocation in interface HstComponentConfiguration
Returns:
the canonical location where the configuration is stored

getCanonicalIdentifier

public String getCanonicalIdentifier()
Description copied from interface: HstComponentConfiguration
Returns the identifier of the backing stored component configuration. Note that multiple HstComponentConfiguration's can share the same canonical identifier due to inheritance. Also, multiple subsites can share the same backing configuration, and thus share the same canonical identifiers

Specified by:
getCanonicalIdentifier in interface HstComponentConfiguration
Returns:
the identifier of the backing stored component configuration

isInherited

public boolean isInherited()
Specified by:
isInherited in interface HstComponentConfiguration
Returns:
true when the backing provider (HstNode) of this HstComponentConfiguration is inherited

isStandalone

public boolean isStandalone()
Specified by:
isStandalone in interface HstComponentInfo
Returns:
true when this HstComponentConfiguration is configured to be rendered standalone in case of HstURL.COMPONENT_RENDERING_TYPE

getLabel

public String getLabel()
Specified by:
getLabel in interface HstComponentConfiguration
Returns:
the label if present and null otherwise

getIconPath

public String getIconPath()
Specified by:
getIconPath in interface HstComponentConfiguration
Returns:
the icon path if present and null otherwise. The iconPath should be a path relative to the site webapp

populateComponentReferences

protected void populateComponentReferences(Map<String,HstComponentConfiguration> rootComponentConfigurations,
                                           List<HstComponentConfiguration> populated)
                                    throws ServiceException
Throws:
ServiceException

setRenderPath

protected void setRenderPath(Map<String,HstNode> templateResourceMap)

setServeResourcePath

protected void setServeResourcePath(Map<String,HstNode> templateResourceMap)

inheritParameters

protected void inheritParameters()

autocreateReferenceNames

protected void autocreateReferenceNames()


Copyright © 2008-2012 Hippo. All Rights Reserved.