[opencms-dev] Nice static export behaviour discovered by accident

Pere Torrodellas ptorrodellas at fihoca.com
Thu Feb 14 17:14:36 CET 2008


Hello,

I've just discovered a nice static export behaviour I was unaware of, and of which I've been unable to find any reference in the OpenCms info sources. Maybe someone can direct me to where it's explained?

By mistake I defined a page, "detall_fitxa.html", with export=true. But in fact it's not static, because its template includes a JSP that produces different output depending on an iput parameter. The different page variations are requested from a menu page built by a search function, with entries of the form:

<li><a href="<cms:link>/.../detall_fitxa.html?idFitxaOcup=<%= idFitxa %></cms:link>" ...</a></li> 

idFitxaOcup being the parameter that defines the specific output.

I expected this to return always the same output, the one corresponding to the first invocation that triggers the export of detall_fitxa.html.

But it was working, and nicely serving the right different pages from the export directory !!

To my amazement, in the menu page navigator source, instead of having entries like:

<li><a href="/.../export/.../detall_fitxa.html?idFitxaOcup=1" ...</a></li> 
<li><a href="/.../export/.../detall_fitxa.html?idFitxaOcup=2" ...</a></li> 
<li><a href="/.../export/.../detall_fitxa.html?idFitxaOcup=3" ...</a></li> 

OpenCms is producing entries of the form:

<li><a href="/.../export/.../detall_fitxa.html_1906779681.html"...</a></li>
<li><a href="/.../export/.../detall_fitxa.html_1906779812.html"...</a></li>
<li><a href="/.../export/.../detall_fitxa.html_1906779813.html"...</a></li>

and those pages with the strange names get indeed into the right export directory and are served from there. 

So by declaring one page exportable, I got N exported pages, one for every input parameter that was being selected in the menu page.  

This is not at all what I understood from the static export OpenCms info... but it's really nice if you don't have a lot of different variations. It's kind of like Flex with the "params" directive, but completely static... 

Is this a documented feature? Did I miss it in the OpenCms documentation? How can OpenCms decide the different page names in the menu before knowing the whole set of possible parameter values??? Interesting stuff, but I feel uneasy depending on it until someone tells me that this is "working as designed".

Thanks for any info,

Pere
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20080214/f7556a4c/attachment.htm>


More information about the opencms-dev mailing list