JavaTM Adventure Builder Reference application - Version 1.0.1 > Configuring Mail Notifications
Java BluePrints

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 build.xml script in the adventure builder project directory utilizes entries from a properties files in order to create the proper resources. The steps for this are:

  1. Open file <adventure.home>/project/setup/setup.properties
  2. Set mail.host with the name of your mail server
  3. Set mail.username to the username to be used in the mail.host to send mails
  4. Set mail.fromaddress to your mail address
  5. 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 :

  1. Go to <adventure.home>
  2. Run build.xml script as follows : asant 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 :

  1. Open file <adventure.home>/project/apps/opc/opc-ejb/src/conf/ejb-jar.xml
  2. Search for "SendMail"
  3. Change the env-entry-value for SendMail to true
  4. 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:

  1. Go to <adventure.home>/project
  2. Build new OPC module with command asant
    See Building the demo for the information of how to build.
  3. Undeploy existing OPC module with command asadmin undeploy OPC
  4. 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 © 2004 Sun Microsystems, Inc.  All Rights Reserved.