org.dspace.app.xmlui.aspect.administrative
Class FlowEPersonUtils

java.lang.Object
  extended by org.dspace.app.xmlui.aspect.administrative.FlowEPersonUtils

public class FlowEPersonUtils
extends Object

Utility methods to processes actions on EPeople. These methods are used exclusively from the administrative flow scripts.

Author:
scott phillips

Constructor Summary
FlowEPersonUtils()
           
 
Method Summary
static FlowResult processAddEPerson(Context context, org.apache.cocoon.environment.Request request, Map objectModel)
          Add a new eperson.
static FlowResult processDeleteEPeople(Context context, String[] epeopleIDs)
          Delete the epeople specified by the epeopleIDs parameter.
static FlowResult processEditEPerson(Context context, org.apache.cocoon.environment.Request request, Map ObjectModel, int epersonID)
          Edit an eperson's metadata, the email address, first name, and last name are all required.
static FlowResult processLoginAs(Context context, Map objectModel, int epersonID)
          Log this user in as another user.
static FlowResult processResetPassword(Context context, int epersonID)
          Send the user a forgot password email message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FlowEPersonUtils

public FlowEPersonUtils()
Method Detail

processAddEPerson

public static FlowResult processAddEPerson(Context context,
                                           org.apache.cocoon.environment.Request request,
                                           Map objectModel)
                                    throws SQLException,
                                           AuthorizeException
Add a new eperson. This method will check that the email address, first name, and last name are non empty. Also a check is performed to see if the requested email address is already in use by another user.

Parameters:
context - The current DSpace context
request - The HTTP request parameters
objectModel - Cocoon's object model
Returns:
A process result's object.
Throws:
SQLException
AuthorizeException

processEditEPerson

public static FlowResult processEditEPerson(Context context,
                                            org.apache.cocoon.environment.Request request,
                                            Map ObjectModel,
                                            int epersonID)
                                     throws SQLException,
                                            AuthorizeException
Edit an eperson's metadata, the email address, first name, and last name are all required. The user's email address can be updated but it must remain unique, if the email address already exists then the an error is produced.

Parameters:
context - The current DSpace context
request - The HTTP request parameters
ObjectModel - Cocoon's object model
epersonID - The unique id of the eperson being edited.
Returns:
A process result's object.
Throws:
SQLException
AuthorizeException

processResetPassword

public static FlowResult processResetPassword(Context context,
                                              int epersonID)
                                       throws IOException,
                                              javax.mail.MessagingException,
                                              SQLException,
                                              AuthorizeException
Send the user a forgot password email message. The message will contain a token that the user can use to login and pick a new password.

Parameters:
context - The current DSpace context
epersonID - The unique id of the eperson being edited.
Returns:
A process result's object.
Throws:
IOException
javax.mail.MessagingException
SQLException
AuthorizeException

processLoginAs

public static FlowResult processLoginAs(Context context,
                                        Map objectModel,
                                        int epersonID)
                                 throws SQLException
Log this user in as another user. If the operation failed then the flow result will be set to failure with it's message set correctly. Note that after logging out the user may not have sufficient privileges to continue.

Parameters:
context - The current DSpace context.
objectModel - Object model to obtain the HTTP request from.
epersonID - The epersonID of the person to login as.
Returns:
The flow result.
Throws:
SQLException

processDeleteEPeople

public static FlowResult processDeleteEPeople(Context context,
                                              String[] epeopleIDs)
                                       throws NumberFormatException,
                                              SQLException,
                                              AuthorizeException,
                                              EPersonDeletionException
Delete the epeople specified by the epeopleIDs parameter. This assumes that the deletion has been confirmed.

Parameters:
context - The current DSpace context
epeopleIDs - The unique id of the eperson being edited.
Returns:
A process result's object.
Throws:
NumberFormatException
SQLException
AuthorizeException
EPersonDeletionException


Copyright © 2011 DuraSpace. All Rights Reserved.