Project

General

Profile

« Previous | Next » 

Revision 881

Added by berkley over 22 years ago

updated documentation. removed a lot of typos and updated all of the new stuff for the new release

View differences:

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
    &lt;?xml version="1.0"?&gt;
46
    &lt;style-set name="knb"&gt;
47
      &lt;default-style&gt;http://http://server.domain.com/metacat/style/ascii-treeview.xsl&lt;/default-style&gt;
48
      &lt;doctype publicid="-//NCEAS//resultset//EN"&gt;
49
        &lt;target publicid="-//W3C//HTML//EN"&gt;http://http://server.domain.com/metacat/style/resultset.xsl&lt;/target&gt;
50
      &lt;/doctype&gt;
51
      &lt;doctype publicid="-//NCEAS//login//EN"&gt;
52
        &lt;target publicid="-//W3C//HTML//EN"&gt;http://http://server.domain.com/metacat/style/login.xsl&lt;/target&gt;
53
      &lt;/doctype&gt;
54
      &lt;doctype publicid="-//NCEAS//eml-dataset-2.0//EN"&gt;
55
        &lt;target publicid="-//W3C//HTML//EN"&gt;http://http://server.domain.com/metacat/style/eml-dataset-display.xsl&lt;/target&gt;  
56
      &lt;/doctype&gt;
57
      &lt;doctype publicid="-//NCEAS//eml-dataset//EN"&gt;
58
        &lt;target publicid="-//W3C//HTML//EN"&gt;http://http://server.domain.com/metacat/style/eml-dataset-display.xsl&lt;/target&gt;  
59
      &lt;/doctype&gt;
60
      &lt;doctype publicid="-//NCEAS//eml-resource//EN"&gt;
61
        &lt;target publicid="-//W3C//HTML//EN"&gt;http://http://server.domain.com/metacat/style/eml-dataset-display.xsl&lt;/target&gt;  
62
      &lt;/doctype&gt;      
63
      &lt;doctype publicid="-//ecoinformatics.org//eml-dataset-2.0.0beta4//EN"&gt;
64
        &lt;target publicid="-//W3C//HTML//EN"&gt;http://http://server.domain.com/metacat/style/eml-dataset-display.xsl&lt;/target&gt;  
65
      &lt;/doctype&gt;
66
    &lt;/style-set&gt;
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&amp;qformat=html&amp;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&amp;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 &lt;style-set&gt; 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