On 16.02.2008 06:32, nanomonk wrote:

I need to POST .xml file to server for further its processing...
so, I have a simple upload.html for test:

and I have pipeline with StreamGenerator:

all ok and in source of
"http://localhost:8888/setSettings?paramone=12345&paramtwo=blablabla"; I see
my .xml.
But.. I need to get from it some data and process it... I think to do that
in .xsp. I need to take params of request and according them to do some
actions... But I don't know how to get DOM Document from this recieved
.xml...

You have one problem with your approach: You can't have 2 generators. XSP is a generator and so is the StreamGenerator. The easiest way for you might be using flowscript [1] as somebody already mentioned, even if it is not the most straight-forward:

<map:match pattern="upload/setSettings">
  <map:call function="handleUploadSettings"/>
</map:match>

import Packages.org.apache.cocoon.components.flow.util.PipelineUtil;

function handleUploadSettings() {
  var util = cocoon.createObject(PipelineUtil);
  try {
    var dom = util.processToDom("upload/getStream");
    // call your own Java classes here
  } finally {
    cocoon.disposeObject(util);
  }

  // eventually display new page
  cocoon.sendPage("upload/showResult");
}

<map:match pattern="upload/getStream">
  <map:generate type="stream">
    <map:parameter name="form-name" value="uploadfile"/>
    <map:parameter name="defaultContentType" value="text/xml"/>
  </map:generate>
  <map:serialize type="xml" />
</map:match>

<map:match pattern="upload/showResult">
  <!-- do whatever you want -->
</map:match>

Flowscript gives you this controller kind of thing if you are familiar with MVC model. It only bloats the sitemap a bit ...

Joerg

[1] http://cocoon.apache.org/2.1/userdocs/flow/index.html

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to