cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steffen Stundzig <stef...@smb-tec.com>
Subject Re: [C2] Selectors and objectModel
Date Fri, 11 May 2001 07:26:46 GMT
Hi Marcus,

> Marcus Crafter <crafterm@fztig938.bank.dresdner.net> wrote:
> Hi Giacomo,
> 
> On Thu, 10 May 2001, giacomo wrote:
> 
> > On Thu, 10 May 2001, Marcus Crafter wrote:
> > 
> > >    <map:match pattern="login.xml">
> > >        <map:select type="login">
> > >            <map:when test="permitted">
> > >                <map:generate src="{frontend}/index.xml"/>
> > >            </map:when>
> > >            <map:when test="denied">
> > >                 <map:generate src="common/{error}.xml"/>
> > >            </map:when>
> > >        </map:select>
> > >        <map:serialize/>
> > >    </map:match>
> > >
> > > 	Problem is, modifying the objectModel in the selector code doesn't
> > > 	seem to let me do what I want.
> > >
> > > 	ie:
> > > 		objectModel.put("frontend", frontend);
> > >

I'm also new to C2. I would try the following approach:
<map:act type="login">
 <map:select type="coded">
  <map:when test="{loginactionreturnvalue} == \"permitted\">
   <map:generate src="{frontent}/index.xml"/>
  </map:when>
  <map:when test="{loginactionreturnvalue} == \"denied\">
   <map:generate src="common/{error}.xml"/>
  </map:when>
 </map:select>
</map:act>

Not tested, it's only a feeling. :-)=)

So the action for login returns a map with the key 'loginactionreturnvalue'
and the keys 'frontent' or 'error'.
The selector matches the strings and generate the specific src.

Regards
	Steffen...




-- 
______________________________________________________________________
Steffen Stundzig                            mailto:steffen@smb-tec.com
SMB GmbH                                        http://www.smb-tec.com




---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>


Mime
View raw message