com.gentics.cr.portlet
Class BaseNavigationPortlet

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

public class BaseNavigationPortlet
extends AGenticsPortlet

The Class BaseNavigationPortlet.

 

Field Summary
private  String[] attributes
          The standard attributes.
private static org.apache.jcs.JCS cache
          The cache.
private static String CACHED_OBJECT_KEY
          The Constant CACHED_OBJECT_KEY.
private static String CACHEKEY_KEY
          The Constant CACHEKEY_KEY.
private static String CACHEZONE_KEY
          Key for the cache zone.
private static String CHILDFILTER
          standard child filter for navigation objects.
static String NAVIGATIONCACHE_CONFIG_KEY
          configuration key for enabling (default) or disabling the JCS content cache.
private static String ROOT_ATTRIBUTE_KEY
          The Constant ROOT_ATTRIBUTE_KEY.
private  String rootAttribute
          The root attribute.
private  com.gentics.cr.RequestProcessor rp
          The request processor.
private  com.gentics.cr.template.ITemplate template
          The template.
private static String TEMPLATE_PATH_KEY
          The Constant TEMPLATE_PATH_KEY.
private  String tmplPath
          The tmpl path.
private  com.gentics.cr.util.velocity.VelocityTools tools
          The tools.
 
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
BaseNavigationPortlet()
           
 
Method Summary
 void doView(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response)
           
private  LinkedList<String> getActivePath(com.gentics.cr.CRResolvableBean crBean, String active)
          Gets the active path.
private  String getCacheKey(String startFolder)
          Gets the cache key.
private  com.gentics.cr.CRResolvableBean getCrBean(String startFolder)
          This method fetches the navigation object from the Request Processor and handles the caching when configured.
protected  void initialize()
          the portlet instance initialize method.
private  void pushCrBeanToCache(com.gentics.cr.CRResolvableBean crBean)
          Push cr bean to cache.
 
Methods inherited from class com.gentics.cr.portlet.AGenticsPortlet
getContentid, getCrConf, getFileTemplate, getLog, getStartfolder, getStartpage, init, processAction, 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, serveResource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CACHED_OBJECT_KEY

private static final String CACHED_OBJECT_KEY
The Constant CACHED_OBJECT_KEY.

See Also:
Constant Field Values

CACHEKEY_KEY

private static final String CACHEKEY_KEY
The Constant CACHEKEY_KEY.

See Also:
Constant Field Values

CHILDFILTER

private static final String CHILDFILTER
standard child filter for navigation objects.

See Also:
Constant Field Values

CACHEZONE_KEY

private static final String CACHEZONE_KEY
Key for the cache zone.

See Also:
Constant Field Values

NAVIGATIONCACHE_CONFIG_KEY

public static final String NAVIGATIONCACHE_CONFIG_KEY
configuration key for enabling (default) or disabling the JCS content cache. Default: disabled

See Also:
Constant Field Values

TEMPLATE_PATH_KEY

private static final String TEMPLATE_PATH_KEY
The Constant TEMPLATE_PATH_KEY.

See Also:
Constant Field Values

ROOT_ATTRIBUTE_KEY

private static final String ROOT_ATTRIBUTE_KEY
The Constant ROOT_ATTRIBUTE_KEY.

See Also:
Constant Field Values

rootAttribute

private String rootAttribute
The root attribute.


rp

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


tmplPath

private String tmplPath
The tmpl path.


template

private com.gentics.cr.template.ITemplate template
The template.


tools

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


attributes

private String[] attributes
The standard attributes. Will be merged with configured attributes.


cache

private static org.apache.jcs.JCS cache
The cache.

Constructor Detail

BaseNavigationPortlet

public BaseNavigationPortlet()
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

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

doView

public 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

getCrBean

private com.gentics.cr.CRResolvableBean getCrBean(String startFolder)
                                           throws com.gentics.cr.exceptions.CRException,
                                                  javax.portlet.PortletException
This method fetches the navigation object from the Request Processor and handles the caching when configured.

Parameters:
startFolder - the folder for which the navigation should be builded
Returns:
Collection the navigation object
Throws:
com.gentics.cr.exceptions.CRException - the CR exception
javax.portlet.PortletException - the portlet exception

pushCrBeanToCache

private void pushCrBeanToCache(com.gentics.cr.CRResolvableBean crBean)
Push cr bean to cache.

Parameters:
crBean - the cr bean

getCacheKey

private String getCacheKey(String startFolder)
Gets the cache key.

Parameters:
startFolder - the start folder
Returns:
the cache key

getActivePath

private LinkedList<String> getActivePath(com.gentics.cr.CRResolvableBean crBean,
                                         String active)
Gets the active path.

Parameters:
crBean - the cr bean
active - the active
Returns:
the active path


Copyright © 2014 Gentics Software GmbH. All Rights Reserved.