You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Joern Nettingsmeier <po...@uni-due.de> on 2006/09/07 17:38:44 UTC
usecase framework and continuations...
hi everyone!
can it be that the creation of a continuation is somehow linked to the
view jxtemplate? if that's true i'm going to collapse in tears.
i have tried for weeks to write a usecase that uses a sitemap-based view
(<view uri="cocoon://..."/>), and have never been able to obtain a
continuation id - ${cocoon.continuation.id} returned an empty string.
now that i've changed the view to be a jxtemplate (<view
template="..."/>), the continuation id is there.
can anyone confirm this or tell me what else might have gone wrong?
regards,
jörn
--
"I don't need backups. I need restore!" - Trad.
--
Jörn Nettingsmeier, EDV-Administrator
Institut für Politikwissenschaft
Universität Duisburg-Essen, Standort Duisburg
Mail: pol-admin@uni-due.de, Telefon: 0203/379-2736
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org
Re: [HEADSUP] enable continuations for usecase uri views.
Posted by Jörn Nettingsmeier <po...@uni-duisburg.de>.
Doug Chestnut wrote:
>
>
> Jörn Nettingsmeier wrote:
>> ok, i have finally assumed lazy consensus, and the patch is in:
>> http://svn.apache.org/viewvc?view=rev&revision=448941
>>
>> please be aware that uri views will now sendPageAndWait. that means you
>> should eventually "submit" your usecase, otherwise a stale, very lonely,
>> bored and sad continuation will remain on the server until the timeout
>> hath mercy upon it.
> Perhaps we need to give a reasonable exception to continuation creation
> (continuation="false")? I could see someone wanting to add
> functionality to a modules sitemap.xmap, and register that functionality
> as a usecase (but never "submit" to the usecase framework).
fine with me, as long as it's the same for both template and uri views.
usecases.js could use some cleaning up anyways. currently it has a
number of hacks that are cforms-specific, which is not nice, and they
are not yet applied to the uri view branch (so i'm not 100% true to my
own standards that template and uri should be functionally equivalent).
but i have postponed that, since the flowscript first needs to be split
up into functions to make it more readable and reduce code duplication -
the current code takes the "-script" part quite literally, as it's
basically one long list of statements. are there any traps with local
functions in a rhino flowscript?
as to the cforms hacks, is there a way of including other files in
server-side javascript? if yes, we might add a hook for usecase-specific
code that gets called before sendPageAndWait, to get rid of the cforms
stuff in the generic flow handler.
that would promote the usecase framework from an 85 to a 100% solution
(provided the user is prepared to write the missing 15% her/himself) :-D
wdyt?
--
"Open source takes the bullshit out of software."
- Charles Ferguson on TechnologyReview.com
--
Jörn Nettingsmeier, EDV-Administrator
Institut für Politikwissenschaft
Universität Duisburg-Essen, Standort Duisburg
Mail: pol-admin@uni-due.de, Telefon: 0203/379-2736
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org
Re: [HEADSUP] enable continuations for usecase uri views.
Posted by Doug Chestnut <dh...@virginia.edu>.
Jörn Nettingsmeier wrote:
> Joern Nettingsmeier wrote:
>
>> hi everyone!
>>
>>
>> does anyone else have an opinion about this issue? i'd appreciate some
>> more comments, just to make sure that i'm not overlooking any
>> side-effects, that's why i'm not that happy with "lazy consensus".
>>
>> if there are no objections to this patch, could anyone commit it (while
>> i wait for the apache bureaucracy to grind my access creds)?
>
>
> ok, i have finally assumed lazy consensus, and the patch is in:
> http://svn.apache.org/viewvc?view=rev&revision=448941
>
> please be aware that uri views will now sendPageAndWait. that means you
> should eventually "submit" your usecase, otherwise a stale, very lonely,
> bored and sad continuation will remain on the server until the timeout
> hath mercy upon it.
Perhaps we need to give a reasonable exception to continuation creation
(continuation="false")? I could see someone wanting to add
functionality to a modules sitemap.xmap, and register that functionality
as a usecase (but never "submit" to the usecase framework).
--Doug
>
> this may have broken the "export" usecase in the jcrsource module, but
> since i don't know what it's supposed to do, i can't test it.
>
>
> regards,
>
> jörn
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org
Re: [HEADSUP] enable continuations for usecase uri views.
Posted by Jörn Nettingsmeier <po...@uni-duisburg.de>.
Joern Nettingsmeier wrote:
> hi everyone!
>
>
> does anyone else have an opinion about this issue? i'd appreciate some
> more comments, just to make sure that i'm not overlooking any
> side-effects, that's why i'm not that happy with "lazy consensus".
>
> if there are no objections to this patch, could anyone commit it (while
> i wait for the apache bureaucracy to grind my access creds)?
ok, i have finally assumed lazy consensus, and the patch is in:
http://svn.apache.org/viewvc?view=rev&revision=448941
please be aware that uri views will now sendPageAndWait. that means you
should eventually "submit" your usecase, otherwise a stale, very lonely,
bored and sad continuation will remain on the server until the timeout
hath mercy upon it.
this may have broken the "export" usecase in the jcrsource module, but
since i don't know what it's supposed to do, i can't test it.
regards,
jörn
--
"Open source takes the bullshit out of software."
- Charles Ferguson on TechnologyReview.com
--
Jörn Nettingsmeier, EDV-Administrator
Institut für Politikwissenschaft
Universität Duisburg-Essen, Standort Duisburg
Mail: pol-admin@uni-due.de, Telefon: 0203/379-2736
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org
[HEADSUP] enable continuations for usecase uri views.
Posted by Joern Nettingsmeier <po...@uni-due.de>.
hi everyone!
does anyone else have an opinion about this issue? i'd appreciate some
more comments, just to make sure that i'm not overlooking any
side-effects, that's why i'm not that happy with "lazy consensus".
if there are no objections to this patch, could anyone commit it (while
i wait for the apache bureaucracy to grind my access creds)?
regards,
jörn
simon litwan wrote:
> On Fre, 2006-09-08 at 18:59 +0200, Jörn Nettingsmeier wrote:
>> hi everyone!
>>
>>
>> i would like to enable continuations for usecases that employ a uri
>> view, so that they behave just like usecases with jxtemplate views.
>>
>> please review the attached (trivial) patch and share your insights.
>>
>>
>> a quick grep through the lenya source shows that only 3 other usecases
>> use uri views:
>>
>> nettings@kleineronkel:/srv/lenya/src> grep -r "<view.*uri" *
>>
>> modules/bxe/config/cocoon-xconf/usecase-bxe.xconf:
>> <view uri="cocoon://modules/bxe/bxe.open" menu="false"/>
>> modules/bxe/config/cocoon-xconf/usecase-bxe-close.xconf:
>> <view uri="cocoon://modules/bxe/bxe.close" menu="false"/>
>> modules-optional/jcrsource/config/cocoon-xconf/usecase-export.xconf:
>> <view uri="cocoon://modules/jcrsource/lenya-repository-content.xml"
>> menu="false"/>
>>
>> i'm not sure what will happen to them. my guess is they should Just
>> Work, but i can't test it atm.
>>
> i tested it for the bxe uscases and it seems to have no impact.
> i couldn't test the jcrsource uscase though.
>
> i also would like the possibility to use uri instead of jxtemplate for
> views.
>
> simon
>
>> regards,
>>
>> jörn
>>
>>
>>
>> einfaches Textdokument attachment (usecase-uriview-enable_cont.diff)
>> Index: src/webapp/lenya/usecases/usecases.js
>> ===================================================================
>> --- src/webapp/lenya/usecases/usecases.js (revision 441201)
>> +++ src/webapp/lenya/usecases/usecases.js (working copy)
>> @@ -190,10 +190,14 @@
>> if (viewUri.startsWith("cocoon:/")) {
>> viewUri = viewUri.substring(new Packages.java.lang.String("cocoon:/").length());
>> }
>> - cocoon.sendPage(viewUri, {
>> + if (cocoon.log.isDebugEnabled())
>> + cocoon.log.debug("usecases.js::executeUsecase() in usecase " + usecaseName + ", creating view, calling Cocoon with viewUri = [" + viewUri + "]");
>> +
>> + cocoon.sendPageAndWait(viewUri, {
>> "usecase" : proxy
>> });
>> - return;
>> + //cocoon.sendpage(viewUri, { "usecase" : proxy });
>> + //return;
>> }
>> }
>> catch (exception) {
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
>> For additional commands, e-mail: dev-help@lenya.apache.org
--
"I don't need backups. I need restore!" - Trad.
--
Jörn Nettingsmeier, EDV-Administrator
Institut für Politikwissenschaft
Universität Duisburg-Essen, Standort Duisburg
Mail: pol-admin@uni-due.de, Telefon: 0203/379-2736
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org
Re: [RFC] enable continuations for usecase uri views.[was Re:
usecase framework and continuations...]
Posted by simon litwan <si...@wyona.com>.
On Fre, 2006-09-08 at 18:59 +0200, Jörn Nettingsmeier wrote:
> hi everyone!
>
>
> i would like to enable continuations for usecases that employ a uri
> view, so that they behave just like usecases with jxtemplate views.
>
> please review the attached (trivial) patch and share your insights.
>
>
> a quick grep through the lenya source shows that only 3 other usecases
> use uri views:
>
> nettings@kleineronkel:/srv/lenya/src> grep -r "<view.*uri" *
>
> modules/bxe/config/cocoon-xconf/usecase-bxe.xconf:
> <view uri="cocoon://modules/bxe/bxe.open" menu="false"/>
> modules/bxe/config/cocoon-xconf/usecase-bxe-close.xconf:
> <view uri="cocoon://modules/bxe/bxe.close" menu="false"/>
> modules-optional/jcrsource/config/cocoon-xconf/usecase-export.xconf:
> <view uri="cocoon://modules/jcrsource/lenya-repository-content.xml"
> menu="false"/>
>
> i'm not sure what will happen to them. my guess is they should Just
> Work, but i can't test it atm.
>
i tested it for the bxe uscases and it seems to have no impact.
i couldn't test the jcrsource uscase though.
i also would like the possibility to use uri instead of jxtemplate for
views.
simon
>
> regards,
>
> jörn
>
>
>
> einfaches Textdokument attachment (usecase-uriview-enable_cont.diff)
> Index: src/webapp/lenya/usecases/usecases.js
> ===================================================================
> --- src/webapp/lenya/usecases/usecases.js (revision 441201)
> +++ src/webapp/lenya/usecases/usecases.js (working copy)
> @@ -190,10 +190,14 @@
> if (viewUri.startsWith("cocoon:/")) {
> viewUri = viewUri.substring(new Packages.java.lang.String("cocoon:/").length());
> }
> - cocoon.sendPage(viewUri, {
> + if (cocoon.log.isDebugEnabled())
> + cocoon.log.debug("usecases.js::executeUsecase() in usecase " + usecaseName + ", creating view, calling Cocoon with viewUri = [" + viewUri + "]");
> +
> + cocoon.sendPageAndWait(viewUri, {
> "usecase" : proxy
> });
> - return;
> + //cocoon.sendpage(viewUri, { "usecase" : proxy });
> + //return;
> }
> }
> catch (exception) {
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
> For additional commands, e-mail: dev-help@lenya.apache.org
--
Simon Litwan simon.litwan@wyona.com
Wyona Inc. - Open Source Content Management - Apache Lenya
http://www.wyona.com http://lenya.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org
[RFC] enable continuations for usecase uri views.[was Re: usecase
framework and continuations...]
Posted by Jörn Nettingsmeier <po...@uni-duisburg.de>.
hi everyone!
i would like to enable continuations for usecases that employ a uri
view, so that they behave just like usecases with jxtemplate views.
please review the attached (trivial) patch and share your insights.
a quick grep through the lenya source shows that only 3 other usecases
use uri views:
nettings@kleineronkel:/srv/lenya/src> grep -r "<view.*uri" *
modules/bxe/config/cocoon-xconf/usecase-bxe.xconf:
<view uri="cocoon://modules/bxe/bxe.open" menu="false"/>
modules/bxe/config/cocoon-xconf/usecase-bxe-close.xconf:
<view uri="cocoon://modules/bxe/bxe.close" menu="false"/>
modules-optional/jcrsource/config/cocoon-xconf/usecase-export.xconf:
<view uri="cocoon://modules/jcrsource/lenya-repository-content.xml"
menu="false"/>
i'm not sure what will happen to them. my guess is they should Just
Work, but i can't test it atm.
regards,
jörn
--
"Open source takes the bullshit out of software."
- Charles Ferguson on TechnologyReview.com
--
Jörn Nettingsmeier, EDV-Administrator
Institut für Politikwissenschaft
Universität Duisburg-Essen, Standort Duisburg
Mail: pol-admin@uni-due.de, Telefon: 0203/379-2736
oooooh no! [was Re: usecase framework and continuations...]
Posted by Jörn Nettingsmeier <po...@uni-duisburg.de>.
Joern Nettingsmeier wrote:
> hi everyone!
>
>
> can it be that the creation of a continuation is somehow linked to the
> view jxtemplate? if that's true i'm going to collapse in tears.
aaaaaaaargh. i found it at long last. in usecases.js, we have
try {
var templateUri = view.getTemplateURI();
if (templateUri) {
cocoon.sendPageAndWait(viewUri, {
"usecase" : proxy
});
} else {
cocoon.sendPage(viewUri, {
"usecase" : proxy
});
}
according to the cocoon docs, sendPage will immediately continue in the
flowscript, hence no continuation.
shit. this one cost me 4 workdays :(
why does usecases.js assume that usecases with uri views don't want
continuations?
it's really irritating - no, it's downright nasty - when in a strict MVC
context the mechanism of the *view* has such fundamental implications
for the *controller*...
there's really no way i (or other users) could have anticipated this
behavious, especially since it is not mentioned in the docs at all.
probably the authors of usecases.js assumed that if people use a uri
view, they want a one-shot output page and won't bother to ever call the
continuation. this will of course produce a stale continuation that will
sit on the server until it times out. will this be a big problem?
if not, are there any objections to change the sendPage to sendPageAndWait?
whatever the rationale behind the current code is, a view that affects
the workings of the controller is a bug is a bug is a bug. if it can't
be fixed in a straightforward way, please add a <h1>Warning: this looks
like MVC, but it isn't!</h1> to the docs, with an explanation of how it
works.
regards,
jörn
--
"Open source takes the bullshit out of software."
- Charles Ferguson on TechnologyReview.com
--
Jörn Nettingsmeier, EDV-Administrator
Institut für Politikwissenschaft
Universität Duisburg-Essen, Standort Duisburg
Mail: pol-admin@uni-due.de, Telefon: 0203/379-2736
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org