[opencms-dev] Full static export

Schliemann, Kai K.Schliemann at comundus.com
Mon Sep 8 16:08:47 CEST 2014


Hi Zoltan,
you have two choices for getting all resources exported:

1.       Change <defaultpropertyvalue>false</defaultpropertyvalue> to <defaultpropertyvalue>true</defaultpropertyvalue>
this means, that all resources defined in <resourcestorender> get statically exported by default. Only if you set the property “export” to “false” a resource (and its children) do not get exported.

2.       Set the property “export” to “true” on any folder, you wish to get statically exported (e.g. /sites/yoursite/ and your module resources)  - and leave <defaultpropertyvalue> set to “false”.
The defaultsuffixes ignore the setting of defaultpropertyvalue, so files with these extensions get exported anyway. You could stop that by setting the export property of remove an extension from this setting.

If you want to create a snapshot of your site to copy it to some other place you can use CmsAfterPublishStaticExportHandler. For a production system I would recommend the CmsOnDemandStaticExportHandler because CmsAfterPublishStaticExportHandler causes heavy load after each publishing process.

HTH

Best regards
Kai


Von: opencms-dev-bounces at opencms.org [mailto:opencms-dev-bounces at opencms.org] Im Auftrag von DZoltan
Gesendet: Montag, 8. September 2014 15:49
An: The OpenCms mailing list
Betreff: Re: [opencms-dev] Full static export

Kai thanks for the response,
I tried to define the static export as by the link you sent me but it only exported the static resources such as css and images.
JSPs, structured contents and container pages were not exported.
Is there something missing? should I add something to the suffixes (what about pages without suffix?) ?

this is the current config:
<staticexport enabled="true">
            <staticexporthandler>org.opencms.staticexport.CmsAfterPublishStaticExportHandler</staticexporthandler>
            <linksubstitutionhandler>org.opencms.staticexport.CmsDefaultLinkSubstitutionHandler</linksubstitutionhandler>
            <exportpath>export</exportpath>
            <exportworkpath>temp</exportworkpath>
            <exportbackups>2</exportbackups>
            <defaultpropertyvalue>false</defaultpropertyvalue>
            <defaultsuffixes>
                        <suffix key=".woff" />
                        <suffix key=".ttf" />
                        <suffix key=".svg" />
                        <suffix key=".jpg" />
                        <suffix key=".gif" />
                        <suffix key=".png" />
                        <suffix key=".doc" />
                        <suffix key=".xls" />
                        <suffix key=".ppt" />
                        <suffix key=".pdf" />
                        <suffix key=".txt" />
                        <suffix key=".css" />
                        <suffix key=".zip" />
                        <suffix key=".swf" />
                        <suffix key=".js" />
            </defaultsuffixes>
            <rendersettings>
                        <rfs-prefix>${CONTEXT_NAME}/export</rfs-prefix>
                        <vfs-prefix>${CONTEXT_NAME}${SERVLET_NAME}</vfs-prefix>
                        <userelativelinks>false</userelativelinks>
                        <exporturl>http://127.0.0.1:8081${CONTEXT_NAME}/handle404</exporturl<http://127.0.0.1:8081$%7bCONTEXT_NAME%7d/handle404%3c/exporturl>>
                        <plainoptimization>true</plainoptimization>
                        <testresource uri="/system/shared/page.dtd" />
                        <resourcestorender>
                                   <regex>/sites/.*</regex>
                                   <regex>/system/workplace/commons/style/.*</regex>
                                   <regex>/system/galleries/.*</regex>
                                   <regex>/system/modules/.*/resources/.*</regex>
                        </resourcestorender>
            </rendersettings>
</staticexport>


On Mon, Sep 8, 2014 at 3:59 PM, Schliemann, Kai <K.Schliemann at comundus.com<mailto:K.Schliemann at comundus.com>> wrote:
Hi,
yes, it is: http://www.opencms-wiki.org/wiki/Static_Export

Best regards
Kai

Von: opencms-dev-bounces at opencms.org<mailto:opencms-dev-bounces at opencms.org> [mailto:opencms-dev-bounces at opencms.org<mailto:opencms-dev-bounces at opencms.org>] Im Auftrag von DZoltan
Gesendet: Montag, 8. September 2014 14:45
An: The OpenCms mailing list
Betreff: [opencms-dev] Full static export

Hi,
I am looking for a way to export the entire site to static files on the disk and not only the static files like CSS and images.

Is there a way to create a snapshot/dump of the site including container pages (assuming the content is fixed and not user generated)?

It will be best if the export can happen on publish so when a new container page is created with a content linked to it, there will be a static version of the page already rendered.

is it possible? did anyone have experience with such thing?

_______________________________________________
This mail is sent to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20140908/6f236256/attachment.htm>


More information about the opencms-dev mailing list