org.apache.portals.bridges.groovy
Class GroovyPreferencesValidator

java.lang.Object
  extended by org.apache.portals.bridges.groovy.GroovyPreferencesValidator
All Implemented Interfaces:
javax.portlet.PreferencesValidator

public class GroovyPreferencesValidator
extends java.lang.Object
implements javax.portlet.PreferencesValidator

GroovyPreferencesValidator parses and invokes a groovy-scripted validator. A groovy-scripted PreferencesValidator just need to be implemented like any other Java-based preferences validator.

Author:
Woonsan Ko

Field Summary
static java.lang.String AUTO_REFRESH_PREF_KEY
           
protected  boolean autoRefresh
           
protected  groovy.lang.GroovyClassLoader groovyClassLoader
           
protected  groovy.lang.GroovyCodeSource groovyCodeSource
           
protected  long parsedFileLastModified
           
static java.lang.String SCRIPT_SOURCE_PREF_KEY
           
static java.lang.String SCRIPT_SOURCE_URL_ENCODING_PREF_KEY
           
protected  javax.portlet.PreferencesValidator scriptPreferencesValidatorInstance
           
protected  java.lang.String scriptSourceUri
           
protected  java.lang.String scriptSourceUriEncoding
           
 
Constructor Summary
GroovyPreferencesValidator()
           
 
Method Summary
protected  void createScriptPreferencesValidatorInstance()
           
 void initialize(javax.portlet.PortletPreferences preferences)
           
protected  boolean isScriptFileModified()
           
protected  void refreshPreferencesValidatorInstance()
           
 void validate(javax.portlet.PortletPreferences preferences)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SCRIPT_SOURCE_PREF_KEY

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

SCRIPT_SOURCE_URL_ENCODING_PREF_KEY

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

AUTO_REFRESH_PREF_KEY

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

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

scriptPreferencesValidatorInstance

protected javax.portlet.PreferencesValidator scriptPreferencesValidatorInstance

groovyClassLoader

protected groovy.lang.GroovyClassLoader groovyClassLoader
Constructor Detail

GroovyPreferencesValidator

public GroovyPreferencesValidator()
Method Detail

validate

public void validate(javax.portlet.PortletPreferences preferences)
              throws javax.portlet.ValidatorException
Specified by:
validate in interface javax.portlet.PreferencesValidator
Throws:
javax.portlet.ValidatorException

initialize

public void initialize(javax.portlet.PortletPreferences preferences)
                throws javax.portlet.ValidatorException
Throws:
javax.portlet.ValidatorException

refreshPreferencesValidatorInstance

protected void refreshPreferencesValidatorInstance()
                                            throws javax.portlet.ValidatorException
Throws:
javax.portlet.ValidatorException

isScriptFileModified

protected boolean isScriptFileModified()

createScriptPreferencesValidatorInstance

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


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