• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Should I use XML???

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi folks,
I'm building a
java interface (class) for my web appln. Basically, I want this
interface to be an email interface (internally I will use JavaMail
API)
to send messages. The email contents and recipient lists are all
to be dynamicallly generated. I want some ideas on the design.
For the FROM, TO, CC, BCC lists, I plan to have setter methods.
However, the subject and BODY are in the form of standard text
files with PLACEHOLDERS for dynamic text inclusion.
I am thinking of using xml files for the different email templates. However, I'm a little unsure of how to use PLACEHOLDERS (eg. would they be EMPTY elements?).
Do you think, it is worthwhile including an xml parser into my
app for this purpose. There is likely to be additional templates, in future.
The email interface that I build, should be generic enough to read
from
these templates and include the dynamic content at placeholder
spaces
and generate emails to recipient list.
If you have the time, do send me your thoughts on how you would
approach this. I'm trying to think of the simplest way to implement
this.
Shd. I go text file and do parsing on my own or go XML way....?
Thanks,
-JS
=====
mock template eg:-
subject: project [PROJ_NAME] has been approved
body:
Hi [USER_NAME],
This email is to let you know that the project [PROJ_NAME] has
been approved with the foll. info
Project Start date : [START_DATE]
project end date : [END_DATE]
budget : [$AMOUNT]
This is for your informational purpose only.
Thanks,
[APPROVER]
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jai,
It might be a bit of a overhead actually
Velocity might be a much better choixe for that purpose. There is a good introductionnary article in Javaworld about Velocity.
Cheers
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic