org.apache.portals.bridges.groovy
Class GroovyPortlet

java.lang.Object
  extended by javax.portlet.GenericPortlet
      extended by org.apache.portals.bridges.groovy.GroovyPortlet
All Implemented Interfaces:
javax.portlet.Portlet, javax.portlet.PortletConfig
Direct Known Subclasses:
GroovyPortletHeaderPhaseSupport

public class GroovyPortlet
extends javax.portlet.GenericPortlet

GroovyPortlet parses and invokes a groovy-scripted portlet. A groovy-scripted portlet just need to be implemented like any other Java-based portlet. So, a groovy-scripted portlet can support full features of JSR-168 portlet.

Author:
Woonsan Ko

Field Summary
static java.lang.String AUTO_REFRESH_INIT_PARAM
           
protected  boolean autoRefresh
           
protected  groovy.lang.GroovyClassLoader groovyClassLoader
           
protected  groovy.lang.GroovyCodeSource groovyCodeSource
           
protected  long parsedFileLastModified
           
protected  javax.portlet.PortletConfig portletConfig
           
protected  java.lang.reflect.Method portletDoEditMethod
           
static java.lang.String SCRIPT_SOURCE_INIT_PARAM
           
static java.lang.String SCRIPT_SOURCE_URL_ENCODING_INIT_PARAM
           
protected  javax.portlet.GenericPortlet scriptGenericPortletInstance
           
protected  javax.portlet.Portlet scriptPortletInstance
           
protected  java.lang.String scriptSourceUri
           
protected  java.lang.String scriptSourceUriEncoding
           
 
Constructor Summary
GroovyPortlet()
           
 
Method Summary
protected  void createScriptPortletInstance()
           
 void destroy()
           
 void doEdit(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response)
           
 javax.portlet.PortletConfig getPortletConfig()
           
 void init(javax.portlet.PortletConfig config)
           
protected  boolean isScriptFileModified()
           
 void processAction(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response)
           
protected  void refreshPortletInstance()
           
 void render(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response)
           
 
Methods inherited from class javax.portlet.GenericPortlet
doDispatch, doHelp, doView, getInitParameter, getInitParameterNames, getPortletContext, getPortletName, getResourceBundle, getTitle, init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SCRIPT_SOURCE_INIT_PARAM

public static final java.lang.String SCRIPT_SOURCE_INIT_PARAM
See Also:
Constant Field Values

SCRIPT_SOURCE_URL_ENCODING_INIT_PARAM

public static final java.lang.String SCRIPT_SOURCE_URL_ENCODING_INIT_PARAM
See Also:
Constant Field Values

AUTO_REFRESH_INIT_PARAM

public static final java.lang.String AUTO_REFRESH_INIT_PARAM
See Also:
Constant Field Values

portletConfig

protected javax.portlet.PortletConfig portletConfig

scriptSourceUri

protected java.lang.String scriptSourceUri

scriptSourceUriEncoding

protected java.lang.String scriptSourceUriEncoding

autoRefresh

protected boolean autoRefresh

parsedFileLastModified

protected long parsedFileLastModified

groovyCodeSource

protected groovy.lang.GroovyCodeSource groovyCodeSource

scriptPortletInstance

protected javax.portlet.Portlet scriptPortletInstance

scriptGenericPortletInstance

protected javax.portlet.GenericPortlet scriptGenericPortletInstance

portletDoEditMethod

protected java.lang.reflect.Method portletDoEditMethod

groovyClassLoader

protected groovy.lang.GroovyClassLoader groovyClassLoader
Constructor Detail

GroovyPortlet

public GroovyPortlet()
Method Detail

init

public void init(javax.portlet.PortletConfig config)
          throws javax.portlet.PortletException
Specified by:
init in interface javax.portlet.Portlet
Overrides:
init in class javax.portlet.GenericPortlet
Throws:
javax.portlet.PortletException

destroy

public void destroy()
Specified by:
destroy in interface javax.portlet.Portlet
Overrides:
destroy in class javax.portlet.GenericPortlet

processAction

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

render

public void render(javax.portlet.RenderRequest request,
                   javax.portlet.RenderResponse response)
            throws javax.portlet.PortletException,
                   java.io.IOException
Specified by:
render in interface javax.portlet.Portlet
Overrides:
render in class javax.portlet.GenericPortlet
Throws:
javax.portlet.PortletException
java.io.IOException

getPortletConfig

public javax.portlet.PortletConfig getPortletConfig()
Overrides:
getPortletConfig in class javax.portlet.GenericPortlet

doEdit

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

refreshPortletInstance

protected void refreshPortletInstance()
                               throws javax.portlet.PortletException
Throws:
javax.portlet.PortletException

isScriptFileModified

protected boolean isScriptFileModified()

createScriptPortletInstance

protected void createScriptPortletInstance()
                                    throws org.codehaus.groovy.control.CompilationFailedException,
                                           java.lang.InstantiationException,
                                           java.io.IOException,
                                           java.lang.IllegalAccessException,
                                           javax.portlet.PortletException
Throws:
org.codehaus.groovy.control.CompilationFailedException
java.lang.InstantiationException
java.io.IOException
java.lang.IllegalAccessException
javax.portlet.PortletException


Copyright © 1999-2011 Apache Software Foundation. All Rights Reserved.