[opencms-dev] Exporting Template Resources fails!

Ulrich Rueth lists at rueth.info
Sun Jan 16 22:26:46 CET 2005


Dear OpenCms experts,

please read on closely, as I really don't know how to continue, and there
are other people on this list who also got stuck at this point.

I get the following strange behaviour when trying to do a static export.
- OpenCms6 alpha 3.
- Tomcat running on localhost:8080.
- Apache Web Server on localhost (but I think it is not needed, I use Tomcat
in standalone mode).
- Target is to export to the Apache Web Server server root directory, say
(on Windows) "F:\Web", so I need to get rid of the "opencms/opencms" part of
the URL. Therefore I set the rfs-prefix to nothing. I correctly set
<exportpath>F:/Web/</exportpath>
- I have created a site under /sites/privat/, which I gave the exportname
/privat/ (to get rid of the "sites" string).

The export seems to work perfectly for non template resources, but fails in
all cases I have tried for the template resource.

Changing the vfs-prefix makes OpenCms unusable, so nothing to twist on this
parameter.

Please help me and others on this list, or tell us it's a bug, then we'll
stop trying.

CASE 1:
=======

Render settings in opencms-importexport.xml:

		<rendersettings>
			<rfs-prefix></rfs-prefix>
			<vfs-prefix>${CONTEXT_NAME}${SERVLET_NAME}</vfs-prefix>
			<userelativelinks>false</userelativelinks>
			<exporturl>http://localhost:8080${CONTEXT_NAME}/handle404</exporturl>
			<plainoptimization>true</plainoptimization>
			<testresource uri="/system/shared/page.dtd"/>
			<resourcestorender>
				<regex>/sites/.*</regex>
				<regex>/system/galleries/.*</regex>
				<regex>/system/modules/.*/resources/.*</regex>
			</resourcestorender>
		</rendersettings>

The resources under /system/galleries and /system/modules (Non-Template
Resources) are perfectly exported.
The resources under /sites/ (Template Resources) are _not_ exported, the log
sais for _each_ of those resources:

INFO [cexport.CmsStaticExportManager:1514] Request result for RFS file
/privat/foto/hochzeit/article_0004.html with url
(http://localhost:8080/opencms6/handle404/privat/foto/hochzeit/article_0004.
html) was STATUS=404

I really don't know what this "handle404" directory is good for, so I
changed the exporturl to http://localhost:8080${CONTEXT_NAME}/opencms,
expecting OpenCms to read the resource from the (correct) path, e.g.
http://localhost:8080/opencms6/opencms/sites/privat/foto/hochzeit/article_00
04.html

But unfortunately this leads to the following result.

CASE 2:
=======

Render settings:

		<rendersettings>
			<rfs-prefix></rfs-prefix>
			<vfs-prefix>${CONTEXT_NAME}${SERVLET_NAME}</vfs-prefix>
			<userelativelinks>false</userelativelinks>
			<exporturl>http://localhost:8080${CONTEXT_NAME}/opencms</exporturl>
			<plainoptimization>true</plainoptimization>
			<testresource uri="/system/shared/page.dtd"/>
			<resourcestorender>
				<regex>/sites/.*</regex>
				<regex>/system/galleries/.*</regex>
				<regex>/system/modules/.*/resources/.*</regex>
			</resourcestorender>
		</rendersettings>

The resources under /system/galleries and /system/modules (Non-Template
Resources) are perfectly exported.
The resources under /sites/ are not exported, the log sais for _each_ of
these resources:

WARN [.opencms.i18n.CmsLocaleManager: 407] Could not read locale property
for resource /sites/default/privat/foto/hochzeit/article_0003.html
org.opencms.file.CmsVfsResourceNotFoundException:
[org.opencms.db.mysql.CmsVfsDriver.readResource/3]
/sites/default/privat/foto/hochzeit/article_0003.html [Code 2 - Resource not
found!]
	at org.opencms.db.generic.CmsVfsDriver.readResource(CmsVfsDriver.java:1391)
	at org.opencms.db.CmsDriverManager.readResource(CmsDriverManager.java:5718)
	[SNIP]
16 Jan 2005 21:57:08,953  INFO [s.i18n.CmsDefaultLocaleHandler:  91] Could
not read encoding property for resource
/sites/default/privat/foto/hochzeit/article_0003.html
org.opencms.file.CmsVfsResourceNotFoundException:
[org.opencms.db.mysql.CmsVfsDriver.readResource/3]
/sites/default/privat/foto/hochzeit/article_0003.html [Code 2 - Resource not
found!]
	at org.opencms.db.generic.CmsVfsDriver.readResource(CmsVfsDriver.java:1391)
	at org.opencms.db.CmsDriverManager.readResource(CmsDriverManager.java:5718)
	[SNIP]
INFO [cexport.CmsStaticExportManager:1514] Request result for RFS file
/privat/foto/hochzeit/article_0003.html with url
(http://localhost:8080/opencms6/opencms/privat/foto/hochzeit/article_0003.ht
ml) was STATUS=404

Reason seems to be clear in this case, as the resources are located under
/sites/privat/ and _not_ /sites/default/privat/!

I have the impression it has something to do with the exportname and this
"handle404" directory.

Thanks for your kind help!

Regards
Ulrich




More information about the opencms-dev mailing list