Revision 881
Added by berkley almost 23 years ago
metacatread.html | ||
---|---|---|
32 | 32 |
wants to specify the requested document. </p> |
33 | 33 |
<P> <img alt="architecture diagram of the Metacat read process" |
34 | 34 |
src="metadataread.gif"> </p> |
35 |
<p>The documents are requested by <b>docid</b> servlet parameter: |
|
36 |
<ul> |
|
37 |
<li> By docid alone as: <br> |
|
38 |
<i>docid=NCEAS.54</i></li> |
|
39 |
<li> By Metacat URL as: <br> |
|
40 |
<i>docid=metacat://server.domain.com/metacat?docid=NCEAS.54</i></li> |
|
41 |
<li> By HTTP URL: <br> |
|
42 |
<i>docid=http://otherserver.domain.com/filename</i></li> |
|
43 |
</ul> |
|
35 |
<p>The documents are requested by the <b>docid</b> servlet parameter by specifying |
|
36 |
the document id that you wish to read.<br> |
|
44 | 37 |
</p> |
45 |
<p>There are two different output formats that a client can request from |
|
46 |
Metacat: HTML or XML. This is specified by the <b>qformat</b> parameter. <br> |
|
47 |
If more than one document is requested, the qformat does not matter, |
|
48 |
instead the documents are zipped together and retrieved to the client. <br> |
|
49 |
When <b>abstractpath</b> parameter along with docid parameter is |
|
50 |
specified as a XPath expression of the location of abstract data within |
|
51 |
XML document, the abstract data only are read and retrieved in XML format. |
|
38 |
<p> |
|
39 |
Metacat allows the dynamic transformation of read documents through the use |
|
40 |
of style-sets. A style-set is an xsl stylesheet or a group of stylesheets |
|
41 |
that are specified in a config file. The following is an example of a style-set |
|
42 |
config file: |
|
43 |
</p> |
|
44 |
<pre> |
|
45 |
<?xml version="1.0"?> |
|
46 |
<style-set name="knb"> |
|
47 |
<default-style>http://http://server.domain.com/metacat/style/ascii-treeview.xsl</default-style> |
|
48 |
<doctype publicid="-//NCEAS//resultset//EN"> |
|
49 |
<target publicid="-//W3C//HTML//EN">http://http://server.domain.com/metacat/style/resultset.xsl</target> |
|
50 |
</doctype> |
|
51 |
<doctype publicid="-//NCEAS//login//EN"> |
|
52 |
<target publicid="-//W3C//HTML//EN">http://http://server.domain.com/metacat/style/login.xsl</target> |
|
53 |
</doctype> |
|
54 |
<doctype publicid="-//NCEAS//eml-dataset-2.0//EN"> |
|
55 |
<target publicid="-//W3C//HTML//EN">http://http://server.domain.com/metacat/style/eml-dataset-display.xsl</target> |
|
56 |
</doctype> |
|
57 |
<doctype publicid="-//NCEAS//eml-dataset//EN"> |
|
58 |
<target publicid="-//W3C//HTML//EN">http://http://server.domain.com/metacat/style/eml-dataset-display.xsl</target> |
|
59 |
</doctype> |
|
60 |
<doctype publicid="-//NCEAS//eml-resource//EN"> |
|
61 |
<target publicid="-//W3C//HTML//EN">http://http://server.domain.com/metacat/style/eml-dataset-display.xsl</target> |
|
62 |
</doctype> |
|
63 |
<doctype publicid="-//ecoinformatics.org//eml-dataset-2.0.0beta4//EN"> |
|
64 |
<target publicid="-//W3C//HTML//EN">http://http://server.domain.com/metacat/style/eml-dataset-display.xsl</target> |
|
65 |
</doctype> |
|
66 |
</style-set> |
|
67 |
</pre> |
|
52 | 68 |
|
53 |
<p>For example, if a user wanted to request document NCEAS.54 and have it |
|
54 |
returned as HTML, the servlet call would look like this: <br> |
|
55 |
<i>http://server.domain.com/knb/servlet/metacat?action=read&qformat=html&docid=NCEAS.54</i> |
|
56 |
<br> |
|
57 |
Another way to request a document is by Metacat URL. the URL would look like: <br> |
|
58 |
<i>http://server.domain.com/knb/servlet/metacat? |
|
59 |
action=read&qformat=xml&docid=metacat://server.domain.com/metacat?docid=NCEAS.54</i> |
|
60 |
<br> |
|
61 |
Note that this url requests that the document be delivered in xml instead of html. |
|
69 |
<p> |
|
70 |
Whenever a read action is requested from Metacat, you can also provide a qformat parameter. |
|
71 |
This qformat parameter should be the name of the style-set that you wish to use |
|
72 |
to transform the document you are requesting. Note that the value that you set |
|
73 |
qformat to must equal the <style-set> name parameter. |
|
62 | 74 |
</p> |
63 | 75 |
<p> |
64 |
Metacat URLs as in the second example become useful when more than one Metacat |
|
65 |
server is being run at one site or a bunch of sites are replicating between each |
|
66 |
other and you want to specify a document at a precise location. |
|
67 |
<!-- <a href="./packages.html">Package</a> |
|
68 |
files exclusively use Metacat URLs for document identification. --> |
|
76 |
A default style-set can be set in the metacat.properties file. If qformat |
|
77 |
is set to 'html', Metacat will use the default. If qformat is set to 'xml', |
|
78 |
Metacat will return the XML document untransformed. |
|
69 | 79 |
</p> |
70 |
|
|
71 | 80 |
<br> |
72 | 81 |
<a href="./metacatquery.html">Back</a> | <a href="./metacattour.html">Home</a> | |
73 | 82 |
<a href="./saxparser.html">Next</a> |
Also available in: Unified diff
updated documentation. removed a lot of typos and updated all of the new stuff for the new release