You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Peter Paulus <pa...@neroc.nl> on 2003/10/07 15:24:10 UTC

Can't get form POST working

Hello all,

We're using Cocoon 2.1 in combination with Slide. I can't get a POST from a
form to work.

We're trying to post a form that should alter one of the DAV: properties in
Slide.

I can see the request come in the core.log:

DEBUG   (2003-10-07) 13:12.38:681   [core]
(/cocoon/authoring/edit//20030906142751859.xml) Thread-5/Cocoon: DEBUGGING
INFORMATION:
REQUEST: /cocoon/authoring/edit//20030906142751859.xml

CONTEXT PATH: /cocoon
SERVLET PATH: /authoring/edit/20030906142751859.xml
PATH INFO: null

REMOTE HOST: paulus.xyz.nl
REMOTE ADDRESS: nn.nn.hh.hh
REMOTE USER: null
REQUEST SESSION ID: 18376CB9436F2485593F7BE52BF6C4C3
REQUEST PREFERRED LOCALE: nl
SERVER HOST: tarzan
SERVER PORT: 8081

METHOD: POST
CONTENT LENGTH: 181
PROTOCOL: HTTP/1.1
SCHEME: http
AUTH TYPE: null

CURRENT ACTIVE REQUESTS: 1
REQUEST PARAMETERS:

PARAM: 'cocoon-source-property-value' VALUES: '[ppk]'
PARAM: 'doAddProperty' VALUES: '[]'
PARAM: 'cocoon-source-uri' VALUES: '[slide://20030906142751859.xml]'
PARAM: 'cocoon-source-property-namespace' VALUES: '[DAV:]'
PARAM: 'cocoon-source-property-name' VALUES: '[displayname]'
HEADER PARAMETERS:

PARAM: 'accept' VALUES: '[image/gif, image/x-xbitmap, image/jpeg,
image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint,
application/msword, application/x-shockwave-flash, */*]'
PARAM: 'referer' VALUES:
'[http://tarzan:8081/cocoon/authoring/edit//20030906142751859.xml]'
PARAM: 'accept-language' VALUES: '[nl]'
PARAM: 'content-type' VALUES: '[application/x-www-form-urlencoded]'
PARAM: 'accept-encoding' VALUES: '[gzip, deflate]'
PARAM: 'user-agent' VALUES: '[Mozilla/4.0 (compatible; MSIE 6.0; Windows NT
5.0)]'
PARAM: 'host' VALUES: '[tarzan:8081]'
PARAM: 'content-length' VALUES: '[181]'
PARAM: 'connection' VALUES: '[Keep-Alive]'
PARAM: 'cache-control' VALUES: '[no-cache]'
PARAM: 'cookie' VALUES: '[JSESSIONID=18376CB9436F2485593F7BE52BF6C4C3]'

SESSION ATTRIBUTES:

PARAM: 
'org.apache.cocoon.webapps.authentication.components.DefaultAuthenticationMa
nager/UserStatus' VALUE:
'org.apache.cocoon.webapps.authentication.user.UserState@1557a77'


My guess is that Cocoon should somewere call Slide's SourceMultiAction, that
get's handed the request for further processing. The doAddProperty hints in
that direction.

But I cannot find, after looking at the source for 3 days now, where the
POST get's handled by Cocoon.

Can somebody help me with this?

With kind regards,
Peter Paulus 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


RE: Can't get form POST working

Posted by Peter Paulus <pa...@neroc.nl>.
Hello all,

I've got this working again. It was a sitemap problem.

The SourceMultiAction handles 'posts', provided you use the right
parameters.

Somehow, the following fragment disappeared somewhere along the line form
the sitemap.

<map:match pattern="someForm">
    <map:act type='source-actions'>
        <map:parameter name='cocoon-source-principal' value='{../ID}'/>
    </map:act>
    <map:read src='someForm.html'/>
</map:match>

Of course you need an action as follows:
<map:action name='source-actions' logger='sitemap.action.slide'
src='org.apache.cocoon.acting.SourceMultiAction'/>


The form sould look someting like this:
<form action="" method="post" enctype="multipart/form-data>
<input type='hidden' name='cocoon-source-uri' value='slide://'>
Filename: <input type='text' name='cocoon-source-name><br>
Local file: <input type='file' name='cocoon-upload-file'><br>
<input type='submit' name='doUploadSource' value='upload file'>
</form>

The SourceMultiAction supports other types of operation besides
uploadSource:
doCreateCollection,
doDeleteSource,
doAddProperty,
doDeleteProperty,
doAddPrincipalPermission
doRemovePrincipalPermission
doAddPrincipalGroupPermission
doRemovePrincipalGroupPermission

all requiring there own 'cocoon-*' parameters.

With kind regards,
Peter Paulus



----------
From: Peter Paulus <pa...@neroc.nl>
Date: Tue, 07 Oct 2003 15:24:10 +0200
To: <us...@cocoon.apache.org>
Subject: Can't get form POST working

Hello all,

We're using Cocoon 2.1 in combination with Slide. I can't get a POST from a
form to work.

We're trying to post a form that should alter one of the DAV: properties in
Slide.

I can see the request come in the core.log:

DEBUG   (2003-10-07) 13:12.38:681   [core]
(/cocoon/authoring/edit//20030906142751859.xml) Thread-5/Cocoon: DEBUGGING
INFORMATION:
REQUEST: /cocoon/authoring/edit//20030906142751859.xml

CONTEXT PATH: /cocoon
SERVLET PATH: /authoring/edit/20030906142751859.xml
PATH INFO: null

REMOTE HOST: paulus.xyz.nl
REMOTE ADDRESS: nn.nn.hh.hh
REMOTE USER: null
REQUEST SESSION ID: 18376CB9436F2485593F7BE52BF6C4C3
REQUEST PREFERRED LOCALE: nl
SERVER HOST: tarzan
SERVER PORT: 8081

METHOD: POST
CONTENT LENGTH: 181
PROTOCOL: HTTP/1.1
SCHEME: http
AUTH TYPE: null

CURRENT ACTIVE REQUESTS: 1
REQUEST PARAMETERS:

PARAM: 'cocoon-source-property-value' VALUES: '[ppk]'
PARAM: 'doAddProperty' VALUES: '[]'
PARAM: 'cocoon-source-uri' VALUES: '[slide://20030906142751859.xml]'
PARAM: 'cocoon-source-property-namespace' VALUES: '[DAV:]'
PARAM: 'cocoon-source-property-name' VALUES: '[displayname]'
HEADER PARAMETERS:

PARAM: 'accept' VALUES: '[image/gif, image/x-xbitmap, image/jpeg,
image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint,
application/msword, application/x-shockwave-flash, */*]'
PARAM: 'referer' VALUES:
'[http://tarzan:8081/cocoon/authoring/edit//20030906142751859.xml]'
PARAM: 'accept-language' VALUES: '[nl]'
PARAM: 'content-type' VALUES: '[application/x-www-form-urlencoded]'
PARAM: 'accept-encoding' VALUES: '[gzip, deflate]'
PARAM: 'user-agent' VALUES: '[Mozilla/4.0 (compatible; MSIE 6.0; Windows NT
5.0)]'
PARAM: 'host' VALUES: '[tarzan:8081]'
PARAM: 'content-length' VALUES: '[181]'
PARAM: 'connection' VALUES: '[Keep-Alive]'
PARAM: 'cache-control' VALUES: '[no-cache]'
PARAM: 'cookie' VALUES: '[JSESSIONID=18376CB9436F2485593F7BE52BF6C4C3]'

SESSION ATTRIBUTES:

PARAM: 
'org.apache.cocoon.webapps.authentication.components.DefaultAuthenticationMa
nager/UserStatus' VALUE:
'org.apache.cocoon.webapps.authentication.user.UserState@1557a77'


My guess is that Cocoon should somewere call Slide's SourceMultiAction, that
get's handed the request for further processing. The doAddProperty hints in
that direction.

But I cannot find, after looking at the source for 3 days now, where the
POST get's handled by Cocoon.

Can somebody help me with this?

With kind regards,
Peter Paulus 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org