[opencms-dev] CmsStaticExportManager / looking up VFS resource by rfsName ...

Ruben Malchow ruben at khm.de
Wed Nov 19 07:11:51 CET 2008




hi list,

we're having a bit of a problem with a multi-site setup and RFS 
rules. basically, what happens is this:

   /sites/a/index.html

and

   /sites/b/index.html

are being called. now, if both exportnames are set to / (because 
we don't them in any urls) and both files are exported, opencms
will mix up these resources. when doing the handle404, it will 
only see /index.html. and it will try to determine the 
corresponding vfs resource from this, ignoring host and port.

if there are any rfs rules in place, CmsStaticExportManager.getExportData()

(line 2196), will no longer know the difference between:

   http://localhost:8081/index.html

and
   
   http://localhost:8080/index.html

i found there might be an easy fix to this. replacing line 907:

        return getExportData(rfsName, null, cms);

with this:

    	String vfsName = null;
    	
    	CmsSite site = OpenCms.getSiteManager().matchRequest(request);

    	if(site!=null) {
        	vfsName = site.getSiteRoot()+rfsName;
    	}
        
        return getExportData(rfsName, vfsName, cms);

should do the trick. this will actually resolve the vfsName
in a place where the information about the host and port
are still available. 

what do you guys think? is that reasonable? doable?

ruben



More information about the opencms-dev mailing list