Copyright© 2008-2022 Sitevision AB, all rights reserved.
public abstract class GenericSiteVisionPortlet
extends GenericPortlet
Modifier | Constructor and Description |
---|---|
protected |
GenericSiteVisionPortlet()
Does nothing and should not be explicitly called.
|
Modifier and Type | Method and Description |
---|---|
protected Session |
getJcrSession(PortletRequest aPortletRequest)
Convenience method that gets the Session instance from a portlet request.
|
protected Utils |
getUtils(PortletRequest aPortletRequest)
Convenience method that gets the Utils instance from a portlet request.
|
protected PrintWriter |
getWriter(RenderResponse aRenderResponse)
Convenience method that sets the
text/html content type and gets the render response writer. |
protected PrintWriter |
getWriter(ResourceResponse aResourceResponse)
Convenience method that sets the
application/json content type with UTF-8
charset and gets the resource response writer. |
destroy, doDispatch, doEdit, doHeaders, doHelp, doView, getContainerRuntimeOptions, getDefaultNamespace, getInitParameter, getInitParameterNames, getNextPossiblePortletModes, getPortletConfig, getPortletContext, getPortletName, getProcessingEventQNames, getPublicRenderParameterNames, getPublishingEventQNames, getResourceBundle, getSupportedLocales, getTitle, init, init, processAction, processEvent, render, serveResource
protected GenericSiteVisionPortlet()
A portlet class constructor should only be invoked by the Sitevision portlet container.
Portlet initial state should be implemented via any of the init
methods!
protected Utils getUtils(PortletRequest aPortletRequest)
aPortletRequest
- a portlet requestnull
if aPortletRequest
is null
protected Session getJcrSession(PortletRequest aPortletRequest)
aPortletRequest
- a portlet requestnull
if aPortletRequest
is null
protected PrintWriter getWriter(RenderResponse aRenderResponse) throws IOException
text/html
content type and gets the render response writer.
The portlet specification states that the content type for the render response must be set before obtaining the response writer. This convenience method ensures that.
aRenderResponse.setContentType("text/html");
return aRenderResponse.getWriter();
Note! This method should be called only once during your rendering process (and you
should of course only use this method if you render content with the text/html
content type).
aRenderResponse
- a render responseaRenderResponse
writer, null
if aRenderResponse
is null
IOException
- if an input or output exception occurredIllegalStateException
- if the getPortletOutputStream
method has been called on aRenderResponse
protected PrintWriter getWriter(ResourceResponse aResourceResponse) throws IOException
application/json
content type with UTF-8
charset and gets the resource response writer.
The portlet specification states that the content type for the resource response must be set before obtaining the response writer. This convenience method ensures that.
aResourceResponse.setContentType("application/json");
aResourceResponse.setCharacterEncoding("UTF-8");
return aResourceResponse.getWriter();
Note! This method should be called only once during your serve resource process (and you should of course
only use this method if you serve a UTF-8
resource with the application/json
content type).
aResourceResponse
- a resource responseaResourceResponse
writer, null
if aResourceResponse
is null
IOException
- if an input or output exception occurredIllegalStateException
- if the getPortletOutputStream
method has been called on aResourceResponse
Sitevision - Portal and Content Management Made Easy
Sitevision is an advanced Java enterprise portal product and a portlet container (JSR 286) that implements Java Content Repository (JSR 283).
Copyright© 2008-2022 Sitevision AB, all rights reserved.