org.apache.jetspeed.modules.actions.portlets
Class RegistryUpdateAction

java.lang.Object
  extended byorg.apache.turbine.modules.Assembler
      extended byorg.apache.turbine.modules.Action
          extended byorg.apache.turbine.modules.ActionEvent
              extended byorg.apache.jetspeed.modules.actions.portlets.PortletActionEvent
                  extended byorg.apache.jetspeed.modules.actions.portlets.PortletAction
                      extended byorg.apache.jetspeed.modules.actions.portlets.GenericMVCAction
                          extended byorg.apache.jetspeed.modules.actions.portlets.VelocityPortletAction
                              extended byorg.apache.jetspeed.modules.actions.portlets.SecureVelocityPortletAction
                                  extended byorg.apache.jetspeed.modules.actions.portlets.RegistryUpdateAction
Direct Known Subclasses:
ClientUpdateAction, ControllerUpdateAction, ControlUpdateAction, MediaUpdateAction, PortletUpdateAction, SecurityUpdateAction, SkinUpdateAction

public abstract class RegistryUpdateAction
extends SecureVelocityPortletAction

An abstract base class with default actions for many of the common fields and parameters shared by the registry entries. To add a new registry update action, simply derive from this class and override the resetForm, clearUserData, and updateRegistry functions. If you need to provide more actions that those that are provided, simply create them in your derived class.

Version:
$Id: RegistryUpdateAction.java,v 1.10 2004/03/31 04:49:10 morciuch Exp $
Author:
Jeremy Ford

Field Summary
protected  java.lang.String pane
           
protected  java.lang.String registry
           
protected  java.lang.String registryEntryName
           
 
Fields inherited from class org.apache.turbine.modules.ActionEvent
BUTTON, BUTTON_LENGTH, LENGTH, METHOD_NAME_LENGTH, METHOD_NAME_PREFIX
 
Constructor Summary
RegistryUpdateAction()
           
 
Method Summary
protected  void buildNormalContext(VelocityPortlet portlet, org.apache.velocity.context.Context context, org.apache.turbine.util.RunData rundata)
          Subclasses must override this method to provide default behavior for the portlet action
protected  void clearUserData(org.apache.turbine.util.RunData rundata)
          Remove any data that was added to the user's temporary storage
 void doAddcapability(org.apache.turbine.util.RunData rundata, org.apache.velocity.context.Context context)
          Add capabilities to a registry entry
 void doAddmediatype(org.apache.turbine.util.RunData rundata, org.apache.velocity.context.Context context)
          Add a media type to a registry entry
 void doAddparameter(org.apache.turbine.util.RunData rundata, org.apache.velocity.context.Context context)
          Add a parameter to a registry entry
 void doCancel(org.apache.turbine.util.RunData rundata, org.apache.velocity.context.Context context)
          Cleanup method
 void doDelete(org.apache.turbine.util.RunData rundata, org.apache.velocity.context.Context context)
          Delete a registry entry
 void doInsert(org.apache.turbine.util.RunData rundata, org.apache.velocity.context.Context context)
          Insert a registry entry into the registry
 void doRemovecapability(org.apache.turbine.util.RunData rundata, org.apache.velocity.context.Context context)
          Remove capabilites from a registry entry
 void doRemovemediatypes(org.apache.turbine.util.RunData rundata, org.apache.velocity.context.Context context)
          Remove media types from a registry entry
 void doRemoveparameters(org.apache.turbine.util.RunData rundata, org.apache.velocity.context.Context context)
          Remove parameters from a registry entry
 void doUpdate(org.apache.turbine.util.RunData rundata, org.apache.velocity.context.Context context)
          Update a registry entry
 void doUpdateparameters(org.apache.turbine.util.RunData rundata, org.apache.velocity.context.Context context)
          Update parameters of a registry entry
 void doUpdateparametervalues(org.apache.turbine.util.RunData rundata, org.apache.velocity.context.Context context)
          Update parameter's values of a registry entry
protected  boolean hasChanged(java.lang.String oldValue, java.lang.String newValue)
          Determines whether a field has changed value.
protected  java.util.Collection iteratorToCollection(java.util.Iterator iter)
          Turns an iterator into a collection
protected  org.apache.turbine.util.DynamicURI redirect(org.apache.turbine.util.RunData rundata, java.lang.String mode, int reason)
          Method that sets up a redirect link given the rundata, the mode, and a reason
protected  void resetForm(org.apache.turbine.util.RunData rundata)
          Method to reset data entered into the forms
protected  void updateRegistryEntry(org.apache.turbine.util.RunData rundata, RegistryEntry registryEntry)
          Basic implementation of a method to update a registry entry.
 
Methods inherited from class org.apache.jetspeed.modules.actions.portlets.SecureVelocityPortletAction
executeEvents
 
Methods inherited from class org.apache.jetspeed.modules.actions.portlets.VelocityPortletAction
buildConfigureContext, buildConfigureContext, buildMaximizedContext, buildMaximizedContext, buildNormalContext
 
Methods inherited from class org.apache.jetspeed.modules.actions.portlets.GenericMVCAction
checkAdministrativeAction, doPerform, getAttribute, getAttribute, getPortletInstance, perform, setAttribute
 
Methods inherited from class org.apache.jetspeed.modules.actions.portlets.PortletAction
doPerform, getContext, getPortlet, getTemplate, resetTemplate, setTemplate, setTemplate
 
Methods inherited from class org.apache.jetspeed.modules.actions.portlets.PortletActionEvent
fireEvent
 
Methods inherited from class org.apache.turbine.modules.ActionEvent
executeEvents, formatString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

registryEntryName

protected java.lang.String registryEntryName

registry

protected java.lang.String registry

pane

protected java.lang.String pane
Constructor Detail

RegistryUpdateAction

public RegistryUpdateAction()
Method Detail

buildNormalContext

protected void buildNormalContext(VelocityPortlet portlet,
                                  org.apache.velocity.context.Context context,
                                  org.apache.turbine.util.RunData rundata)
                           throws java.lang.Exception
Description copied from class: VelocityPortletAction
Subclasses must override this method to provide default behavior for the portlet action

Specified by:
buildNormalContext in class VelocityPortletAction
Throws:
java.lang.Exception

doInsert

public void doInsert(org.apache.turbine.util.RunData rundata,
                     org.apache.velocity.context.Context context)
              throws java.lang.Exception
Insert a registry entry into the registry

Parameters:
rundata - The turbine rundata context for this request.
context - The velocity context for this request.
Throws:
java.lang.Exception

doUpdate

public void doUpdate(org.apache.turbine.util.RunData rundata,
                     org.apache.velocity.context.Context context)
              throws java.lang.Exception
Update a registry entry

Parameters:
rundata - The turbine rundata context for this request.
context - The velocity context for this request.
Throws:
java.lang.Exception

doDelete

public void doDelete(org.apache.turbine.util.RunData rundata,
                     org.apache.velocity.context.Context context)
              throws java.lang.Exception
Delete a registry entry

Parameters:
rundata - The turbine rundata context for this request.
context - The velocity context for this request.
Throws:
java.lang.Exception

doCancel

public void doCancel(org.apache.turbine.util.RunData rundata,
                     org.apache.velocity.context.Context context)
              throws java.lang.Exception
Cleanup method

Parameters:
rundata - The turbine rundata context for this request.
context - The velocity context for this request.
Throws:
java.lang.Exception

updateRegistryEntry

protected void updateRegistryEntry(org.apache.turbine.util.RunData rundata,
                                   RegistryEntry registryEntry)
                            throws java.lang.Exception
Basic implementation of a method to update a registry entry. The fields that are common to all registry entries can simply be added below.

Parameters:
rundata - The turbine rundata context for this request.
registryEntry - The registry entry to update
Throws:
java.lang.Exception

hasChanged

protected boolean hasChanged(java.lang.String oldValue,
                             java.lang.String newValue)
Determines whether a field has changed value. Used in update methods.

Parameters:
oldValue - The original value
newValue - The new value

doAddparameter

public void doAddparameter(org.apache.turbine.util.RunData rundata,
                           org.apache.velocity.context.Context context)
                    throws java.lang.Exception
Add a parameter to a registry entry

Parameters:
rundata - The turbine rundata context for this request.
context - The velocity context for this request.
Throws:
java.lang.Exception

doUpdateparameters

public void doUpdateparameters(org.apache.turbine.util.RunData rundata,
                               org.apache.velocity.context.Context context)
                        throws java.lang.Exception
Update parameters of a registry entry

Parameters:
rundata - The turbine rundata context for this request.
context - The velocity context for this request.
Throws:
java.lang.Exception

doUpdateparametervalues

public void doUpdateparametervalues(org.apache.turbine.util.RunData rundata,
                                    org.apache.velocity.context.Context context)
                             throws java.lang.Exception
Update parameter's values of a registry entry

Parameters:
rundata - The turbine rundata context for this request.
context - The velocity context for this request.
Throws:
java.lang.Exception

doRemoveparameters

public void doRemoveparameters(org.apache.turbine.util.RunData rundata,
                               org.apache.velocity.context.Context context)
                        throws java.lang.Exception
Remove parameters from a registry entry

Parameters:
rundata - The turbine rundata context for this request.
context - The velocity context for this request.
Throws:
java.lang.Exception

doAddmediatype

public void doAddmediatype(org.apache.turbine.util.RunData rundata,
                           org.apache.velocity.context.Context context)
                    throws java.lang.Exception
Add a media type to a registry entry

Parameters:
rundata - The turbine rundata context for this request.
context - The velocity context for this request.
Throws:
java.lang.Exception

doRemovemediatypes

public void doRemovemediatypes(org.apache.turbine.util.RunData rundata,
                               org.apache.velocity.context.Context context)
                        throws java.lang.Exception
Remove media types from a registry entry

Parameters:
rundata - The turbine rundata context for this request.
context - The velocity context for this request.
Throws:
java.lang.Exception

doAddcapability

public void doAddcapability(org.apache.turbine.util.RunData rundata,
                            org.apache.velocity.context.Context context)
                     throws java.lang.Exception
Add capabilities to a registry entry

Parameters:
rundata - The turbine rundata context for this request.
context - The velocity context for this request.
Throws:
java.lang.Exception

doRemovecapability

public void doRemovecapability(org.apache.turbine.util.RunData rundata,
                               org.apache.velocity.context.Context context)
                        throws java.lang.Exception
Remove capabilites from a registry entry

Parameters:
rundata - The turbine rundata context for this request.
context - The velocity context for this request.
Throws:
java.lang.Exception

redirect

protected org.apache.turbine.util.DynamicURI redirect(org.apache.turbine.util.RunData rundata,
                                                      java.lang.String mode,
                                                      int reason)
                                               throws org.apache.turbine.util.TurbineException
Method that sets up a redirect link given the rundata, the mode, and a reason

Parameters:
rundata -
mode -
reason -
Returns:
Throws:
org.apache.turbine.util.TurbineException

clearUserData

protected void clearUserData(org.apache.turbine.util.RunData rundata)
Remove any data that was added to the user's temporary storage

Parameters:
rundata -

resetForm

protected void resetForm(org.apache.turbine.util.RunData rundata)
Method to reset data entered into the forms

Parameters:
rundata -

iteratorToCollection

protected java.util.Collection iteratorToCollection(java.util.Iterator iter)
Turns an iterator into a collection

Parameters:
iter - An iterator
Returns:
the collection


Copyright © 2000-2005 Apache Software Foundation. All Rights Reserved.