This release of the Java Pet Store includes a new Administration
application, which allows the Pet Store Administrator to change
the status of all pending orders. This separate application
operates independently of the Java Pet Store application (although
it shares and manipulates parts of the Pet Store's data model).
Creating the admin user
The admin application appears in the directory $JPS_HOME/src/petstoreadmin .
The application requires a user id admin in the J2EE server.
Follow these steps to create the admin user (with password admin ,
in the server's default realm):
- Stop the j2ee server if it is running:
j2ee -stop
- Create the user with the command:
$J2EE_HOME/bin/realmtool -add admin admin default
- Restart the J2EE server:
j2ee
Deploying the Administration application
The Enterprise Archive ("ear" file) for the Administration application is
distributed with the Java Pet Store in the file
$JPS_HOME/petstoreadmin.ear . To deploy the Administration application,
follow these steps:
- Configure and deploy the petstore application, as explained in the
section appropriate for your operating system, in
installation and configuration.
- Repeat steps 9 & 10 of the installation instructions in the
previous step, but replace the file name
petstore.ear with petstoreadmin.ear .
- Use the Pet Store application to order some pets.
- To access the administration module, use your browser to
visit the URL
http://localhost:8000/admin . You may
need to replace localhost with the name of your
J2EE server, and 8000 with the J2EE server port
address.
- You should see the "Admin Welcome Page". Click on the
Enter.. link to log in.
- Enter
admin as the user name, and
admin as the password.
- A successful login will take you to the administration
screen. In this screen, you can choose either to update orders
or to log out.
- Clicking on the update order button will display all
pending Pet Store orders. Change order status to
(A)pproved or (D)enied by clicking the
appropriate boxes. The Update button updates the
status of all marked orders.
Rebuilding the Administration application
To rebuild the Administration application:
- change directory to
$JPS_HOME/src/petstoreadmin/src
sh build.sh (or build if you are using Windows)
- Deploy the new enterprise archive file
cd $JPS_HOME/src/petstoreadmin/build/petstoreadmin.ear
created in the build step
|