Metacat High Level API

Back | Home | Next

Multiple client interface
Since Metacat Servlet is a subclass of HttpServlet, this allows any client to communicate with Metacat by essentially passing a URL with embedded servlet parameters. Metacat Servlet provides an HTTP Interface and can handle GET and POST requests. HTTP requests are sent from the the Client application and contain a number of parameters. These parameters, in form of name/value pairs, provide input data for the Servlet and also provide the Servlet any extra information it needs to handle the request.

Extensions of HttpServlet
Metacat Server adds the functionality for writing, quering, and reading of XML stored in the Metacat Database as well functions for validating and transforming XML documents.

MetacatServlet Parameters
Action Supplemental Parameters Description
login
  • username - the user's login name
  • password - the user's password
Log the user in.
logout none Log the current user out and destroy the associated session.
query
  • returndoctype - the doctype that you wish to use for your Package View
  • qformat - the format that you wish to return the resultset in. Possible values are 'html' or 'xml'.
  • querytitle - OPTIONAL - the title of the query
  • doctype - OPTIONAL - if doctype is specified, the search is limited only to the doctype(s) specified.
  • returnfield - a custom field to be returned by any hit document. This is explained in more detail in Queries and Results.
  • operator - the boolean operator to apply to the query - Possible values are: UNION or INTERSECT
  • searchmode - the type of search to be performed. Possible values are: contains, starts-with, ends-with, equals, isnot-equal, greater-than, less-than, greater-than-equals, less-than-equals.
  • anyfield - a freetext search variable. A value placed in this parameter will be searched for in any document in any node.
Perform a free text query.
squery
  • query - the text of the pathquery document that is being sent to the server
Perform a structured query.
read
  • docid - the docid of the document to read
  • qformat - the format to return the document in. Possible values are: html, xml
Get docid from the database and return it in qformat form.
insert
  • docid - the user defined docid to assign to the new XML document.
  • doctext - the text of the XML document to insert
Insert an XML document into the database.
update
  • docid - the docid of the document to update
  • doctext - the text with which to update the XML document
Overwrite an XML document with a new one and give the new one the same docid but with next revision number.
upload
  • docid - the docid of the data document to upload
  • datafile - the data document to upload
Upload (insert or update) a data document into metacat. Data files are stored on metacat and may be in any format (binary or text), but they are all treated as if they were binary.
delete
  • docid - the docid of the document to delete
Delete the specified docid from the database.
validate
  • docid - the docid of the document to validate
  • valtext - the DTD by which to validate this document
Validate docid against its DTD.
getaccesscontrol
  • docid - the docid of the document to get the ACL for
Get ACL for document with that docid
getprincipals none Get all users and groups in the current authentication schema
getdoctypes none Get all doctypes currently available in Metacat Catalog System.
getdtdschema
  • doctype - the doctype which DTD or XMLSchema file to read.
Read DTD or XMLSchema file for the specified doctype.
getdataguide
  • doctype - the doctype for which to get the data guide

  • Deprecated. Use getdtdschema action instead.
Read a dataguide for doctype.
getlastdocid
  • username - the user's login name which last docid to get.
Get the latest docid with rev number used by user.
protocoltest
  • url - the url to test against the protocol handler
Test the protocol handlers installed for metacat:// URLs.
export
  • docid - the docid of the package you wish to export
  • Exports a data package in a zip file.

    MetacatReplication Parameters
    Action Supplemental Parameters Description
    forcereplicate
    • server - The server to which this document is being sent
    • docid - The docid of the document to send
    • dbaction - DEFAULTS TO UPDATE - The action to perform on the document. INSERT or UPDATE.
    Force this server to get docid from the remote host.
    getall none Forces the local server to check all known servers for updated documents.
    getcatalog none Sends the contents of the xml_catalog table encoded in XML.
    getlock
    • docid - the docid to get the lock for
    • updaterev - the revision number of docid
    Request a lock on docid.
    gettime none Return the local time on this server.
    servercontrol
    • subaction - The replication control to be performed. Possible values:
      • add - add a new server to the replication list
      • delete - remove a server from the replication list
      • list - list all of the servers currently in the server list
    • replicate - a boolean flag (1 or 0) which determines if this server is to copy files from the newly added server.
    • server - the server to add/delete
    Perform subaction on the Replication daemon.
    read
    • docid - the docid to read
    Sends docid to the remote host.
    start
    • rate - DEFAULTS TO 1000 - The rate (in seconds) at which you want the replication daemon to check for updated documents. The value cannot be less than 30.
    Start the Replication daemon with a time interval of deltaT.
    stop none Stop the Replication daemon.
    update none Send a list of all documents on the local server along with their revision numbers.

    Back | Home | Next