<br><font size=2 face="sans-serif">Thank you Petr and Irene for your comments.</font>
<br>
<br><font size=2 face="sans-serif">I have tried both these methods of setting
the non-caching of this element.</font>
<br>
<br><font size=2 face="sans-serif">Currently I've implemented the return
new CmsCacheDirectives(false); way of doing it as I feel it covers all
my bases in a generic way.</font>
<br>
<br><font size=2 face="sans-serif">Petr, I am sure my element was picking
up the method from the CmsXmlTemplateX class as it was extending this class
and my System out actually demostrated that the element was executing the
new CmsCacheDirectives call.</font>
<br>
<br><font size=2 face="sans-serif">I have however taken the getCacheDirectives
out of the CmsXmlTemplateX and placed it into the element class to give
that a go, but still nothing is working.</font>
<br>
<br><font size=2 face="sans-serif">BTW the opencms.properties element.cache
obviously still doesn't work in v5, so I'll leave it as true.</font>
<br>
<br><font size=2 face="sans-serif">Everything I read tells me I've done
the right thing, but obviously something is missing. I've noticed
that in the offline version of, a refresh of my form when it is partially
filled out will result in the form being redisplayed empty. Online
though redisplays the form with the fields still populated. This
convinces me that this is a really heavy form of caching.</font>
<br>
<br><font size=2 face="sans-serif">I'm wondering if anyone has got this
working in v5RC2?</font>
<br>
<br><font size=2 face="sans-serif">Can we get an official response from
the OCMS team on this? Has anything changed regarding the imlementation
of cache in this version?</font>
<br>
<br><font size=2 face="sans-serif">After all my testing various combinations
and permutations of these things, I'm down to simply overiding the getCacheDirectives
method in my element class as such:</font>
<br>
<br><font size=2 face="sans-serif"> public CmsCacheDirectives
getCacheDirectives(CmsObject cms,</font>
<br><font size=2 face="sans-serif">
String templateFile, String elementName, Hashtable parameters,</font>
<br><font size=2 face="sans-serif">
String templateSelector) {</font>
<br><font size=2 face="sans-serif"> return new
CmsCacheDirectives(false);</font>
<br><font size=2 face="sans-serif"> }</font>
<br>
<br>
<br><font size=2 face="sans-serif">Thank you for your responses so far,
it has been appreciated,</font>
<br>
<br><font size=2 face="sans-serif">Regards,<br>
Aaron<br>
</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td>
<td><font size=1 face="sans-serif"><b>"Petr Hollay" <ph@ethikom.de></b></font>
<br><font size=1 face="sans-serif">Sent by: owner-opencms-dev@www.opencms.org</font>
<p><font size=1 face="sans-serif">26/02/03 19:56</font>
<br><font size=1 face="sans-serif">Please respond to opencms-dev</font>
<td><font size=1 face="Arial"> </font>
<br><font size=1 face="sans-serif"> To:
<opencms-dev@www.opencms.org></font>
<br><font size=1 face="sans-serif"> cc:
</font>
<br><font size=1 face="sans-serif"> Subject:
RE: [opencms-dev] contact us form not
working in online project</font></table>
<br>
<br>
<br>
<br><font size=2>Hi,</font>
<br><font size=2>this can work but it makes your Java class dependent
on form fields.</font>
<br><font size=3> </font>
<br><font size=2>The general way as described bellow - </font><font size=3>return
new CmsCacheDirectives(false) - </font><font size=2>should work.</font>
<br><font size=3> </font>
<br><font size=2>Aaron, are you sure you are using your Java class CmsXmlTemplateX
for you element? </font>
<br><font size=2>You don't need it for frame/content templates, if
you have your dynamic functionality only in this one form handled
by element.</font>
<br><font size=3> </font>
<br><font size=2>Btw. setting element.cache to false makes troubles in
OpenCms 4.6, until now I don't now if it is better in 5 RC2.</font>
<br><font size=3> </font>
<br><font size=2>Regards</font>
<br><font size=2>Petr</font>
<br><font size=3> </font>
<br><font size=2>-----Original Message-----</font>
<br><font size=2><b>From:</b> owner-opencms-dev@www.opencms.org [mailto:owner-opencms-dev@www.opencms.org]<b>On
Behalf Of </b>Irene Santerini</font>
<br><font size=2><b>Sent:</b> Wednesday, February 26, 2003 9:37 AM</font>
<br><font size=2><b>To:</b> opencms-dev@www.opencms.org</font>
<br><font size=2><b>Subject:</b> Re: [opencms-dev] contact us form
not working in online project</font>
<br>
<br>
<br><font size=2>Hi Aaron,</font>
<br><font size=2> </font>
<br><font size=2>I've implemented a form to send email (OpenCms
4.6). </font>
<br><font size=2>The element.cache variable is set to true in my opencms.properties
file.</font>
<br><font size=2> </font>
<br><font size=2>I've used the method "getCacheDirectives" in
this way:</font>
<br>
<br><font size=2> public CmsCacheDirectives getCacheDirectives(</font>
<br><font size=2>
CmsObject cms, String templateFile, String elementName, Hashtable
parameters, String templateSelector) {</font>
<br><font size=2> </font>
<br><font size=2> Vector para = new Vector();</font>
<br><font size=2> </font>
<br><font size=2> // new object CmsCacheDirectives</font>
<br><font size=2> CmsCacheDirectives cd = new CmsCacheDirectives(true,false,false,false,true);</font>
<br><font size=2> </font>
<br><font size=2> para.addElement("action");</font>
<br><font size=2> // my form parameters</font>
<br><font size=2> para.addElement("name");
</font>
<br><font size=2> para.addElement("tel");</font>
<br><font size=2> para.addElement("e_mail");</font>
<br><font size=2> para.addElement("address");</font>
<br><font size=2> cd.setNoCacheParameters(para);</font>
<br><font size=2> </font>
<br><font size=2> cd.renewAfterEveryPublish();</font>
<br><font size=2> </font>
<br><font size=2> return cd;</font>
<br><font size=2> </font>
<br><font size=2> }</font>
<br>
<br><font size=2>I hope this can help you.</font>
<br><font size=3> </font>
<br><font size=3> </font>
<br><font size=2>Irene</font>
<br><font size=3> </font>
<br><font size=3>----- Original Message ----- </font>
<br><font size=3><b>From:</b> </font><a href=mailto:astaffo2@csc.com.au><font size=3 color=blue><u>astaffo2@csc.com.au</u></font></a><font size=3>
</font>
<br><font size=3><b>To:</b> </font><a href="mailto:opencms-dev@www.opencms.org"><font size=3 color=blue><u>opencms-dev@www.opencms.org</u></font></a><font size=3>
</font>
<br><font size=3><b>Sent:</b> Wednesday, February 26, 2003 4:23 AM</font>
<br><font size=3><b>Subject:</b> Re: [opencms-dev] contact us form
not working in online project</font>
<br>
<br>
<br><font size=2>Further to my last email regarding my cache issue:</font><font size=3>
</font>
<br>
<br><font size=2>We're running ocms 5RC2</font><font size=3> </font>
<br>
<br><font size=2>We are currently extending the CmsXmlTemplate (eg. CmsXmlTemplateX)
and use it for the frame template and the content template.</font><font size=3>
</font>
<br>
<br><font size=2>The element used for the form extends the CmsXmlTemplateX
class.</font><font size=3> </font>
<br>
<br><font size=2>In the CmsXmlTemplateX I include the following overide
to the getCacheDirectives:</font><font size=3> </font>
<br>
<br><font size=2> public CmsCacheDirectives getCacheDirectives(CmsObject
cms,</font><font size=3> </font>
<br><font size=2> String
templateFile, String elementName, Hashtable parameters,</font><font size=3>
</font>
<br><font size=2> String
templateSelector) {</font><font size=3> </font>
<br><font size=2> System.out.println("in
getCacheDirectives: " + templateFile);</font><font size=3> </font>
<br><font size=2>
return new CmsCacheDirectives(false);</font><font size=3>
</font>
<br><font size=2> }</font><font size=3> </font>
<br>
<br><font size=2>I'm using the System.out to prove the method is
being overidden and to tell me which template is calling it.</font><font size=3>
</font>
<br>
<br><font size=2>Assuming the element.cache variable is set to true
in the opencms.properties file (due to the error in my last email);
when I hit my contact us form from the offline project I get three
returns from the System.out:</font><font size=3> </font>
<br>
<br><font size=2>in getCacheDirectives: /system/modules/org.opencms.default/frametemplates/myFrame</font><font size=3>
</font>
<br><font size=2>in getCacheDirectives: /system/modules/org.opencms.default/contenttemplates/myContent</font><font size=3>
</font>
<br><font size=2>in getCacheDirectives: /content/elements/contactUs</font><font size=3>
</font>
<br>
<br><font size=2>Which I would expect given the inheritence. And
from this the form works well and sends the emails.</font><font size=3>
</font>
<br>
<br><font size=2>When I access this form from the online version, I get
no entries from the System out (this is even the case when the element.cache
is set to false).</font><font size=3> </font>
<br>
<br><font size=2>Are there any differences with version 5 RC 2? I've
tried returning the CMSCacheDirectives with specific boolean values
and I've tried the setNoCacheParameters to the parameter "action"
which is set when the form is submitted. None of this has made
a difference.</font><font size=3> </font>
<br>
<br><font size=2>Any help is appreciated.</font><font size=3> </font>
<br>
<br><font size=2>BTW if you missed my last email, the error message produced
when I request the contact us form from the offline version when elelment,cache
is set to false is:</font><font size=3> </font>
<br>
<br><font size=2>com.opencms.core.CmsException: 0 Unknown exception. Detailed
error: A relative path has entered the A_CmsXmlContent class. filename=../frametemplates/secondLevelFrame.
</font>
<br><font size=2> at com.opencms.template.A_CmsXmlContent.init(A_CmsXmlContent.java:1031)</font><font size=3>
</font>
<br><font size=2> at com.opencms.template.CmsXmlTemplateFile.<init>(CmsXmlTemplateFile.java:105)</font><font size=3>
</font>
<br><font size=2> at com.opencms.template.CmsXmlTemplate.getOwnTemplateFile(CmsXmlTemplate.java:399)</font><font size=3>
</font>
<br><font size=2> at com.opencms.template.CmsXmlTemplate.getContent(CmsXmlTemplate.java:160)</font><font size=3>
</font>
<br><font size=2> at com.opencms.template.CmsXmlTemplate.templateElement(CmsXmlTemplate.java:1468)</font><font size=3>
</font>
<br><font size=2> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)</font><font size=3> </font>
<br><font size=2> ......</font><font size=3>
</font>
<br>
<br>
<br><font size=2>Regards,</font>
<br><font size=2>Aaron</font>
<br>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=1%>
<td width=36%><font size=1><b>"Irene Santerini" <i.santerini@inera.it></b></font><font size=3>
</font>
<br><font size=1>Sent by: owner-opencms-dev@www.opencms.org</font><font size=3>
</font>
<br>
<br><font size=1>25/02/03 19:46</font><font size=3> </font>
<br><font size=1>Please respond to opencms-dev</font><font size=3> </font>
<br>
<td width=61%><font size=1> </font>
<br><font size=1> To:
<opencms-dev@www.opencms.org></font><font size=3> </font>
<br><font size=1> cc:
</font><font size=3> </font>
<br><font size=1> Subject:
Re: [opencms-dev] contact us form not working in online
project</font></table>
<br>
<br>
<br>
<br><font size=2>Hi Aaron,</font><font size=3> </font>
<br><font size=3> </font>
<br><font size=2> do you have implemented the method "getCacheDirectives"
in your class?</font><font size=3> </font>
<br><font size=3> </font>
<br><font size=2>Irene.</font><font size=3> </font>
<br><font size=3>----- Original Message ----- </font>
<br><font size=3><b>From:</b> </font><a href=mailto:astaffo2@csc.com.au><font size=3 color=blue><u>astaffo2@csc.com.au</u></font></a><font size=3>
</font>
<br><font size=3><b>To:</b> </font><a href="mailto:opencms-dev@opencms.com"><font size=3 color=blue><u>opencms-dev@opencms.com</u></font></a><font size=3>
</font>
<br><font size=3><b>Sent:</b> Tuesday, February 25, 2003 6:25 AM
</font>
<br><font size=3><b>Subject:</b> [opencms-dev] contact us form not
working in online project </font>
<br>
<br>
<br><font size=2>Hi all</font><font size=3> </font>
<br>
<br><font size=2>We've implemented a Contact Us form using
the built-in form handling facility of ocms.</font><font size=3>
</font>
<br>
<br><font size=2>This form utilises the code example set found in
the user's guide and works perfectly in the offline project.</font><font size=3>
</font>
<br>
<br><font size=2>The problem lies in the online project when we publish
this form. When we access the form, it displays fine,
but when submitted it flicks back to the form as a basic html
form would behave.</font><font size=3> </font>
<br>
<br><font size=2>What I'm assuming is that the class isn't being
invoked at this point.</font><font size=3> </font>
<br>
<br><font size=2>Other custom classes we've created are being called
happily in the online project - all the classes including the
contact us class are in a jar file in the WEB-INF/lib directory.</font><font size=3>
</font>
<br>
<br><font size=2>Has anyone experienced this or have any suggestions?</font><font size=3>
</font>
<br>
<br><font size=2>Regards,</font><font size=3> </font>
<br><font size=2>Aaron</font><font size=3> </font>
<br>
<br>