Package org.hippoecm.hst.core.component
Interface HstURL
-
public interface HstURL
TheHstURL
interface represents a URL that reference the HstComponent itself.An HstURL is created through the
HstResponse
. Parameters can be added toHstURL
objects.There are four types of HstURLs:
- Action URLs, they are created with
, and trigger an action request followed by a render request.HstResponse.createActionURL()
- Render URLs, they are created with
, and trigger a render request.HstResponse.createRenderURL()
- Resource URLs, they are created with
, and trigger a resource rendering request.HstResponse.createResourceURL()
- Navigational Render URLs, they are created with
, and trigger a render request to another navigation link url.HstResponse.createNavigationalURL(String)
- Component Rendering URLs, they are created with
HstResponse.createComponentRenderingURL()
The string representation of a HstURL does not need to be a valid URL at the time the
is generating its content. It may contain special tokens that will be converted to a valid URL by the container before the content is returned to the client.HstComponent
- Version:
- $Id$
- Action URLs, they are created with
-
-
Field Summary
Fields Modifier and Type Field Description static String
ACTION_TYPE
static String
COMPONENT_RENDERING_TYPE
static String
RENDER_TYPE
static String
RESOURCE_TYPE
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Map<String,String[]>
getParameterMap()
Returns the parameter map of this url.String
getReferenceNamespace()
Returns the reference namespaceString
getResourceID()
Returns the resource IDString
getType()
Returns the url type: render, action or resourcevoid
setParameter(String name, String value)
Sets a parameter of this url.void
setParameter(String name, String[] values)
Sets a parameter array of this url.void
setParameters(Map<String,String[]> parameters)
Sets parameter map of this urlvoid
setResourceID(String resourceID)
Allows setting a resource ID that can be retrieved when serving the resource through HstRequest.getResourceID() method in a HstComponent instance.String
toString()
Returns string representation of this url.String
toString(boolean containerResource)
Returns String representation of url, possibly depending on whethercontainerResource
is true or false : Container resources in specific cases need to return a different url.void
write(Writer out)
Writes the string representation of this url.void
write(Writer out, boolean escapeXML)
Writes the string representation of this url, as xml-escaped.
-
-
-
Field Detail
-
ACTION_TYPE
static final String ACTION_TYPE
- See Also:
- Constant Field Values
-
RENDER_TYPE
static final String RENDER_TYPE
- See Also:
- Constant Field Values
-
COMPONENT_RENDERING_TYPE
static final String COMPONENT_RENDERING_TYPE
- See Also:
- Constant Field Values
-
RESOURCE_TYPE
static final String RESOURCE_TYPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getType
String getType()
Returns the url type: render, action or resource
-
getReferenceNamespace
String getReferenceNamespace()
Returns the reference namespace- Returns:
- String
-
setParameter
void setParameter(String name, String value)
Sets a parameter of this url.- Parameters:
name
-value
-
-
setParameter
void setParameter(String name, String[] values)
Sets a parameter array of this url.- Parameters:
name
-values
-
-
setParameters
void setParameters(Map<String,String[]> parameters)
Sets parameter map of this url- Parameters:
parameters
-
-
toString
String toString()
Returns string representation of this url.
-
toString
String toString(boolean containerResource)
Returns String representation of url, possibly depending on whethercontainerResource
is true or false : Container resources in specific cases need to return a different url. For example the URL for a container resource in case of the PageModelAPI should never includeResolvedMount.getMatchingIgnoredPrefix()
: typically this value in the preview CM is _cmsinternal, but for PageModelApi responses this should never be included for container resources
-
write
void write(Writer out) throws IOException
Writes the string representation of this url.- Parameters:
out
-- Throws:
IOException
-
write
void write(Writer out, boolean escapeXML) throws IOException
Writes the string representation of this url, as xml-escaped.- Parameters:
out
-escapeXML
-- Throws:
IOException
-
setResourceID
void setResourceID(String resourceID)
Allows setting a resource ID that can be retrieved when serving the resource through HstRequest.getResourceID() method in a HstComponent instance.- Parameters:
resourceID
-
-
getResourceID
String getResourceID()
Returns the resource ID- Returns:
- the resource ID
-
-