org.norther.tammi.spray.template.step
Class FormStepAction

java.lang.Object
  extended by org.norther.tammi.spray.loader.task.Action
      extended by org.norther.tammi.spray.loader.task.Submit
          extended by org.norther.tammi.spray.template.step.FlowStepAction
              extended by org.norther.tammi.spray.template.step.NextStepAction
                  extended by org.norther.tammi.spray.template.step.FormStepAction
All Implemented Interfaces:
Serializable, Task
Direct Known Subclasses:
RepositoryStepAction

public class FormStepAction
extends NextStepAction

A flow step action updating form variables of steps.

Version:
$Id: FormStepAction.java,v 1.59 2010-07-01 06:58:58 cvsimp Exp $
Author:
Ilkka Priha
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.norther.tammi.spray.loader.task.Task
Task.Control
 
Field Summary
 
Fields inherited from class org.norther.tammi.spray.loader.task.Submit
EXECUTE_METHOD, SUBMIT_PREFIX
 
Constructor Summary
FormStepAction()
          Constructs a new flow step action.
 
Method Summary
 void clearParameters(ServletRequest request, ServletResponse response, FilterChain chain, StepFlowContext context)
          Clears the parameters.
 void loadPropertyFile(File file, String encoding, ServletRequest request, ServletResponse response, FilterChain chain, StepFlowContext context, Configuration config)
          Loads the specified property file to the given configuration.
 void loadUploadedFile(File file, String encoding, Locale locale, ServletRequest request, ServletResponse response, FilterChain chain, StepFlowContext context, Configuration config)
          Loads the specified property file to the given configuration applying the specified locale.
 Task.Control submit(ServletRequest request, ServletResponse response, FilterChain chain, StepFlowContext context)
          Updates the form.
 void submitCancelStep(ServletRequest request, ServletResponse response, FilterChain chain, StepFlowContext context)
          Cancels the step.
 void submitFinishStep(ServletRequest request, ServletResponse response, FilterChain chain, StepFlowContext context)
          Finishes the step.
 void submitInsertForm(ServletRequest request, ServletResponse response, FilterChain chain, StepFlowContext context)
          Inserts incomplete data to the form.
 void submitNextStep(ServletRequest request, ServletResponse response, FilterChain chain, StepFlowContext context)
          Goes to the next step.
 void submitPreviousStep(ServletRequest request, ServletResponse response, FilterChain chain, StepFlowContext context)
          Goes to the previous step.
 void submitRenewForm(ServletRequest request, ServletResponse response, FilterChain chain, StepFlowContext context)
          Renews the form.
 void submitResetForm(ServletRequest request, ServletResponse response, FilterChain chain, StepFlowContext context)
          Resets the form.
 void submitReuseForm(ServletRequest request, ServletResponse response, FilterChain chain, StepFlowContext context)
          Reuses the form.
 void submitUpdateForm(ServletRequest request, ServletResponse response, FilterChain chain, StepFlowContext context)
          Updates the form and finishes the step.
 VariableValidity update(boolean transition, Collection<Variable> updates, ServletRequest request, ServletResponse response, FilterChain chain, StepFlowContext context)
          Updates attributes of form variables of the current flow step, if the step is not a read-only step and the principal has write permissions, and makes the step ready for forthcoming actions.
 VariableValidity update(boolean transition, ServletRequest request, ServletResponse response, FilterChain chain, StepFlowContext context)
          Updates attributes of form variables of the current flow step, if the step is not a read-only step and the principal has write permissions, and makes the step ready for forthcoming actions.
 VariableValidity update(Set<String> filter, boolean transition, boolean readonly, Collection<Variable> updates, ServletRequest request, ServletResponse response, FilterChain chain, StepFlowContext context)
          Updates filtered attributes of form variables of the current flow step depending on the read-only option and makes the step ready for forthcoming actions.
 VariableValidity update(Set<String> filter, boolean transition, Collection<Variable> updates, ServletRequest request, ServletResponse response, FilterChain chain, StepFlowContext context)
          Updates filtered attributes of form variables of the current flow step, if the step is not a read-only step and the principal has write permissions, and makes the step ready for forthcoming actions.
 
Methods inherited from class org.norther.tammi.spray.template.step.NextStepAction
isNextStepEnabled, setNextStepEnabled, submitBackStep
 
Methods inherited from class org.norther.tammi.spray.template.step.FlowStepAction
checkPermission, checkPermission, checkPermission, construct, execute, execute, finish, forward, getPermissibleRoles, getSignature, include, initialize, initialize, prepare, submit, submitOpenHelp
 
Methods inherited from class org.norther.tammi.spray.loader.task.Submit
getAction, getAction, invoke
 
Methods inherited from class org.norther.tammi.spray.loader.task.Action
find, find, getFilter, getMBeanServer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FormStepAction

public FormStepAction()
Constructs a new flow step action.

Method Detail

clearParameters

public void clearParameters(ServletRequest request,
                            ServletResponse response,
                            FilterChain chain,
                            StepFlowContext context)
Clears the parameters.

Parameters:
request - the request.
response - the response.
chain - the filter chain.
context - the flow context.

submit

public Task.Control submit(ServletRequest request,
                           ServletResponse response,
                           FilterChain chain,
                           StepFlowContext context)
                    throws Exception
Updates the form.

Overrides:
submit in class FlowStepAction
Parameters:
request - the request.
response - the response.
chain - the filter chain.
context - the flow context.
Returns:
the execution control.
Throws:
Exception - on errors.

submitInsertForm

public void submitInsertForm(ServletRequest request,
                             ServletResponse response,
                             FilterChain chain,
                             StepFlowContext context)
                      throws Exception
Inserts incomplete data to the form.

Parameters:
request - the request.
response - the response.
chain - the filter chain.
context - the flow context.
Throws:
Exception - on errors.

submitUpdateForm

public void submitUpdateForm(ServletRequest request,
                             ServletResponse response,
                             FilterChain chain,
                             StepFlowContext context)
                      throws Exception
Updates the form and finishes the step.

Parameters:
request - the request.
response - the response.
chain - the filter chain.
context - the flow context.
Throws:
Exception - on errors.

submitResetForm

public void submitResetForm(ServletRequest request,
                            ServletResponse response,
                            FilterChain chain,
                            StepFlowContext context)
                     throws Exception
Resets the form.

Parameters:
request - the request.
response - the response.
chain - the filter chain.
context - the flow context.
Throws:
Exception - on errors.

submitReuseForm

public void submitReuseForm(ServletRequest request,
                            ServletResponse response,
                            FilterChain chain,
                            StepFlowContext context)
                     throws Exception
Reuses the form.

Parameters:
request - the request.
response - the response.
chain - the filter chain.
context - the flow context.
Throws:
Exception - on errors.

submitRenewForm

public void submitRenewForm(ServletRequest request,
                            ServletResponse response,
                            FilterChain chain,
                            StepFlowContext context)
                     throws Exception
Renews the form.

Parameters:
request - the request.
response - the response.
chain - the filter chain.
context - the flow context.
Throws:
Exception - on errors.

submitNextStep

public void submitNextStep(ServletRequest request,
                           ServletResponse response,
                           FilterChain chain,
                           StepFlowContext context)
                    throws Exception
Goes to the next step.

Overrides:
submitNextStep in class NextStepAction
Parameters:
request - the request.
response - the response.
chain - the filter chain.
context - the flow context.
Throws:
Exception - on errors.

submitPreviousStep

public void submitPreviousStep(ServletRequest request,
                               ServletResponse response,
                               FilterChain chain,
                               StepFlowContext context)
                        throws Exception
Goes to the previous step.

Overrides:
submitPreviousStep in class NextStepAction
Parameters:
request - the request.
response - the response.
chain - the filter chain.
context - the flow context.
Throws:
Exception - on errors.

submitFinishStep

public void submitFinishStep(ServletRequest request,
                             ServletResponse response,
                             FilterChain chain,
                             StepFlowContext context)
                      throws Exception
Finishes the step.

Overrides:
submitFinishStep in class NextStepAction
Parameters:
request - the request.
response - the response.
chain - the filter chain.
context - the flow context.
Throws:
Exception - on errors.

submitCancelStep

public void submitCancelStep(ServletRequest request,
                             ServletResponse response,
                             FilterChain chain,
                             StepFlowContext context)
                      throws Exception
Cancels the step.

Overrides:
submitCancelStep in class NextStepAction
Parameters:
request - the request.
response - the response.
chain - the filter chain.
context - the flow context.
Throws:
Exception - on errors.

update

public VariableValidity update(boolean transition,
                               ServletRequest request,
                               ServletResponse response,
                               FilterChain chain,
                               StepFlowContext context)
                        throws Exception
Updates attributes of form variables of the current flow step, if the step is not a read-only step and the principal has write permissions, and makes the step ready for forthcoming actions.

Parameters:
transition - true if a transition is requested.
request - the request.
response - the response.
chain - the filter chain.
context - the flow context.
Returns:
the form validity.
Throws:
Exception - on errors.

update

public VariableValidity update(boolean transition,
                               Collection<Variable> updates,
                               ServletRequest request,
                               ServletResponse response,
                               FilterChain chain,
                               StepFlowContext context)
                        throws Exception
Updates attributes of form variables of the current flow step, if the step is not a read-only step and the principal has write permissions, and makes the step ready for forthcoming actions. Updated variables, whether valid or invalid, are collected to a user specified collection.

Parameters:
transition - true if a transition is requested.
updates - an optional collection for updated variables.
request - the request.
response - the response.
chain - the filter chain.
context - the flow context.
Returns:
the form validity.
Throws:
Exception - on errors.

update

public VariableValidity update(Set<String> filter,
                               boolean transition,
                               Collection<Variable> updates,
                               ServletRequest request,
                               ServletResponse response,
                               FilterChain chain,
                               StepFlowContext context)
                        throws Exception
Updates filtered attributes of form variables of the current flow step, if the step is not a read-only step and the principal has write permissions, and makes the step ready for forthcoming actions. Updated variables, whether valid or invalid, are collected to a user specified collection.

Parameters:
filter - an optional parameter filter.
transition - true if a transition is requested.
updates - an optional collection for updated variables.
request - the request.
response - the response.
chain - the filter chain.
context - the flow context.
Returns:
the form validity.
Throws:
Exception - on errors.

update

public VariableValidity update(Set<String> filter,
                               boolean transition,
                               boolean readonly,
                               Collection<Variable> updates,
                               ServletRequest request,
                               ServletResponse response,
                               FilterChain chain,
                               StepFlowContext context)
                        throws Exception
Updates filtered attributes of form variables of the current flow step depending on the read-only option and makes the step ready for forthcoming actions. Updated variables, whether valid or invalid, are collected to a user specified collection.

Parameters:
filter - an optional parameter filter.
transition - true if a transition is requested.
readonly - true for a read-only step, false otherwise.
updates - an optional collection for updated variables.
request - the request.
response - the response.
chain - the filter chain.
context - the flow context.
Returns:
the form validity.
Throws:
Exception - on errors.

loadPropertyFile

public void loadPropertyFile(File file,
                             String encoding,
                             ServletRequest request,
                             ServletResponse response,
                             FilterChain chain,
                             StepFlowContext context,
                             Configuration config)
                      throws Exception
Loads the specified property file to the given configuration. The file is deleted after loading.

Parameters:
file - the property file.
encoding - the encoding.
request - the request.
response - the response.
chain - the filter chain.
context - the flow context.
config - the parsed configuration.
Throws:
Exception - on errors.

loadUploadedFile

public void loadUploadedFile(File file,
                             String encoding,
                             Locale locale,
                             ServletRequest request,
                             ServletResponse response,
                             FilterChain chain,
                             StepFlowContext context,
                             Configuration config)
                      throws Exception
Loads the specified property file to the given configuration applying the specified locale. The file is deleted after loading.

Parameters:
file - the property file.
encoding - the encoding.
locale - the locale.
request - the request.
response - the response.
chain - the filter chain.
context - the flow context.
config - the parsed configuration.
Throws:
Exception - on errors.


Copyright © 2004 The Norther Organization. All rights reserved.