Package org.dspace.administer
Class CreateAdministrator
- java.lang.Object
-
- org.dspace.administer.CreateAdministrator
-
public final class CreateAdministrator extends Object
A command-line tool for creating an initial administrator for setting up a DSpace site. Prompts for an e-mail address, last name, first name and password from standard input. An administrator group is then created and the data passed in used to create an e-person in that group.Alternatively, it can be used to take the email, first name, last name and desired password as arguments thus: CreateAdministrator -e [email] -f [first name] -l [last name] -p [password] This is particularly convenient for automated deploy scripts that require an initial administrator, for example, before deployment can be completed
- Version:
- $Revision$
- Author:
- Robert Tansley, Richard Jones
-
-
Field Summary
Fields Modifier and Type Field Description protected EPersonServiceePersonServiceprotected GroupServicegroupService
-
Constructor Summary
Constructors Modifier Constructor Description protectedCreateAdministrator()constructor, which just creates and object with a ready context
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcreateAdministrator(String email, String first, String last, String language, String pw)Create the administrator with the given details.static voidmain(String[] argv)For invoking via the command line.protected voidnegotiateAdministratorDetails()Method which will negotiate with the user via the command line to obtain the administrator's details
-
-
-
Field Detail
-
ePersonService
protected EPersonService ePersonService
-
groupService
protected GroupService groupService
-
-
Method Detail
-
main
public static void main(String[] argv) throws Exception
For invoking via the command line. If called with no command line arguments, it will negotiate with the user for the administrator details- Parameters:
argv- the command line arguments given- Throws:
Exception- if error
-
negotiateAdministratorDetails
protected void negotiateAdministratorDetails() throws ExceptionMethod which will negotiate with the user via the command line to obtain the administrator's details- Throws:
Exception- if error
-
createAdministrator
protected void createAdministrator(String email, String first, String last, String language, String pw) throws Exception
Create the administrator with the given details. If the user already exists then they are simply upped to administrator status- Parameters:
email- the email for the userfirst- user's first namelast- user's last namelanguage- preferred languagepw- desired password- Throws:
Exception- if error
-
-