[opencms-dev] Include body content between sites

Joachim Zittmayr joachim at imap.cc
Thu Apr 13 20:35:12 CEST 2006


hi noel!
u could also do the following (imho a bit 'cleaner'):

            CmsRequestContext con = cms.getRequestContext();
            con.saveSiteRoot();
            con.setSiteRoot(somePath);
            rootNavEl =
            nav.getNavigationForResource(aResourceInSomePath);
            con.restoreSiteRoot();
good luck!
joachim

On Thu, 13 Apr 2006 00:51:58 -0500, "Noel Gelineau"
<ngelineau at greenridge.ca> said:
> I wonder if I could simulate what a sibling does within code.  In any
> case, the previous code worked great, thanks Thomas.
> 
> -----Original Message-----
> From: opencms-dev-bounces at opencms.org
> [mailto:opencms-dev-bounces at opencms.org] On Behalf Of François-Léonard
> Gilbert
> Sent: Wednesday, April 12, 2006 8:15 AM
> To: The OpenCms mailing list
> Subject: Re: [opencms-dev] Re: Include body content between sites
> 
> This looks quite complicated, and it introduces the possibility of a
> security breach...
> 
> I suggest making a sibling of test.html in "/sites/site2/".
> 
> 
> On 4/12/06, Thomas März <thomas.maerz at gmail.com> wrote:
> > I did not run the code, but it should work.
> >
> > | CmsJspActionElement cms = new CmsJspActionElement(pageContext, request, response);
> > | String siteRoot = cms.getRequestContext().getSiteRoot();
> > | cms.getRequestContext().setSiteRoot("");
> > | cms.include("/sites/site1/test.html, "body");
> > | cms.getRequestContext().setSiteRoot(siteRoot);
> >
> 
> _______________________________________________
> 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
> 
> 
> 
> -------------------------------------------------------------------------------------------------------------------
> This communication, including its attachments, if any, is intended solely
> for the recipient; it is confidential and may contain personal or private
> information, or proprietary and/or privileged material. As such, any
> unauthorized use, retention, copying, disclosure or other distribution of
> this communication, or the taking of any action in reliance on its
> contents
> is strictly prohibited. If you have received this communication in error,
> please notify us immediately and delete this communication (and any
> attachments.)
> 
> 
> _______________________________________________
> 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
-- 
  Joachim Zittmayr
  joachim at imap.cc

-- 
http://www.fastmail.fm - Access your email from home and the web




More information about the opencms-dev mailing list