You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Jean-Christophe Kermagoret <jc...@babelobjects.com> on 2004/04/01 10:10:59 UTC

Trying to solve a bug

Hi,
I'm trying to solve a bug but I need a little information.

Here is the bug I open it in bugzilla.

I need to use a upload form with the new cocoon portal. I use the 
portal-html-eventlink to transform the action attribute. The problem is 
enctype attribute is deleted by the portal-html-eventlink transformer.


I modified the tranformer to have the enctype attribute if present. I pass the continuation id in an hidden field, but when the pipeline is processed, the {request-param:continuation-id} is empty but I saw the uploaded file in the upload-directory.

If I don't use the transformer then I can set up a pipeline in the action attribute and I see the continuation-id

So,
I think there is a problem with the multipart request. The fact to put the enctype data is not enough. Why the portal doesn't see the request param ?

I tried to track the processing of the portal with Eclipse but I have non synchronized data between my souce and the classes that are generated so it's difficult to know what's happening.

Can anybody give me a little info to help me debugging this ?

-- 

Jean-Christophe Kermagoret
jck@BabelObjects.Com




Re: Trying to solve a bug

Posted by Jean-Christophe Kermagoret <jc...@babelobjects.com>.
You are completely right.
I have hope again... Thanks Carsten ;-)

I dive in this way.

I will tell you and complete the wiki.

Jean-Christophe

Carsten Ziegeler wrote:

> 
>
>  
>
>>-----Original Message-----
>>From: Jean-Christophe Kermagoret [mailto:jck@babelobjects.com] 
>>Sent: Thursday, April 01, 2004 10:56 AM
>>To: dev@cocoon.apache.org
>>Subject: Re: Trying to solve a bug
>>
>>I think the transfomer is OK.
>>
>>When I look in my html form, everything is ok :
>>-- Begin html form code --
>>
>><form method="POST" enctype="multipart/form-data" 
>>action="portal?cocoon-portal-action=3&cocoon-portal-event=76" 
>>xmlns:coplet="http://apache.org/cocoon/portal/coplet/1.0">
>><input name="woody_submit_id" type="hidden"><input 
>>value="1404764e523640355b684e00066541184b53794d" 
>>type="hidden" name="continuation-id"> <div 
>>xmlns:wi="http://apache.org/cocoon/woody/instance/1.0" 
>>class="tcContentBackground"> <table>
>>
>>-- End --
>>
>>It's when I press the submit button that I see the 
>>request-param:continuation-id is empty even if I'm sure the 
>>request has been parsed, because I saw the uploaded file in 
>>the upload-directory.
>>
>>But when I do {request-param:continuation-id} in my pipeline, 
>>there is nothing.
>>
>>Very strange
>>    
>>
>
>No :) If you look at the action tag of the form, there are two request
>parameters appened (cocoon-portal-action and cocoon-portal-event).
>As these two request parameters that are important for the portal
>to work correctly (or precisly to link this request to the upload
>coplet) are never received by Cocoon and therefore the portal
>never gets them, the processing doesn't work properly and
>you don't get the cont id.
>It would work if it would look like this:
><form method="POST" enctype="multipart/form-data"  action="portal">
><input name="cocoon-portal-action" type="hidden" value="3"/>
><input name="cocoon-portal-event" type="hidden" value="76"/> 
><input name="woody_submit_id" type="hidden">
><input value="1404764e523640355b684e00066541184b53794d" type="hidden"
>name="continuation-id">
>...
>
>Carsten
>
>  
>
>>Jean-Christophe Kermagoret wrote:
>>
>>    
>>
>>>Carsten,
>>>thanks for your answer
>>>
>>>I already use hidden field for continuation id.
>>>
>>>My action attribute doesn't contain anything important. Just submit 
>>>value for example according the 
>>>http://wiki.cocoondev.org/Wiki.jsp?page=WoodyCopletForPortalEngine
>>>
>>>So, I have no request param appended to the uri in my 
>>>      
>>>
>>action attribute.
>>    
>>
>>>However, I still can't see any request-param, hidden or not.
>>>
>>>Jean-Christophe
>>>
>>>Carsten Ziegeler wrote:
>>>
>>>      
>>>
>>>>Hi,
>>>>
>>>>now I think I remember that I had the same problem when I 
>>>>        
>>>>
>>wrote the 
>>    
>>
>>>>upload coplet sample that is in the basket sample in our CVS.
>>>>If you specify an enctype attribute, the request 
>>>>        
>>>>
>>parameters appended 
>>    
>>
>>>>to the uri in the form action attribute are either not 
>>>>        
>>>>
>>send to Cocoon 
>>    
>>
>>>>or are not received by Cocoon - I tested this with Tomcat 
>>>>        
>>>>
>>and Jetty. 
>>    
>>
>>>>So I guess this is by design.
>>>>Now, the portal rewrites all links in order to process 
>>>>        
>>>>
>>them correctly.
>>    
>>
>>>>When you use the portal-html-eventlink transformer, it rewrites a 
>>>>form action to something like "portal?cocoon-portal-action=24".
>>>>So, if then also an enctype attribute is set for the form, Cocoon 
>>>>never receives the request parameter.
>>>>Instead putting this into a hidden field works. So I think this is 
>>>>not a bug of the portal.
>>>>If you want to have a form with an enctype attribute you 
>>>>        
>>>>
>>have either 
>>    
>>
>>>>to expand the html-eventlink transformer so that it 
>>>>        
>>>>
>>creates in this 
>>    
>>
>>>>case a form element without request parameters in the action, but 
>>>>with some hidden input fields or you have to write your own 
>>>>transformer for this. You can use the BasketTransformer as 
>>>>        
>>>>
>>a starting 
>>    
>>
>>>>point.
>>>>
>>>>HTH
>>>>Carsten
>>>>
>>>> 
>>>>
>>>>        
>>>>
>>>>>-----Original Message-----
>>>>>From: Jean-Christophe Kermagoret 
>>>>>          
>>>>>
>>[mailto:jck@babelobjects.com] Sent: 
>>    
>>
>>>>>Thursday, April 01, 2004 10:11 AM
>>>>>To: dev@cocoon.apache.org
>>>>>Subject: Trying to solve a bug
>>>>>
>>>>>Hi,
>>>>>I'm trying to solve a bug but I need a little information.
>>>>>
>>>>>Here is the bug I open it in bugzilla.
>>>>>
>>>>>I need to use a upload form with the new cocoon portal. I use the 
>>>>>portal-html-eventlink to transform the action attribute. 
>>>>>          
>>>>>
>>The problem 
>>    
>>
>>>>>is enctype attribute is deleted by the portal-html-eventlink 
>>>>>transformer.
>>>>>
>>>>>
>>>>>I modified the tranformer to have the enctype attribute 
>>>>>          
>>>>>
>>if present. 
>>    
>>
>>>>>I pass the continuation id in an hidden field, but when 
>>>>>          
>>>>>
>>the pipeline 
>>    
>>
>>>>>is processed, the {request-param:continuation-id} is 
>>>>>          
>>>>>
>>empty but I saw 
>>    
>>
>>>>>the uploaded file in the upload-directory.
>>>>>
>>>>>If I don't use the transformer then I can set up a 
>>>>>          
>>>>>
>>pipeline in the 
>>    
>>
>>>>>action attribute and I see the continuation-id
>>>>>
>>>>>So,
>>>>>I think there is a problem with the multipart request. 
>>>>>          
>>>>>
>>The fact to 
>>    
>>
>>>>>put the enctype data is not enough. Why the portal 
>>>>>          
>>>>>
>>doesn't see the 
>>    
>>
>>>>>request param ?
>>>>>
>>>>>I tried to track the processing of the portal with Eclipse but I 
>>>>>have non synchronized data between my souce and the 
>>>>>          
>>>>>
>>classes that are 
>>    
>>
>>>>>generated so it's difficult to know what's happening.
>>>>>
>>>>>Can anybody give me a little info to help me debugging this ?
>>>>>
>>>>>--
>>>>>
>>>>>Jean-Christophe Kermagoret
>>>>>jck@BabelObjects.Com
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>  
>>>>>          
>>>>>
>>>>
>>>> 
>>>>
>>>>        
>>>>
>>>      
>>>
>>-- 
>>
>>Jean-Christophe Kermagoret
>>jck@BabelObjects.Com
>>
>>
>>
>>
>>    
>>
>
>
>  
>


-- 

Jean-Christophe Kermagoret
jck@BabelObjects.Com




RE: Trying to solve a bug

Posted by Carsten Ziegeler <cz...@s-und-n.de>.
Jean-Christophe Kermagoret wrote:
> 
> Hi,
> it seems you correct the bug.
> 
> I will verify deeper in the evening.
> 
Great!

> May you tell me what you did ?
> 
> I saw you modify HTMLEventLinkTransformer What else have you done ?
> 
Yes, I modified this transformer in the way you already did. This
transformer
generates sax events that are catched by the CopletTransformer. I changed
the CopletTransformer as well. Now, if the coplet transformer receives a
form element with an enctype attribute, it will create the form element
and add hidden input fields to the form for each request parameter the
action has.
For example: <form action="portal?hallo=you" enctype="something">
is transformed to
<form action="portal" enctype="something">
  <input type="hidden" name="hallo" value="you"/>

That's it.

> By the way, what tools are you using ?
Just eclipse.

> Have you got a hot code replace servlet container to test 
> what you develop ? 
Sometimes I use Tomcat 4.1.27/29 for this, but it seemed that the code
wasn't
always replaced although Tomcat did tell that it reloaded the classes etc.
So in the end you where never sure if the old or the new code was really
running which makes debugging a little bit painfull :)

> Is it ever possible with cocoon ?
Sure, it doesn't depend on Cocoon but rather on the container or the jdk.

>From my experiences, restarting the container (jetty in my case) is
not that slow but very reliable. You always know that your latest code
is running.

> 
> Thanks a lot for your help. I will close the bug tomorrow if 
> everything goes well.
> 
Great. Thanks

Carsten


Re: Trying to solve a bug

Posted by Jean-Christophe Kermagoret <jc...@babelobjects.com>.
Hi,
it seems you correct the bug.

I will verify deeper in the evening.

May you tell me what you did ?

I saw you modify HTMLEventLinkTransformer
What else have you done ?

By the way, what tools are you using ?
Have you got a hot code replace servlet container to test what you 
develop ? Is it ever possible with cocoon ?

Thanks a lot for your help. I will close the bug tomorrow if everything 
goes well.

Jean-Christophe

Carsten Ziegeler wrote:

>I will commit a fix (which hopefully works) in some minutes. Please test it,
>and then hopefully close the bug.
>
>Thanks
>Carsten 
>
>  
>
>>-----Original Message-----
>>From: Carsten Ziegeler [mailto:cziegeler@s-und-n.de] 
>>Sent: Thursday, April 01, 2004 11:10 AM
>>To: dev@cocoon.apache.org
>>Subject: RE: Trying to solve a bug
>>
>> 
>>
>>    
>>
>>>-----Original Message-----
>>>From: Jean-Christophe Kermagoret [mailto:jck@babelobjects.com]
>>>Sent: Thursday, April 01, 2004 10:56 AM
>>>To: dev@cocoon.apache.org
>>>Subject: Re: Trying to solve a bug
>>>
>>>I think the transfomer is OK.
>>>
>>>When I look in my html form, everything is ok :
>>>-- Begin html form code --
>>>
>>><form method="POST" enctype="multipart/form-data" 
>>>action="portal?cocoon-portal-action=3&cocoon-portal-event=76" 
>>>xmlns:coplet="http://apache.org/cocoon/portal/coplet/1.0">
>>><input name="woody_submit_id" type="hidden"><input 
>>>value="1404764e523640355b684e00066541184b53794d"
>>>type="hidden" name="continuation-id"> <div 
>>>xmlns:wi="http://apache.org/cocoon/woody/instance/1.0"
>>>class="tcContentBackground"> <table>
>>>
>>>-- End --
>>>
>>>It's when I press the submit button that I see the 
>>>request-param:continuation-id is empty even if I'm sure the request 
>>>has been parsed, because I saw the uploaded file in the 
>>>upload-directory.
>>>
>>>But when I do {request-param:continuation-id} in my 
>>>      
>>>
>>pipeline, there is 
>>    
>>
>>>nothing.
>>>
>>>Very strange
>>>      
>>>
>>No :) If you look at the action tag of the form, there are 
>>two request parameters appened (cocoon-portal-action and 
>>cocoon-portal-event).
>>As these two request parameters that are important for the 
>>portal to work correctly (or precisly to link this request to 
>>the upload
>>coplet) are never received by Cocoon and therefore the portal 
>>never gets them, the processing doesn't work properly and you 
>>don't get the cont id.
>>It would work if it would look like this:
>><form method="POST" enctype="multipart/form-data"  
>>action="portal"> <input name="cocoon-portal-action" 
>>type="hidden" value="3"/> <input name="cocoon-portal-event" 
>>type="hidden" value="76"/> <input name="woody_submit_id" 
>>type="hidden"> <input 
>>value="1404764e523640355b684e00066541184b53794d" type="hidden"
>>name="continuation-id">
>>...
>>
>>Carsten
>>
>>    
>>
>>>Jean-Christophe Kermagoret wrote:
>>>
>>>      
>>>
>>>>Carsten,
>>>>thanks for your answer
>>>>
>>>>I already use hidden field for continuation id.
>>>>
>>>>My action attribute doesn't contain anything important. 
>>>>        
>>>>
>>Just submit 
>>    
>>
>>>>value for example according the 
>>>>http://wiki.cocoondev.org/Wiki.jsp?page=WoodyCopletForPortalEngine
>>>>
>>>>So, I have no request param appended to the uri in my
>>>>        
>>>>
>>>action attribute.
>>>      
>>>
>>>>However, I still can't see any request-param, hidden or not.
>>>>
>>>>Jean-Christophe
>>>>
>>>>Carsten Ziegeler wrote:
>>>>
>>>>        
>>>>
>>>>>Hi,
>>>>>
>>>>>now I think I remember that I had the same problem when I
>>>>>          
>>>>>
>>>wrote the
>>>      
>>>
>>>>>upload coplet sample that is in the basket sample in our CVS.
>>>>>If you specify an enctype attribute, the request
>>>>>          
>>>>>
>>>parameters appended
>>>      
>>>
>>>>>to the uri in the form action attribute are either not
>>>>>          
>>>>>
>>>send to Cocoon
>>>      
>>>
>>>>>or are not received by Cocoon - I tested this with Tomcat
>>>>>          
>>>>>
>>>and Jetty. 
>>>      
>>>
>>>>>So I guess this is by design.
>>>>>Now, the portal rewrites all links in order to process
>>>>>          
>>>>>
>>>them correctly.
>>>      
>>>
>>>>>When you use the portal-html-eventlink transformer, it 
>>>>>          
>>>>>
>>rewrites a 
>>    
>>
>>>>>form action to something like "portal?cocoon-portal-action=24".
>>>>>So, if then also an enctype attribute is set for the 
>>>>>          
>>>>>
>>form, Cocoon 
>>    
>>
>>>>>never receives the request parameter.
>>>>>Instead putting this into a hidden field works. So I 
>>>>>          
>>>>>
>>think this is 
>>    
>>
>>>>>not a bug of the portal.
>>>>>If you want to have a form with an enctype attribute you
>>>>>          
>>>>>
>>>have either
>>>      
>>>
>>>>>to expand the html-eventlink transformer so that it
>>>>>          
>>>>>
>>>creates in this
>>>      
>>>
>>>>>case a form element without request parameters in the 
>>>>>          
>>>>>
>>action, but 
>>    
>>
>>>>>with some hidden input fields or you have to write your own 
>>>>>transformer for this. You can use the BasketTransformer as
>>>>>          
>>>>>
>>>a starting
>>>      
>>>
>>>>>point.
>>>>>
>>>>>HTH
>>>>>Carsten
>>>>>
>>>>> 
>>>>>
>>>>>          
>>>>>
>>>>>>-----Original Message-----
>>>>>>From: Jean-Christophe Kermagoret
>>>>>>            
>>>>>>
>>>[mailto:jck@babelobjects.com] Sent: 
>>>      
>>>
>>>>>>Thursday, April 01, 2004 10:11 AM
>>>>>>To: dev@cocoon.apache.org
>>>>>>Subject: Trying to solve a bug
>>>>>>
>>>>>>Hi,
>>>>>>I'm trying to solve a bug but I need a little information.
>>>>>>
>>>>>>Here is the bug I open it in bugzilla.
>>>>>>
>>>>>>I need to use a upload form with the new cocoon portal. 
>>>>>>            
>>>>>>
>>I use the 
>>    
>>
>>>>>>portal-html-eventlink to transform the action attribute.
>>>>>>            
>>>>>>
>>>The problem
>>>      
>>>
>>>>>>is enctype attribute is deleted by the portal-html-eventlink 
>>>>>>transformer.
>>>>>>
>>>>>>
>>>>>>I modified the tranformer to have the enctype attribute
>>>>>>            
>>>>>>
>>>if present. 
>>>      
>>>
>>>>>>I pass the continuation id in an hidden field, but when
>>>>>>            
>>>>>>
>>>the pipeline
>>>      
>>>
>>>>>>is processed, the {request-param:continuation-id} is
>>>>>>            
>>>>>>
>>>empty but I saw
>>>      
>>>
>>>>>>the uploaded file in the upload-directory.
>>>>>>
>>>>>>If I don't use the transformer then I can set up a
>>>>>>            
>>>>>>
>>>pipeline in the
>>>      
>>>
>>>>>>action attribute and I see the continuation-id
>>>>>>
>>>>>>So,
>>>>>>I think there is a problem with the multipart request. 
>>>>>>            
>>>>>>
>>>The fact to
>>>      
>>>
>>>>>>put the enctype data is not enough. Why the portal
>>>>>>            
>>>>>>
>>>doesn't see the
>>>      
>>>
>>>>>>request param ?
>>>>>>
>>>>>>I tried to track the processing of the portal with 
>>>>>>            
>>>>>>
>>Eclipse but I 
>>    
>>
>>>>>>have non synchronized data between my souce and the
>>>>>>            
>>>>>>
>>>classes that are
>>>      
>>>
>>>>>>generated so it's difficult to know what's happening.
>>>>>>
>>>>>>Can anybody give me a little info to help me debugging this ?
>>>>>>
>>>>>>--
>>>>>>
>>>>>>Jean-Christophe Kermagoret
>>>>>>jck@BabelObjects.Com
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>  
>>>>>>            
>>>>>>
>>>>>
>>>>> 
>>>>>
>>>>>          
>>>>>
>>>>        
>>>>
>>>--
>>>
>>>Jean-Christophe Kermagoret
>>>jck@BabelObjects.Com
>>>
>>>
>>>
>>>
>>>      
>>>
>>    
>>
>
>
>  
>


-- 

Jean-Christophe Kermagoret
jck@BabelObjects.Com




RE: Trying to solve a bug

Posted by Carsten Ziegeler <cz...@s-und-n.de>.
I will commit a fix (which hopefully works) in some minutes. Please test it,
and then hopefully close the bug.

Thanks
Carsten 

> -----Original Message-----
> From: Carsten Ziegeler [mailto:cziegeler@s-und-n.de] 
> Sent: Thursday, April 01, 2004 11:10 AM
> To: dev@cocoon.apache.org
> Subject: RE: Trying to solve a bug
> 
>  
> 
> > -----Original Message-----
> > From: Jean-Christophe Kermagoret [mailto:jck@babelobjects.com]
> > Sent: Thursday, April 01, 2004 10:56 AM
> > To: dev@cocoon.apache.org
> > Subject: Re: Trying to solve a bug
> > 
> > I think the transfomer is OK.
> > 
> > When I look in my html form, everything is ok :
> > -- Begin html form code --
> > 
> > <form method="POST" enctype="multipart/form-data" 
> > action="portal?cocoon-portal-action=3&cocoon-portal-event=76" 
> > xmlns:coplet="http://apache.org/cocoon/portal/coplet/1.0">
> > <input name="woody_submit_id" type="hidden"><input 
> > value="1404764e523640355b684e00066541184b53794d"
> > type="hidden" name="continuation-id"> <div 
> > xmlns:wi="http://apache.org/cocoon/woody/instance/1.0"
> > class="tcContentBackground"> <table>
> > 
> > -- End --
> > 
> > It's when I press the submit button that I see the 
> > request-param:continuation-id is empty even if I'm sure the request 
> > has been parsed, because I saw the uploaded file in the 
> > upload-directory.
> > 
> > But when I do {request-param:continuation-id} in my 
> pipeline, there is 
> > nothing.
> > 
> > Very strange
> 
> No :) If you look at the action tag of the form, there are 
> two request parameters appened (cocoon-portal-action and 
> cocoon-portal-event).
> As these two request parameters that are important for the 
> portal to work correctly (or precisly to link this request to 
> the upload
> coplet) are never received by Cocoon and therefore the portal 
> never gets them, the processing doesn't work properly and you 
> don't get the cont id.
> It would work if it would look like this:
> <form method="POST" enctype="multipart/form-data"  
> action="portal"> <input name="cocoon-portal-action" 
> type="hidden" value="3"/> <input name="cocoon-portal-event" 
> type="hidden" value="76"/> <input name="woody_submit_id" 
> type="hidden"> <input 
> value="1404764e523640355b684e00066541184b53794d" type="hidden"
> name="continuation-id">
> ...
> 
> Carsten
> 
> > 
> > Jean-Christophe Kermagoret wrote:
> > 
> > > Carsten,
> > > thanks for your answer
> > >
> > > I already use hidden field for continuation id.
> > >
> > > My action attribute doesn't contain anything important. 
> Just submit 
> > > value for example according the 
> > > http://wiki.cocoondev.org/Wiki.jsp?page=WoodyCopletForPortalEngine
> > >
> > > So, I have no request param appended to the uri in my
> > action attribute.
> > >
> > > However, I still can't see any request-param, hidden or not.
> > >
> > > Jean-Christophe
> > >
> > > Carsten Ziegeler wrote:
> > >
> > >> Hi,
> > >>
> > >> now I think I remember that I had the same problem when I
> > wrote the
> > >> upload coplet sample that is in the basket sample in our CVS.
> > >> If you specify an enctype attribute, the request
> > parameters appended
> > >> to the uri in the form action attribute are either not
> > send to Cocoon
> > >> or are not received by Cocoon - I tested this with Tomcat
> > and Jetty. 
> > >> So I guess this is by design.
> > >> Now, the portal rewrites all links in order to process
> > them correctly.
> > >> When you use the portal-html-eventlink transformer, it 
> rewrites a 
> > >> form action to something like "portal?cocoon-portal-action=24".
> > >> So, if then also an enctype attribute is set for the 
> form, Cocoon 
> > >> never receives the request parameter.
> > >> Instead putting this into a hidden field works. So I 
> think this is 
> > >> not a bug of the portal.
> > >> If you want to have a form with an enctype attribute you
> > have either
> > >> to expand the html-eventlink transformer so that it
> > creates in this
> > >> case a form element without request parameters in the 
> action, but 
> > >> with some hidden input fields or you have to write your own 
> > >> transformer for this. You can use the BasketTransformer as
> > a starting
> > >> point.
> > >>
> > >> HTH
> > >> Carsten
> > >>
> > >>  
> > >>
> > >>> -----Original Message-----
> > >>> From: Jean-Christophe Kermagoret
> > [mailto:jck@babelobjects.com] Sent: 
> > >>> Thursday, April 01, 2004 10:11 AM
> > >>> To: dev@cocoon.apache.org
> > >>> Subject: Trying to solve a bug
> > >>>
> > >>> Hi,
> > >>> I'm trying to solve a bug but I need a little information.
> > >>>
> > >>> Here is the bug I open it in bugzilla.
> > >>>
> > >>> I need to use a upload form with the new cocoon portal. 
> I use the 
> > >>> portal-html-eventlink to transform the action attribute.
> > The problem
> > >>> is enctype attribute is deleted by the portal-html-eventlink 
> > >>> transformer.
> > >>>
> > >>>
> > >>> I modified the tranformer to have the enctype attribute
> > if present. 
> > >>> I pass the continuation id in an hidden field, but when
> > the pipeline
> > >>> is processed, the {request-param:continuation-id} is
> > empty but I saw
> > >>> the uploaded file in the upload-directory.
> > >>>
> > >>> If I don't use the transformer then I can set up a
> > pipeline in the
> > >>> action attribute and I see the continuation-id
> > >>>
> > >>> So,
> > >>> I think there is a problem with the multipart request. 
> > The fact to
> > >>> put the enctype data is not enough. Why the portal
> > doesn't see the
> > >>> request param ?
> > >>>
> > >>> I tried to track the processing of the portal with 
> Eclipse but I 
> > >>> have non synchronized data between my souce and the
> > classes that are
> > >>> generated so it's difficult to know what's happening.
> > >>>
> > >>> Can anybody give me a little info to help me debugging this ?
> > >>>
> > >>> --
> > >>>
> > >>> Jean-Christophe Kermagoret
> > >>> jck@BabelObjects.Com
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>   
> > >>
> > >>
> > >>
> > >>  
> > >>
> > >
> > >
> > 
> > 
> > --
> > 
> > Jean-Christophe Kermagoret
> > jck@BabelObjects.Com
> > 
> > 
> > 
> > 
> 
> 


RE: Trying to solve a bug

Posted by Carsten Ziegeler <cz...@s-und-n.de>.
 

> -----Original Message-----
> From: Jean-Christophe Kermagoret [mailto:jck@babelobjects.com] 
> Sent: Thursday, April 01, 2004 10:56 AM
> To: dev@cocoon.apache.org
> Subject: Re: Trying to solve a bug
> 
> I think the transfomer is OK.
> 
> When I look in my html form, everything is ok :
> -- Begin html form code --
> 
> <form method="POST" enctype="multipart/form-data" 
> action="portal?cocoon-portal-action=3&cocoon-portal-event=76" 
> xmlns:coplet="http://apache.org/cocoon/portal/coplet/1.0">
> <input name="woody_submit_id" type="hidden"><input 
> value="1404764e523640355b684e00066541184b53794d" 
> type="hidden" name="continuation-id"> <div 
> xmlns:wi="http://apache.org/cocoon/woody/instance/1.0" 
> class="tcContentBackground"> <table>
> 
> -- End --
> 
> It's when I press the submit button that I see the 
> request-param:continuation-id is empty even if I'm sure the 
> request has been parsed, because I saw the uploaded file in 
> the upload-directory.
> 
> But when I do {request-param:continuation-id} in my pipeline, 
> there is nothing.
> 
> Very strange

No :) If you look at the action tag of the form, there are two request
parameters appened (cocoon-portal-action and cocoon-portal-event).
As these two request parameters that are important for the portal
to work correctly (or precisly to link this request to the upload
coplet) are never received by Cocoon and therefore the portal
never gets them, the processing doesn't work properly and
you don't get the cont id.
It would work if it would look like this:
<form method="POST" enctype="multipart/form-data"  action="portal">
<input name="cocoon-portal-action" type="hidden" value="3"/>
<input name="cocoon-portal-event" type="hidden" value="76"/> 
<input name="woody_submit_id" type="hidden">
<input value="1404764e523640355b684e00066541184b53794d" type="hidden"
name="continuation-id">
...

Carsten

> 
> Jean-Christophe Kermagoret wrote:
> 
> > Carsten,
> > thanks for your answer
> >
> > I already use hidden field for continuation id.
> >
> > My action attribute doesn't contain anything important. Just submit 
> > value for example according the 
> > http://wiki.cocoondev.org/Wiki.jsp?page=WoodyCopletForPortalEngine
> >
> > So, I have no request param appended to the uri in my 
> action attribute.
> >
> > However, I still can't see any request-param, hidden or not.
> >
> > Jean-Christophe
> >
> > Carsten Ziegeler wrote:
> >
> >> Hi,
> >>
> >> now I think I remember that I had the same problem when I 
> wrote the 
> >> upload coplet sample that is in the basket sample in our CVS.
> >> If you specify an enctype attribute, the request 
> parameters appended 
> >> to the uri in the form action attribute are either not 
> send to Cocoon 
> >> or are not received by Cocoon - I tested this with Tomcat 
> and Jetty. 
> >> So I guess this is by design.
> >> Now, the portal rewrites all links in order to process 
> them correctly.
> >> When you use the portal-html-eventlink transformer, it rewrites a 
> >> form action to something like "portal?cocoon-portal-action=24".
> >> So, if then also an enctype attribute is set for the form, Cocoon 
> >> never receives the request parameter.
> >> Instead putting this into a hidden field works. So I think this is 
> >> not a bug of the portal.
> >> If you want to have a form with an enctype attribute you 
> have either 
> >> to expand the html-eventlink transformer so that it 
> creates in this 
> >> case a form element without request parameters in the action, but 
> >> with some hidden input fields or you have to write your own 
> >> transformer for this. You can use the BasketTransformer as 
> a starting 
> >> point.
> >>
> >> HTH
> >> Carsten
> >>
> >>  
> >>
> >>> -----Original Message-----
> >>> From: Jean-Christophe Kermagoret 
> [mailto:jck@babelobjects.com] Sent: 
> >>> Thursday, April 01, 2004 10:11 AM
> >>> To: dev@cocoon.apache.org
> >>> Subject: Trying to solve a bug
> >>>
> >>> Hi,
> >>> I'm trying to solve a bug but I need a little information.
> >>>
> >>> Here is the bug I open it in bugzilla.
> >>>
> >>> I need to use a upload form with the new cocoon portal. I use the 
> >>> portal-html-eventlink to transform the action attribute. 
> The problem 
> >>> is enctype attribute is deleted by the portal-html-eventlink 
> >>> transformer.
> >>>
> >>>
> >>> I modified the tranformer to have the enctype attribute 
> if present. 
> >>> I pass the continuation id in an hidden field, but when 
> the pipeline 
> >>> is processed, the {request-param:continuation-id} is 
> empty but I saw 
> >>> the uploaded file in the upload-directory.
> >>>
> >>> If I don't use the transformer then I can set up a 
> pipeline in the 
> >>> action attribute and I see the continuation-id
> >>>
> >>> So,
> >>> I think there is a problem with the multipart request. 
> The fact to 
> >>> put the enctype data is not enough. Why the portal 
> doesn't see the 
> >>> request param ?
> >>>
> >>> I tried to track the processing of the portal with Eclipse but I 
> >>> have non synchronized data between my souce and the 
> classes that are 
> >>> generated so it's difficult to know what's happening.
> >>>
> >>> Can anybody give me a little info to help me debugging this ?
> >>>
> >>> --
> >>>
> >>> Jean-Christophe Kermagoret
> >>> jck@BabelObjects.Com
> >>>
> >>>
> >>>
> >>>
> >>>   
> >>
> >>
> >>
> >>  
> >>
> >
> >
> 
> 
> -- 
> 
> Jean-Christophe Kermagoret
> jck@BabelObjects.Com
> 
> 
> 
> 


Re: Trying to solve a bug

Posted by Jean-Christophe Kermagoret <jc...@babelobjects.com>.
I think the transfomer is OK.

When I look in my html form, everything is ok :
-- Begin html form code --

<form method="POST" enctype="multipart/form-data" action="portal?cocoon-portal-action=3&cocoon-portal-event=76" xmlns:coplet="http://apache.org/cocoon/portal/coplet/1.0">
<input name="woody_submit_id" type="hidden"><input value="1404764e523640355b684e00066541184b53794d" type="hidden" name="continuation-id">
<div xmlns:wi="http://apache.org/cocoon/woody/instance/1.0" class="tcContentBackground">
<table>

-- End --

It's when I press the submit button that I see the 
request-param:continuation-id is empty even if I'm sure the request has 
been parsed, because I saw the uploaded file in the upload-directory.

But when I do {request-param:continuation-id} in my pipeline, there is 
nothing.

Very strange


Jean-Christophe Kermagoret wrote:

> Carsten,
> thanks for your answer
>
> I already use hidden field for continuation id.
>
> My action attribute doesn't contain anything important. Just submit 
> value for example according the 
> http://wiki.cocoondev.org/Wiki.jsp?page=WoodyCopletForPortalEngine
>
> So, I have no request param appended to the uri in my action attribute.
>
> However, I still can't see any request-param, hidden or not.
>
> Jean-Christophe
>
> Carsten Ziegeler wrote:
>
>> Hi,
>>
>> now I think I remember that I had the same problem when I wrote the
>> upload coplet sample that is in the basket sample in our CVS.
>> If you specify an enctype attribute, the request parameters appended
>> to the uri in the form action attribute are either not send to
>> Cocoon or are not received by Cocoon - I tested this with Tomcat
>> and Jetty. So I guess this is by design.
>> Now, the portal rewrites all links in order to process them correctly.
>> When you use the portal-html-eventlink transformer, it rewrites
>> a form action to something like "portal?cocoon-portal-action=24".
>> So, if then also an enctype attribute is set for the form, Cocoon
>> never receives the request parameter.
>> Instead putting this into a hidden field works. So I think this
>> is not a bug of the portal.
>> If you want to have a form with an enctype attribute you have
>> either to expand the html-eventlink transformer so that it creates
>> in this case a form element without request parameters in the
>> action, but with some hidden input fields or you have to write
>> your own transformer for this. You can use the BasketTransformer
>> as a starting point.
>>
>> HTH
>> Carsten
>>
>>  
>>
>>> -----Original Message-----
>>> From: Jean-Christophe Kermagoret [mailto:jck@babelobjects.com] Sent: 
>>> Thursday, April 01, 2004 10:11 AM
>>> To: dev@cocoon.apache.org
>>> Subject: Trying to solve a bug
>>>
>>> Hi,
>>> I'm trying to solve a bug but I need a little information.
>>>
>>> Here is the bug I open it in bugzilla.
>>>
>>> I need to use a upload form with the new cocoon portal. I use the 
>>> portal-html-eventlink to transform the action attribute. The problem 
>>> is enctype attribute is deleted by the portal-html-eventlink 
>>> transformer.
>>>
>>>
>>> I modified the tranformer to have the enctype attribute if present. 
>>> I pass the continuation id in an hidden field, but when the pipeline 
>>> is processed, the {request-param:continuation-id} is empty but I saw 
>>> the uploaded file in the upload-directory.
>>>
>>> If I don't use the transformer then I can set up a pipeline in the 
>>> action attribute and I see the continuation-id
>>>
>>> So,
>>> I think there is a problem with the multipart request. The fact to 
>>> put the enctype data is not enough. Why the portal doesn't see the 
>>> request param ?
>>>
>>> I tried to track the processing of the portal with Eclipse but I 
>>> have non synchronized data between my souce and the classes that are 
>>> generated so it's difficult to know what's happening.
>>>
>>> Can anybody give me a little info to help me debugging this ?
>>>
>>> -- 
>>>
>>> Jean-Christophe Kermagoret
>>> jck@BabelObjects.Com
>>>
>>>
>>>
>>>
>>>   
>>
>>
>>
>>  
>>
>
>


-- 

Jean-Christophe Kermagoret
jck@BabelObjects.Com




Re: Trying to solve a bug

Posted by Jean-Christophe Kermagoret <jc...@babelobjects.com>.
Carsten,
thanks for your answer

I already use hidden field for continuation id.

My action attribute doesn't contain anything important. Just submit 
value for example according the 
http://wiki.cocoondev.org/Wiki.jsp?page=WoodyCopletForPortalEngine

So, I have no request param appended to the uri in my action attribute.

However, I still can't see any request-param, hidden or not.

Jean-Christophe

Carsten Ziegeler wrote:

>Hi,
>
>now I think I remember that I had the same problem when I wrote the
>upload coplet sample that is in the basket sample in our CVS.
>If you specify an enctype attribute, the request parameters appended
>to the uri in the form action attribute are either not send to
>Cocoon or are not received by Cocoon - I tested this with Tomcat
>and Jetty. So I guess this is by design.
>Now, the portal rewrites all links in order to process them correctly.
>When you use the portal-html-eventlink transformer, it rewrites
>a form action to something like "portal?cocoon-portal-action=24".
>So, if then also an enctype attribute is set for the form, Cocoon
>never receives the request parameter.
>Instead putting this into a hidden field works. So I think this
>is not a bug of the portal.
>If you want to have a form with an enctype attribute you have
>either to expand the html-eventlink transformer so that it creates
>in this case a form element without request parameters in the
>action, but with some hidden input fields or you have to write
>your own transformer for this. You can use the BasketTransformer
>as a starting point.
>
>HTH
>Carsten 
> 
>
>  
>
>>-----Original Message-----
>>From: Jean-Christophe Kermagoret [mailto:jck@babelobjects.com] 
>>Sent: Thursday, April 01, 2004 10:11 AM
>>To: dev@cocoon.apache.org
>>Subject: Trying to solve a bug
>>
>>Hi,
>>I'm trying to solve a bug but I need a little information.
>>
>>Here is the bug I open it in bugzilla.
>>
>>I need to use a upload form with the new cocoon portal. I use 
>>the portal-html-eventlink to transform the action attribute. 
>>The problem is enctype attribute is deleted by the 
>>portal-html-eventlink transformer.
>>
>>
>>I modified the tranformer to have the enctype attribute if 
>>present. I pass the continuation id in an hidden field, but 
>>when the pipeline is processed, the 
>>{request-param:continuation-id} is empty but I saw the 
>>uploaded file in the upload-directory.
>>
>>If I don't use the transformer then I can set up a pipeline 
>>in the action attribute and I see the continuation-id
>>
>>So,
>>I think there is a problem with the multipart request. The 
>>fact to put the enctype data is not enough. Why the portal 
>>doesn't see the request param ?
>>
>>I tried to track the processing of the portal with Eclipse 
>>but I have non synchronized data between my souce and the 
>>classes that are generated so it's difficult to know what's happening.
>>
>>Can anybody give me a little info to help me debugging this ?
>>
>>-- 
>>
>>Jean-Christophe Kermagoret
>>jck@BabelObjects.Com
>>
>>
>>
>>
>>    
>>
>
>
>  
>


-- 

Jean-Christophe Kermagoret
jck@BabelObjects.Com




RE: Trying to solve a bug

Posted by Carsten Ziegeler <cz...@s-und-n.de>.
Hi,

now I think I remember that I had the same problem when I wrote the
upload coplet sample that is in the basket sample in our CVS.
If you specify an enctype attribute, the request parameters appended
to the uri in the form action attribute are either not send to
Cocoon or are not received by Cocoon - I tested this with Tomcat
and Jetty. So I guess this is by design.
Now, the portal rewrites all links in order to process them correctly.
When you use the portal-html-eventlink transformer, it rewrites
a form action to something like "portal?cocoon-portal-action=24".
So, if then also an enctype attribute is set for the form, Cocoon
never receives the request parameter.
Instead putting this into a hidden field works. So I think this
is not a bug of the portal.
If you want to have a form with an enctype attribute you have
either to expand the html-eventlink transformer so that it creates
in this case a form element without request parameters in the
action, but with some hidden input fields or you have to write
your own transformer for this. You can use the BasketTransformer
as a starting point.

HTH
Carsten 
 

> -----Original Message-----
> From: Jean-Christophe Kermagoret [mailto:jck@babelobjects.com] 
> Sent: Thursday, April 01, 2004 10:11 AM
> To: dev@cocoon.apache.org
> Subject: Trying to solve a bug
> 
> Hi,
> I'm trying to solve a bug but I need a little information.
> 
> Here is the bug I open it in bugzilla.
> 
> I need to use a upload form with the new cocoon portal. I use 
> the portal-html-eventlink to transform the action attribute. 
> The problem is enctype attribute is deleted by the 
> portal-html-eventlink transformer.
> 
> 
> I modified the tranformer to have the enctype attribute if 
> present. I pass the continuation id in an hidden field, but 
> when the pipeline is processed, the 
> {request-param:continuation-id} is empty but I saw the 
> uploaded file in the upload-directory.
> 
> If I don't use the transformer then I can set up a pipeline 
> in the action attribute and I see the continuation-id
> 
> So,
> I think there is a problem with the multipart request. The 
> fact to put the enctype data is not enough. Why the portal 
> doesn't see the request param ?
> 
> I tried to track the processing of the portal with Eclipse 
> but I have non synchronized data between my souce and the 
> classes that are generated so it's difficult to know what's happening.
> 
> Can anybody give me a little info to help me debugging this ?
> 
> -- 
> 
> Jean-Christophe Kermagoret
> jck@BabelObjects.Com
> 
> 
> 
>