com.gentics.cr.portlet
Class AContentDisplayPortlet

java.lang.Object
  extended by javax.portlet.GenericPortlet
      extended by com.gentics.cr.portlet.AGenticsPortlet
          extended by com.gentics.cr.portlet.AContentDisplayPortlet
All Implemented Interfaces:
javax.portlet.EventPortlet, javax.portlet.Portlet, javax.portlet.PortletConfig, javax.portlet.ResourceServingPortlet
Direct Known Subclasses:
BaseContentPortlet, BaseSidebarPortlet

public abstract class AContentDisplayPortlet
extends AGenticsPortlet

The Class AbstractContentPortlet.

 

Field Summary
protected  Set<String> attributes
          attributes that should be fetched for the content beans
static String ATTRIBUTES_KEY
          The Constant CONTENTID_RENDER_PARAMETER.
private  String[] defaultAttributes
          default attributes that should be fetched in any case
private  boolean isDisplayVersion
          defines if there should be included the version in resource urls
private  boolean isVelocityRendered
          parameter to determine if velocity should be rendered
static String ISVELOCITYRENDERED_KEY
          Config key for the boolean value isvelocityrendered
private  String jspEditTemplate
          The jsp edit template.
private  String jspTemplate
          The jsp template.
private  com.gentics.api.lib.expressionparser.Expression pageRule
          The page rule.
private  com.gentics.cr.rendering.ContentRenderer renderer
          The renderer.
private  com.gentics.cr.RequestProcessor rp
          The rp.
private  com.gentics.cr.CRConfigUtil rpConfig
          The Request processor config.
private static String SERVE_RESOURCE_VERSION_KEY
           
private  com.gentics.cr.util.velocity.VelocityTools tools
          VelocityTools to deploy into the template context.
protected  org.apache.velocity.app.VelocityEngine vEngine
          The Velocity render Engine Used for content velocity rendering
 
Fields inherited from class com.gentics.cr.portlet.AGenticsPortlet
CONTENTID_OVERRIDE_ATTRIBUTE, CONTENTID_RENDER_PARAMETER, INITPARAM_EDITTEMPLATE_NAME, INITPARAM_STARTFOLDER_NAME, INITPARAM_STARTPAGE_NAME, INITPARAM_VIEWTEMPLATE_NAME, log, PAGE_RULE
 
Constructor Summary
AContentDisplayPortlet()
           
 
Method Summary
protected  void dispatch(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response)
          The dispatcher method.
protected abstract  void doInternalView(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response)
          Do internal view.
 void doView(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response)
           
protected  void executeVelocityRender(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response, com.gentics.cr.CRResolvableBean crBean)
           
protected  com.gentics.cr.RequestProcessor getRp()
          returns the request processor
protected abstract  void handleError(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response, javax.portlet.PortletException exception)
          Handle error.
protected  void initialize()
          the portlet instance initialize method.
protected  void prepareDisplayResponse(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response)
          Displays the content.
 void processAction(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response)
           
 void serveResource(javax.portlet.ResourceRequest request, javax.portlet.ResourceResponse response)
           
 
Methods inherited from class com.gentics.cr.portlet.AGenticsPortlet
getContentid, getCrConf, getFileTemplate, getLog, getStartfolder, getStartpage, init, setCrConf, setLog
 
Methods inherited from class javax.portlet.GenericPortlet
destroy, doDispatch, doEdit, doHeaders, doHelp, getContainerRuntimeOptions, getDefaultNamespace, getInitParameter, getInitParameterNames, getNextPossiblePortletModes, getPortletConfig, getPortletContext, getPortletName, getProcessingEventQNames, getPublicRenderParameterNames, getPublishingEventQNames, getResourceBundle, getSupportedLocales, getTitle, init, processEvent, render
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SERVE_RESOURCE_VERSION_KEY

private static final String SERVE_RESOURCE_VERSION_KEY
See Also:
Constant Field Values

ISVELOCITYRENDERED_KEY

public static final String ISVELOCITYRENDERED_KEY
Config key for the boolean value isvelocityrendered

See Also:
Constant Field Values

ATTRIBUTES_KEY

public static final String ATTRIBUTES_KEY
The Constant CONTENTID_RENDER_PARAMETER.

See Also:
Constant Field Values

pageRule

private com.gentics.api.lib.expressionparser.Expression pageRule
The page rule.


rp

private com.gentics.cr.RequestProcessor rp
The rp.


renderer

private com.gentics.cr.rendering.ContentRenderer renderer
The renderer.


jspTemplate

private String jspTemplate
The jsp template.


jspEditTemplate

private String jspEditTemplate
The jsp edit template.


rpConfig

private com.gentics.cr.CRConfigUtil rpConfig
The Request processor config.


vEngine

protected org.apache.velocity.app.VelocityEngine vEngine
The Velocity render Engine Used for content velocity rendering


tools

private com.gentics.cr.util.velocity.VelocityTools tools
VelocityTools to deploy into the template context.


isVelocityRendered

private boolean isVelocityRendered
parameter to determine if velocity should be rendered


defaultAttributes

private String[] defaultAttributes
default attributes that should be fetched in any case


attributes

protected Set<String> attributes
attributes that should be fetched for the content beans


isDisplayVersion

private boolean isDisplayVersion
defines if there should be included the version in resource urls

Constructor Detail

AContentDisplayPortlet

public AContentDisplayPortlet()
Method Detail

initialize

protected void initialize()
Description copied from class: AGenticsPortlet
the portlet instance initialize method.

in this method every kind of Gentics portlet can initialize its own connectors and helpers

please remeber! Always call super.init(); if you override this method!

This method is called exact once on portlet init.

Please use this method if you have to initialize components within your portlet instance (E.g. connectors, helper classes etc.)

Specified by:
initialize in class AGenticsPortlet

processAction

public void processAction(javax.portlet.ActionRequest request,
                          javax.portlet.ActionResponse response)
                   throws javax.portlet.PortletException,
                          IOException
Specified by:
processAction in interface javax.portlet.Portlet
Overrides:
processAction in class AGenticsPortlet
Throws:
javax.portlet.PortletException
IOException

doView

public final void doView(javax.portlet.RenderRequest request,
                         javax.portlet.RenderResponse response)
                  throws javax.portlet.PortletException,
                         IOException
Overrides:
doView in class javax.portlet.GenericPortlet
Throws:
javax.portlet.PortletException
IOException

serveResource

public final void serveResource(javax.portlet.ResourceRequest request,
                                javax.portlet.ResourceResponse response)
                         throws javax.portlet.PortletException,
                                IOException
Specified by:
serveResource in interface javax.portlet.ResourceServingPortlet
Overrides:
serveResource in class javax.portlet.GenericPortlet
Throws:
javax.portlet.PortletException
IOException

prepareDisplayResponse

protected void prepareDisplayResponse(javax.portlet.RenderRequest request,
                                      javax.portlet.RenderResponse response)
                               throws javax.portlet.PortletException,
                                      IOException
Displays the content.

Here the content is fetched with the Request Processor and processed by the Velocity Renderer if configured

Parameters:
request - the request
response - the response
Throws:
javax.portlet.PortletException - the portlet exception
IOException - Signals that an I/O exception has occurred.

executeVelocityRender

protected void executeVelocityRender(javax.portlet.RenderRequest request,
                                     javax.portlet.RenderResponse response,
                                     com.gentics.cr.CRResolvableBean crBean)
                              throws IOException
Throws:
IOException

dispatch

protected void dispatch(javax.portlet.RenderRequest request,
                        javax.portlet.RenderResponse response)
                 throws javax.portlet.PortletException,
                        IOException
The dispatcher method. Display the content through a JSP-File (= defined as "jspTemplate").

Parameters:
request - the request.
response - the response.
Throws:
javax.portlet.PortletException - the portlet exception
IOException - Signals that an I/O exception has occurred.

doInternalView

protected abstract void doInternalView(javax.portlet.RenderRequest request,
                                       javax.portlet.RenderResponse response)
                                throws javax.portlet.PortletException,
                                       IOException
Do internal view. TODO

TODO

Parameters:
request - the request
response - the response
Throws:
javax.portlet.PortletException - the portlet exception
IOException - Signals that an I/O exception has occurred.

handleError

protected abstract void handleError(javax.portlet.RenderRequest request,
                                    javax.portlet.RenderResponse response,
                                    javax.portlet.PortletException exception)
                             throws javax.portlet.PortletException
Handle error.

Parameters:
request - the request
response - the response
exception - the exception
Throws:
javax.portlet.PortletException

getRp

protected com.gentics.cr.RequestProcessor getRp()
returns the request processor

Returns:
rp the RequestProcessor


Copyright © 2014 Gentics Software GmbH. All Rights Reserved.