package export feature
Metacat needs to be able to produce an exported version of a data package in the
same ZIP format that morpho creates data package exports. This involves getting
all of the metadata and data files associated with the package, arranging them
in the directory correctly, and producing an html summary. The code for this is
essentially complete in morpho and should usable in metacat almost directly.
Note that the morpho export dows some funny things, like puts all of the data
files inthe metadata directory. We need to fix this as well. I suggest an
export structure like this:
package.dir | |---- data | | | |------d1.1 | |------d2.1 | |---- metadata | | | |------m3.1 | |------m4.1 | |---- metadata.html
#1 Updated by Jing Tao almost 19 years ago
Export feature was implemented. When a request containing a docid and
action=export, this feature will export the whole dapackage to a zip output
stream. The structure is as same as describled above. In the zip output
stream, there is not only the requested version, but also the old versions
will be put too.
At first a method named handleExportAction was added in MetaCatServlet class.
In this method it will call a method named getZippedPackage form DBQuery.
in the getZipppedPackage, the requested docid will be checked first. If its
data type is not eml-dataset, the request will be rejected. If it is, the
whole docids for the package will be got. If the request docid is current
newest version. The docids will be get from xml_relation table. If it is old
version, a DocumentImpl object will be create base on this request docid. The
DocmentImpl object will be parsed and get a triple collection. Then we can get
the whole docids. The docids will be transfer to DocumentImpl objects and be
put into zip output stream. A summary html file will be created too.
There is still a permission issue need to figure out. And it depends on bug 436
#2 Updated by Jing Tao almost 19 years ago
The permission issue was figure out too. In AccessControlList class, user,
public and group will be put into a user package. The permission for each
element in this user package will be checked. Owner has all permission. The
other user will be look up into xml_access table.
In exported datapackage, the eml-access document wouldn't be include.