AW: [opencms-dev] Static export of dynamic links
Bart Elberg
belberg at idealcorp.com
Wed Oct 16 02:18:19 CEST 2002
Well after some playing with static export, I got most of my links
working. To answer Kai's question: yes, this is in a template. Here is
the answer to my own question. The original link in the template was:
href="]]><method
name="getServletPath"/><![CDATA[projects/projects/project.htm?org=]]><PROCESS>orgid</PROCESS><![CDATA["
and to support static export the link now looks like:
href="]]><link>/projects/projects/project.htm?org=<PROCESS>orgid</PROCESS></link><![CDATA["
There are a couple of subtle points in this example... no CDATA within
the LINK tag and the PROCESS tag can be nested within the LINK tag.
A second example:
<img src="]]><PROCESS>buttonoffimage</PROCESS><![CDATA["
In this case the entire link/URLis generated in the associated class.
To support static export the calling program must use the
getLinkSubstitution() method to map the link. Then the code can set the
link/URL in the template.
String imagePath = cms.getLinkSubstitution("/projects/images/");
templateDocument.setData("buttonoffimage", imagePath +
buttonOffImage);
I hope these examples help other people (I sure could have used them!).
Now that this is working, I realize that there are other problems with
static export... more emails!!!
Bart
-----------------------
Schmidt, Kai wrote:
>Hi Bart,
>
>I don´t know if you use it in a template. If yes try the <link>-tag (p.168
>in the pdf) instead of the "getServletPath"!
>Hope you don´t mind if this solution is too simple and does not meet your
>requirements ;-)
>
>best regards, Kai
>
>
>>How can I make the following dynamic link compatible with
>>static export?
>>
>> href="]]><method
>>name="getServletPath"/><![CDATA[projects/projects/project.htm?
>>org=]]><PROCESS>orgid</PROCESS><![CDATA["
>>
>>The documentation is not clear how the getLinkSubstitution()
>>method should be used.
>>
>>Any help is appreciated. Thanks!
>>
>>Bart Elberg
>>__________________________________________________
>>I.D.E.A.L. Technology Corporation - Orlando Office
>>http://www.idealcorp.com - 407.999.9870 x15
>>
>>
More information about the opencms-dev
mailing list