Project

General

Profile

1 878 berkley
<!--
2
  * Metacatapi.html
3
  *
4
  *      Authors: Jivka Bojilova
5
  *    Copyright: 2000 Regents of the University of California and the
6
  *               National Center for Ecological Analysis and Synthesis
7
  *  For Details: http://www.nceas.ucsb.edu/
8
  *      Created: 2000 April 5
9
  *      Version: 0.01
10
  *    File Info: '$Id$'
11
  *
12
  * October Meeting SDSC, 2000
13
-->
14
<HTML>
15
<HEAD>
16
<TITLE>Metacat</TITLE>
17 3780 daigle
<link rel="stylesheet" type="text/css" href="./default.css">
18 878 berkley
</HEAD>
19
<BODY>
20
  <table width="100%">
21
    <tr>
22
      <td class="tablehead" colspan="2"><p class="label">Metacat High Level API</p></td>
23
      <td class="tablehead" colspan="2" align="right">
24
        <a href="./metacatout.html">Back</a> | <a href="./metacattour.html">Home</a> |
25
        <a href="./packages.html">Next</a>
26
      </td>
27
    </tr>
28
  </table>
29
  <p>
30
      <b>Multiple client interface</b> <br>
31
      Since Metacat Servlet is a subclass of HttpServlet, this allows any client
32
      to communicate with Metacat by essentially passing a URL with embedded
33
      servlet parameters.
34
      Metacat Servlet provides an HTTP Interface and can handle GET and POST
35
      requests. HTTP requests are sent from the the Client application and contain
36
      a number of parameters. These parameters, in form of name/value pairs, provide
37
      input data for the Servlet and also provide the Servlet any extra information it
38
      needs to handle the request. </p>
39
  <P> <b>Extensions of HttpServlet</b> <br>
40
      Metacat Server adds the functionality for writing, quering, and reading of
41
      XML stored in the Metacat Database as well functions for validating and
42
      transforming XML documents. </p>
43
  <b>MetacatServlet Parameters</b>
44
  <table border="1">
45
    <tr>
46
      <td><b>Action</b></td>
47
      <td><b>Supplemental Parameters</b></td>
48
      <td><b>Description</b></td>
49
    </tr>
50
    <tr>
51
      <td>login</td>
52
      <td>
53
        <ul>
54
          <li>username - the user's login name</li>
55
          <li>password - the user's password</li>
56
        </ul>
57
      </td>
58
      <td>Log the user in.</td>
59
    </tr>
60
    <tr>
61
      <td>logout</td>
62
      <td>none</td>
63
      <td>Log the current user out and destroy the associated session.</td>
64
    </tr>
65
    <tr>
66
      <td>query</td>
67
      <td>
68
        <ul>
69
          <li>returndoctype - the doctype that you wish to use for your
70
          <a href="./packages.html">Package View</a></li>
71
          <li>qformat - the format that you wish to return the resultset in.
72
          Possible values are 'html' or 'xml'.</li>
73
          <li>querytitle - OPTIONAL - the title of the query</li>
74
          <li>doctype - OPTIONAL - if doctype is specified, the search is limited
75
          only to the doctype(s) specified.</li>
76
          <li>returnfield - a custom field to be returned by any hit document.
77
          This is explained in more detail in <a href="./metacatquery.html">
78
          Queries and Results</a>.</li>
79
          <li>operator - the boolean operator to apply to the query - Possible
80
          values are: UNION or INTERSECT</li>
81
          <li>searchmode - the type of search to be performed.  Possible values
82
          are: contains, starts-with, ends-with, equals, isnot-equal, greater-than,
83
          less-than, greater-than-equals, less-than-equals.</li>
84
          <li>anyfield - a freetext search variable.  A value placed in this
85
          parameter will be searched for in any document in any node.</li>
86
        </ul>
87
      </td>
88
      <td>Perform a free text query.</td>
89
    </tr>
90
    <tr>
91
      <td>squery</td>
92
      <td>
93
      <ul>
94
        <li>query - the text of the pathquery document that is being sent to the
95
        server</li>
96
      </ul>
97
      </td>
98
      <td>Perform a structured query.</td>
99
    </tr>
100
    <tr>
101
      <td>read</td>
102
      <td>
103
      <ul>
104
        <li>docid - the docid of the document to read</li>
105
        <li>qformat - the format to return the document in.  Possible values
106
        are: html, xml</li>
107
      </ul>
108
      </td>
109
      <td>Get docid from the database and return it in qformat form.</td>
110
    </tr>
111
    <tr>
112
      <td>insert</td>
113
      <td>
114
        <ul>
115 3761 tao
          <li>docid - the user defined docid to assign to the new XML document.</li>
116
          <li>doctext - the text of the XML document to insert</li>
117 878 berkley
        </ul>
118
      </td>
119 3761 tao
      <td>Insert an XML document into the database.</td>
120 878 berkley
    </tr>
121
    <tr>
122
      <td>update</td>
123
      <td>
124
      <ul>
125
        <li>docid - the docid of the document to update</li>
126 3761 tao
        <li>doctext - the text with which to update the XML document</li>
127 878 berkley
      </ul>
128
      </td>
129 3761 tao
      <td>Overwrite an XML document with a new one and give the new one
130 878 berkley
          the same docid but with next revision number.</td>
131
    </tr>
132
    <tr>
133 3761 tao
      <td>upload</td>
134
      <td>
135
      <ul>
136
        <li>docid - the docid of the data document to upload</li>
137
        <li>datafile - the data document to upload</li>
138
      </ul>
139
      </td>
140
      <td>Upload (insert or update) a data document into the database. Data files are stored on
141
               metacat and may be in any format (binary or text), but they are all
142
               treated as if they were binary. .</td>
143
    </tr>
144
    <tr>
145 878 berkley
      <td>delete</td>
146
      <td>
147
        <ul>
148
          <li>docid - the docid of the document to delete</li>
149
        </ul>
150
      </td>
151
      <td>Delete the specified docid from the database.</td>
152
    </tr>
153
    <tr>
154
      <td>validate</td>
155
      <td>
156
      <ul>
157
        <li>docid - the docid of the document to validate</li>
158
        <li>valtext - the DTD by which to validate this document</li>
159
      </ul>
160
      </td>
161
      <td>Validate docid against its DTD.</td>
162
    </tr>
163
    <tr>
164
      <td>getaccesscontrol</td>
165
      <td>
166
      <ul>
167
        <li>docid - the docid of the document to get the ACL for</li>
168
      </ul>
169
      </td>
170
      <td>Get ACL for document with that docid</td>
171
    </tr>
172
    <tr>
173
      <td>getprincipals</td>
174
      <td>none</td>
175
      <td>Get all users and groups in the current authentication schema</td>
176
    </tr>
177
    <tr>
178
      <td>getdoctypes</td>
179
      <td>none</td>
180
      <td>Get all doctypes currently available in Metacat Catalog System.</td>
181
    </tr>
182
    <tr>
183
      <td>getdtdschema</td>
184
      <td>
185
        <ul>
186
          <li>doctype - the doctype which DTD or XMLSchema file to read.</td>
187
        </ul>
188
      </td>
189
      <td>Read DTD or XMLSchema file for the specified doctype.</td>
190
    </tr>
191
    <tr>
192
      <td>getdataguide</td>
193
      <td>
194
        <ul>
195
          <li>doctype - the doctype for which to get the data guide</li> <br>
196
          <i><b> Deprecated. </b></i> Use getdtdschema action instead.
197
        </ul>
198
      </td>
199
      <td>Read a dataguide for doctype.</td>
200
    </tr>
201
    <tr>
202
      <td>getlastdocid</td>
203
      <td>
204
        <ul>
205
          <li>username - the user's login name which last docid to get.</td>
206
        </ul>
207
      </td>
208
      <td>Get the latest docid with rev number used by user.</td>
209
    </tr>
210
    <tr>
211
      <td>protocoltest</td>
212
      <td>
213
        <ul>
214
          <li>url - the url to test against the protocol handler</li>
215
        </ul>
216
      </td>
217
      <td>Test the protocol handlers installed for metacat:// URLs.</td>
218
    </tr>
219 985 berkley
    <tr>
220
      <td>export</td>
221
      <td>
222
        <li>docid - the docid of the package you wish to export</li>
223
      </td>
224
      <td>
225
        Exports a data package in a zip file.
226
      </td>
227
    </tr>
228 878 berkley
  </table>
229
230
  <br>
231
  <b><a href="./replication.html">MetacatReplication</a> Parameters</b>
232
    <table border="1">
233
    <tr>
234
      <td><b>Action</b></td>
235
      <td><b>Supplemental Parameters</b></td>
236
      <td><b>Description</b></td>
237
    </tr>
238
    <tr>
239
      <td>forcereplicate</td>
240
      <td>
241
        <ul>
242
          <li>server - The server to which this document is being sent</li>
243
          <li>docid - The docid of the document to send</li>
244
          <li>dbaction - DEFAULTS TO UPDATE - The action to perform on the
245
          document.  INSERT or UPDATE.</li>
246
        </ul>
247
      </td>
248
      <td>Force this server to get docid from the remote host.</td>
249
    </tr>
250
    <tr>
251
      <td>getall</td>
252
      <td>none</td>
253
      <td>Forces the local server to check all known servers for updated
254
      documents.</td>
255
    </tr>
256
    <tr>
257
      <td>getcatalog</td>
258
      <td>none</td>
259
      <td>Sends the contents of the xml_catalog table encoded in XML.</td>
260
    </tr>
261
    <tr>
262
      <td>getlock</td>
263
      <td>
264
        <ul>
265
          <li>docid - the docid to get the lock for</li>
266
          <li>updaterev - the revision number of docid</li>
267
        </ul>
268
      </td>
269
      <td>Request a lock on docid.</td>
270
    </tr>
271
    <tr>
272
      <td>gettime</td>
273
      <td>none</td>
274
      <td>Return the local time on this server.</td>
275
    </tr>
276
    <tr>
277
      <td>servercontrol</td>
278
      <td>
279
        <ul>
280
          <li>subaction - The replication control to be performed.  Possible
281
          values:
282
            <ul>
283
              <li>add - add a new server to the replication list</li>
284
              <li>delete - remove a server from the replication list</li>
285
              <li>list - list all of the servers currently in the server list</li>
286
            </ul>
287
          <li>replicate - a boolean flag (1 or 0) which determines if this
288
          server is to copy files from the newly added server.</li>
289
          <li>server - the server to add/delete</li>
290
        </ul>
291
      </td>
292
      <td>Perform subaction on the Replication daemon.</td>
293
    </tr>
294
    <tr>
295
      <td>read</td>
296
      <td>
297
        <ul>
298
          <li>docid - the docid to read</li>
299
        </ul>
300
      </td>
301
      <td>Sends docid to the remote host.</td>
302
    </tr>
303
    <tr>
304
      <td>start</td>
305
      <td>
306
        <ul>
307
          <li>rate - DEFAULTS TO 1000 - The rate (in seconds) at which you want
308
          the replication daemon to check for updated documents.  The value
309
          cannot be less than 30.</li>
310
        </ul>
311
      </td>
312
      <td>Start the Replication daemon with a time interval of deltaT.</td>
313
    </tr>
314
    <tr>
315
      <td>stop</td>
316
      <td>none</td>
317
      <td>Stop the Replication daemon.</td>
318
    </tr>
319
    <tr>
320
      <td>update</td>
321
      <td>none</td>
322
      <td>Send a list of all documents on the local server along with their
323
      revision numbers.</td>
324
    </tr>
325
  </table>
326
  <br>
327
  <a href="./metacatout.html">Back</a> | <a href="./metacattour.html">Home</a> |
328
  <a href="./packages.html">Next</a>
329
</BODY>
330
</HTML>