pho 0.7.3 → 0.7.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +6 -0
- data/README +9 -1
- data/Rakefile +1 -1
- data/doc/index.html +3 -1
- data/doc/rdoc/classes/Pho/Analyzers.html +310 -0
- data/doc/rdoc/classes/Pho/CommandLine.html +770 -0
- data/doc/rdoc/classes/Pho/DatatypeProperty.html +241 -0
- data/doc/rdoc/classes/Pho/Enrichment/StoreEnricher.html +410 -0
- data/doc/rdoc/classes/Pho/Enrichment.html +119 -0
- data/doc/rdoc/classes/Pho/Etags.html +310 -0
- data/doc/rdoc/classes/Pho/Facet/Results.html +299 -0
- data/doc/rdoc/classes/Pho/Facet/Term.html +177 -0
- data/doc/rdoc/classes/Pho/Facet.html +119 -0
- data/doc/rdoc/classes/Pho/FieldPredicateMap.html +695 -0
- data/doc/rdoc/classes/Pho/FieldWeighting.html +230 -0
- data/doc/rdoc/classes/Pho/FileManagement/AbstractFileManager.html +478 -0
- data/doc/rdoc/classes/Pho/FileManagement/FileManager.html +264 -0
- data/doc/rdoc/classes/Pho/FileManagement/RDFManager.html +259 -0
- data/doc/rdoc/classes/Pho/FileManagement.html +121 -0
- data/doc/rdoc/classes/Pho/Job.html +627 -0
- data/doc/rdoc/classes/Pho/JobUpdate.html +141 -0
- data/doc/rdoc/classes/Pho/Jobs.html +538 -0
- data/doc/rdoc/classes/Pho/Namespaces.html +164 -0
- data/doc/rdoc/classes/Pho/OAI/Record.html +165 -0
- data/doc/rdoc/classes/Pho/OAI/Records.html +331 -0
- data/doc/rdoc/classes/Pho/OAI.html +118 -0
- data/doc/rdoc/classes/Pho/QueryProfile.html +524 -0
- data/doc/rdoc/classes/Pho/RDF/Parser.html +279 -0
- data/doc/rdoc/classes/Pho/RDF.html +120 -0
- data/doc/rdoc/classes/Pho/RDFCollection.html +119 -0
- data/doc/rdoc/classes/Pho/ResourceHash/Converter.html +325 -0
- data/doc/rdoc/classes/Pho/ResourceHash/SetAlgebra.html +241 -0
- data/doc/rdoc/classes/Pho/ResourceHash.html +123 -0
- data/doc/rdoc/classes/Pho/Snapshot.html +402 -0
- data/doc/rdoc/classes/Pho/Sparql/SparqlClient.html +594 -0
- data/doc/rdoc/classes/Pho/Sparql/SparqlHelper.html +696 -0
- data/doc/rdoc/classes/Pho/Sparql.html +187 -0
- data/doc/rdoc/classes/Pho/Status.html +296 -0
- data/doc/rdoc/classes/Pho/Store.html +1569 -0
- data/doc/rdoc/classes/Pho/StoreSparqlClient.html +183 -0
- data/doc/rdoc/classes/Pho/Update/Changeset.html +521 -0
- data/doc/rdoc/classes/Pho/Update/ChangesetBuilder.html +330 -0
- data/doc/rdoc/classes/Pho/Update/ChangesetHelper.html +159 -0
- data/doc/rdoc/classes/Pho/Update/Changesets.html +205 -0
- data/doc/rdoc/classes/Pho/Update/LiteralStatement.html +257 -0
- data/doc/rdoc/classes/Pho/Update/ResourceStatement.html +237 -0
- data/doc/rdoc/classes/Pho/Update/Statement.html +303 -0
- data/doc/rdoc/classes/Pho/Update.html +128 -0
- data/doc/rdoc/classes/Pho.html +283 -0
- data/doc/rdoc/classes/String.html +146 -0
- data/doc/rdoc/created.rid +1 -0
- data/doc/rdoc/files/CHANGES.html +373 -0
- data/doc/rdoc/files/README.html +204 -0
- data/doc/rdoc/files/lib/pho/changeset_builder_rb.html +108 -0
- data/doc/rdoc/files/lib/pho/changeset_rb.html +108 -0
- data/doc/rdoc/files/lib/pho/command_line_rb.html +101 -0
- data/doc/rdoc/files/lib/pho/converter_rb.html +108 -0
- data/doc/rdoc/files/lib/pho/enrichment_rb.html +101 -0
- data/doc/rdoc/files/lib/pho/etags_rb.html +108 -0
- data/doc/rdoc/files/lib/pho/facet_rb.html +101 -0
- data/doc/rdoc/files/lib/pho/field_predicate_map_rb.html +101 -0
- data/doc/rdoc/files/lib/pho/file_management_rb.html +101 -0
- data/doc/rdoc/files/lib/pho/file_manager_rb.html +108 -0
- data/doc/rdoc/files/lib/pho/job_rb.html +101 -0
- data/doc/rdoc/files/lib/pho/oai_rb.html +101 -0
- data/doc/rdoc/files/lib/pho/query_profile_rb.html +101 -0
- data/doc/rdoc/files/lib/pho/rdf_collection_rb.html +101 -0
- data/doc/rdoc/files/lib/pho/rdf_rb.html +108 -0
- data/doc/rdoc/files/lib/pho/resource_hash_rb.html +101 -0
- data/doc/rdoc/files/lib/pho/snapshot_rb.html +109 -0
- data/doc/rdoc/files/lib/pho/sparql_rb.html +101 -0
- data/doc/rdoc/files/lib/pho/status_rb.html +101 -0
- data/doc/rdoc/files/lib/pho/store_rb.html +108 -0
- data/doc/rdoc/files/lib/pho_rb.html +133 -0
- data/doc/rdoc/fr_class_index.html +72 -0
- data/doc/rdoc/fr_file_index.html +49 -0
- data/doc/rdoc/fr_method_index.html +239 -0
- data/doc/rdoc/index.html +24 -0
- data/doc/rdoc/rdoc-style.css +208 -0
- data/lib/pho/enrichment.rb +1 -0
- data/lib/pho/field_predicate_map.rb +5 -0
- data/lib/pho/query_profile.rb +5 -0
- data/lib/pho/store.rb +4 -1
- data/tests/tc_field_predicate_map.rb +7 -1
- data/tests/tc_query_profile.rb +6 -0
- data/tests/tc_store_util.rb +7 -0
- metadata +134 -21
@@ -0,0 +1,331 @@
|
|
1
|
+
<?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 xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Class: Pho::OAI::Records</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">Pho::OAI::Records</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../../files/lib/pho/oai_rb.html">
|
59
|
+
lib/pho/oai.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr class="top-aligned-row">
|
66
|
+
<td><strong>Parent:</strong></td>
|
67
|
+
<td>
|
68
|
+
Object
|
69
|
+
</td>
|
70
|
+
</tr>
|
71
|
+
</table>
|
72
|
+
</div>
|
73
|
+
<!-- banner header -->
|
74
|
+
|
75
|
+
<div id="bodyContent">
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<div id="contextContent">
|
80
|
+
|
81
|
+
<div id="description">
|
82
|
+
<p>
|
83
|
+
Collection of records
|
84
|
+
</p>
|
85
|
+
|
86
|
+
</div>
|
87
|
+
|
88
|
+
|
89
|
+
</div>
|
90
|
+
|
91
|
+
<div id="method-list">
|
92
|
+
<h3 class="section-bar">Methods</h3>
|
93
|
+
|
94
|
+
<div class="name-list">
|
95
|
+
<a href="#M000069">new</a>
|
96
|
+
<a href="#M000070">parse</a>
|
97
|
+
<a href="#M000071">read_from_store</a>
|
98
|
+
<a href="#M000072">read_next_records</a>
|
99
|
+
</div>
|
100
|
+
</div>
|
101
|
+
|
102
|
+
</div>
|
103
|
+
|
104
|
+
|
105
|
+
<!-- if includes -->
|
106
|
+
|
107
|
+
<div id="section">
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
<div id="attribute-list">
|
114
|
+
<h3 class="section-bar">Attributes</h3>
|
115
|
+
|
116
|
+
<div class="name-list">
|
117
|
+
<table>
|
118
|
+
<tr class="top-aligned-row context-row">
|
119
|
+
<td class="context-item-name">cursor</td>
|
120
|
+
<td class="context-item-value"> [R] </td>
|
121
|
+
<td class="context-item-desc"></td>
|
122
|
+
</tr>
|
123
|
+
<tr class="top-aligned-row context-row">
|
124
|
+
<td class="context-item-name">from</td>
|
125
|
+
<td class="context-item-value"> [R] </td>
|
126
|
+
<td class="context-item-desc"></td>
|
127
|
+
</tr>
|
128
|
+
<tr class="top-aligned-row context-row">
|
129
|
+
<td class="context-item-name">list_size</td>
|
130
|
+
<td class="context-item-value"> [R] </td>
|
131
|
+
<td class="context-item-desc"></td>
|
132
|
+
</tr>
|
133
|
+
<tr class="top-aligned-row context-row">
|
134
|
+
<td class="context-item-name">records</td>
|
135
|
+
<td class="context-item-value"> [R] </td>
|
136
|
+
<td class="context-item-desc"></td>
|
137
|
+
</tr>
|
138
|
+
<tr class="top-aligned-row context-row">
|
139
|
+
<td class="context-item-name">response_date</td>
|
140
|
+
<td class="context-item-value"> [R] </td>
|
141
|
+
<td class="context-item-desc"></td>
|
142
|
+
</tr>
|
143
|
+
<tr class="top-aligned-row context-row">
|
144
|
+
<td class="context-item-name">resumption_token</td>
|
145
|
+
<td class="context-item-value"> [R] </td>
|
146
|
+
<td class="context-item-desc"></td>
|
147
|
+
</tr>
|
148
|
+
<tr class="top-aligned-row context-row">
|
149
|
+
<td class="context-item-name">to</td>
|
150
|
+
<td class="context-item-value"> [R] </td>
|
151
|
+
<td class="context-item-desc"></td>
|
152
|
+
</tr>
|
153
|
+
</table>
|
154
|
+
</div>
|
155
|
+
</div>
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
<!-- if method_list -->
|
160
|
+
<div id="methods">
|
161
|
+
<h3 class="section-bar">Public Class methods</h3>
|
162
|
+
|
163
|
+
<div id="method-M000069" class="method-detail">
|
164
|
+
<a name="M000069"></a>
|
165
|
+
|
166
|
+
<div class="method-heading">
|
167
|
+
<a href="#M000069" class="method-signature">
|
168
|
+
<span class="method-name">new</span><span class="method-args">(responseDate, from, to, records=[], token=nil, list_size=nil, cursor=nil)</span>
|
169
|
+
</a>
|
170
|
+
</div>
|
171
|
+
|
172
|
+
<div class="method-description">
|
173
|
+
<p><a class="source-toggle" href="#"
|
174
|
+
onclick="toggleCode('M000069-source');return false;">[Source]</a></p>
|
175
|
+
<div class="method-source-code" id="M000069-source">
|
176
|
+
<pre>
|
177
|
+
<span class="ruby-comment cmt"># File lib/pho/oai.rb, line 23</span>
|
178
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">responseDate</span>, <span class="ruby-identifier">from</span>, <span class="ruby-identifier">to</span>, <span class="ruby-identifier">records</span>=[], <span class="ruby-identifier">token</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">list_size</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">cursor</span>=<span class="ruby-keyword kw">nil</span>)
|
179
|
+
<span class="ruby-ivar">@response_date</span> = <span class="ruby-identifier">responseDate</span>
|
180
|
+
<span class="ruby-ivar">@from</span> = <span class="ruby-identifier">from</span>
|
181
|
+
<span class="ruby-ivar">@to</span> = <span class="ruby-identifier">to</span>
|
182
|
+
<span class="ruby-ivar">@records</span> = <span class="ruby-identifier">records</span>
|
183
|
+
<span class="ruby-ivar">@resumption_token</span> = <span class="ruby-identifier">token</span>
|
184
|
+
<span class="ruby-ivar">@list_size</span> = <span class="ruby-identifier">list_size</span>
|
185
|
+
<span class="ruby-ivar">@cursor</span> = <span class="ruby-identifier">cursor</span>
|
186
|
+
<span class="ruby-keyword kw">end</span>
|
187
|
+
</pre>
|
188
|
+
</div>
|
189
|
+
</div>
|
190
|
+
</div>
|
191
|
+
|
192
|
+
<div id="method-M000070" class="method-detail">
|
193
|
+
<a name="M000070"></a>
|
194
|
+
|
195
|
+
<div class="method-heading">
|
196
|
+
<a href="#M000070" class="method-signature">
|
197
|
+
<span class="method-name">parse</span><span class="method-args">(response)</span>
|
198
|
+
</a>
|
199
|
+
</div>
|
200
|
+
|
201
|
+
<div class="method-description">
|
202
|
+
<p><a class="source-toggle" href="#"
|
203
|
+
onclick="toggleCode('M000070-source');return false;">[Source]</a></p>
|
204
|
+
<div class="method-source-code" id="M000070-source">
|
205
|
+
<pre>
|
206
|
+
<span class="ruby-comment cmt"># File lib/pho/oai.rb, line 33</span>
|
207
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-constant">Records</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">response</span>)
|
208
|
+
<span class="ruby-identifier">doc</span> = <span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">Document</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">response</span>)
|
209
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">root</span>.<span class="ruby-identifier">get_elements</span>(<span class="ruby-value str">"error"</span>)[<span class="ruby-value">0</span>] <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
|
210
|
+
<span class="ruby-identifier">code</span> = <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">root</span>.<span class="ruby-identifier">get_elements</span>(<span class="ruby-value str">"error"</span>)[<span class="ruby-value">0</span>].<span class="ruby-identifier">attributes</span>[<span class="ruby-value str">"code"</span>]
|
211
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">code</span> <span class="ruby-operator">==</span> <span class="ruby-value str">"noRecordsMatch"</span>
|
212
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
|
213
|
+
<span class="ruby-keyword kw">else</span>
|
214
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-node">"Unable to list records: #{code}, #{doc.root.get_elements("error")[0].text}"</span>
|
215
|
+
<span class="ruby-keyword kw">end</span>
|
216
|
+
<span class="ruby-keyword kw">end</span>
|
217
|
+
<span class="ruby-identifier">records</span> = []
|
218
|
+
<span class="ruby-identifier">responseDate</span> = <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">root</span>.<span class="ruby-identifier">get_elements</span>(<span class="ruby-value str">"responseDate"</span>)[<span class="ruby-value">0</span>].<span class="ruby-identifier">text</span>
|
219
|
+
<span class="ruby-identifier">from</span> = <span class="ruby-constant">DateTime</span>.<span class="ruby-identifier">parse</span>( <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">root</span>.<span class="ruby-identifier">get_elements</span>(<span class="ruby-value str">"request"</span>)[<span class="ruby-value">0</span>].<span class="ruby-identifier">attributes</span>[<span class="ruby-value str">"from"</span>] )
|
220
|
+
<span class="ruby-identifier">to</span> = <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">root</span>.<span class="ruby-identifier">get_elements</span>(<span class="ruby-value str">"request"</span>)[<span class="ruby-value">0</span>].<span class="ruby-identifier">attributes</span>[<span class="ruby-value str">"until"</span>]
|
221
|
+
<span class="ruby-identifier">to</span> = <span class="ruby-constant">DateTime</span>.<span class="ruby-identifier">parse</span>( <span class="ruby-identifier">to</span> ) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">to</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span>
|
222
|
+
<span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">XPath</span>.<span class="ruby-identifier">each</span>( <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">root</span>, <span class="ruby-value str">"//oai:header"</span>, {<span class="ruby-value str">"oai"</span> =<span class="ruby-operator">></span> <span class="ruby-value str">"http://www.openarchives.org/OAI/2.0/"</span>} ) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">header</span><span class="ruby-operator">|</span>
|
223
|
+
<span class="ruby-identifier">uri</span> = <span class="ruby-identifier">header</span>.<span class="ruby-identifier">get_elements</span>(<span class="ruby-value str">"identifier"</span>)[<span class="ruby-value">0</span>].<span class="ruby-identifier">text</span>
|
224
|
+
<span class="ruby-identifier">datestamp</span> = <span class="ruby-identifier">header</span>.<span class="ruby-identifier">get_elements</span>(<span class="ruby-value str">"datestamp"</span>)[<span class="ruby-value">0</span>].<span class="ruby-identifier">text</span>
|
225
|
+
<span class="ruby-identifier">records</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">Record</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">uri</span>, <span class="ruby-constant">DateTime</span>.<span class="ruby-identifier">parse</span>( <span class="ruby-identifier">datestamp</span> ) )
|
226
|
+
<span class="ruby-keyword kw">end</span>
|
227
|
+
<span class="ruby-identifier">resumption_token</span> = <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">root</span>.<span class="ruby-identifier">get_elements</span>(<span class="ruby-value str">"//resumptionToken"</span>)[<span class="ruby-value">0</span>]
|
228
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">resumption_token</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
|
229
|
+
<span class="ruby-identifier">token</span> = <span class="ruby-identifier">resumption_token</span>.<span class="ruby-identifier">text</span>
|
230
|
+
<span class="ruby-identifier">list_size</span> = <span class="ruby-identifier">resumption_token</span>.<span class="ruby-identifier">attributes</span>[<span class="ruby-value str">"completeListSize"</span>].<span class="ruby-identifier">to_i</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">resumption_token</span>.<span class="ruby-identifier">attributes</span>[<span class="ruby-value str">"completeListSize"</span>] <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
|
231
|
+
<span class="ruby-identifier">cursor</span> = <span class="ruby-identifier">resumption_token</span>.<span class="ruby-identifier">attributes</span>[<span class="ruby-value str">"cursor"</span>].<span class="ruby-identifier">to_i</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">resumption_token</span>.<span class="ruby-identifier">attributes</span>[<span class="ruby-value str">"cursor"</span>] <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
|
232
|
+
<span class="ruby-keyword kw">end</span>
|
233
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-constant">Records</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">DateTime</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">responseDate</span>), <span class="ruby-identifier">from</span>, <span class="ruby-identifier">to</span>, <span class="ruby-identifier">records</span>, <span class="ruby-identifier">token</span>, <span class="ruby-identifier">list_size</span>, <span class="ruby-identifier">cursor</span>)
|
234
|
+
<span class="ruby-keyword kw">end</span>
|
235
|
+
</pre>
|
236
|
+
</div>
|
237
|
+
</div>
|
238
|
+
</div>
|
239
|
+
|
240
|
+
<div id="method-M000071" class="method-detail">
|
241
|
+
<a name="M000071"></a>
|
242
|
+
|
243
|
+
<div class="method-heading">
|
244
|
+
<a href="#M000071" class="method-signature">
|
245
|
+
<span class="method-name">read_from_store</span><span class="method-args">(store, from=nil, to=nil, resumption_token=nil)</span>
|
246
|
+
</a>
|
247
|
+
</div>
|
248
|
+
|
249
|
+
<div class="method-description">
|
250
|
+
<p>
|
251
|
+
List records from a store
|
252
|
+
</p>
|
253
|
+
<p><a class="source-toggle" href="#"
|
254
|
+
onclick="toggleCode('M000071-source');return false;">[Source]</a></p>
|
255
|
+
<div class="method-source-code" id="M000071-source">
|
256
|
+
<pre>
|
257
|
+
<span class="ruby-comment cmt"># File lib/pho/oai.rb, line 63</span>
|
258
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-constant">Records</span>.<span class="ruby-identifier">read_from_store</span>(<span class="ruby-identifier">store</span>, <span class="ruby-identifier">from</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">to</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">resumption_token</span>=<span class="ruby-keyword kw">nil</span>)
|
259
|
+
<span class="ruby-identifier">resp</span> = <span class="ruby-identifier">store</span>.<span class="ruby-identifier">list_records</span>(<span class="ruby-identifier">from</span>, <span class="ruby-identifier">to</span>, <span class="ruby-identifier">resumption_token</span>)
|
260
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">resp</span>.<span class="ruby-identifier">status</span> <span class="ruby-operator">!=</span> <span class="ruby-value">200</span>
|
261
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-value str">"Unable to list records"</span>
|
262
|
+
<span class="ruby-keyword kw">end</span>
|
263
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">parse</span>(<span class="ruby-identifier">resp</span>.<span class="ruby-identifier">content</span>)
|
264
|
+
<span class="ruby-keyword kw">end</span>
|
265
|
+
</pre>
|
266
|
+
</div>
|
267
|
+
</div>
|
268
|
+
</div>
|
269
|
+
|
270
|
+
<div id="method-M000072" class="method-detail">
|
271
|
+
<a name="M000072"></a>
|
272
|
+
|
273
|
+
<div class="method-heading">
|
274
|
+
<a href="#M000072" class="method-signature">
|
275
|
+
<span class="method-name">read_next_records</span><span class="method-args">(store, resumption_token)</span>
|
276
|
+
</a>
|
277
|
+
</div>
|
278
|
+
|
279
|
+
<div class="method-description">
|
280
|
+
<p>
|
281
|
+
Fetch the next list of records from a store, using a resumption token
|
282
|
+
</p>
|
283
|
+
<p>
|
284
|
+
Returns nil if there are no records to retrieve. Can be used as a simple
|
285
|
+
iterator, e.g:
|
286
|
+
</p>
|
287
|
+
<pre>
|
288
|
+
records = store.list_records
|
289
|
+
while records != nil
|
290
|
+
#do something with retrieved records
|
291
|
+
records = Records.read_next_records(store, records.resumption_token
|
292
|
+
end
|
293
|
+
</pre>
|
294
|
+
<table>
|
295
|
+
<tr><td valign="top">store:</td><td>the store
|
296
|
+
|
297
|
+
</td></tr>
|
298
|
+
<tr><td valign="top">records:</td><td>previously retrieved resumption_token
|
299
|
+
|
300
|
+
</td></tr>
|
301
|
+
</table>
|
302
|
+
<p><a class="source-toggle" href="#"
|
303
|
+
onclick="toggleCode('M000072-source');return false;">[Source]</a></p>
|
304
|
+
<div class="method-source-code" id="M000072-source">
|
305
|
+
<pre>
|
306
|
+
<span class="ruby-comment cmt"># File lib/pho/oai.rb, line 83</span>
|
307
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-constant">Records</span>.<span class="ruby-identifier">read_next_records</span>(<span class="ruby-identifier">store</span>, <span class="ruby-identifier">resumption_token</span>)
|
308
|
+
<span class="ruby-comment cmt">#list is already complete</span>
|
309
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">records</span>.<span class="ruby-identifier">resumption_token</span> = <span class="ruby-keyword kw">nil</span>
|
310
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
|
311
|
+
<span class="ruby-keyword kw">end</span>
|
312
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-constant">Records</span>.<span class="ruby-identifier">read_from_store</span>(<span class="ruby-identifier">store</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">token</span>)
|
313
|
+
<span class="ruby-keyword kw">end</span>
|
314
|
+
</pre>
|
315
|
+
</div>
|
316
|
+
</div>
|
317
|
+
</div>
|
318
|
+
|
319
|
+
|
320
|
+
</div>
|
321
|
+
|
322
|
+
|
323
|
+
</div>
|
324
|
+
|
325
|
+
|
326
|
+
<div id="validator-badges">
|
327
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
328
|
+
</div>
|
329
|
+
|
330
|
+
</body>
|
331
|
+
</html>
|
@@ -0,0 +1,118 @@
|
|
1
|
+
<?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 xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Module: Pho::OAI</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Module</strong></td>
|
53
|
+
<td class="class-name-in-header">Pho::OAI</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../files/lib/pho/oai_rb.html">
|
59
|
+
lib/pho/oai.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
</table>
|
66
|
+
</div>
|
67
|
+
<!-- banner header -->
|
68
|
+
|
69
|
+
<div id="bodyContent">
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
<div id="contextContent">
|
74
|
+
|
75
|
+
<div id="description">
|
76
|
+
<p>
|
77
|
+
<a href="OAI.html">OAI</a>-PMH Support
|
78
|
+
</p>
|
79
|
+
|
80
|
+
</div>
|
81
|
+
|
82
|
+
|
83
|
+
</div>
|
84
|
+
|
85
|
+
|
86
|
+
</div>
|
87
|
+
|
88
|
+
|
89
|
+
<!-- if includes -->
|
90
|
+
|
91
|
+
<div id="section">
|
92
|
+
|
93
|
+
<div id="class-list">
|
94
|
+
<h3 class="section-bar">Classes and Modules</h3>
|
95
|
+
|
96
|
+
Class <a href="OAI/Record.html" class="link">Pho::OAI::Record</a><br />
|
97
|
+
Class <a href="OAI/Records.html" class="link">Pho::OAI::Records</a><br />
|
98
|
+
|
99
|
+
</div>
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
<!-- if method_list -->
|
108
|
+
|
109
|
+
|
110
|
+
</div>
|
111
|
+
|
112
|
+
|
113
|
+
<div id="validator-badges">
|
114
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
115
|
+
</div>
|
116
|
+
|
117
|
+
</body>
|
118
|
+
</html>
|