org.hippoecm.hst.mock.configuration.components
Class MockHstComponentConfiguration

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

public class MockHstComponentConfiguration
extends Object
implements HstComponentConfiguration

Mock implementation of 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
MockHstComponentConfiguration(String id)
           
 
Method Summary
 HstComponentConfiguration addChild(HstComponentConfiguration config)
           
 void addChildren(MockHstComponentConfiguration... config)
           
 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
 SortedMap<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 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 getReferenceName()
          Return the referenceName of this HstComponentConfiguration.
 String getRenderPath()
           
 String getServeResourcePath()
           
 String getXType()
           
 boolean isInherited()
           
 boolean isStandalone()
           
 void setCanonicalIdentifier(String canonicalIdentifier)
           
 void setCanonicalStoredLocation(String canonicalStoredLocation)
           
 void setComponentClassName(String componentClassName)
           
 void setComponentType(HstComponentConfiguration.Type componentType)
           
 void setIconPath(String iconPath)
           
 void setInherited(boolean inherited)
           
 void setLabel(String label)
           
 void setLocalParameter(String name, String value)
           
 void setName(String name)
           
 void setNamedRenderer(String namedRenderer)
           
 void setNamedResourceServer(String namedResourceServer)
           
 void setPageErrorHandlerClassName(String pageErrorHandlerClassName)
           
 void setParameter(String name, String value)
           
 void setParent(HstComponentConfiguration parent)
           
 void setReferenceName(String referenceName)
           
 void setRenderPath(String renderPath)
           
 void setServeResourcePath(String serveResourcePath)
           
 void setStandalone(boolean standalone)
           
 void setXType(String xType)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockHstComponentConfiguration

public MockHstComponentConfiguration(String id)
Method Detail

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

getChildren

public SortedMap<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

addChild

public HstComponentConfiguration addChild(HstComponentConfiguration config)

addChildren

public void addChildren(MockHstComponentConfiguration... config)

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

setCanonicalStoredLocation

public void setCanonicalStoredLocation(String canonicalStoredLocation)

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

setLocalParameter

public void setLocalParameter(String name,
                              String value)

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

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

setParameter

public void setParameter(String name,
                         String value)

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

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

setParent

public void setParent(HstComponentConfiguration parent)

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)

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()

setRenderPath

public void setRenderPath(String renderPath)

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

setServeResourcePath

public void setServeResourcePath(String serveResourcePath)

getComponentClassName

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

setComponentClassName

public void setComponentClassName(String componentClassName)

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

setName

public void setName(String name)

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

setCanonicalIdentifier

public void setCanonicalIdentifier(String canonicalIdentifier)

getComponentType

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

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.

setComponentType

public void setComponentType(HstComponentConfiguration.Type componentType)

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()

setNamedRenderer

public void setNamedRenderer(String namedRenderer)

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()

setNamedResourceServer

public void setNamedResourceServer(String namedResourceServer)

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

setPageErrorHandlerClassName

public void setPageErrorHandlerClassName(String pageErrorHandlerClassName)

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

setXType

public void setXType(String xType)

isInherited

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

setInherited

public void setInherited(boolean 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

setStandalone

public void setStandalone(boolean standalone)

getLabel

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

setLabel

public void setLabel(String label)

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

setIconPath

public void setIconPath(String iconPath)


Copyright © 2008-2012 Hippo. All Rights Reserved.