You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Artur Bialecki <ar...@digitalfairway.com> on 2002/05/16 17:06:43 UTC
Action XSP
Actions are great, however it would be nice If
I could dynamically create them with XSP so in
my sitemap I have:
<map:action
name="my-action"
src="/actions/my-action.xsp"
logger="action.my-action"
/>
Where my-action.xsp gets trasfomed to java using
some action.xsl, builtin and custom logicsheets.
Cocoon already has everything I need other than the
action.xsl.
How would I go about adding this functionality?
Where do I start?
Thanks,
Artur...
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: Action XSP
Posted by Konstantin Piroumian <kp...@apache.org>.
From: "Sylvain Wallez" <sy...@anyware-tech.com>
> Konstantin Piroumian wrote:
> >From: "Artur Bialecki" <ar...@digitalfairway.com>
> >
...
> >
> >May I ask a question? Why do you need an XSP based action? IMHO, actions
> >should be pure Java classes that perform some programmatic logic and you
> >have Generators for XML generation, based on the result from actions.
> >
> >Are there any real use-cases?
> >
Thanks Arthur and Sylvain for excellent explanations!
I am thinking in a little Struts way where you can do anything using pure
Java, but I can agree that sometimes it can be useful to have XSP actions.
Further comments bellow:
>
> I think the need expressed by Arthur is the hot-recompilation nature of
> XSPs, which it really great at development time, along with the
> high-level constructs offered by taglibs.
>
> But there are cases where an XSP can be more than a generator : consider
> the ESQL logicsheet, which provides powerful tags for querying
> databases. But what if you would like to choose a particular page
> depending on the query results ? If the XSP is the pipeline generator,
> redirect (even internal) is not possible. If the XSP is an action,
> redirect is possible.
I've never used ESQL. We are using EJBs, so I get pure Java Beans and
Collections as a result of a business call, so having placed them in request
then using either XSP and/or CastorTransformer I get XML from them. And I
can for sure make a redirect depending on the result of EJB call.
>
> That's what the ServerPagesAction is for. It is to be used in
> conjonction with the action taglib (providing redirect and action result
> primitives) and the capture taglib (for capturing parts of the
> XSP-produced XML for later use).
Redirects from inside of an XSP reminds me of C1 times and that approach was
not recommended in C2. Am I wrong?
>
> In a sense, the XSP action belongs to the same domain than pipe-aware
> selectors that were discussed a while ago.
And were rejected because of some conceptual inconsistencies or something
like that, aren't they?
Konstantin
>
> Sylvain
>
> --
> Sylvain Wallez
> Anyware Technologies Apache Cocoon
> http://www.anyware-tech.com mailto:sylvain@apache.org
>
>
>
>
> ---------------------------------------------------------------------
> 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: Action XSP
Posted by Sylvain Wallez <sy...@anyware-tech.com>.
Konstantin Piroumian wrote:
>From: "Artur Bialecki" <ar...@digitalfairway.com>
>
>
>
>>Actions are great, however it would be nice If
>>I could dynamically create them with XSP so in
>>my sitemap I have:
>><map:action
>> name="my-action"
>> src="/actions/my-action.xsp"
>> logger="action.my-action"
>>/>
>>
>>Where my-action.xsp gets trasfomed to java using
>>some action.xsl, builtin and custom logicsheets.
>>
>>Cocoon already has everything I need other than the
>>action.xsl.
>>
>>
>
>Are you looking for this:
>xml-cocoon2\src\java\org\apache\cocoon\components\language\markup\xsp\java\a
>ction.xsl ?
>
>
And org.apache.cocoon.acting.ServerPagesAction (Vadim was faster ;)
>>How would I go about adding this functionality?
>>Where do I start?
>>
>>
>
>May I ask a question? Why do you need an XSP based action? IMHO, actions
>should be pure Java classes that perform some programmatic logic and you
>have Generators for XML generation, based on the result from actions.
>
>Are there any real use-cases?
>
I think the need expressed by Arthur is the hot-recompilation nature of
XSPs, which it really great at development time, along with the
high-level constructs offered by taglibs.
But there are cases where an XSP can be more than a generator : consider
the ESQL logicsheet, which provides powerful tags for querying
databases. But what if you would like to choose a particular page
depending on the query results ? If the XSP is the pipeline generator,
redirect (even internal) is not possible. If the XSP is an action,
redirect is possible.
That's what the ServerPagesAction is for. It is to be used in
conjonction with the action taglib (providing redirect and action result
primitives) and the capture taglib (for capturing parts of the
XSP-produced XML for later use).
In a sense, the XSP action belongs to the same domain than pipe-aware
selectors that were discussed a while ago.
Sylvain
--
Sylvain Wallez
Anyware Technologies Apache Cocoon
http://www.anyware-tech.com mailto:sylvain@apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
RE: Action XSP
Posted by Artur Bialecki <ar...@digitalfairway.com>.
> -----Original Message-----
> From: Konstantin Piroumian [mailto:kpiroumian@apache.org]
>
>
> From: "Artur Bialecki" <ar...@digitalfairway.com>
>
> >
> > Actions are great, however it would be nice If
> > I could dynamically create them with XSP so in
> > my sitemap I have:
> > <map:action
> > name="my-action"
> > src="/actions/my-action.xsp"
> > logger="action.my-action"
> > />
> >
> > Where my-action.xsp gets trasfomed to java using
> > some action.xsl, builtin and custom logicsheets.
> >
> > Cocoon already has everything I need other than the
> > action.xsl.
>
> Are you looking for this:
> xml-cocoon2\src\java\org\apache\cocoon\components\language\markup\xsp\java\a
> ction.xsl ?
>
Yes (I think so), thanks.
> >
> > How would I go about adding this functionality?
> > Where do I start?
>
> May I ask a question? Why do you need an XSP based action? IMHO, actions
> should be pure Java classes that perform some programmatic logic and you
> have Generators for XML generation, based on the result from actions.
>
> Are there any real use-cases?
>
I use cocoon to provide a GUI for large enterprise
application, so there are lots of forms, lots of logic,
lots of error checking which means lots of redirects.
When proting from C1 I found that I need lots of
custom actions. Also, our GUI masters who know XSL
very well (but no deep Java knowledge) found that
is easy to do logic they need using builtin and
custom taglibs I provided. This way they can control
the complex navigation themselves without wasting
time taking to me and waiting for me to write java
logic for them.
I also like the shorten development cycle since I
can quicky test my actions on a live system without
the recompile/redeploy/restart (iAS needs restarting)
cycle.
So I don't want generate XML in my actions. I want
to control flow based on business logic provided by
my ejbs. I'm also looking into writing custom
matches/selectors for this purpose.
One last reason is that we let our customers write
their own custom interfaces. It's a lot easier to
tell them: Copy and modify given action xsp, update
your site map and you're done.
Artur...
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
RE: Action XSP
Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Konstantin Piroumian [mailto:kpiroumian@apache.org]
>
> From: "Artur Bialecki" <ar...@digitalfairway.com>
>
> >
> > Actions are great, however it would be nice If
> > I could dynamically create them with XSP so in
> > my sitemap I have:
> > <map:action
> > name="my-action"
> > src="/actions/my-action.xsp"
> > logger="action.my-action"
> > />
See also
\src\java\org\apache\cocoon\acting\ServerPagesAction.java
Vadim
> >
> > Where my-action.xsp gets trasfomed to java using
> > some action.xsl, builtin and custom logicsheets.
> >
> > Cocoon already has everything I need other than the
> > action.xsl.
>
> Are you looking for this:
>
xml-cocoon2\src\java\org\apache\cocoon\components\language\markup\xsp\ja
va\a
> ction.xsl ?
>
> >
> > How would I go about adding this functionality?
> > Where do I start?
>
> May I ask a question? Why do you need an XSP based action? IMHO,
actions
> should be pure Java classes that perform some programmatic logic and
you
> have Generators for XML generation, based on the result from actions.
>
> Are there any real use-cases?
>
> Konstantin
>
> >
> > Thanks,
> >
> > Artur...
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: Action XSP
Posted by Konstantin Piroumian <kp...@apache.org>.
From: "Artur Bialecki" <ar...@digitalfairway.com>
>
> Actions are great, however it would be nice If
> I could dynamically create them with XSP so in
> my sitemap I have:
> <map:action
> name="my-action"
> src="/actions/my-action.xsp"
> logger="action.my-action"
> />
>
> Where my-action.xsp gets trasfomed to java using
> some action.xsl, builtin and custom logicsheets.
>
> Cocoon already has everything I need other than the
> action.xsl.
Are you looking for this:
xml-cocoon2\src\java\org\apache\cocoon\components\language\markup\xsp\java\a
ction.xsl ?
>
> How would I go about adding this functionality?
> Where do I start?
May I ask a question? Why do you need an XSP based action? IMHO, actions
should be pure Java classes that perform some programmatic logic and you
have Generators for XML generation, based on the result from actions.
Are there any real use-cases?
Konstantin
>
> Thanks,
>
> Artur...
>
>
>
>
> ---------------------------------------------------------------------
> 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