Reading a Document from the Database |
Back | Home | Next |
Metacat allows clients to read a document in several different ways, depending on how the client wants the document returned and how the client wants to specify the requested document.
There are two ways to specify which document you want. 1) By docid alone or 2) by a Metacat URL.
There are two different output formats that a client can request from Metacat. 1) html or 2) xml. This is specified by the "qformat" parameter.
For example, if a user wanted to request document NCEAS.54 and have it returned as HTML, the servlet call would look like this:
http://server.domain.com/Metacat/servlet/Metacat?action=read&qformat=html&docid=NCEAS.54Another way to request a document is by Metacat URL. the URL would look like:
http://server.domain.com/Metacat/servlet/Metacat? action=read&qformat=xml&docid=Metacat://server.domain.com/Metacat?docid=NCEAS.54Note that this url requests that the document be delivered in xml instead of html.
Metacat URLs become useful when more than one Metacat server is being run at one site or a bunch of sites are replicating between each other and you want to specify a document at a precise location. Package files exclusively use Metacat URLs for document identification.