cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard Light <>
Subject Uploading files: further issues
Date Wed, 20 Sep 2006 17:13:08 GMT


I am making some progress with my attempts to use the
FileUploadsWithFlow code in the Wiki.  However, I'm now stuck.

Two little problems which I managed to fix are that:

1. the match pattern in the sitemap needs to be:

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

for it to match, and

2. "JavaScript" in the <map:flow> element is case-sensitive, i.e.

<map:flow language="JavaScript">
    <map:script src="upload.js" />
<map:flow language="javascript">
    <map:script src="upload.js" />

The second of these issues may be caused by my having a non-standard
setup, though I don't remember altering the <flow-interpreters> element
in cocoon.xconf.

The problem is in executing my little JavaScript program:

var role = 'org.apache.cocoon.components.upload.FileUploadManager';

   function upload() {
      var uploader = cocoon.getComponent(role);
      var part = cocoon.request.get("upload-file");
      try {
        uploader.upload (part);
      } catch (Exception) {

I get an internal server error: "getComponent is not a function".

If I comment out this line, I get an error message "sendPage is not a
function".  So the interpreter is happy with cocoon.request.get, but not
these two commands.  Any thoughts on what I need to set up or change to
get this to work?


Richard Light

Richard Light
SGML/XML and Museum Information Consultancy

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message