|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hippoecm.hst.mock.core.component.MockHstResponseBase
org.hippoecm.hst.mock.core.component.MockHstResponse
public class MockHstResponse
MockHstResponse
Field Summary |
---|
Fields inherited from interface javax.servlet.http.HttpServletResponse |
---|
SC_ACCEPTED, SC_BAD_GATEWAY, SC_BAD_REQUEST, SC_CONFLICT, SC_CONTINUE, SC_CREATED, SC_EXPECTATION_FAILED, SC_FORBIDDEN, SC_FOUND, SC_GATEWAY_TIMEOUT, SC_GONE, SC_HTTP_VERSION_NOT_SUPPORTED, SC_INTERNAL_SERVER_ERROR, SC_LENGTH_REQUIRED, SC_METHOD_NOT_ALLOWED, SC_MOVED_PERMANENTLY, SC_MOVED_TEMPORARILY, SC_MULTIPLE_CHOICES, SC_NO_CONTENT, SC_NON_AUTHORITATIVE_INFORMATION, SC_NOT_ACCEPTABLE, SC_NOT_FOUND, SC_NOT_IMPLEMENTED, SC_NOT_MODIFIED, SC_OK, SC_PARTIAL_CONTENT, SC_PAYMENT_REQUIRED, SC_PRECONDITION_FAILED, SC_PROXY_AUTHENTICATION_REQUIRED, SC_REQUEST_ENTITY_TOO_LARGE, SC_REQUEST_TIMEOUT, SC_REQUEST_URI_TOO_LONG, SC_REQUESTED_RANGE_NOT_SATISFIABLE, SC_RESET_CONTENT, SC_SEE_OTHER, SC_SERVICE_UNAVAILABLE, SC_SWITCHING_PROTOCOLS, SC_TEMPORARY_REDIRECT, SC_UNAUTHORIZED, SC_UNSUPPORTED_MEDIA_TYPE, SC_USE_PROXY |
Constructor Summary | |
---|---|
MockHstResponse()
|
Method Summary | |
---|---|
void |
addHeadElement(Element element,
String keyHint)
Adds an header element property to the response. |
void |
addPreamble(Comment comment)
Add a preamble comment node, which gets rendered at the beginning of the render window. |
boolean |
containsHeadElement(String keyHint)
Asks if a property exists already or not. |
HstURL |
createActionURL()
Creates a HST Action URL targeting the HstComponent. |
Comment |
createComment(String comment)
Creates a comment element |
HstURL |
createComponentRenderingURL()
Creates a HST component rendering URL targeting a specific HstComponent |
Element |
createElement(String tagName)
Creates an element of the type specified to be used in the #addProperty(String, Element) method. |
HstURL |
createNavigationalURL(String pathInfo)
Creates a HST Navigational Render URL |
HstURL |
createRenderURL()
Creates a HST Render URL targeting the HstComponent. |
HstURL |
createResourceURL()
Creates a HST Resource URL targeting the current HstComponent. |
HstURL |
createResourceURL(String referenceNamespace)
Creates a HST Resource URL targeting the HstComponent indicated by referenceNamespace. |
void |
flushChildContent(String name)
Flushes the buffer of child window. |
void |
forward(String pathInfo)
Forwards the page request to pathInfo. |
List<String> |
getChildContentNames()
Returns the flushable child content window names. |
String |
getForwardPathInfo()
|
List<Element> |
getHeadElements()
Retrieves header element list. |
String |
getNamespace()
The value returned by this method should be prefixed or appended to elements, such as JavaScript variables or function names, to ensure they are unique in the context of the HST-managed page. |
List<Comment> |
getPreambles()
|
Map<String,String[]> |
getRenderParameters()
|
String |
getRenderPath()
|
String |
getServeResourcePath()
|
Element |
getWrapperElement()
Returns the wrapper element for the rendered content |
boolean |
isRendererSkipped()
For single /subtree component rendering mode that has HstComponentInfo.isStandalone() equal to false , this
check can be used whether some HstComponent won't get its renderer called. |
void |
setNamespace(String namespace)
|
void |
setRendererSkipped(boolean rendererSkipped)
|
void |
setRenderParameter(String key,
String value)
Sets a String parameter for the rendering phase. |
void |
setRenderParameter(String key,
String[] values)
Sets a String parameter for the rendering phase. |
void |
setRenderParameters(Map<String,String[]> parameters)
Sets a parameter map for the render request. |
void |
setRenderPath(String renderPath)
Sets the renderPath dynamically. |
void |
setServeResourcePath(String serveResourcePath)
Sets the serveResourcePath dynamically. |
void |
setWrapperElement(Element element)
Sets wrapper element for the rendered content |
Methods inherited from class org.hippoecm.hst.mock.core.component.MockHstResponseBase |
---|
addCookie, addDateHeader, addHeader, addIntHeader, containsHeader, encodeRedirectUrl, encodeRedirectURL, encodeUrl, encodeURL, flushBuffer, getBufferSize, getCharacterEncoding, getContentAsByteArray, getContentAsString, getContentLength, getContentType, getCookies, getHeaders, getLocale, getOutputStream, getRedirectLocation, getStatusCode, getStatusMessage, getWriter, isCommitted, reset, resetBuffer, sendError, sendError, sendRedirect, setBufferSize, setCharacterEncoding, setContentLength, setContentType, setDateHeader, setHeader, setIntHeader, setLocale, setStatus, setStatus |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.hippoecm.hst.core.component.HstResponse |
---|
addCookie, sendError, sendError, sendRedirect, setStatus |
Methods inherited from interface javax.servlet.http.HttpServletResponse |
---|
addDateHeader, addHeader, addIntHeader, containsHeader, encodeRedirectUrl, encodeRedirectURL, encodeUrl, encodeURL, setDateHeader, setHeader, setIntHeader, setStatus |
Methods inherited from interface javax.servlet.ServletResponse |
---|
flushBuffer, getBufferSize, getCharacterEncoding, getContentType, getLocale, getOutputStream, getWriter, isCommitted, reset, resetBuffer, setBufferSize, setCharacterEncoding, setContentLength, setContentType, setLocale |
Constructor Detail |
---|
public MockHstResponse()
Method Detail |
---|
public HstURL createRenderURL()
HstResponse
createRenderURL
in interface HstResponse
public HstURL createNavigationalURL(String pathInfo)
HstResponse
createNavigationalURL
in interface HstResponse
pathInfo
- the path to be navigated
public HstURL createActionURL()
HstResponse
createActionURL
in interface HstResponse
public HstURL createResourceURL()
HstResponse
createResourceURL
in interface HstResponse
public HstURL createResourceURL(String referenceNamespace)
HstResponse
createResourceURL
in interface HstResponse
public HstURL createComponentRenderingURL()
HstResponse
createComponentRenderingURL
in interface HstResponse
public String getNamespace()
HstResponse
getNamespace
in interface HstResponse
public void setNamespace(String namespace)
public void setRenderParameter(String key, String value)
HstResponse
setRenderParameter
in interface HstResponse
key
- key of the render parametervalue
- value of the render parameterpublic void setRenderParameter(String key, String[] values)
HstResponse
setRenderParameter
in interface HstResponse
key
- key of the render parametervalues
- values of the render parameterspublic void setRenderParameters(Map<String,String[]> parameters)
HstResponse
setRenderParameters
in interface HstResponse
public Map<String,String[]> getRenderParameters()
public Element createElement(String tagName)
HstResponse
#addProperty(String, Element)
method.
createElement
in interface HstResponse
tagName
- the tag name of the element
public Comment createComment(String comment)
HstResponse
createComment
in interface HstResponse
comment
- the comment text
public void addHeadElement(Element element, String keyHint)
HstResponse
addHeadElement
in interface HstResponse
public List<Element> getHeadElements()
HstResponse
HstResponse.addHeadElement(Element, String)
,
then the portal will write all the merged head tag elements finally.
getHeadElements
in interface HstResponse
public boolean containsHeadElement(String keyHint)
HstResponse
containsHeadElement
in interface HstResponse
public void setRenderPath(String renderPath)
HstResponse
HstComponent.doBeforeRender(HstRequest, HstResponse)
method.
setRenderPath
in interface HstResponse
public String getRenderPath()
public void setServeResourcePath(String serveResourcePath)
HstResponse
HstComponent.doBeforeServeResource(HstRequest, HstResponse)
method.
setServeResourcePath
in interface HstResponse
public String getServeResourcePath()
public void flushChildContent(String name) throws IOException
HstResponse
Note: the child content can be flushed only once. If it is already flushed, then the next invocations will not make any effect.
flushChildContent
in interface HstResponse
name
- the name of the child window
IOException
public List<String> getChildContentNames()
HstResponse
getChildContentNames
in interface HstResponse
public void forward(String pathInfo) throws IOException
HstResponse
Only in HstComponent.doBeforeRender(HstRequest, HstResponse)
,
the invocation on this method will be effective.
If the invocation on this method is done in a view page during render phase,
the invocation will be just ignored with no operation.
forward
in interface HstResponse
pathInfo
- the path info to forward. It should start with a "/" and is relative to the root of your hst sitemap
IOException
- If the response was committedpublic String getForwardPathInfo()
public void setWrapperElement(Element element)
HstResponse
setWrapperElement
in interface HstResponse
public Element getWrapperElement()
HstResponse
getWrapperElement
in interface HstResponse
public void addPreamble(Comment comment)
HstResponse
addPreamble
in interface HstResponse
comment
- the comment nodepublic List<Comment> getPreambles()
public boolean isRendererSkipped()
HstResponse
HstComponentInfo.isStandalone()
equal to false
, this
check can be used whether some HstComponent
won't get its renderer called. In other words, this is for performance optimization
to short-circuit the doBeforeRender for components that won't get rendered any way.
isRendererSkipped
in interface HstResponse
true
when for this HstResponse
the renderer won't be invokedpublic void setRendererSkipped(boolean rendererSkipped)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |