You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Robby Pelssers, AGP" <ro...@agp.nl> on 2007/03/05 15:09:17 UTC
Howto replacing jexl expressions within a String
Hi all,
I will shortly describe what I'm trying to accomplish:
I have a mysql database with e.g. three tables. I want to automatically
generate a context from tables 2 and 3. Then the message which is a String
in a database containing jexl expressions should be substituted with the
correct values. What's the way to accomplish this?!
Any advice would be most appreciated.
----------------------------------------------------------------------------
-------------------
TABLE 1: table containing message templates e.g.
Id:
1
message:
Dear customer,
We would like to inform you about a new product called ${product.name}.
Description: ${product.description}
Price: ${product.price}
----------------------------------------------------------------------------
-------------------
TABLE 2: contains queries which will provide data for populating a certain
message context
id:
product
query:
SELECT id, name, description, price FROM product WHERE id = :id
----------------------------------------------------------------------------
-------------------
TABLE 3: describes which context fields will be generated from a resultset
id: queryid: columname: contextfield:
1 product name name
2 product description description
3 product price price
Cheers,
Robby Pelssers
Telefoon: +31 (0)413 387 777
Fax: +31 (0)413 367 025
Mobiel: +31 (0)6 1003 3035
E-mail: robby.pelssers@agp.nl
AGP Solutions B.V.
De Amert 160, 5462 GH Veghel
Postbus 226, 5460 AE Veghel
Internet: http://www.agp.nl/solutions
De informatie in en/of gekoppeld aan dit e-mailbericht is uitsluitend
bestemd voor geadresseerde en kan vertrouwelijke gegevens bevatten.
Openbaarmaking, vermenigvuldiging, verspreiding en/of verstrekking van deze
informatie aan derden is niet toegestaan. Door de elektronische verzending
van het bericht kunnen er geen rechten worden ontleend aan de informatie.
Indien u dit e-mailbericht niet goed heeft ontvangen, neemt u dan contact op
met de verzender.