<br><font size=2 face="sans-serif">Further to my email below; I was wondering
if it a good work around to just leave the directory containing the contact
Us form out of the static export.</font>
<br>
<br><font size=2 face="sans-serif">The /opencms/export/contactUs/contactUs.html
obviously doesn't work and /opencms/opencms/contactUs/contactUs.html does.</font>
<br>
<br><font size=2 face="sans-serif">When I set the export property for the
contactUs directory and contactUs.html file to 'dynamic' or 'false' the
links in my exported files eg.</font>
<br>
<br><font size=2 face="sans-serif"><a href="]]><LINK><![CDATA[/contactUs/contactUs.html]]></LINK><![CDATA[">Contact
Us</a> (like my header and footer files)</font>
<br>
<br><font size=2 face="sans-serif">still link to /opencms/export/contactUs/contactUs.html</font>
<br>
<br><font size=2 face="sans-serif">Shouldn't setting this export property
in the folder and file and then publishing make the <LINK> links
response and link /opencms/export files to my /opencms/opencms/contactUs/contactUs/html?</font>
<br>
<br><font size=2 face="sans-serif">Or do I have to hard code my links?</font>
<br>
<br><font size=2 face="sans-serif">Your advice is most appreciated.</font>
<br><font size=2 face="sans-serif"><br>
Regards,<br>
Aaron Stafford<br>
___________________________________________________<br>
Analyst Programmer, Web Services, Enterprise Business Solutions,<br>
CSC Australia<br>
212 Northbourne Avenue, Canberra ACT 2612<br>
Ph: +61 2 6246 8730 Mobile: +61 404 043 729 Fax:
+61 2 6242 8100<br>
Email: astaffo2@csc.com.au Web: http://www.csc.com.au<br>
----------------------------------------------------------------------------------------<br>
This email, including any attachments, is intended only for use by the
addressee(s) and may contain confidential and/or personal information and
may also be the subject of legal privilege. Any personal information contained
in this email is not to be used or disclosed for any purpose other than
the purpose for which you have received it. If you are not the intended
recipient, you must not disclose or use the information contained in it.
In this case, please let me know by return email, delete the message permanently
from your system and destroy any copies.<br>
----------------------------------------------------------------------------------------<br>
</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td>
<td><font size=1 face="sans-serif"><b>astaffo2@csc.com.au</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">27/02/03 09:07</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>Thank you Petr and Irene for your comments.</font><font size=3>
</font>
<br>
<br><font size=2>I have tried both these methods of setting the non-caching
of this element.</font><font size=3> </font>
<br>
<br><font size=2>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><font size=3>
</font>
<br>
<br><font size=2>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><font size=3> </font>
<br>
<br><font size=2>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><font size=3> </font>
<br>
<br><font size=2>BTW the opencms.properties element.cache obviously still
doesn't work in v5, so I'll leave it as true.</font><font size=3> </font>
<br>
<br><font size=2>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><font size=3> </font>
<br>
<br><font size=2>I'm wondering if anyone has got this working in v5RC2?</font><font size=3>
</font>
<br>
<br><font size=2>Can we get an official response from the OCMS team on
this? Has anything changed regarding the imlementation of cache in
this version?</font><font size=3> </font>
<br>
<br><font size=2>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><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> return new CmsCacheDirectives(false);</font><font size=3>
</font>
<br><font size=2> }</font><font size=3> </font>
<br>
<br>
<br><font size=2>Thank you for your responses so far, it has been appreciated,</font><font size=3>
</font>
<br>
<br><font size=2>Regards,</font>
<br><font size=2>Aaron</font>
<br><font size=3> </font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=1%>
<td width=35%><font size=1><b>"Petr Hollay" <ph@ethikom.de></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>26/02/03 19:56</font><font size=3> </font>
<br><font size=1>Please respond to opencms-dev</font><font size=3> </font>
<td width=63%><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,</font><font size=3> </font>
<br><font size=2>this can work but it makes your Java class dependent
on form fields.</font><font size=3> </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><font size=3>
</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><font size=3> </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><font size=3>
</font>
<br><font size=3> </font>
<br><font size=2>Regards</font><font size=3> </font>
<br><font size=2>Petr</font><font size=3> </font>
<br><font size=3> </font>
<br><font size=2>-----Original Message-----</font><font size=3> </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><font size=3> </font>
<br><font size=2><b>Sent:</b> Wednesday, February 26, 2003 9:37 AM</font><font size=3>
</font>
<br><font size=2><b>To:</b> opencms-dev@www.opencms.org</font><font size=3>
</font>
<br><font size=2><b>Subject:</b> Re: [opencms-dev] contact us form
not working in online project</font><font size=3> </font>
<br>
<br>
<br><font size=2>Hi Aaron,</font><font size=3> </font>
<br><font size=2> </font><font size=3> </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><font size=3> </font>
<br><font size=2> </font><font size=3> </font>
<br><font size=2>I've used the method "getCacheDirectives" in
this way:</font><font size=3> </font>
<br>
<br><font size=2> public CmsCacheDirectives getCacheDirectives(</font><font size=3>
</font>
<br><font size=2>
CmsObject cms, String templateFile, String elementName, Hashtable
parameters, String templateSelector) {</font><font size=3> </font>
<br><font size=2> </font><font size=3> </font>
<br><font size=2> Vector para = new Vector();</font><font size=3>
</font>
<br><font size=2> </font><font size=3> </font>
<br><font size=2> // new object CmsCacheDirectives</font><font size=3>
</font>
<br><font size=2> CmsCacheDirectives cd = new CmsCacheDirectives(true,false,false,false,true);</font><font size=3>
</font>
<br><font size=2> </font><font size=3> </font>
<br><font size=2> para.addElement("action");</font><font size=3>
</font>
<br><font size=2> // my form parameters</font><font size=3>
</font>
<br><font size=2> para.addElement("name");
</font>
<br><font size=2> para.addElement("tel");</font><font size=3>
</font>
<br><font size=2> para.addElement("e_mail");</font><font size=3>
</font>
<br><font size=2> para.addElement("address");</font><font size=3>
</font>
<br><font size=2> cd.setNoCacheParameters(para);</font><font size=3>
</font>
<br><font size=2> </font><font size=3> </font>
<br><font size=2> cd.renewAfterEveryPublish();</font><font size=3>
</font>
<br><font size=2> </font><font size=3> </font>
<br><font size=2> return cd;</font><font size=3> </font>
<br><font size=2> </font><font size=3> </font>
<br><font size=2> }</font><font size=3> </font>
<br>
<br><font size=2>I hope this can help you.</font><font size=3> </font>
<br><font size=3> </font>
<br><font size=3> </font>
<br><font size=2>Irene</font><font size=3> </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><font size=3> </font>
<br><font size=2>Aaron</font><font size=3> </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><font size=3>
</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>
<br>