org.norther.tammi.spray.db.step
Class UserAccountAction

java.lang.Object
  extended by org.norther.tammi.spray.loader.task.Action
      extended by org.norther.tammi.spray.loader.task.ActionEvent
          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
                      extended by org.norther.tammi.spray.db.step.RepositoryStepAction
                          extended by org.norther.tammi.spray.db.step.SelectionStepAction
                              extended by org.norther.tammi.spray.db.step.UserAccountAction
All Implemented Interfaces:
Serializable, Task, StepFlowConstants

public class UserAccountAction
extends SelectionStepAction

A flow step action for editing user accounts.

Note that an optional locale variant is interpreted as a user specific skin.

Author:
Ilkka Priha
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.norther.tammi.spray.db.step.SelectionStepAction
DELETE_ACTION, INSERT_ACTION, MARKED_NAME_PROPERTY, SELECTED_NAME_PROPERTY, UPDATE_ACTION
 
Fields inherited from class org.norther.tammi.spray.db.step.RepositoryStepAction
NULL_PK, ROOT_PK
 
Fields inherited from interface org.norther.tammi.spray.template.flow.StepFlowConstants
ADAPTABLE_STATE, DISPOSABLE_STATE, EXPLICIT_STATE, FINISHED_STATE, HELP_PIPE_PROPERTY, QUALIFIED_STATE, READ_ONLY_STATE, REPOSITORY_PROPERTY, SELECTABLE_STATE
 
Constructor Summary
UserAccountAction()
          Constructs a new flow step action.
 
Method Summary
protected  String digest(String username, String password, FilterChain chain)
          Digests the password for the specified username by applying the current realm.
 Variable getAccountVariable(int index, Identity id, ServletRequest request, ServletResponse response, FilterChain chain, StepFlowContext context)
          Gets an imported account variable for the selected user.
 Variable getAccountVariable(int index, Identity id, String fkField, ServletRequest request, ServletResponse response, FilterChain chain, StepFlowContext context)
          Gets an imported account variable for the selected user and foreign key.
 Variable getAccountVariable(int index, ServletRequest request, ServletResponse response, FilterChain chain, StepFlowContext context)
          Gets an imported account variable for the current user.
static List getPostDependencies()
          Gets the post-dependencies of the account class.
static List getPreDependencies()
          Gets the pre-dependencies of the account class.
 void prepare(ServletRequest request, ServletResponse response, FilterChain chain, StepFlowContext context)
          Prepares the current account variable.
 void submitDeleteAccount(int index, ServletRequest request, ServletResponse response, FilterChain chain, StepFlowContext context)
          Deletes the selected user account.
 void submitInsertAccount(int index, ServletRequest request, ServletResponse response, FilterChain chain, StepFlowContext context)
          Inserts the selected user account.
 void submitUpdateAccount(int index, ServletRequest request, ServletResponse response, FilterChain chain, StepFlowContext context)
          Updates the selected user account.
 void submitUpdateForm(ServletRequest request, ServletResponse response, FilterChain chain, StepFlowContext context)
          Executes the default submit.
 
Methods inherited from class org.norther.tammi.spray.db.step.SelectionStepAction
checkPermission, clearSelectedIdentity, deleteVariable, filterRoleNameEnumeration, getAccountIdentity, getImportedVariable, getImportedVariable, getImportedVariable, getImportedVariable, getMandatorySelection, getSelectedIdentities, getSelectedIdentity, getSelectedIndeces, getSelectedIndex, getSelectedVariable, getSelectionEnumeration, getSelectionEnumeration, getSelectionVariable, getSelectionVariable, getSelectionVariable, getSelectionVariable, getSelectionVariable, getSelectionVariable, getSelectionVariable, getSelectionVariable, insertVariable, queryAccountVariable, queryAllObjects, queryTreeObjects, sortObjects, submitDeleteVariable, submitInsertVariable, submitQueryVariable, submitSearchVariable, submitSelectAll, submitUnselectAll, submitUpdateVariable, submitVariable, updateVariable
 
Methods inherited from class org.norther.tammi.spray.db.step.RepositoryStepAction
add1NForeignReferences, add1NNullReferences, add1NObjectReferences, addAttributeValues, addToRelationMap, createVariable, createVariable, deleteVariable, getAttributeValue, getAttributeValues, getBeanRepositoryClient, getConnectionKey, getEndReference, getIntrospector, getKeyAttributeValue, getKeyAttributeValues, getLoader, getNextReference, getNextReference, getNextReferences, getPersister, getPersister, getPersister, getPostDependencies, getPreDependencies, getRepositoryClient, getResourceKey, getRootReference, getRootReferences, insertVariable, isNullPK, isRelatedTo, isRootPK, setAttributeValue, setAttributeValue, setKeyAttributeValue, setKeyAttributeValues, setMNForeignReferences, setMNObjectReferences, setPostDependencies, setPreDependencies, toClass, updateVariable
 
Methods inherited from class org.norther.tammi.spray.template.step.FormStepAction
disableNextStep, enableNextStep, isStepFinished, parseUploadedFile, parseUploadedFile, setStepFinished, submit, submitCancelStep, submitFinishStep, submitNextStep, submitPreviousStep, submitRenewForm, submitResetForm, update, update
 
Methods inherited from class org.norther.tammi.spray.template.step.NextStepAction
submitBackStep
 
Methods inherited from class org.norther.tammi.spray.template.step.FlowStepAction
checkPermission, checkPermission, done, execute, execute, finish, forward, getPermissibleRoles, getSignature, include, initialize, initialize, pushError, submit, submitOpenHelp
 
Methods inherited from class org.norther.tammi.spray.loader.task.ActionEvent
getAction, getAction, getAction, invoke
 
Methods inherited from class org.norther.tammi.spray.loader.task.Action
find, getFilter, getMBeanServer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserAccountAction

public UserAccountAction()
Constructs a new flow step action.

Method Detail

getPreDependencies

public static List getPreDependencies()
Gets the pre-dependencies of the account class.

Returns:
a list of dependencies or null.

getPostDependencies

public static List getPostDependencies()
Gets the post-dependencies of the account class.

Returns:
a list of dependencies or null.

getAccountVariable

public Variable getAccountVariable(int index,
                                   ServletRequest request,
                                   ServletResponse response,
                                   FilterChain chain,
                                   StepFlowContext context)
                            throws Exception
Gets an imported account variable for the current user.

Parameters:
index - the variable index.
request - the request.
response - the response.
chain - the filter chain.
context - the flow context.
Returns:
the prepared variable.
Throws:
Exception - on errros.

getAccountVariable

public Variable getAccountVariable(int index,
                                   Identity id,
                                   ServletRequest request,
                                   ServletResponse response,
                                   FilterChain chain,
                                   StepFlowContext context)
                            throws Exception
Gets an imported account variable for the selected user.

Parameters:
index - the variable index.
id - the selected identity.
request - the request.
response - the response.
chain - the filter chain.
context - the flow context.
Returns:
the prepared variable.
Throws:
Exception - on errros.

getAccountVariable

public Variable getAccountVariable(int index,
                                   Identity id,
                                   String fkField,
                                   ServletRequest request,
                                   ServletResponse response,
                                   FilterChain chain,
                                   StepFlowContext context)
                            throws Exception
Gets an imported account variable for the selected user and foreign key.

Parameters:
index - the variable index.
id - the selected identity.
fkField - the foreign key field.
request - the request.
response - the response.
chain - the filter chain.
context - the flow context.
Returns:
the prepared variable.
Throws:
Exception - on errros.

prepare

public void prepare(ServletRequest request,
                    ServletResponse response,
                    FilterChain chain,
                    StepFlowContext context)
             throws Exception
Prepares the current account variable.

Overrides:
prepare in class FlowStepAction
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
Executes the default submit.

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

submitInsertAccount

public void submitInsertAccount(int index,
                                ServletRequest request,
                                ServletResponse response,
                                FilterChain chain,
                                StepFlowContext context)
                         throws Exception
Inserts the selected user account.

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

submitUpdateAccount

public void submitUpdateAccount(int index,
                                ServletRequest request,
                                ServletResponse response,
                                FilterChain chain,
                                StepFlowContext context)
                         throws Exception
Updates the selected user account.

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

submitDeleteAccount

public void submitDeleteAccount(int index,
                                ServletRequest request,
                                ServletResponse response,
                                FilterChain chain,
                                StepFlowContext context)
                         throws Exception
Deletes the selected user account.

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

digest

protected String digest(String username,
                        String password,
                        FilterChain chain)
                 throws Exception
Digests the password for the specified username by applying the current realm.

Parameters:
username - the username.
password - the password.
chain - the filter chain.
Returns:
the digested password.
Throws:
Exception - on errors.


Copyright © 2004 The Norther Organization. All rights reserved.