1 |
3132
|
perry
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
2 |
|
|
<!DOCTYPE html
|
3 |
|
|
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4 |
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5 |
|
|
|
6 |
|
|
<html>
|
7 |
|
|
<head>
|
8 |
|
|
<title>setup (MetacatTest)</title>
|
9 |
|
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10 |
|
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11 |
|
|
</head>
|
12 |
|
|
<body class="standalone-code">
|
13 |
|
|
<pre><span class="ruby-comment cmt"># File test/metacat_test.rb, line 7</span>
|
14 |
|
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">setup</span>
|
15 |
|
|
<span class="ruby-comment cmt"># This test case is setup for use against the ucsb/msi metacat server</span>
|
16 |
|
|
<span class="ruby-comment cmt"># You need a valid login to run the test case as well as an squery, eml-docid,</span>
|
17 |
|
|
<span class="ruby-comment cmt"># and datatable docid that will all return documents</span>
|
18 |
|
|
<span class="ruby-ivar">@username</span> = <span class="ruby-value str">'uid=cburt,o=PISCO,dc=ecoinformatics,dc=org'</span>
|
19 |
|
|
<span class="ruby-ivar">@password</span> = <span class="ruby-value str">'7lobster'</span>
|
20 |
|
|
<span class="ruby-ivar">@metacat</span> = <span class="ruby-constant">Metacat</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">"http://data.piscoweb.org/catalog/metacat"</span>)
|
21 |
|
|
<span class="ruby-comment cmt">#must return at least one eml document</span>
|
22 |
|
|
<span class="ruby-ivar">@squery</span> = <span class="ruby-value str">'<?xml version="1.0"?>
|
23 |
|
|
<pathquery version="1.2">
|
24 |
|
|
<returndoctype>eml://ecoinformatics.org/eml-2.0.1</returndoctype>
|
25 |
|
|
<returndoctype>eml://ecoinformatics.org/eml-2.0.0</returndoctype>
|
26 |
|
|
<returnfield>dataset/title</returnfield>
|
27 |
|
|
<returnfield>dataTable/entityName</returnfield>
|
28 |
|
|
<returnfield>creator/individualName/surName</returnfield>
|
29 |
|
|
<returnfield>creator/organizationName</returnfield>
|
30 |
|
|
<returnfield>dataTable/physical/distribution/online/url</returnfield>
|
31 |
|
|
<querygroup operator="INTERSECT">
|
32 |
|
|
<queryterm casesensitive="false" searchmode="starts-with">
|
33 |
|
|
<value>PISCO:</value>
|
34 |
|
|
<pathexpr>title</pathexpr>
|
35 |
|
|
</queryterm>
|
36 |
|
|
<querygroup operator="INTERSECT">
|
37 |
|
|
<queryterm casesensitive="true" searchmode="equals">
|
38 |
|
|
<value>Subtidal Community Survey Data</value>
|
39 |
|
|
<pathexpr>keywordSet/keyword</pathexpr>
|
40 |
|
|
</queryterm>
|
41 |
|
|
<queryterm casesensitive="true" searchmode="equals">
|
42 |
|
|
<value>PISCO Categories</value>
|
43 |
|
|
<pathexpr>keywordSet/keywordThesaurus</pathexpr>
|
44 |
|
|
</queryterm>
|
45 |
|
|
</querygroup>
|
46 |
|
|
</querygroup>
|
47 |
|
|
</pathquery>'</span>
|
48 |
|
|
<span class="ruby-ivar">@data_table_docid</span> = <span class="ruby-value str">'HMS001_020ADCP019R00_20060612.40.1'</span>
|
49 |
|
|
<span class="ruby-ivar">@eml_docid</span> = <span class="ruby-value str">'HMS001_020ADCP019R00_20060612.50.1'</span>
|
50 |
|
|
<span class="ruby-comment cmt"># Not accessable to user Public</span>
|
51 |
|
|
<span class="ruby-ivar">@locked_docid</span> = <span class="ruby-value str">'chad.1.1'</span>
|
52 |
|
|
<span class="ruby-keyword kw">end</span></pre>
|
53 |
|
|
</body>
|
54 |
|
|
</html>
|