public class MockHstComponentConfiguration extends Object implements HstComponentConfiguration, ConfigurationLockInfo
HstComponentConfiguration
.HstComponentConfiguration.Type
PARAMETER_PREFIX_NAME_DELIMITER
Constructor and Description |
---|
MockHstComponentConfiguration(String id) |
Modifier and Type | Method and Description |
---|---|
HstComponentConfiguration |
addChild(HstComponentConfiguration config) |
void |
addChildren(MockHstComponentConfiguration... config) |
String |
getAsyncMode()
Optional mode parameter to determine which technology should used for rendering asynchronous component.
|
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(java.util.Map<? extends K, ? extends V>) 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() |
Calendar |
getLastModified() |
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 |
getLockedBy()
Returns the name of the user that has locked this configuration item or
null if it is not locked. |
Calendar |
getLockedOn()
Returns the timestamp at which this configuration item became locked or
null if it is not locked. |
List<String> |
getMountVariants()
This method returns all
HstComponentConfiguration.getParameterPrefixes()
for the entire Mount combined |
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. |
Set<String> |
getParameterPrefixes()
Parameters can have prefixes (variant).
|
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() |
List<String> |
getVariants()
This method returns
HstComponentConfiguration.getParameterPrefixes() for the entire composite tree of descendant components
including the current component |
String |
getXType() |
boolean |
isAsync()
Rendering asynchronous is very useful for hst components that are uncacheable, depend on external services, or take long to render.
|
boolean |
isCompositeCacheable() |
boolean |
isInherited() |
boolean |
isMarkedDeleted()
true when this HstComponentConfiguration is marked as deleted. |
boolean |
isPrototype() |
boolean |
isStandalone() |
boolean |
isSuppressWasteMessage()
When the
HstComponentWindow#getResponseState() of this HstComponentInfo is not flushed
by its parent rendering, a warning message about possible waste detection can be logged. |
void |
setAsync(boolean async) |
void |
setAsyncMode(String asyncMode) |
void |
setCanonicalIdentifier(String canonicalIdentifier) |
void |
setCanonicalStoredLocation(String canonicalStoredLocation) |
void |
setComponentClassName(String componentClassName) |
void |
setComponentType(HstComponentConfiguration.Type componentType) |
void |
setCompositeCacheable(boolean compositeCacheable) |
void |
setIconPath(String iconPath) |
void |
setInherited(boolean inherited) |
void |
setLabel(String label) |
void |
setLastModified(Calendar lastModified) |
void |
setLocalParameter(String name,
String value) |
void |
setLockedBy(String lockedBy) |
void |
setLockedOn(Calendar lockedOn) |
void |
setMarkedDeleted(boolean markedDeleted) |
void |
setMountVariants(List<String> mountVariants) |
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 |
setVariants(List<String> variants) |
void |
setXType(String xType) |
public MockHstComponentConfiguration(String id)
public HstComponentConfiguration getChildByName(String name)
HstComponentConfiguration
getChildByName
in interface HstComponentConfiguration
name
- the name of the child HstComponentConfigurationpublic SortedMap<String,HstComponentConfiguration> getChildren()
HstComponentConfiguration
Collections.unmodifiableMap(java.util.Map<? extends K, ? extends V>)
to avoid client code changing configurationgetChildren
in interface HstComponentConfiguration
HstComponentConfiguration
children in order they were added, and an empty Map if no
children presentpublic HstComponentConfiguration addChild(HstComponentConfiguration config)
public void addChildren(MockHstComponentConfiguration... config)
public String getCanonicalStoredLocation()
HstComponentConfiguration
getCanonicalStoredLocation
in interface HstComponentConfiguration
public void setCanonicalStoredLocation(String canonicalStoredLocation)
public String getLocalParameter(String name)
HstComponentConfiguration
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)
)getLocalParameter
in interface HstComponentConfiguration
name
- the name of the parametername
and null
if not existingpublic Map<String,String> getLocalParameters()
HstComponentConfiguration
HstComponentConfiguration.getParameter(String)
, but now only parameters directly present on the HstConfigurationItem are
returned. Thus, no inheritance by parents involvedgetLocalParameters
in interface HstComponentConfiguration
public String getParameter(String name)
HstComponentConfiguration
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)
getParameter
in interface HstComponentConfiguration
name
- the name of the parametername
and null
if not existingpublic Set<String> getParameterPrefixes()
HstComponentConfiguration
Set
of prefixes / variants in use. Only the prefixes/variants on the current component are
returned, thus not for descendant components like HstComponentConfiguration.getVariants()
does.getParameterPrefixes
in interface HstComponentConfiguration
Set
of available prefixes for all available parameters and if no prefixes in use, returns an
Empty Set
public Map<String,String> getParameters()
HstComponentConfiguration
HstComponentConfiguration.getParameter(String)
. Implementations should return an
unmodifiable map, for example Collections.unmodifiableMap(java.util.Map<? extends K, ? extends V>)
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()
getParameters
in interface HstComponentConfiguration
public HstComponentConfiguration getParent()
HstComponentConfiguration
HstComponentConfiguration
for this this component or null if a root component.getParent
in interface HstComponentConfiguration
public void setParent(HstComponentConfiguration parent)
public String getReferenceName()
HstComponentConfiguration
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 namesgetReferenceName
in interface HstComponentConfiguration
public void setReferenceName(String referenceName)
public String getRenderPath()
getRenderPath
in interface HstComponentConfiguration
null
when HstComponentConfiguration.getNamedRenderer()
does not
return null
HstComponentConfiguration.getNamedRenderer()
public void setRenderPath(String renderPath)
public String getServeResourcePath()
getServeResourcePath
in interface HstComponentConfiguration
HstComponent
public void setServeResourcePath(String serveResourcePath)
public String getComponentClassName()
getComponentClassName
in interface HstComponentInfo
HstComponent
interfacepublic void setComponentClassName(String componentClassName)
public String getId()
HstComponentInfo
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.getId
in interface HstComponentInfo
null
if no id setpublic String getName()
HstComponentInfo
HstComponent
instance.getName
in interface HstComponentInfo
public void setName(String name)
public String getCanonicalIdentifier()
HstComponentConfiguration
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 identifiersgetCanonicalIdentifier
in interface HstComponentConfiguration
public void setCanonicalIdentifier(String canonicalIdentifier)
public HstComponentConfiguration.Type getComponentType()
getComponentType
in interface HstComponentConfiguration
HstComponentConfiguration.Type
of this componentpublic String getComponentFilterTag()
HstComponentConfiguration
HstRequestContext.getComponentFilterTags()
) for this
component.getComponentFilterTag
in interface HstComponentConfiguration
public void setComponentType(HstComponentConfiguration.Type componentType)
public String getNamedRenderer()
getNamedRenderer
in interface HstComponentConfiguration
null
when HstComponentConfiguration.getRenderPath()
does not return null
HstComponentConfiguration.getRenderPath()
public void setNamedRenderer(String namedRenderer)
public String getNamedResourceServer()
getNamedResourceServer
in interface HstComponentConfiguration
null
when HstComponentConfiguration.getServeResourcePath()
does not return null
HstComponentConfiguration.getServeResourcePath()
public void setNamedResourceServer(String namedResourceServer)
public String getPageErrorHandlerClassName()
getPageErrorHandlerClassName
in interface HstComponentConfiguration
PageErrorHandler
or null
when not configuredpublic void setPageErrorHandlerClassName(String pageErrorHandlerClassName)
public String getXType()
getXType
in interface HstComponentConfiguration
null
if the component does not have an xtypepublic void setXType(String xType)
public boolean isInherited()
isInherited
in interface HstComponentConfiguration
true
when the backing provider (HstNode
) of this HstComponentConfiguration
is inheritedpublic boolean isPrototype()
isPrototype
in interface HstComponentConfiguration
true
when this HstComponentConfiguration
can be used as a prototype to create other
HstComponentConfiguration
s withpublic void setInherited(boolean inherited)
public boolean isStandalone()
isStandalone
in interface HstComponentInfo
true
when this HstComponentConfiguration
is configured to be rendered standalone in case of HstURL.COMPONENT_RENDERING_TYPE
public void setStandalone(boolean standalone)
public boolean isAsync()
HstComponentInfo
isAsync
in interface HstComponentInfo
true
when this HstComponentConfiguration
is configured to be rendered asynchronous.public void setAsync(boolean async)
public String getAsyncMode()
HstComponentInfo
getAsyncMode
in interface HstComponentInfo
public void setAsyncMode(String asyncMode)
public boolean isCompositeCacheable()
isCompositeCacheable
in interface HstComponentInfo
true
if rendering / resource requests can have their entire page http responses cached. Note that
a HstComponentConfiguration
by default is cacheable unless configured not to be cacheable. A HstComponentConfiguration
is only cacheable if and only if all its descendant HstComponentConfiguration
s for the request are cacheable : Note
explicitly for 'the request', thus HstComponentConfiguration
that are HstComponentInfo.isAsync()
and its descendants can be uncacheable while an ancestor HstComponentConfiguration
can stay cacheablepublic boolean isSuppressWasteMessage()
HstComponentInfo
HstComponentWindow#getResponseState()
of this HstComponentInfo
is not flushed
by its parent rendering, a warning message about possible waste detection can be logged. If you want to
suppress this message, HstComponentInfo.isSuppressWasteMessage()
should return true
isSuppressWasteMessage
in interface HstComponentInfo
true
when possible waste messages about this component should be suppressedpublic void setCompositeCacheable(boolean compositeCacheable)
public String getLabel()
getLabel
in interface HstComponentConfiguration
null
otherwisepublic void setLabel(String label)
public String getIconPath()
getIconPath
in interface HstComponentConfiguration
null
otherwise. The iconPath should be a path relative to the
site webapppublic void setIconPath(String iconPath)
public List<String> getVariants()
HstComponentConfiguration
HstComponentConfiguration.getParameterPrefixes()
for the entire composite tree of descendant components
including the current componentgetVariants
in interface HstComponentConfiguration
HstComponentConfiguration
plus all the variants
of all its descendant HstComponentConfiguration
s. If no variants are present, and EMPTY List is
returned.public List<String> getMountVariants()
HstComponentConfiguration
HstComponentConfiguration.getParameterPrefixes()
for the entire Mount
combinedgetMountVariants
in interface HstComponentConfiguration
Mount
. If no
variants are present, an empty list is returned.public String getLockedBy()
ConfigurationLockInfo
null
if it is not locked.getLockedBy
in interface ConfigurationLockInfo
null
public void setLockedBy(String lockedBy)
public Calendar getLockedOn()
ConfigurationLockInfo
null
if it is not locked.getLockedOn
in interface ConfigurationLockInfo
null
public void setLockedOn(Calendar lockedOn)
public Calendar getLastModified()
getLastModified
in interface HstComponentConfiguration
Calendar
time this component got changed for the last time or null
if not
availablepublic void setLastModified(Calendar lastModified)
public boolean isMarkedDeleted()
HstComponentConfiguration
true
when this HstComponentConfiguration
is marked as deleted. An HstComponentConfiguration
that
has an ancestor that is marked as deleted will itself also be marked as deleted. A marked deleted component item will
be part of the HST model via HstComponentsConfiguration.getComponentConfigurations()
but should be skipped
during execution.isMarkedDeleted
in interface HstComponentConfiguration
true
when this HstComponentConfiguration
is marked as deleted.public void setMarkedDeleted(boolean markedDeleted)
Copyright © 2008–2016 Hippo B.V. (http://www.onehippo.com). All rights reserved.