https://projects.ecoinformatics.org/ecoinfo/https://projects.ecoinformatics.org/ecoinfo/ecoinfo/favicon.ico?14691340362001-07-19T09:50:25ZEcoinformatics RedmineMetacat - Bug #191: Override protocol handling for http URLshttps://projects.ecoinformatics.org/ecoinfo/issues/191?journal_id=6562001-07-19T09:50:25ZMatt Jonesjones@nceas.ucsb.edu
<ul></ul><p>There are concomitant changes in Morpho to produce these types of file uploads.<br />Morpho now uses the HTTPClient library for http communication, which<br />allows streaming data between client and server (Sun's http protocol<br />handler buffers all data before sending, which limits data transfer size<br />to memory available). No changes in metacat were needed to accomodate this<br />switch of protocol handlers on the client side; all changes were due to the<br />need for an alternative data encoding (other than URL encoding) that<br />efficiently supports binary files).</p>
<p>Modified Metacat to support large data file uploads. This is accomplished<br />by supporting a new content type for data sent to metacat:<br /> multipart/form-data<br />which allows multiple files to be sent in a standard MIME format. The<br />MetacatServlet.handleGetOrPost() method now checks the incoming content<br />type and sends multipart/form-data encoded submissions to<br />MetacatServlet.handleMultipartForm(), which in turn delegates to<br />MetacatServlet.handleUploadAction(). When a client wants to load a data<br />file to metacat, now morpho creates a "multipart/form-data" encoded stream that<br />contains an "action" parameter set to the value "upload", a "docid" <br />parameter set to the value of the accession number for the file, and<br />a "datafile" part that contains the actual file contents. Because of a<br />bug / shortcoming in the com.oreilly.servlet library that I am using to parse<br />this mime encoding, the "action" and "docid" paramters MUST come before<br />the "datafile" part or metacat won't find the paramters.</p>
<p>The provided docid is inserted into xml_documents (after checking that it<br />meets expectations [unique, rev 1, etc]). Then the data file<br />recieved from the "upload" action is stored on the filesystem<br />using the Accession number provided in the docid. See<br />DocumentImpl.registerDocument for details.</p>
<p>This functionality completely replaces the socket-based functionality found<br />in DataFileUploadInterface and DataFileServer. It would still be nice to<br />abstract away the file storage functions so that they can be either written<br />to the filesystem or other locations (like the db ina BLOB) when they are<br />recieved in this new encoding format.</p>
<p>The cos.jar file is now needed for parsing the new encoding.</p> Metacat - Bug #191: Override protocol handling for http URLshttps://projects.ecoinformatics.org/ecoinfo/issues/191?journal_id=6572001-07-19T10:03:40ZMatt Jonesjones@nceas.ucsb.edu
<ul></ul><p>And also...</p>
<p>Because "multipart/form-data" is the standard format produced by web browsers<br />when doing a "file upload", this change makes it so that we can use a standard<br />web client to upload data to Metacat. Pretty cool!</p> Metacat - Bug #191: Override protocol handling for http URLshttps://projects.ecoinformatics.org/ecoinfo/issues/191?journal_id=6582013-03-27T21:13:35ZRedmine Admin
<ul></ul><p>Original Bugzilla ID was 191</p>