<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1141" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><SPAN class=716005208-26022003><FONT face=Arial color=#0000ff
size=2>Hi,</FONT></SPAN></DIV>
<DIV><SPAN class=716005208-26022003><FONT face=Arial color=#0000ff size=2>this
can work but it makes your Java class dependent on form
fields.</FONT></SPAN></DIV>
<DIV><SPAN class=716005208-26022003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=716005208-26022003><FONT face=Arial color=#0000ff size=2>The
general way as described bellow - <FONT color=#000000>return new
CmsCacheDirectives(false) - <SPAN class=716005208-26022003><FONT face=Arial
color=#0000ff size=2>should work.</FONT></SPAN></FONT></FONT></SPAN></DIV>
<DIV><SPAN class=716005208-26022003><FONT face=Arial color=#0000ff size=2><SPAN
class=716005208-26022003></SPAN></FONT></SPAN> </DIV>
<DIV><SPAN class=716005208-26022003><FONT face=Arial color=#0000ff size=2><SPAN
class=716005208-26022003>Aaron, are you sure you are using your Java class
CmsXmlTemplateX for you element? </SPAN></FONT></SPAN></DIV>
<DIV><SPAN class=716005208-26022003><FONT face=Arial color=#0000ff size=2><SPAN
class=716005208-26022003>You don't need it for frame/content templates,
</SPAN></FONT></SPAN><SPAN class=716005208-26022003><FONT face=Arial
color=#0000ff size=2><SPAN class=716005208-26022003>if you have your dynamic
functionality only in this one form handled by
element.</SPAN></FONT></SPAN></DIV>
<DIV><SPAN class=716005208-26022003><FONT face=Arial color=#0000ff size=2><SPAN
class=716005208-26022003></SPAN></FONT></SPAN> </DIV>
<DIV><SPAN class=716005208-26022003><FONT face=Arial color=#0000ff size=2><SPAN
class=716005208-26022003>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.</SPAN></FONT></SPAN></DIV>
<DIV><SPAN class=716005208-26022003><FONT face=Arial color=#0000ff size=2><SPAN
class=716005208-26022003></SPAN></FONT></SPAN> </DIV>
<DIV><SPAN class=716005208-26022003><FONT face=Arial color=#0000ff size=2><SPAN
class=716005208-26022003>Regards</SPAN></FONT></SPAN></DIV>
<DIV><SPAN class=716005208-26022003><FONT face=Arial color=#0000ff size=2><SPAN
class=716005208-26022003>Petr</SPAN></FONT></SPAN></DIV>
<DIV><SPAN class=716005208-26022003><FONT face=Arial color=#0000ff size=2><SPAN
class=716005208-26022003></SPAN></FONT></SPAN> </DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B>
owner-opencms-dev@www.opencms.org
[mailto:owner-opencms-dev@www.opencms.org]<B>On Behalf Of </B>Irene
Santerini<BR><B>Sent:</B> Wednesday, February 26, 2003 9:37 AM<BR><B>To:</B>
opencms-dev@www.opencms.org<BR><B>Subject:</B> Re: [opencms-dev] contact us
form not working in online project<BR><BR></FONT></DIV>
<DIV><FONT size=2>Hi Aaron,</FONT></DIV>
<DIV><FONT size=2> </DIV>
<DIV>I've implemented a form to send email (OpenCms 4.6). </DIV>
<DIV>The element.cache variable is set to true in my opencms.properties
file.</DIV>
<DIV> </DIV>
<DIV>I've used the method "getCacheDirectives" in this way:<BR></DIV>
<DIV><BR> public CmsCacheDirectives getCacheDirectives(</DIV>
<DIV>
CmsObject cms, String templateFile, String elementName, Hashtable parameters,
String templateSelector) {</DIV>
<DIV> </DIV>
<DIV> Vector para = new Vector();</DIV>
<DIV> </DIV>
<DIV> // new object CmsCacheDirectives<BR>
CmsCacheDirectives cd = new
CmsCacheDirectives(true,false,false,false,true);</DIV>
<DIV> </DIV>
<DIV> para.addElement("action");</DIV>
<DIV> // my form parameters<BR>
para.addElement("name"); <BR>
para.addElement("tel");<BR>
para.addElement("e_mail");<BR>
para.addElement("address");<BR></DIV>
<DIV> cd.setNoCacheParameters(para);</DIV>
<DIV> </DIV>
<DIV> cd.renewAfterEveryPublish();</DIV>
<DIV> </DIV>
<DIV> return cd;</DIV>
<DIV> </DIV>
<DIV> }<BR></FONT><FONT size=2></FONT></DIV>
<DIV><FONT size=2>I hope this can help you.</DIV></FONT>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Irene</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=astaffo2@csc.com.au
href="mailto:astaffo2@csc.com.au">astaffo2@csc.com.au</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A
title=opencms-dev@www.opencms.org
href="mailto:opencms-dev@www.opencms.org">opencms-dev@www.opencms.org</A>
</DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Wednesday, February 26, 2003 4:23
AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [opencms-dev] contact us
form not working in online project</DIV>
<DIV><FONT size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><BR></DIV><BR><FONT face=sans-serif size=2>Further to my last
email regarding my cache issue:</FONT> <BR><BR><FONT face=sans-serif
size=2>We're running ocms 5RC2</FONT> <BR><BR><FONT face=sans-serif
size=2>We are currently extending the CmsXmlTemplate (eg. CmsXmlTemplateX)
and use it for the frame template and the content template.</FONT>
<BR><BR><FONT face=sans-serif size=2>The element used for the form extends
the CmsXmlTemplateX class.</FONT> <BR><BR><FONT face=sans-serif size=2>In
the CmsXmlTemplateX I include the following overide to the
getCacheDirectives:</FONT> <BR><BR><FONT face=sans-serif size=2>
public CmsCacheDirectives getCacheDirectives(CmsObject cms,</FONT>
<BR><FONT face=sans-serif size=2>
String templateFile, String elementName, Hashtable parameters,</FONT>
<BR><FONT face=sans-serif size=2>
String templateSelector) {</FONT> <BR><FONT face=sans-serif size=2>
System.out.println("in getCacheDirectives: " +
templateFile);</FONT> <BR><FONT face=sans-serif size=2>
return new
CmsCacheDirectives(false);</FONT> <BR><FONT face=sans-serif size=2>
}</FONT> <BR><BR><FONT face=sans-serif 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> <BR><BR><FONT face=sans-serif 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>
<BR><BR><FONT face=sans-serif size=2>in getCacheDirectives:
/system/modules/org.opencms.default/frametemplates/myFrame</FONT> <BR><FONT
face=sans-serif size=2>in getCacheDirectives:
/system/modules/org.opencms.default/contenttemplates/myContent</FONT>
<BR><FONT face=sans-serif size=2>in getCacheDirectives:
/content/elements/contactUs</FONT> <BR><BR><FONT face=sans-serif
size=2>Which I would expect given the inheritence. And from this the
form works well and sends the emails.</FONT> <BR><BR><FONT face=sans-serif
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> <BR><BR><FONT face=sans-serif 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> <BR><BR><FONT
face=sans-serif size=2>Any help is appreciated.</FONT> <BR><BR><FONT
face=sans-serif 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> <BR><BR><FONT face=sans-serif
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
face=sans-serif size=2> at
com.opencms.template.A_CmsXmlContent.init(A_CmsXmlContent.java:1031)</FONT>
<BR><FONT face=sans-serif size=2> at
com.opencms.template.CmsXmlTemplateFile.<init>(CmsXmlTemplateFile.java:105)</FONT>
<BR><FONT face=sans-serif size=2> at
com.opencms.template.CmsXmlTemplate.getOwnTemplateFile(CmsXmlTemplate.java:399)</FONT>
<BR><FONT face=sans-serif size=2> at
com.opencms.template.CmsXmlTemplate.getContent(CmsXmlTemplate.java:160)</FONT>
<BR><FONT face=sans-serif size=2> at
com.opencms.template.CmsXmlTemplate.templateElement(CmsXmlTemplate.java:1468)</FONT>
<BR><FONT face=sans-serif size=2> at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</FONT> <BR><FONT
face=sans-serif size=2> ......</FONT>
<BR><BR><FONT face=sans-serif
size=2><BR>Regards,<BR>Aaron<BR></FONT><BR><BR><BR>
<TABLE width="100%">
<TBODY>
<TR vAlign=top>
<TD>
<TD><FONT face=sans-serif size=1><B>"Irene Santerini"
<i.santerini@inera.it></B></FONT> <BR><FONT face=sans-serif
size=1>Sent by: owner-opencms-dev@www.opencms.org</FONT>
<P><FONT face=sans-serif size=1>25/02/03 19:46</FONT> <BR><FONT
face=sans-serif size=1>Please respond to opencms-dev</FONT> </P>
<TD><FONT face=Arial size=1>
</FONT><BR><FONT face=sans-serif size=1>
To:
<opencms-dev@www.opencms.org></FONT> <BR><FONT
face=sans-serif size=1> cc:
</FONT> <BR><FONT face=sans-serif size=1>
Subject: Re: [opencms-dev]
contact us form not working in online
project</FONT></TD></TR></TBODY></TABLE><BR><BR><BR><BR><FONT size=2>Hi
Aaron,</FONT> <BR><FONT size=3> </FONT> <BR><FONT size=2> do you
have implemented the method "getCacheDirectives" in your class?</FONT>
<BR><FONT size=3> </FONT> <BR><FONT size=2>Irene.</FONT> <BR><FONT
size=3>----- Original Message ----- </FONT><BR><FONT size=3><B>From:</B>
</FONT><A href="mailto:astaffo2@csc.com.au"><FONT color=blue
size=3><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
color=blue size=3><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>
<BR><FONT size=2>Aaron</FONT> <BR></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>