org.jasig.portlet.test.cachecontrol.publicscope
Class CacheControlTestPortlet

java.lang.Object
  extended by javax.portlet.GenericPortlet
      extended by org.jasig.portlet.test.cachecontrol.publicscope.CacheControlTestPortlet
All Implemented Interfaces:
javax.portlet.EventPortlet, javax.portlet.Portlet, javax.portlet.PortletConfig, javax.portlet.ResourceServingPortlet

public class CacheControlTestPortlet
extends javax.portlet.GenericPortlet

Subclass of GenericPortlet intended to mimic the validation CacheControl example in the Portlet 2.0 specification (section PLT.22.2). This portlet demonstrates the cache control behavior by exposing a simple message service. The view displays a form where a visitor can send a message. If there are no new messages, the portlet tells the portal to use the cached content (see CacheControl.setUseCachedContent(boolean). This portlet is separate from the CacheControlTestController for 2 purposes:

  1. To demonstrate that the unmodified example in the portlet spec functions as expected
  2. This portlet has it's own portlet definition in which PUBLIC scope is specified

Version:
$Id: CacheControlTestPortlet.java 24281 2011-07-11 01:35:14Z nblair $
Author:
Nicholas Blair

Constructor Summary
CacheControlTestPortlet()
           
 
Method Summary
protected  void doView(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response)
          Example copied from Portlet version 2.0 Specification, section PLT.22.2, with minor modifications.
protected  boolean markupIsStillValid()
          Implemented by inverse of MessageService#hasNewMessages().
 void processAction(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response)
          Add a new message, if the "message" request parameter is not empty.
 
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, init, processEvent, render, serveResource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheControlTestPortlet

public CacheControlTestPortlet()
Method Detail

doView

protected void doView(javax.portlet.RenderRequest request,
                      javax.portlet.RenderResponse response)
               throws javax.portlet.PortletException,
                      IOException
Example copied from Portlet version 2.0 Specification, section PLT.22.2, with minor modifications. (non-Javadoc)

Overrides:
doView in class javax.portlet.GenericPortlet
Throws:
javax.portlet.PortletException
IOException
See Also:
GenericPortlet.doView(javax.portlet.RenderRequest, javax.portlet.RenderResponse)

processAction

public void processAction(javax.portlet.ActionRequest request,
                          javax.portlet.ActionResponse response)
                   throws javax.portlet.PortletException,
                          IOException
Add a new message, if the "message" request parameter is not empty. (non-Javadoc)

Specified by:
processAction in interface javax.portlet.Portlet
Overrides:
processAction in class javax.portlet.GenericPortlet
Throws:
javax.portlet.PortletException
IOException
See Also:
GenericPortlet.processAction(javax.portlet.ActionRequest, javax.portlet.ActionResponse)

markupIsStillValid

protected boolean markupIsStillValid()
Implemented by inverse of MessageService#hasNewMessages().

Returns:


Copyright © 2012 Jasig. All Rights Reserved.