The JavaTM Adventure Builder
Reference application (referred to as adventure builder) also allows
you to get
e-mail notifications as an
order goes through various stages in the workflow. This document
describes
the steps to configure mail notifications.
1. Setup Mailer Properties
The mail support is setup through a configurable resource in the
J2EE 1.4 SDK. The e-mail notifcations are sent via
this resource. The setup script in the adventure builder root
directory utilizes entries from a properties files in order to create
the proper resources. The steps for this are:
- Open file <adventure.home>/project/setup/setup.properties
- Set mail.host with the name of your mail server
- Set mail.username to the username to be used in the
mail.host to send mails
- Set mail.fromaddress to your mail address
- Save and close this file
2. Create Mail Resources
Once the mailer properties are setup, the next and final step is to
create the JavaMail resources in the J2EE 1.4 SDK as follows :
- Go to <adventure.home>
- Run setup script as follows : setup.{bat|sh}
create-mail-resource
3. Modify the Order Processing Center (OPC) Deployment
Descriptors
The first step is to enable the mail notification option for OPC
module. The steps for this are :
- Open file <adventure.home>/project/apps/opc/opc-ejb/src/conf/ejb-jar.xml
- Search for "SendMail"
- Change the env-entry-value for SendMail
to true
- Save and close this file
4. Build and Deploy the Re-Configured Module
Once the e-mail notification is enabled, next step is to deploy the
new e-mail enabled OPC module. The steps for this are:
- Go to <adventure.home>/project
- Build new OPC module with command asant
See Building the demo for the
information of how to build.
- Undeploy existing OPC module with command asadmin
undeploy OPC
- Deploy newly built OPC module with command asadmin deploy
apps/opc/build/opc.ear
With the above steps, the mailer configured. Now you can create
some adventure package and the OPC module will send e-mail
notifications. The e-mail address used will be the one specified in the
billing, shipping address of the customer web side page that is
displayed before placing the order.
Copyright © 2005 Sun Microsystems,
Inc.
All Rights Reserved.