The feature of check permission before Metacat handle a "read" action. If user doesn't have permission, its request will be rejected.After creating a DocumentImpl object. A method named hasReadPermission in that class will be called to make sure the user has permission to read it.
A method named hasReadPermission was added. The method will check if a user has permission toread a xml document.
A new method named hasPermissionToExportPackage was added. So when MetaCat handle export action, it will check if user has permission to read the data package. If it has, MetaCat will export a zip output stream to it. Otherwise, MetaCat will be through a exception.
Code to handle "read" permission was changed in hasPermission method. The old code used old way to look up the public_access field in xml_documents table.
A new action named export was add to it. This action will export a zip output stream for a data package. In the zip output stream, meta data documents, data files and a html summary file are include. The stucture will looks like:package----/metadata/metadata docments...
Two metacat util methods were add. One is getDocIdFromString and the other is getVersionFromString. They output a docid and revision if a string like str1.str2.str3. were passed to them.
A method named transformXmlDocument were overload. It transform an XML document to StringWriter using the stylesheet reference from the db.
A public method named getZippedPackage() and other relative private methods were add to this class. The public method can give a zip output stream if a docid and other parameters were passed to it.
Some code format problem was fixed.
The bug was fixed.After a referral exception happend, we should set enviroment properties again before creating a contex. These environment properties include PROVIDER_URL, SECURITY_PRINCIPLE, SECURITY_CREDENTIALS, REFERRAL, and INITIAL_CONTEXT_FACOTRY. Otherwise, you couldn't get a naming exception.
View revisions
Also available in: Atom