Java (TM) Adventure Builder Reference Application - V1.0 > Configuring Mail Notifications           
Java BluePrints

The JAVA(TM) 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

JavaMail[tm] is setup via a configurable resource in the J2EE 1.4 Developer's release.  The e-mail  notifcations are sent via this resource. The setup script in the adventure builder root directories utilizes entries from properties files in order to create the proper resources.  The steps for this are :

  1. Open file <adventure.home>/src/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 Developer's release as follows :

  1. Go to <adventure.home>/src
  2. Run setup 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>/src/apps/opc/opc-ejb/src/conf/ejb-jar.xml
  2. Search for "SendMail"
  3. Change the env-entry-value for SendMail (in line 112) 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>/src
  2. Build new OPC module with command asant
  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.