com.gentics.cr.portlet
Class AGenticsPortlet

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

public abstract class AGenticsPortlet
extends javax.portlet.GenericPortlet

The Class AbstractGenticsPortlet.

This is the basic Gentics portlet abstract class that provides some basic features

 

Field Summary
static String CONTENTID_OVERRIDE_ATTRIBUTE
          The Constant CONTENTID_OVERRIDE_PARAMETER.
static String CONTENTID_RENDER_PARAMETER
          The Constant CONTENTID_RENDER_PARAMETER.
private  CCPortletConfig crConf
          The Content Repository configuration.
static String INITPARAM_EDITTEMPLATE_NAME
          The Constant INITPARAM_EDITTEMPLATE_NAME.
static String INITPARAM_STARTFOLDER_NAME
          The Constant INITPARAM_STARTFOLDER_NAME.
static String INITPARAM_STARTPAGE_NAME
          The Constant INITPARAM_STARTPAGE_NAME.
static String INITPARAM_VIEWTEMPLATE_NAME
          The Constant INITPARAM_VIEWTAMPLATE_NAME.
protected  org.apache.log4j.Logger log
          the Logger.
static String PAGE_RULE
          the Page Rule.
private  String startfolder
          the startfolder for this portlet instance.
private  String startpage
          the startpage for this portlet instance.
 
Constructor Summary
AGenticsPortlet()
           
 
Method Summary
protected  String getContentid(javax.portlet.RenderRequest request)
          returns the current contentid set as public render parameter.
protected  CCPortletConfig getCrConf()
          Gets the cr conf.
protected  com.gentics.cr.template.FileTemplate getFileTemplate(String templatePath)
          Gets the File Template from configured Template path or from default template file path if left empty.
protected  org.apache.log4j.Logger getLog()
          Gets the log.
protected  String getStartfolder()
          Gets the startfolder.
protected  String getStartpage()
          Gets the startpage.
 void init()
           
protected abstract  void initialize()
          the portlet instance initialize method.
 void processAction(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response)
           
protected  void setCrConf(CCPortletConfig crConfig)
          Sets the cr conf.
protected  void setLog(org.apache.log4j.Logger logger)
          Sets the log.
private  void setStartfolder(String sf)
          Sets the startfolder.
private  void setStartpage(String sp)
          Sets the startpage.
 
Methods inherited from class javax.portlet.GenericPortlet
destroy, doDispatch, doEdit, doHeaders, doHelp, doView, getContainerRuntimeOptions, getDefaultNamespace, getInitParameter, getInitParameterNames, getNextPossiblePortletModes, getPortletConfig, getPortletContext, getPortletName, getProcessingEventQNames, getPublicRenderParameterNames, getPublishingEventQNames, getResourceBundle, getSupportedLocales, getTitle, init, processEvent, render, serveResource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INITPARAM_STARTPAGE_NAME

public static final String INITPARAM_STARTPAGE_NAME
The Constant INITPARAM_STARTPAGE_NAME.

See Also:
Constant Field Values

INITPARAM_STARTFOLDER_NAME

public static final String INITPARAM_STARTFOLDER_NAME
The Constant INITPARAM_STARTFOLDER_NAME.

See Also:
Constant Field Values

INITPARAM_VIEWTEMPLATE_NAME

public static final String INITPARAM_VIEWTEMPLATE_NAME
The Constant INITPARAM_VIEWTAMPLATE_NAME.

See Also:
Constant Field Values

INITPARAM_EDITTEMPLATE_NAME

public static final String INITPARAM_EDITTEMPLATE_NAME
The Constant INITPARAM_EDITTEMPLATE_NAME.

See Also:
Constant Field Values

CONTENTID_RENDER_PARAMETER

public static final String CONTENTID_RENDER_PARAMETER
The Constant CONTENTID_RENDER_PARAMETER.

See Also:
Constant Field Values

CONTENTID_OVERRIDE_ATTRIBUTE

public static final String CONTENTID_OVERRIDE_ATTRIBUTE
The Constant CONTENTID_OVERRIDE_PARAMETER.

See Also:
Constant Field Values

PAGE_RULE

public static final String PAGE_RULE
the Page Rule. this is the page rule to find out, whether an object is a resource (image, css, js) or not.

See Also:
Constant Field Values

log

protected org.apache.log4j.Logger log
the Logger.


crConf

private CCPortletConfig crConf
The Content Repository configuration.


startfolder

private String startfolder
the startfolder for this portlet instance.


startpage

private String startpage
the startpage for this portlet instance.

Constructor Detail

AGenticsPortlet

public AGenticsPortlet()
Method Detail

init

public final void init()
Overrides:
init in class javax.portlet.GenericPortlet

initialize

protected abstract void initialize()
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.)


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 javax.portlet.GenericPortlet
Throws:
javax.portlet.PortletException
IOException

getContentid

protected String getContentid(javax.portlet.RenderRequest request)
                       throws com.gentics.cr.exceptions.CRException
returns the current contentid set as public render parameter.

Parameters:
request - the request
Returns:
the current contentid set in the request as public render parameter.
Throws:
com.gentics.cr.exceptions.CRException

getFileTemplate

protected com.gentics.cr.template.FileTemplate getFileTemplate(String templatePath)
                                                        throws FileNotFoundException,
                                                               com.gentics.cr.exceptions.CRException
Gets the File Template from configured Template path or from default template file path if left empty.

Parameters:
templatePath - the path of the template
Returns:
the FileTemplate
Throws:
FileNotFoundException - the file not found exception
com.gentics.cr.exceptions.CRException - the cR exception

getLog

protected org.apache.log4j.Logger getLog()
Gets the log.

Returns:
the log

setLog

protected void setLog(org.apache.log4j.Logger logger)
Sets the log.

Parameters:
logger - the new log

getCrConf

protected CCPortletConfig getCrConf()
Gets the cr conf.

Returns:
the cr conf

setCrConf

protected void setCrConf(CCPortletConfig crConfig)
Sets the cr conf.

Parameters:
crConfig - the new cr conf

getStartfolder

protected String getStartfolder()
Gets the startfolder.

Returns:
the startfolder

setStartfolder

private void setStartfolder(String sf)
Sets the startfolder.

Parameters:
sf - the new startfolder

getStartpage

protected String getStartpage()
Gets the startpage.

Returns:
the startpage

setStartpage

private void setStartpage(String sp)
Sets the startpage.

Parameters:
sp - the new startpage


Copyright © 2014 Gentics Software GmbH. All Rights Reserved.