[opencms-dev] Direct edit and multi-site... is it possible?

Martin Höller martin.hoeller at xss.co.at
Thu Apr 6 11:31:20 CEST 2006


Hi Claus!

Claus Priisholm schrieb:
> I have following setup:
> 
> <sites>                                
>   <workplace-server>http://siteA</workplace-server>
>   <default-uri>/sites/default/</default-uri>
>   <site server="http://siteA" uri="/sites/default/" />
>   <site server="http://siteB" uri="/sites/siteb/" />
> </sites>

I'm working on a very similar setup here.

> The login code looks like this:
> 
> CmsJspLoginBean cms = new CmsJspLoginBean(pageContext, request, response);
> cms.login(username, password);
> CmsProject proj = cms.getCmsObject().readProject("Offline");
> cms.getRequestContext().setCurrentProject(proj);
> if(someCriteria) {
>   cms.getRequestContext().setSiteRoot("/sites/default/");
>   response.sendRedirect(cms.link("/index.html"));
> } else {
>   cms.getRequestContext().setSiteRoot("/sites/siteb/");
>   response.sendRedirect(cms.link("/index.html"));
> }

I'm quite new to OpenCms but the code I ended up with is similar to
yours. Unfortunately I didn't find much documentation about multi-sites
beside the included multi-site config howto.

> Now if a user (with permission to edit) access the login page via
> http://siteA and the someCriteria is true the result is as expected -
> the /sites/default/index.html is shown.
> 
> But if someCriteria is false the user should end up with the
> /sites/siteb/index.html. This does not happen (in my case the contents
> it shows the contents of /sites/default/index.html but it is using the
> template assigned to /sites/siteb/index.html).

I also ended up with a mix of /sites/default and /sites/siteb. I found
out, that the site-root changes somewhen (right after the use of a
<cms:editable/> tag) during template processing. Additional
setSiteRoot() calls in my template changed the result but still lead to
a broken page.

> It seems that parts of the stuff gets handled correct, while other parts
> seems to default to the default-site despite the setSiteRoot()...
> 
> This is 6.0.3 using the mod_jk rewrite setup.

I'm using 6.2beta here with apache 1.3.34 and mod_rewrite. No difference
though :-(

Did somebody ever manage to successfully set up a multi-site
configuration with direct editing of pages enabled?

tia for any hints,
- martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 256 bytes
Desc: OpenPGP digital signature
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20060406/7493803e/attachment.sig>


More information about the opencms-dev mailing list