You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by Miklos Pocsaji <mi...@gmail.com> on 2005/04/25 10:05:16 UTC

Problem saving a document

Hi!

I'm pretty new to lenya, so my question might be a beginner one.
I created a new resource type called 'headlines', it does not matter
what it is used for. I wanted to modify the content of my documents of
this doctype by adding a menu item to lenya 'Edit' menu. I named the
usecase 'hledit'. I created the usecase-hledit.xmap which matches
fine. In the matching pipeline I modify the contents of the document
and want to save it back. I realized I have to check in/out, this is
ok.
I also realized I have to call the editDocument JavaScript function in
order to make my document saved, which seemed work EXPECT when I want
to save from the CURRENT pipeline. Everything I pass as parameter
'sourceUri' works but when I assign the value
'cocoon:/request2document' to it I get the error:
<map:call function> did not send a response, at
....../usecase-hledit.xmap:109:40
(This is the line where I call the editDocument)

My questions:
 - Exactly, what does the expression "cocoon:/request2document" mean?
Is it used for what I want to (access the XML data of the current
pipeline)
 - What does the error message mean?
 - How can I solve my problem?

Thank you in advance,
Miklos Pocsaji.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: Problem saving a document

Posted by so...@gmail.com.
On 4/25/05, Miklos Pocsaji <mi...@gmail.com> wrote:
> I'm pretty new to lenya, so my question might be a beginner one.
> I created a new resource type called 'headlines', it does not matter
> what it is used for. I wanted to modify the content of my documents of
> this doctype by adding a menu item to lenya 'Edit' menu. I named the
> usecase 'hledit'. I created the usecase-hledit.xmap which matches
> fine. In the matching pipeline I modify the contents of the document
> and want to save it back. I realized I have to check in/out, this is
> ok.
> I also realized I have to call the editDocument JavaScript function in
> order to make my document saved, which seemed work EXPECT when I want
> to save from the CURRENT pipeline. Everything I pass as parameter
> 'sourceUri' works but when I assign the value
> 'cocoon:/request2document' to it I get the error:
> <map:call function> did not send a response, at
> ....../usecase-hledit.xmap:109:40
> (This is the line where I call the editDocument)
> 
> My questions:
>  - Exactly, what does the expression "cocoon:/request2document" mean?

It means send control to the pipeline named "request2document" in the
same XMAP.  "cocoon:/" only looks in the current XMAP.  "cocoon://"
starts at the top with the global sitemap.xmap.


> Is it used for what I want to (access the XML data of the current
> pipeline)

If you want the XML of the "request2document" to be combined with the
current pipeline, use map:aggregate.  Each pipeline should have one
generator, zero or more transformers, and one serializer.

If you just want to reuse code without another generator, use a map:resource.


>  - What does the error message mean?

Your JavaScript function does not end with:
cocoon.sendPage("return-page");
"return-page" must be a pipeline in the same XMAP that sent the
request to the JavaScript function.  There are several methods for
sending data to the pipeline

>  - How can I solve my problem?

Fix the function called in the "request2document" pipeline to return a
new pipeline.

--
If you need more assistance, please post the relevant code from the
XMAP and the JS.

solprovider

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org