cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carsten Ziegeler" <cziege...@s-und-n.de>
Subject RE: [portal] Implementing Login coplet with CForms
Date Tue, 25 May 2004 06:25:14 GMT
 
Alex Romayev wrote:
> 

> Sorry, I don't know why it was giving me null, I tried it 
> again, and it's not.  I did some more testing and this is 
> what I found:
> 
> String sourceUri = uri;
> 
> 1. The uri here never has any request parameters, i.e.
> it's always
> "cocoon:raw:/coplets/registration/login-cforms"
> 
> if ( handlePars != null && handlePars.booleanValue() ) {
> 
> 
>     List list = (List)
> portalService.getTemporaryAttribute(URICopletAdapter.class.getName());
> 
> 2. The list here is always null, which gets us into the else clause
> 
>     if ( list != null && list.contains( coplet )) {
> 	// add parameters
> 	if ( uri.startsWith("cocoon:raw:") ) {
> 	    sourceUri = "cocoon:" + uri.substring(11);
> 	}
>     } else {
> 
> 	// remove parameters
> 	if (!uri.startsWith("cocoon:raw:") ) {
> 	    sourceUri = "cocoon:raw:" + uri.substring(7);
> 	}
>     }
> }
> 
Ok, if the list is null or empty, this means there wasn't any event
for the coplet. If you use forms/links in your coplet they have
to be rewritten to events that have the coplet instance data
as the target. If you e.g. look at the apps demo (the flow coplet),
the html eventlink transformer rewrites all links and creates
events for each link.
Now if the user clicks a link/submits a form, the event is triggered
on the server, the portal notices that this coplet changed and
adds it to the list. When the coplet is then invoked it gets
the parameters.
All other coplets that were not triggered in this req/response
cycle don't get the parameters.

HTH
Carsten


Mime
View raw message