You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by "Gregor J. Rothfuss" <gr...@apache.org> on 2004/12/21 04:37:30 UTC

towards the usecase framework

i understand that http://wiki.apache.org/lenya/UsecaseFrameworkProposal 
is incomplete at this time. i think there is value in starting with the 
conversion of xsp/xslt to flow/jx nevertheless.

i tried out some ideas for the copy usecase (about as simple as they get 
when it comes to usecases) and came up with:

== flow ==

// Display a usecase screen
function showscreen() {
	var requestUri = cocoon.parameters["requestUri"];
	var documentid = cocoon.parameters["document-id"];
	var area = cocoon.parameters["area"];
	var action = cocoon.parameters["action"];

     cocoon.sendPage("internal/generate-view/copy", {
         requesturi : requestUri,
         documentid : documentid,
         area : area,
         action : action
     });
}

=== usecase.xmap ===

<map:match pattern="internal/generate-view/*">
   <map:generate src="fallback://lenya/content/info/{1}.xml"/>
   <map:transform type="jx"/>
   <map:call resource="style-cms-page"/>
</map:match>

<map:match pattern="copy" type="usecase">

  <map:match pattern="showscreen" type="step">
   <map:call function="showscreen">
   <map:parameter name="document-id" value="{page-envelope:document-id}"/>
   <map:parameter name="area" value="{page-envelope:area}"/>
   <map:parameter name="action" value="copyDocument"/>
  </map:call>
</map:match>


== copy.xml ==

<page:page xmlns:c="http://apache.org/cocoon/templates/jx/1.0"
            xmlns="http://www.w3.org/1999/xhtml"
            xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
            xmlns:page="http://apache.org/cocoon/lenya/cms-page/1.0"
         >
   <page:title><i18n:text>Copy Document</i18n:text></page:title>
     <page:body>
       <div class="lenya-box">
        <div class="lenya-box-title">
         <i18n:translate>
           <i18n:text key="copy-doc"/>
           <i18n:param><q>#{documentid}</q></i18n:param>			
         </i18n:translate>
       </div>
  ...

clearly, this has lots of potential for improvement. i want to work on 
this over the next two weeks. once we have the jx and flow in place, we 
can figure out what they have in common, and finish that wiki page, and 
then refactor the flow for usecases.

for reference, we have 70 XSP in lenya, and about 30 XSL that deal with 
usecases.

comments?

-- 
Gregor J. Rothfuss
COO, Wyona       Content Management Solutions    http://wyona.com
Apache Lenya                              http://lenya.apache.org
gregor.rothfuss@wyona.com                       gregor@apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail:              dev-unsubscribe@lenya.apache.org
For additional commands, e-mail:            dev-help@lenya.apache.org
Apache Lenya Project                          http://lenya.apache.org


Re: towards the usecase framework

Posted by Andreas Hartmann <an...@apache.org>.
Andreas Hartmann wrote:
> Gregor J. Rothfuss wrote:

[...]

>> did you remove the xsp from the admin area?
> 
> 
> Not yet, maybe there useful for debugging until the new implementation
> becomes more stable.

Now I removed the usecase XSPs from admin/users. If we need
to debug, we can look at the 1.2 branch.

I didn't yet try to get rid of the non-usecase XSPs (overview pages).

-- ANdreas


---------------------------------------------------------------------
To unsubscribe, e-mail:              dev-unsubscribe@lenya.apache.org
For additional commands, e-mail:            dev-help@lenya.apache.org
Apache Lenya Project                          http://lenya.apache.org


Re: towards the usecase framework

Posted by Andreas Hartmann <an...@apache.org>.
Andreas Hartmann wrote:
> Gregor J. Rothfuss wrote:
> 
>> Andreas Hartmann wrote:
>>
>>> I have ported some of the access control admin usecases to the
>>> flow-based usecase framework described in the Wiki. One flowscript is
>>> shared by all usecases which makes things quite easy to debug (the
>>> important stuff happens in Java). It is not yet stable, but if you're
>>> interested, I can check it in nevertheless.
>>
>>
>>
>> that would definitely be helpful.
> 
> 
> Done.

Some documentation:

http://wiki.apache.org/lenya/UsecaseFramework

(work in progress)

-- Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail:              dev-unsubscribe@lenya.apache.org
For additional commands, e-mail:            dev-help@lenya.apache.org
Apache Lenya Project                          http://lenya.apache.org


Re: towards the usecase framework

Posted by "Gregor J. Rothfuss" <gr...@apache.org>.
Jean Pierre LeJacq wrote:

>>>* No eclipse support for script flows and XSP; refactoring is tedious
>>>
>>>My opinion is, the more plain old java we could use the better.
>>>I guess its time to give java flow another try.
>>
>>I think it is not yet necessary, as Gregor pointed out. If we use
>>the usecase framework described in the Wiki, we have only a single
>>javascript file which is not that hard to maintain. And eventually
>>we can replace it with JavaFlow someday.
> 
> 
> Sounds perfect.

besides the missing eclipse support (a big deal in itself), there was a 
mail on cocoon-users yesterday that reported problems with rhino 
flowscript on weblogic. the proposed solution was to move to javaflow.

http://mail-archives.apache.org/eyebrowse/ReadMsg?listName=cocoon-users@xml.apache.org&msgNo=41372

-- 
Gregor J. Rothfuss
COO, Wyona       Content Management Solutions    http://wyona.com
Apache Lenya                              http://lenya.apache.org
gregor.rothfuss@wyona.com                       gregor@apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail:              dev-unsubscribe@lenya.apache.org
For additional commands, e-mail:            dev-help@lenya.apache.org
Apache Lenya Project                          http://lenya.apache.org


Re: towards the usecase framework

Posted by Jean Pierre LeJacq <jp...@quoininc.com>.
On Wed, 22 Dec 2004, Andreas Hartmann wrote:

> Rolf Kulemann wrote:
>
> > * No eclipse support for script flows and XSP; refactoring is tedious
> >
> > My opinion is, the more plain old java we could use the better.
> > I guess its time to give java flow another try.
>
> I think it is not yet necessary, as Gregor pointed out. If we use
> the usecase framework described in the Wiki, we have only a single
> javascript file which is not that hard to maintain. And eventually
> we can replace it with JavaFlow someday.

Sounds perfect.

-- 
JP



---------------------------------------------------------------------
To unsubscribe, e-mail:              dev-unsubscribe@lenya.apache.org
For additional commands, e-mail:            dev-help@lenya.apache.org
Apache Lenya Project                          http://lenya.apache.org


Re: towards the usecase framework

Posted by Andreas Hartmann <an...@apache.org>.
Rolf Kulemann wrote:
> On Wed, 2004-12-22 at 10:09, Andreas Hartmann wrote:

[...]

>>>http://archives.real-time.com/pipermail/cocoon-devel/2003-August/018166.html
>>>
>>>did you find a good solution for that?
>>
>>This won't be necessary with the usecase framework because the business
>>logic happens in Java. It will still be a problem for custom
>>flowscripts, I have no idea what to do about it.
> 
> 
> I caould not access the link above; can you give me a small summary
> please?

inputModuleGetAttribute() has been dropped, input modules have
to be instanciated using cocoon.getComponent().

[...]

> * Script flow in general opens the same problem as XSP: No compile time
> verification of broken/changed APIs. Well, XSP has this precompiler,
> which is a plus for XSP.
> 
> * All 3 approaches need discipline while developing in order not to mix
> (business) logic with flow mechanisms of pages. Thus, the flow layer
> should only handle page interaction, parameter passing and form 
> handling. The flow layer should be as thin as possible.

Exactly. That's why I focused on supporting various usecases with
a single flowscript. For typical usecases the integrator is not required
to write flowscripts.

> * No eclipse support for script flows and XSP; refactoring is tedious
> 
> My opinion is, the more plain old java we could use the better.
> I guess its time to give java flow another try.

I think it is not yet necessary, as Gregor pointed out. If we use
the usecase framework described in the Wiki, we have only a single
javascript file which is not that hard to maintain. And eventually
we can replace it with JavaFlow someday.

-- Andreas



---------------------------------------------------------------------
To unsubscribe, e-mail:              dev-unsubscribe@lenya.apache.org
For additional commands, e-mail:            dev-help@lenya.apache.org
Apache Lenya Project                          http://lenya.apache.org


Re: towards the usecase framework

Posted by Michael Wechner <mi...@wyona.com>.
Rolf Kulemann wrote:

> <>
> i am hesitant to open up too many construction sites at the same time..
> once our flow scripts settle down, it should be a piece of cake to port
> them to javaflow.
>
>
>My 2 cents re javascript flow, xsp and java flow:
>
>* Script flow in general opens the same problem as XSP: No compile time
>verification of broken/changed APIs. Well, XSP has this precompiler,
>which is a plus for XSP.
>
>* All 3 approaches need discipline while developing in order not to mix
>(business) logic with flow mechanisms of pages. Thus, the flow layer
>should only handle page interaction, parameter passing and form 
>handling. The flow layer should be as thin as possible.
>
>* No eclipse support for script flows and XSP; refactoring is tedious
>
>My opinion is, the more plain old java we could use the better.
>I guess its time to give java flow another try.
>  
>

agreed (whereas I do not mind about "eclipse")

Michi


-- 
Michael Wechner
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://www.wyona.com                      http://lenya.apache.org
michael.wechner@wyona.com                        michi@apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail:              dev-unsubscribe@lenya.apache.org
For additional commands, e-mail:            dev-help@lenya.apache.org
Apache Lenya Project                          http://lenya.apache.org


Re: towards the usecase framework

Posted by Rolf Kulemann <ro...@apache.org>.
On Wed, 2004-12-22 at 10:09, Andreas Hartmann wrote:
> Gregor J. Rothfuss wrote:
> > Andreas Hartmann wrote:
...
> Not yet, maybe there useful for debugging until the new implementation
> becomes more stable.
> 
> > i already ran into some problems, such as accessing input modules from 
> > flow (saw your post on the cocoon list too)
> > 
> > http://archives.real-time.com/pipermail/cocoon-devel/2003-August/018166.html
> > 
> > did you find a good solution for that?
> 
> This won't be necessary with the usecase framework because the business
> logic happens in Java. It will still be a problem for custom
> flowscripts, I have no idea what to do about it.

I caould not access the link above; can you give me a small summary
please?

> 
> >> BTW, at which stage is JavaFlow at the moment?

Last time I tried it, there were problems with continuation support and
accessing flow parameters passed from the sitemap. It was fixed in the
trunk. Dunno if it was merged into 2.1.6. 

> > 
> > 
> > i am hesitant to open up too many construction sites at the same time.. 
> > once our flow scripts settle down, it should be a piece of cake to port 
> > them to javaflow.

My 2 cents re javascript flow, xsp and java flow:

* Script flow in general opens the same problem as XSP: No compile time
verification of broken/changed APIs. Well, XSP has this precompiler,
which is a plus for XSP.

* All 3 approaches need discipline while developing in order not to mix
(business) logic with flow mechanisms of pages. Thus, the flow layer
should only handle page interaction, parameter passing and form 
handling. The flow layer should be as thin as possible.

* No eclipse support for script flows and XSP; refactoring is tedious

My opinion is, the more plain old java we could use the better.
I guess its time to give java flow another try.

-- 
Rolf Kulemann


---------------------------------------------------------------------
To unsubscribe, e-mail:              dev-unsubscribe@lenya.apache.org
For additional commands, e-mail:            dev-help@lenya.apache.org
Apache Lenya Project                          http://lenya.apache.org


Re: towards the usecase framework

Posted by Andreas Hartmann <an...@apache.org>.
Gregor J. Rothfuss wrote:
> Andreas Hartmann wrote:
> 
>> I have ported some of the access control admin usecases to the
>> flow-based usecase framework described in the Wiki. One flowscript is
>> shared by all usecases which makes things quite easy to debug (the
>> important stuff happens in Java). It is not yet stable, but if you're
>> interested, I can check it in nevertheless.
> 
> 
> that would definitely be helpful.

Done. ATM the usecases are referenced from admin.xmap, we have to
find a more general mechanism.

> did you remove the xsp from the admin area?

Not yet, maybe there useful for debugging until the new implementation
becomes more stable.

> i already ran into some problems, such as accessing input modules from 
> flow (saw your post on the cocoon list too)
> 
> http://archives.real-time.com/pipermail/cocoon-devel/2003-August/018166.html 
> 
> did you find a good solution for that?

This won't be necessary with the usecase framework because the business
logic happens in Java. It will still be a problem for custom
flowscripts, I have no idea what to do about it.

>> BTW, at which stage is JavaFlow at the moment?
> 
> 
> i am hesitant to open up too many construction sites at the same time.. 
> once our flow scripts settle down, it should be a piece of cake to port 
> them to javaflow.

Sounds very reasonable.

-- Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail:              dev-unsubscribe@lenya.apache.org
For additional commands, e-mail:            dev-help@lenya.apache.org
Apache Lenya Project                          http://lenya.apache.org


Re: towards the usecase framework

Posted by "Gregor J. Rothfuss" <gr...@apache.org>.
Andreas Hartmann wrote:

> I have ported some of the access control admin usecases to the
> flow-based usecase framework described in the Wiki. One flowscript is
> shared by all usecases which makes things quite easy to debug (the
> important stuff happens in Java). It is not yet stable, but if you're
> interested, I can check it in nevertheless.

that would definitely be helpful. did you remove the xsp from the admin 
area?

i already ran into some problems, such as accessing input modules from 
flow (saw your post on the cocoon list too)

http://archives.real-time.com/pipermail/cocoon-devel/2003-August/018166.html

did you find a good solution for that?

> BTW, at which stage is JavaFlow at the moment?

i am hesitant to open up too many construction sites at the same time.. 
once our flow scripts settle down, it should be a piece of cake to port 
them to javaflow.

-- 
Gregor J. Rothfuss
COO, Wyona       Content Management Solutions    http://wyona.com
Apache Lenya                              http://lenya.apache.org
gregor.rothfuss@wyona.com                       gregor@apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail:              dev-unsubscribe@lenya.apache.org
For additional commands, e-mail:            dev-help@lenya.apache.org
Apache Lenya Project                          http://lenya.apache.org


Re: towards the usecase framework

Posted by Andreas Hartmann <an...@apache.org>.
Gregor J. Rothfuss wrote:
> i understand that http://wiki.apache.org/lenya/UsecaseFrameworkProposal 
> is incomplete at this time. i think there is value in starting with the 
> conversion of xsp/xslt to flow/jx nevertheless.

+1

I have ported some of the access control admin usecases to the
flow-based usecase framework described in the Wiki. One flowscript is
shared by all usecases which makes things quite easy to debug (the
important stuff happens in Java). It is not yet stable, but if you're
interested, I can check it in nevertheless.

BTW, at which stage is JavaFlow at the moment?

Thanks a lot for your efforts!

-- Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail:              dev-unsubscribe@lenya.apache.org
For additional commands, e-mail:            dev-help@lenya.apache.org
Apache Lenya Project                          http://lenya.apache.org