org.hippoecm.hst.mock.core.request
Class MockResolvedSiteMapItem

java.lang.Object
  extended by org.hippoecm.hst.mock.core.request.MockResolvedSiteMapItem
All Implemented Interfaces:
ResolvedSiteMapItem

public class MockResolvedSiteMapItem
extends Object
implements ResolvedSiteMapItem

A dummy ResolvedSiteMapItem for testing purposes.


Constructor Summary
MockResolvedSiteMapItem()
           
 
Method Summary
 void addLocalParameter(String key, String value)
           
 void addParameter(String key, String value)
           
 int getErrorCode()
           
 HstComponentConfiguration getHstComponentConfiguration()
           
 HstSiteMapItem getHstSiteMapItem()
           
 String getLocalParameter(String name)
          See ResolvedSiteMapItem.getParameter(String) only without inheritance of ancestor items
 Properties getLocalParameters()
          See ResolvedSiteMapItem.getParameters() only without inheritance of ancestor items
 String getNamedPipeline()
          Returns the namedPipeline to be used for the Hst Request Processing.
 String getParameter(String name)
          Returns a property from the HstSiteMapItem configuration but should have replaced possible property placeholders.
 Properties getParameters()
          Return the parameter map from the HstSiteMapItem configuration, but all values containing property placeholders should be resolved.
 String getPathInfo()
          Returns a relative path from hst request path to the SiteMapItem that was matched.
 HstComponentConfiguration getPortletHstComponentConfiguration()
           
 String getRelativeContentPath()
          This method returns a content path, relative to the Mount.getContentPath().
 ResolvedMount getResolvedMount()
           
 Set<String> getRoles()
           
 int getStatusCode()
           
 Set<String> getUsers()
           
 boolean isAuthenticated()
           
 void removeLocalParameter(String key)
           
 void removeParameter(String key)
           
 void setAuthenticated(boolean authenticated)
           
 void setErrorCode(int errorCode)
           
 void setHstComponentConfiguration(HstComponentConfiguration hstComponentConfiguration)
           
 void setHstSiteMapItem(HstSiteMapItem hstSiteMapItem)
           
 void setNamedPipeline(String namedPipeline)
           
 void setPathInfo(String pathInfo)
           
 void setPortletHstComponentConfiguration(HstComponentConfiguration portletHstComponentConfiguration)
           
 void setRelativeContentPath(String relativeContentPath)
           
 void setResolvedMount(ResolvedMount resolvedMount)
           
 void setRoles(Set<String> roles)
           
 void setStatusCode(int statusCode)
           
 void setUsers(Set<String> users)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockResolvedSiteMapItem

public MockResolvedSiteMapItem()
Method Detail

getRelativeContentPath

public String getRelativeContentPath()
Description copied from interface: ResolvedSiteMapItem
This method returns a content path, relative to the Mount.getContentPath(). This value should have resolved property placeholders, like ${1}/${2}. If a property placeholder cannot be resolved, the implementation may return null

Specified by:
getRelativeContentPath in interface ResolvedSiteMapItem
Returns:
the content path relative to the Mount.getContentPath() or null if not present or has unresolvable property placeholders

setRelativeContentPath

public void setRelativeContentPath(String relativeContentPath)

getPathInfo

public String getPathInfo()
Description copied from interface: ResolvedSiteMapItem
Returns a relative path from hst request path to the SiteMapItem that was matched. This path never starts with a "/".

Specified by:
getPathInfo in interface ResolvedSiteMapItem
Returns:
the matched path to this ResolvedSiteMapItem, relative to the mount path

setPathInfo

public void setPathInfo(String pathInfo)

getParameter

public String getParameter(String name)
Description copied from interface: ResolvedSiteMapItem
Returns a property from the HstSiteMapItem configuration but should have replaced possible property placeholders. If a property placeholder cannot be resolved, the implementation can return null. Parameters are inherited from ancestor items, but in case of the same name, ancestor items have a lower precedence

Specified by:
getParameter in interface ResolvedSiteMapItem
Parameters:
name - the name of the parameter
Returns:
the value of the parameter and null if the parameter is not there or a property placeholder cannot be resolved

getParameters

public Properties getParameters()
Description copied from interface: ResolvedSiteMapItem
Return the parameter map from the HstSiteMapItem configuration, but all values containing property placeholders should be resolved. Parameters are inherited from ancestor items, but in case of the same name, ancestor items have a lower precedence

Specified by:
getParameters in interface ResolvedSiteMapItem
Returns:
the all the parameters as a Properties map, and an empty Properties object when no parameters defined or inherited, or the parameter values cannot be resolved

addParameter

public void addParameter(String key,
                         String value)

removeParameter

public void removeParameter(String key)

getLocalParameter

public String getLocalParameter(String name)
Description copied from interface: ResolvedSiteMapItem
See ResolvedSiteMapItem.getParameter(String) only without inheritance of ancestor items

Specified by:
getLocalParameter in interface ResolvedSiteMapItem
Parameters:
name - the name of the parameter
Returns:
the value of the parameter and null if the parameter is not there or a property placeholder cannot be resolved

getLocalParameters

public Properties getLocalParameters()
Description copied from interface: ResolvedSiteMapItem
See ResolvedSiteMapItem.getParameters() only without inheritance of ancestor items

Specified by:
getLocalParameters in interface ResolvedSiteMapItem
Returns:
the all the parameters as a Properties map, and an empty Properties object when no parameters defined, or the parameter values cannot be resolved

addLocalParameter

public void addLocalParameter(String key,
                              String value)

removeLocalParameter

public void removeLocalParameter(String key)

getHstSiteMapItem

public HstSiteMapItem getHstSiteMapItem()
Specified by:
getHstSiteMapItem in interface ResolvedSiteMapItem
Returns:
the HstSiteMapItem that is matched for this request

setHstSiteMapItem

public void setHstSiteMapItem(HstSiteMapItem hstSiteMapItem)

getStatusCode

public int getStatusCode()
Specified by:
getStatusCode in interface ResolvedSiteMapItem
Returns:
the statusCode specified by HstSiteMapItem.getStatusCode()

setStatusCode

public void setStatusCode(int statusCode)

getErrorCode

public int getErrorCode()
Specified by:
getErrorCode in interface ResolvedSiteMapItem
Returns:
the errorCode specified by HstSiteMapItem.getErrorCode()

setErrorCode

public void setErrorCode(int errorCode)

getRoles

public Set<String> getRoles()
Specified by:
getRoles in interface ResolvedSiteMapItem
Returns:
the roles that are allowed to proceed the request with this resolved sitemap item. If no roles present, and empty list is returned

setRoles

public void setRoles(Set<String> roles)

getUsers

public Set<String> getUsers()
Specified by:
getUsers in interface ResolvedSiteMapItem
Returns:
the users that are allowed to proceed the request with this resolved sitemap item. If no users present, and empty list is returned

setUsers

public void setUsers(Set<String> users)

isAuthenticated

public boolean isAuthenticated()
Specified by:
isAuthenticated in interface ResolvedSiteMapItem
Returns:
true if ResolvedSiteMapItem.getRoles() should be applied to this ResolvedSiteMap item

setAuthenticated

public void setAuthenticated(boolean authenticated)

getHstComponentConfiguration

public HstComponentConfiguration getHstComponentConfiguration()
Specified by:
getHstComponentConfiguration in interface ResolvedSiteMapItem
Returns:
the root HstComponentConfiguration that is configured on the backing ResolvedSiteMapItem.getHstSiteMapItem() of this ResolvedSiteMapItem

setHstComponentConfiguration

public void setHstComponentConfiguration(HstComponentConfiguration hstComponentConfiguration)

getPortletHstComponentConfiguration

public HstComponentConfiguration getPortletHstComponentConfiguration()
Specified by:
getPortletHstComponentConfiguration in interface ResolvedSiteMapItem
Returns:
the HstComponentConfiguration for portlet that is found through ResolvedSiteMapItem.getHstSiteMapItem()

setPortletHstComponentConfiguration

public void setPortletHstComponentConfiguration(HstComponentConfiguration portletHstComponentConfiguration)

getNamedPipeline

public String getNamedPipeline()
Description copied from interface: ResolvedSiteMapItem
Returns the namedPipeline to be used for the Hst Request Processing. When the backing HstSiteMapItem does not contain one, possibly, when present, it is inherited from its backing Mount. If this one does not have it either, null is returned implying the default pipeline will be called

Specified by:
getNamedPipeline in interface ResolvedSiteMapItem
Returns:
the namedPipeline for this ResolvedSiteMapItem or null implying the default should be used

setNamedPipeline

public void setNamedPipeline(String namedPipeline)

getResolvedMount

public ResolvedMount getResolvedMount()
Specified by:
getResolvedMount in interface ResolvedSiteMapItem
Returns:
the ResolvedMount for this resolvedSiteMapItem instance

setResolvedMount

public void setResolvedMount(ResolvedMount resolvedMount)


Copyright © 2008-2012 Hippo. All Rights Reserved.