<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.E-MailFormatvorlage19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="DE" link="blue" vlink="purple">Hi Kai,<br>
<br>
again the perfect hint from you! :-)<br>
<br>
"Everything from the root folder is omitted." and the example - this was eye-opening and should IMO be added to the docs!<br>
I assumed the property can only be used to simply "rename" a folder ... but instead it's a powerful feature and I detected that even just "/" on my "/sites/mysite" folder works and exactly results in what I desired.<br>
<br>
OpenCms is great!<br>
<br>
Little off-topic question you could possibly answer:<br>
In the manifest.xml of a site's database export I see <flags>0</flags><br>
What is this for? (just to get the idea/reason behind)<br>
[ Background: I've created an "import tool" based on an Apache Ant build that can create such a "database export" to migrate/import content to OpenCms.<br>
Works great for Apache Lenya repositories.<br>
Currently I do some refinements to make it easier to customize for other (file based) sources e.g. a static website.<br>
If this then is also of interest for others I'm happy to contribute/share it. ]<br>
<br>
Best regards,<br>
Gerd<br><br><div class="gmail_quote">Am 11. Juni 2018 09:04:54 MESZ schrieb "Schliemann, Kai" <K.Schliemann@comundus.com>:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<div class="WordSection1">
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Hi Gerd,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">I can give you an answer for question 1:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">There is a property called „exportname“. You can define a foldername there. Everything from the root folder is omitted.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">A common use case is, to set this on the resources folder of your module. If you define the exportname „res“ on the resources folder of a module you get something like this:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><a href="https://www.comundus.com/export/res/plugins/bootstrap-smartmenu/css/jquery.smartmenus.bootstrap.min.css">https://www.comundus.com/export/res/plugins/bootstrap-smartmenu/css/jquery.smartmenus.bootstrap.min.css</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">instead of<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><a href="https://www.comundus.com/export/system/modules/com.comundus.internet.template/resources/plugins/bootstrap-smartmenu/css/jquery.smartmenus.bootstrap.min.css">https://www.comundus.com/export/system/modules/com.comundus.internet.template/resources/plugins/bootstrap-smartmenu/css/jquery.smartmenus.bootstrap.min.css</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">You can do the same with resources in your site.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">In most of our projects we use absolute links instead of relative links. But that’s just a matter of taste.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">2.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">I don’t know exactly, but I recognized, that it is always created, when the parent folder is a navigation folder.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">HTH<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Best regards<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Kai<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><b>Von:</b> opencms-dev-bounces@opencms.org <opencms-dev-bounces@opencms.org>
<b>Im Auftrag von </b>Gerd Schrick<br>
<b>Gesendet:</b> Montag, 11. Juni 2018 03:53<br>
<b>An:</b> The OpenCms mailing list <opencms-dev@opencms.org><br>
<b>Betreff:</b> Re: [opencms-dev] static export 404 on Template Resources<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">Hi Kai (and all),<br>
<br>
success! ... with some (smaller) issues/questions.<br>
<br>
A bit awkward to admit: the fix simply was to explicitly set the export property of /sites/mysite to true.<br>
I ignored this most of the time, because of the feedback "... 404" (in contrast to "... ignored" at some other resources) in the output; so I thought that OpenCms really tries to export the resource but failed for some reason. (solution details and config below)<br>
<br>
1. the exported site shall be used at <a href="http://www.somesite.de">www.somesite.de</a> w/o "/sites/mysite/". With relative links to other pages this works, but then "../../" in links to the (template) module resources is too much (although it works in Apache
 or Tomcat locally).<br>
Is there a way to config a "correct" export for that?<br>
With additional <rfs-rule> element(s)?<br>
<br>
2. what's the reason for the additional files "index_export.html" as they are the same as the corresponding "index.html"?<br>
<br>
3. (and related to 1.) the docu says: "create a full static copy of a side that can [...] be stored on an USB stick or CD-Rom.".<br>
That sounds to me that the site can then be browsed from the stick/CD-Rom ... but all the links to pages point to "somepage/" (instead of e.g "somepage/index.html") what does not work w/o a webserver.<br>
Is my assumption wrong or how to do that?<br>
<br>
4. as soon as I add a <rfs-rule> for "/sites/mysite/.*" in the config (see below), the styles in Administration/Database Management (and other) are broken: new_admin.css gets referenced someplace within "mysite".<br>
Why this? (although the rule obviously does not match anything in "/system/workplace/commons")<br>
<br>
Thanks for clarification.<br>
<br>
Best regards,<br>
<br>
Gerd<br>
<br>
<br>
How the full static export works for me (Tomcat standalone on Linux):<br>
<br>
1. all config is just the default (as it was after a fresh 10.5.3 install)<br>
<br>
2. have a site "mysite" with root folder "/sites/mysite" that is published<br>
<br>
3. set property "export" of the sites' root folder to true (this setting must also be published!)<br>
<br>
4. in opencms-importexport.xml add this to <rendersettings> element (see doku):<br>
<rfs-rules><br>
<rfs-rule><br>
<name>MySite</name><br>
<description>rfs-rule for site mysite</description><br>
<source>/sites/mysite/.*</source><br>
<rfs-prefix></rfs-prefix><br>
<exportpath>/home/gsuser/tomcat-8.5.11/webapps/ROOT</exportpath><br>
<userelativelinks>true</userelativelinks><br>
<related-system-res><br>
<regex>/system/modules/mysite.template/.*</regex><br>
</related-system-res><br>
</rfs-rule><br>
<rfs-rule><br>
<!-- GS: fix for broken Workspace styles (old UI) --><br>
<name>cmnsStyle</name><br>
<description>Fix for 404 @ /system/workplace/commons/style/new_admin.css</description><br>
<source>/.*</source><br>
<rfs-prefix>${CONTEXT_NAME}/export</rfs-prefix><br>
<exportpath>export</exportpath><br>
<related-system-res><br>
<regex>/system/workplace/commons/style/.*</regex><br>
</related-system-res><br>
</rfs-rule><br>
</rfs-rules><br>
NOTE: the 2nd rfs-rule is required to fix the broken styles in Administration (see above)<br>
5. restart Tomcat required after the changes in 4.<br>
<br>
<br>
"Schliemann, Kai" <<a href="mailto:K.Schliemann@comundus.com">K.Schliemann@comundus.com</a>> hat am 8. Juni 2018 um 10:41 geschrieben:
<br>
<br>
Hi Gerd,<br>
<br>
ok here are some hints. Maybe they help.<br>
<br>
Your setting in opencms-importexport.xml tells OpenCms to only export files with the file extensions mentioned in „defaultsuffixes“. If you want all resources (html, css, js, images…) to be exported, you have to either set „defaultpropertyvalue“ to „true“ (in
 opencms-importexport.xml) or set the property „export“ on e.g. the root folder of your site (e.g. on „sites/default/“)In order to make static export work properly, you have to add the cms:link-Tag to resources in your templates. Not just the elements (like
 a logo) which style your website, but all resources which reside in OpenCms. E.g. using a link element in one of your XSDs. No matter, if you link to pages, images or download files. One exception. If you use the cms:img tag, you must not use the cms:link
 tag with it. So never mix cms:img and cms:link tag.Check port of Tomcat (that‘s what I already told you)You may also check this thread:
<a href="https://github.com/alkacon/opencms-core/issues/494">https://github.com/alkacon/opencms-core/issues/494</a><br>
<br>
<br>
<br>
Hope one of these hints help you. Please let me know. I am curious.<br>
<br>
<br>
<br>
Best regards<br>
<br>
Kai <br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
Von: <a href="mailto:opencms-dev-bounces@opencms.org">opencms-dev-bounces@opencms.org</a> <<a href="mailto:opencms-dev-bounces@opencms.org">opencms-dev-bounces@opencms.org</a>> Im Auftrag von Gerd Schrick<br>
Gesendet: Donnerstag, 7. Juni 2018 20:13<br>
An: The OpenCms mailing list <<a href="mailto:opencms-dev@opencms.org">opencms-dev@opencms.org</a>><br>
Betreff: Re: [opencms-dev] static export 404 on Template Resources<br>
<br>
<br>
<br>
Dear OpenCms Gurus,<br>
<br>
pleeeeease help!!! ;-)<br>
I guess I'm dearly overlooking some details.<br>
<br>
I've created a relative simple site and now I want to do a full static export, so it can be hosted (w/o OpenCms).<br>
<br>
<br>
<br>
To do this I use Database Management / Start Static Export.<br>
<br>
Seems basically to work BUT:<br>
<br>
1. (the main problem): all the "Non-Template Resources" are exported, but for all of the "Template Resources" it just says "... 404"<br>
<br>
example:<br>
<br>
( 9 / 706 ) Exporting /sites/mysite/material/press/ ... 404 <br>
( 10 / 706 ) Exporting /sites/mysite/material/press/index.html ... 404<br>
<br>
in Tomcat's localhost_access_log I see (for the above):<br>
<br>
127.0.0.1 - - [07/Jun/2018:17:24:06 +0200] "GET /opencms/handle404/opencms/export/sites/mysite/material/press/index.html HTTP/1.1" 404 -<br>
127.0.0.1 - - [07/Jun/2018:17:24:06 +0200] "GET /opencms/handle404/opencms/export/sites/mysite/material/press/ HTTP/1.1" 404 -<br>
the "regular" urls are<br>
localhost:8080/material/press/<br>
localhost:8080/material/press/index.html<br>
<br>
but I assume that the difference here is somehow related to the static export logic.<br>
<br>
2. the exported files are first created in webapps/opencms/temp and when finished moved to folder "backup2" (! instead of "export", where I suspect them to go)<br>
<br>
<br>
<br>
And it doesn't seem to make any difference what is selected in Site/Project.<br>
<br>
<br>
<br>
My setup is OpenCms 10.5.3 on Tomcat 8 (standalone), both with the deafult settings from the installation.<br>
<br>
The excerpt of the opencms-importexport.xml is below.<br>
<br>
<br>
<br>
Would be really great if someone can point me in the right direction.<br>
<br>
<br>
<br>
Best regards,<br>
<br>
Gerd<br>
<br>
<br>
<br>
<br>
<br>
opencms-importexport.xml:<br>
<br>
<staticexport enabled="true"><br>
<staticexporthandler>org.opencms.staticexport.CmsOnDemandStaticExportHandler</staticexporthandler><br>
<linksubstitutionhandler>org.opencms.staticexport.CmsDefaultLinkSubstitutionHandler</linksubstitutionhandler><br>
<exportpath>export</exportpath><br>
<exportworkpath>temp</exportworkpath><br>
<exportbackups>2</exportbackups><br>
<defaultpropertyvalue>false</defaultpropertyvalue><br>
<defaultsuffixes><br>
<suffix key=".jpg" /><br>
<suffix key=".gif" /><br>
<suffix key=".png" /><br>
<suffix key=".doc" /><br>
<suffix key=".xls" /><br>
<suffix key=".ppt" /><br>
<suffix key=".docx" /><br>
<suffix key=".xlsx" /><br>
<suffix key=".pptx" /><br>
<suffix key=".pdf" /><br>
<suffix key=".txt" /><br>
<suffix key=".css" /><br>
<suffix key=".js" /><br>
<suffix key=".zip" /><br>
<suffix key=".swf" /><br>
</defaultsuffixes><br>
<rendersettings><br>
<rfs-prefix>${CONTEXT_NAME}/export</rfs-prefix><br>
<vfs-prefix>${CONTEXT_NAME}</vfs-prefix><br>
<userelativelinks>true</userelativelinks><br>
<exporturl><a href="http://127.0.0.1:8080$%7bCONTEXT_NAME%7d/handle404%3c/exporturl">http://127.0.0.1:8080${CONTEXT_NAME}/handle404</exporturl</a>><br>
<plainoptimization>true</plainoptimization><br>
<testresource uri="/system/shared/page.dtd" /><br>
<resourcestorender><br>
<regex>/sites/.*</regex><br>
<regex>/system/workplace/commons/style/.*</regex><br>
<regex>/system/galleries/.*</regex><br>
<regex>/system/modules/.*/resources/.*</regex><br>
</resourcestorender><br>
</rendersettings><br>
</staticexport><br>
<br>
<br>
<br>
Gerd Schrick <<a href="mailto:mail@schrick-design.de">mail@schrick-design.de</a>> hat am 15. Mai 2018 um 19:14 geschrieben:
<br>
<br>
Hi Kai, <br>
<br>
the port already was set correctly. <br>
<br>
As only resources/requests to <br>
/sites/default/... result in a 404 <br>
but the ones to <br>
/system/... work <br>
it looks like there's somewhere kind of a (not working) url rewrite. <br>
As mentioned I didn't any Tomcat (standalone) nor OCMS config changes that may do that.
<br>
<br>
I've still no idea what's going wrong here or where/what to look for. <br>
<br>
Maybe noone out there doing a full static export out-of-the-box? <br>
<br>
Best regards, <br>
Gerd<br>
<br>
Am 15. Mai 2018 08:42:33 MESZ schrieb "Schliemann, Kai" <<a href="mailto:K.Schliemann@comundus.com">K.Schliemann@comundus.com</a>>:<br>
<br>
Hi Gerd,<br>
<br>
a common mistake is to not set the correct Tomcat port in opencms-importexport.xml. So if your Tomcat rums on port 8080, please make sure to set that port in opencms-importexport.xml.<br>
<br>
Best regards<br>
<br>
Kai<br>
<br>
<br>
<br>
Von: <a href="mailto:opencms-dev-bounces@opencms.org">opencms-dev-bounces@opencms.org</a> <<a href="mailto:opencms-dev-bounces@opencms.org">opencms-dev-bounces@opencms.org</a>> Im Auftrag von Gerd Schrick<br>
Gesendet: Dienstag, 15. Mai 2018 03:27<br>
An: The OpenCms mailing list <<a href="mailto:opencms-dev@opencms.org">opencms-dev@opencms.org</a>><br>
Betreff: Re: [opencms-dev] static export 404 on Template Resources<br>
<br>
<br>
<br>
Anyone out there to help with this?<br>
<br>
Am 6. Mai 2018 01:25:43 MESZ schrieb Gerd Schrick <<a href="mailto:mail@schrick-design.de">mail@schrick-design.de</a>>:<br>
<br>
Dear List,<br>
<br>
I'm on a fresh local install of 10.5.3 in Tomcat (8.5.11) including the example site (Apollo Demo).<br>
All configs/settings are unchanged.<br>
<br>
When I do a Static Export (Database Management -> Static export) there's no Error/Exception shown in the output but any resource below /sites shows ... 404 instead of ... o.k. and (as expected) none of them are exported.<br>
<br>
Excerpt from the output:<br>
::<br>
( 441 / 441 ) Exporting /system/workplace/commons/style/template.css ... o.k.<br>
... exporting Non-Template Resources is finished.<br>
Exporting Template Resources ...<br>
::<br>
( 6 / 563 ) Exporting /system/workplace/commons/style/diff.css ... o.k.<br>
( 7 / 563 ) Exporting /sites/default/tutorial/step-6-publish-your-changes/index.html ... 404
<br>
( 8 / 563 ) Exporting /sites/default/tutorial/step-6-publish-your-changes/ ... 404<br>
::<br>
<br>
It somehow makes sense to me as I get a 404 in the browser when I request the reported URLs<br>
example: /sites/default/tutorial/step-6-publish-your-changes/index.html<br>
404 when: <a href="http://mymachine:8080/sites/default/tutorial/step-6-publish-your-changes/index.html">
http://mymachine:8080/sites/default/tutorial/step-6-publish-your-changes/index.html</a><br>
404 when: <a href="http://mymachine:8080/opencms/sites/default/tutorial/step-6-publish-your-changes/index.html">
http://mymachine:8080/opencms/sites/default/tutorial/step-6-publish-your-changes/index.html</a><br>
correct when: <a href="http://mymachine:8080/opencms/tutorial/step-6-publish-your-changes/index.html">
http://mymachine:8080/opencms/tutorial/step-6-publish-your-changes/index.html</a><br>
<br>
in opencms_importexport.xml is<br>
<exporturl><a href="http://mymachine:8080$%7bCONTEXT_NAME%7d/handle404%3c/exporturl">http://mymachine:8080${CONTEXT_NAME}/handle404</exporturl</a>><br>
to omit "/handle404" (as suggested here: <a href="https://github.com/alkacon/opencms-core/issues/494)">
https://github.com/alkacon/opencms-core/issues/494)</a> did not change anything.<br>
<br>
I already found similar/same issues reported for older versions but all w/o a working solution.<br>
<br>
Thanks for your helpful hints!<br>
Gerd<br>
<br>
<br>
<br>
<br>
_______________________________________________ <br>
This mail is sent to you from the opencms-dev mailing list <br>
To change your list options, or to unsubscribe from the list, please visit <br>
<a href="http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev">http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev</a>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________ <br>
This mail is sent to you from the opencms-dev mailing list <br>
To change your list options, or to unsubscribe from the list, please visit <br>
<a href="http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev">http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev</a>
<br>
<br>
<br>
<br>
<br>
<br>
<o:p></o:p></p>
</div>


</blockquote></div></body></html>