[Yanel-usage] contact-form

Michael Wechner michael.wechner at wyona.com
Thu Jun 23 14:34:41 CEST 2011


Hi Bettina

Am 23.06.11 14:14, schrieb Bettina Messmer:
> Hi,
>
> Thanks a lot for your comment. It's working now. :D

excellent :-)
>
> Now I just wondering how I can change the autogenerated message.

Unfortunately this is currently hard-coded, see

src/contributions/resources/contact-form/src/java/org/wyona/yanel/impl/resources/contactform/ContactResource.java#sendMail(...)

see the String "content".

Now there are at least two possibilities on how to improve this:

1) We could make the sendMail method "protected" instead "private", 
which would allow to overwrite this method (or better introduce a more 
particular method called "getEmailContent")

2) Or we could enhance this resource by introducing some templating of 
the E-Mail message, e.g. using XSLT

I would suggest that we do (2), because it means less customization work 
for integrators like you
(the drawback is less control, but I am not sure if this is actually 
necessary in this case)

Cheers

Michael
> greets,
>
> Bettina
>
>
>
> -------- Original-Nachricht --------
>> Datum: Thu, 23 Jun 2011 13:44:45 +0200
>> Von: Michael Wechner<michael.wechner at wyona.com>
>> An: yanel-usage at wyona.com
>> Betreff: Re: [Yanel-usage] contact-form
>> Hi Bettina
>>
>> Am 23.06.11 12:17, schrieb Bettina Messmer:
>>> Hi,
>>>
>>> I'm trying to create a webpage using the contact-form resource. In order
>> to use it I added contact.html to the map file
>>>     <matcher pattern="**.contact.html" rcpath="contact.html.yanel-rc"/>
>> I guess the matcher pattern would rather be something like
>>
>> **/contact.html
>>
>> whereas I would suggest that you use a one-to-one matching, e.g.
>>
>> http://127.0.0.1:8080/yanel/MY_REALM/en/contact.html
>>
>> res-configs/contact.html.yanel-rc
>>
>> instead using the map
>>
>> HTH
>>
>> Michael
>>>    and then provided a contact.html.yanel-rc
>>>
>>>     <?xml version="1.0"?>
>>>
>>> <yanel:resource-config xmlns:yanel="http://www.wyona.org/yanel/rti/1.0">
>>>     <yanel:rti name="contact-form"
>> namespace="http://www.wyona.org/yanel/resource/1.0"/>
>>>     <yanel:property name="xslt" value="/app/xslt/global2.xsl"/>
>>>     <yanel:property name="mime-type" value="application/xhtml+xml"/>
>>>     <yanel:property name="to" value="....."/>
>>>
>>> </yanel:resource-config>
>>>
>>> now I get always a Page not found error....
>>>
>>> And I don't exactly understand, where my mistake is or which other file
>> i need to add.
>>> thanks and greets,
>>>
>>> Bettina
>>>
>>>
>>>
>> -- 
>> Yanel-usage mailing list Yanel-usage at wyona.com
>> http://lists.wyona.org/cgi-bin/mailman/listinfo/yanel-usage



More information about the Yanel-usage mailing list