[opencms-dev] Concept Problems of Static Export

M Butcher mbutcher at grcomputing.net
Mon Nov 24 18:39:01 CET 2003


Mato wrote:
> Hello pals,
> I´ve some problems with the meaning of static export. If you would 
> answer this questions...
>  
> 1. If you have a website in which all the pages uses jsp templates, Is 
> it necessary to make the static export. I don´t think so. I think that I 
> only have to do the static export of the images and the pdfs,docs... Is 
> this true????

You can do either. I only export images, binaries (Docs and PDFs), and a 
few static HTML or text files. Use the flag in 
$CATALINA_HOME/webapps/opencms/WEB-INF/config/opencms.properties to set 
the default behavior. I believe that by default, everything is exported.

Look for the flag 'staticexport.enabled' and read the comments.

> 2. But if I do this, when I want to make the indexes for Lucene, I don´t 
> have the pages on disk. How can I do this. What my friends told me is to 
> set the static export to true so as to have then on disk, make the 
> indexes, and then set the static export to false. Is this the correct way???

The Lucene module indexes the VFS, not the exported files. You can 
basically configure it to search anything that is stored inside of 
OpenCMS, regardless of whether or not it is exported.

FYI, all of my machines have staticexport.enabled=false -- and I 
developed the Lucene module that way.

> 3. Does the static export really mean that the pages in which jsp is 
> used, are precompiled so as to gain in speed??? But if you have for 
> example in that jsps, conditional clauses that show differents contents, 
> for example depending on the user, this doesn´t work, does it?

JSPs are always (unless configured differently) compiled into bytecode 
the first time they are run, which is why the servlet engine takes so 
much longer the first time you hit it after restarting. As bytecodes, 
though, all the logic is preserved. it's more like running a Java app 
than storing a static HTML file.

If you EXPORT, then during the export process, all JSPs are run and the 
results (that is, just the HTML) are written to a static HTML-only file. 
That means, as you guessed, that conditional logic, user dependancies, 
etc. gets ignored.

I would recommend:
- Set staticexport.enabled=false (make sure you restart after setting this)
- Read through the README file in Lucene 1.4 (or 1.3) for instructions 
on how to set it up. If you are still stuck on #2, post to the list.
- Manually set the staticExport=true property on files you want to have 
exported.

>  
> Thanks in advance. I´ve read the book of the manual, but I don´t have 
> that concept very clear. If you could help me with this questions, or if 
> you have some time to explain in a few paragraphs how does it work, 
> this´d very kind.

I found this to be the most difficult step in learning OpenCms.

I hope this clears things up at least a little.

Matt




More information about the opencms-dev mailing list