Hi,

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>
not:
 <map:match pattern="/upload">
    <map:call function="upload"/>
   </map:match>

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>
not:
<map:flow language="javascript">
    <map:script src="upload.js" />
  </map:flow>

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);
        cocoon.sendPage("success.html");
      } catch (Exception) {
        cocoon.sendPage("failure.html");
      }
   }

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?

Thanks,

Richard Light

-- 
Richard Light
SGML/XML and Museum Information Consultancy
[EMAIL PROTECTED]


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

Reply via email to