Hi Jan, I expected something like that after Brad's last email (thx, Brad). No problem, I'll just check the request myself.
Thanks for your help Andreas > Von: Jan Haderka <[email protected]> > Antworten an: Magnolia User-List <[email protected]> > Datum: Wed, 30 Sep 2009 15:02:54 +0200 > An: Magnolia User-List <[email protected]> > Betreff: Re: [magnolia-user] Detecting preview mode in VirtualURIMapping > > > >> Hi Brad, >> >> thanks for your reply. >> >>> >>> Try: >>> >>> MgnlContext.getAggregationState().isPreviewMode(); >>> >> >> Hmm... this doesn't seem to work inside a VirtualURIMapping. It always >> returns true. >> >> This is with Magnolia 4.1. Is this maybe a bug, which got fixed in 4.1.1 >> (please?!)! Or is it just that the preview mode has not been detected yet >> before the VirtualURIMapping classes are executed? > > Not a bug. If you look in the code, the flag is set by the > InterceptFilter which is part of the cms subchain. However the > VirtualURIFilter is executed long time before that, so there is no way > for VirtualURIFilter to be aware of the mapping. Your only chance is to > read the request parameters directly and check for the flag there > yourself. > Sorry. > > Jan > >> >> Thanks >> Andreas >> >> >>> Von: Brad Kazazes <[email protected]> >>> Antworten an: Magnolia User-List <[email protected]> >>> Datum: Tue, 29 Sep 2009 20:11:04 +1000 >>> An: 'Magnolia User-List' <[email protected]> >>> Betreff: RE: [magnolia-user] Detecting preview mode in VirtualURIMapping >>> >>> >>> Hi Andreas, >>> >>> Try: >>> >>> MgnlContext.getAggregationState().isPreviewMode(); >>> >>> Cheers, >>> Brad >>> >>> -----Original Message----- >>> From: [email protected] >>> [mailto:[email protected]] On Behalf Of Andreas Weder >>> Sent: Tuesday, 29 September 2009 7:20 PM >>> To: Magnolia User-List >>> Subject: [magnolia-user] Detecting preview mode in VirtualURIMapping >>> >>> >>> Hi, fellow Magnolians, >>> >>> how do I properly detect preview mode in a VirtualURIMapping implementation? >>> >>> I've implemented my own VirtualURIMapping classs. I'd like to only enable >>> the mapping it defines, if I'm either on a public instance or in preview >>> mode in an author instance. I've tried using >>> MagnoliaTemplatingUtiltities.getInstance().isEditMode() or >>> CmsFunctions.isEditMode(), but both always return true on my author >>> instance. >>> >>> So how do I properly do that? >>> >>> Thanks for your help >>> Andreas >>> >>> >>> ---------------------------------------------------------------- >>> For list details see >>> http://www.magnolia-cms.com/home/community/mailing-lists.html >>> To unsubscribe, E-mail to: <[email protected]> >>> ---------------------------------------------------------------- >>> >>> >>> ---------------------------------------------------------------- >>> For list details see >>> http://www.magnolia-cms.com/home/community/mailing-lists.html >>> To unsubscribe, E-mail to: <[email protected]> >>> ---------------------------------------------------------------- >>> >> >> >> ---------------------------------------------------------------- >> For list details see >> http://www.magnolia-cms.com/home/community/mailing-lists.html >> To unsubscribe, E-mail to: <[email protected]> >> ---------------------------------------------------------------- > > > ---------------------------------------------------------------- > For list details see > http://www.magnolia-cms.com/home/community/mailing-lists.html > To unsubscribe, E-mail to: <[email protected]> > ---------------------------------------------------------------- > ---------------------------------------------------------------- For list details see http://www.magnolia-cms.com/home/community/mailing-lists.html To unsubscribe, E-mail to: <[email protected]> ----------------------------------------------------------------
