[opencms-dev] Setting the correct site inside event listener

Marc Johnen opencms at johnen.biz
Mon Sep 7 13:40:28 CEST 2009


Hi Paul,

you can do something like
CmsObject co = cmsa.getCmsObject();
co.getRequestContext().setSiteRoot("/");

Regards
Marc


Paul-Inge Flakstad wrote:
> 
> Hi list
> 
> I need to set the site equal to a user's current site, inside an action
> listener. How can I do this?
> 
> Example:
> If a user triggers a specific event while on the site
> "/sites/my-arbitrary-site", I need to set the site to
> "/sites/my-arbitrary-site" inside the event listener code. The event
> listener processes files in the VFS, and if I do not set the correct site,
> the file paths produce "resource not found" messages.
> 
> Cheers,
> Paul
> 
> 
> _______________________________________________
> 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/mailman/listinfo/opencms-dev
> 

-- 
View this message in context: http://www.nabble.com/Setting-the-correct-site-inside-event-listener-tp25293322p25329155.html
Sent from the OpenCMS - Dev mailing list archive at Nabble.com.




More information about the opencms-dev mailing list