New
authorMike Taylor <mike@indexdata.com>
Thu, 28 Jun 2007 13:37:11 +0000 (13:37 +0000)
committerMike Taylor <mike@indexdata.com>
Thu, 28 Jun 2007 13:37:11 +0000 (13:37 +0000)
web/htdocs/admin/upload.html [new file with mode: 0644]
web/htdocs/details/upload.mc [new file with mode: 0644]

diff --git a/web/htdocs/admin/upload.html b/web/htdocs/admin/upload.html
new file mode 100644 (file)
index 0000000..52649fa
--- /dev/null
@@ -0,0 +1,4 @@
+%# $Id: upload.html,v 1.1 2007-06-28 13:37:11 mike Exp $
+<& /chrome/layout.mc, %ARGS,
+    title => "Upload target record",
+    component => "/details/upload.mc" &>
diff --git a/web/htdocs/details/upload.mc b/web/htdocs/details/upload.mc
new file mode 100644 (file)
index 0000000..78b7850
--- /dev/null
@@ -0,0 +1,39 @@
+%# $Id: upload.mc,v 1.1 2007-06-28 13:37:11 mike Exp $
+<%args>
+$filename => undef
+</%args>
+% if (!defined $filename) {
+   <form method="post" action=""
+           enctype="multipart/form-data">
+    <p>
+     ZeeRex file to upload:
+     <input type="file" name="filename" size="50"/>
+     <br/>
+     <input type="submit" name="_submit" value="Submit"/>
+    </p>
+   </form>
+% return;
+% }
+<%perl>
+my $fin = $r->upload()->fh();
+if (!defined $fin) {
+    $m->comp("/details/error.mc", msg => "Upload cancelled");
+    return;
+}
+
+my $xml = join("", <$fin>);
+my $xc = irspy_xpath_context($xml);
+my $id = irspy_record2identifier($xc);
+my $conn = new ZOOM::Connection("localhost:8018/IR-Explain---1", 0,
+                               user => "admin", password => "fruitbat",
+                               elementSetName => "zeerex");
+ZOOM::IRSpy::_really_rewrite_record($conn, $xc->getContextNode());
+</%perl>
+     <p>
+      Upload OK.
+     </p>
+     <p>
+      Proceed to
+      <a href="<% xml_encode("/full.html?id=" . uri_escape($id))
+       %>">the new record</a>.
+     </p>