You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Berin Loritsch <bl...@apache.org> on 2001/04/19 20:41:08 UTC

[C2: VOTE] Making "test" attributes expandable

I propose that we make the "test" attributes in selectors expandable.
The reason being is that there are cases where I need to make tests
on values returned from Actions.  This will make my life alot easier,
and possibly other people's as well.

I have a NavigationAction in my webapp that tests if a user is logged
in and whether they have the permissions to view the resource or not.
As a consequence, I need to either redirect the user, or I need to
make sure that they get the login page.

Since we took away the ability to redirect even from within an Action,
we need a nice clean way to test for our redirect values.

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


AW: [C2: VOTE] Making "test" attributes expandable

Posted by Carsten Ziegeler <cz...@sundn.de>.
> Donald Ball wrote:
> 
> On Thu, 19 Apr 2001, Berin Loritsch wrote:
> 
> > I propose that we make the "test" attributes in selectors expandable.
> > The reason being is that there are cases where I need to make tests
> > on values returned from Actions.  This will make my life alot easier,
> > and possibly other people's as well.
> >
> > I have a NavigationAction in my webapp that tests if a user is logged
> > in and whether they have the permissions to view the resource or not.
> > As a consequence, I need to either redirect the user, or I need to
> > make sure that they get the login page.
> >
> > Since we took away the ability to redirect even from within an Action,
> > we need a nice clean way to test for our redirect values.
> 
> i'm down with that. +1.
> 
> - donald
> 
+5 from me, too

Carsten


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: [C2: VOTE] Making "test" attributes expandable

Posted by giacomo <gi...@apache.org>.

On Thu, 19 Apr 2001, Donald Ball wrote:

> On Thu, 19 Apr 2001, Berin Loritsch wrote:
>
> > I propose that we make the "test" attributes in selectors expandable.
> > The reason being is that there are cases where I need to make tests
> > on values returned from Actions.  This will make my life alot easier,
> > and possibly other people's as well.

After a look in the sitemap.xsl I've seen that expanding the "test"
attribute is only possible for non CodeFactory Selectors/Matchers.
Berin, do you remember when you changed the way those classes are
treaded in the sitemap.xsl to produce a single method to a single
CodeFactory-Matcher? This change allowed a CodeFactory to specify how
the method signature should look like. This way CodeFactories will get
*all* "test" attribute at configuration time and they usually make some
code out of it to be able to integrate it into the generated sitemap
engine. And because the sitemap.xsl has no idea how the method signature
is it cannot substitute values.

For Selectors/Matcher not made to be CodeFactory substitution of the
"test" attribute passed as argument is possible (but I've seen that
there seems to be missing code in the sitemap.xsl which handle non
factories the right way).

Giacomo

> > I have a NavigationAction in my webapp that tests if a user is logged
> > in and whether they have the permissions to view the resource or not.
> > As a consequence, I need to either redirect the user, or I need to
> > make sure that they get the login page.
> >
> > Since we took away the ability to redirect even from within an Action,
> > we need a nice clean way to test for our redirect values.
>
> i'm down with that. +1.
>
> - donald
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
>
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: [C2: VOTE] Making "test" attributes expandable

Posted by Donald Ball <ba...@webslingerZ.com>.
On Thu, 19 Apr 2001, Berin Loritsch wrote:

> I propose that we make the "test" attributes in selectors expandable.
> The reason being is that there are cases where I need to make tests
> on values returned from Actions.  This will make my life alot easier,
> and possibly other people's as well.
>
> I have a NavigationAction in my webapp that tests if a user is logged
> in and whether they have the permissions to view the resource or not.
> As a consequence, I need to either redirect the user, or I need to
> make sure that they get the login page.
>
> Since we took away the ability to redirect even from within an Action,
> we need a nice clean way to test for our redirect values.

i'm down with that. +1.

- donald


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: [C2: VOTE] Making "test" attributes expandable

Posted by giacomo <gi...@apache.org>.

On Thu, 19 Apr 2001, Berin Loritsch wrote:

> I propose that we make the "test" attributes in selectors expandable.
> The reason being is that there are cases where I need to make tests
> on values returned from Actions.  This will make my life alot easier,
> and possibly other people's as well.
>
> I have a NavigationAction in my webapp that tests if a user is logged
> in and whether they have the permissions to view the resource or not.
> As a consequence, I need to either redirect the user, or I need to
> make sure that they get the login page.
>
> Since we took away the ability to redirect even from within an Action,
> we need a nice clean way to test for our redirect values.

No prob. If I don't get any -1 I'll change the sitemap.xsl for that.

Giacomo


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: [C2: VOTE] Making "test" attributes expandable

Posted by Berin Loritsch <bl...@apache.org>.
Davanum Srinivas wrote:
> 
> +1. But can you please post a sample?

This is adapted from a sub-sitemap mounted at "/advertisement" (real world
example):

   <map:match pattern="**.html">
     <map:act set="advertisement">
       <parameter name="dbpool" value="ad-approval"/>
       <map:select>
         <map:when test="&quot;index&quot;.equals({destination})">
           <map:redirect-to uri="/index.html"/>
         </map:when>
         <map:otherwise>
           <map:generate type="serverpages" src="docs/{destination}.xsp"/>
         </map:otherwise>
       </map:select>
       <map:transform src="stylesheets/{action}2form.xsl"/>
       <map:transform src="stylesheets/list2form.xsl"/>
       <map:transform src="stylesheets/form2document.xsl"/>
       <map:transform src="stylesheets/document2agg.xsl"/>
       <map:transform src="stylesheets/agg2html.xsl"/>
       <map:serialize/>
     </map:act>
   </map:match>

This also represents an attempt at content aggregation before Cocoon had it
implemented.

> --- Berin Loritsch <bl...@apache.org> wrote:
> > I propose that we make the "test" attributes in selectors expandable.
> > The reason being is that there are cases where I need to make tests
> > on values returned from Actions.  This will make my life alot easier,
> > and possibly other people's as well.
> >
> > I have a NavigationAction in my webapp that tests if a user is logged
> > in and whether they have the permissions to view the resource or not.
> > As a consequence, I need to either redirect the user, or I need to
> > make sure that they get the login page.
> >
> > Since we took away the ability to redirect even from within an Action,
> > we need a nice clean way to test for our redirect values.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> > For additional commands, email: cocoon-dev-help@xml.apache.org
> >
> 
> =====
> Davanum Srinivas, JNI-FAQ Manager
> http://www.jGuru.com/faq/JNI
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - buy the things you want at great prices
> http://auctions.yahoo.com/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: [C2: VOTE] Making "test" attributes expandable

Posted by Davanum Srinivas <di...@yahoo.com>.
+1. But can you please post a sample?

Thanks,
dims

--- Berin Loritsch <bl...@apache.org> wrote:
> I propose that we make the "test" attributes in selectors expandable.
> The reason being is that there are cases where I need to make tests
> on values returned from Actions.  This will make my life alot easier,
> and possibly other people's as well.
> 
> I have a NavigationAction in my webapp that tests if a user is logged
> in and whether they have the permissions to view the resource or not.
> As a consequence, I need to either redirect the user, or I need to
> make sure that they get the login page.
> 
> Since we took away the ability to redirect even from within an Action,
> we need a nice clean way to test for our redirect values.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
> 


=====
Davanum Srinivas, JNI-FAQ Manager
http://www.jGuru.com/faq/JNI

__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org