curation_concerns 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -1
  3. data/.rubocop.yml +6 -0
  4. data/Gemfile +1 -2
  5. data/RELEASING.md +3 -2
  6. data/Rakefile +15 -14
  7. data/VERSION +1 -1
  8. data/app/controllers/concerns/curation_concerns/curation_concern_controller.rb +1 -1
  9. data/app/controllers/concerns/curation_concerns/parent_container.rb +1 -1
  10. data/app/renderers/curation_concerns/attribute_renderer.rb +1 -1
  11. data/curation_concerns.gemspec +2 -0
  12. data/lib/curation_concerns/rails/routes.rb +19 -7
  13. data/lib/curation_concerns/version.rb +1 -1
  14. data/solr/config/_rest_managed.json +3 -0
  15. data/solr/config/admin-extra.html +31 -0
  16. data/solr/config/elevate.xml +36 -0
  17. data/solr/config/mapping-ISOLatin1Accent.txt +246 -0
  18. data/solr/config/protwords.txt +21 -0
  19. data/solr/config/schema.xml +372 -0
  20. data/solr/config/scripts.conf +24 -0
  21. data/solr/config/solrconfig.xml +300 -0
  22. data/solr/config/spellings.txt +2 -0
  23. data/solr/config/stopwords.txt +58 -0
  24. data/solr/config/stopwords_en.txt +58 -0
  25. data/solr/config/synonyms.txt +31 -0
  26. data/solr/config/xslt/example.xsl +132 -0
  27. data/solr/config/xslt/example_atom.xsl +67 -0
  28. data/solr/config/xslt/example_rss.xsl +66 -0
  29. data/solr/config/xslt/luke.xsl +337 -0
  30. data/spec/actors/curation_concerns/work_actor_spec.rb +1 -1
  31. data/spec/controllers/curation_concerns/file_sets_controller_spec.rb +23 -0
  32. data/spec/models/curation_concerns/collection_behavior_spec.rb +2 -0
  33. data/spec/models/file_set_spec.rb +1 -1
  34. data/spec/renderers/curation_concerns/attribute_renderer_spec.rb +12 -0
  35. data/spec/test_app_templates/Gemfile.extra +0 -3
  36. data/spec/views/curation_concerns/base/_attributes.html.erb_spec.rb +1 -1
  37. metadata +48 -6
  38. data/config/jetty.yml +0 -5
  39. data/tasks/jetty.rake +0 -15
@@ -0,0 +1,300 @@
1
+ <?xml version="1.0" encoding="UTF-8" ?>
2
+ <!--
3
+ Licensed to the Apache Software Foundation (ASF) under one or more
4
+ contributor license agreements. See the NOTICE file distributed with
5
+ this work for additional information regarding copyright ownership.
6
+ The ASF licenses this file to You under the Apache License, Version 2.0
7
+ (the "License"); you may not use this file except in compliance with
8
+ the License. You may obtain a copy of the License at
9
+
10
+ http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+ Unless required by applicable law or agreed to in writing, software
13
+ distributed under the License is distributed on an "AS IS" BASIS,
14
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ See the License for the specific language governing permissions and
16
+ limitations under the License.
17
+ -->
18
+
19
+ <!--
20
+ This is a stripped down config file used for a simple example...
21
+ It is *not* a good example to work from.
22
+ -->
23
+ <config>
24
+
25
+ <!-- Controls what version of Lucene various components of Solr
26
+ adhere to. Generally, you want to use the latest version to
27
+ get all bug fixes and improvements. It is highly recommended
28
+ that you fully re-index after changing this setting as it can
29
+ affect both how text is indexed and queried.
30
+ -->
31
+ <luceneMatchVersion>5.0.0</luceneMatchVersion>
32
+
33
+ <lib dir="${solr.install.dir:../../../..}/contrib/analysis-extras/lib" />
34
+ <lib dir="${solr.install.dir:../../../..}/contrib/analysis-extras/lucene-libs" />
35
+ <lib dir="${solr.install.dir:../../../..}/contrib/extraction/lib" regex=".*\.jar" />
36
+ <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-cell-\d.*\.jar" />
37
+
38
+ <directoryFactory name="DirectoryFactory"
39
+ class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}">
40
+ </directoryFactory>
41
+
42
+ <codecFactory class="solr.SchemaCodecFactory"/>
43
+
44
+ <schemaFactory class="ClassicIndexSchemaFactory"/>
45
+
46
+
47
+ <dataDir>${solr.blacklight-core.data.dir:}</dataDir>
48
+
49
+ <requestDispatcher handleSelect="true" >
50
+ <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="2048000" />
51
+ </requestDispatcher>
52
+
53
+ <requestHandler name="/analysis/field" startup="lazy" class="solr.FieldAnalysisRequestHandler" />
54
+
55
+ <!-- config for the admin interface -->
56
+ <admin>
57
+ <defaultQuery>*:*</defaultQuery>
58
+ </admin>
59
+
60
+ <!-- SearchHandler
61
+
62
+ http://wiki.apache.org/solr/SearchHandler
63
+
64
+ For processing Search Queries, the primary Request Handler
65
+ provided with Solr is "SearchHandler" It delegates to a sequent
66
+ of SearchComponents (see below) and supports distributed
67
+ queries across multiple shards
68
+ -->
69
+ <requestHandler name="search" class="solr.SearchHandler" default="true">
70
+ <!-- default values for query parameters can be specified, these
71
+ will be overridden by parameters in the request
72
+ -->
73
+ <lst name="defaults">
74
+ <str name="defType">edismax</str>
75
+ <str name="echoParams">explicit</str>
76
+ <str name="q.alt">*:*</str>
77
+ <str name="mm">2&lt;-1 5&lt;-2 6&lt;90%</str>
78
+ <int name="qs">1</int>
79
+ <int name="ps">2</int>
80
+ <float name="tie">0.01</float>
81
+ <!-- this qf and pf are used by default, if not otherwise specified by
82
+ client. The default blacklight_config will use these for the
83
+ "keywords" search. See the author_qf/author_pf, title_qf, etc
84
+ below, which the default blacklight_config will specify for
85
+ those searches. You may also be interested in:
86
+ http://wiki.apache.org/solr/LocalParams
87
+ -->
88
+ <str name="qf">
89
+ id
90
+ active_fedora_model_ssi
91
+ title_tesim
92
+ author_tesim
93
+ subject_tesim
94
+ </str>
95
+ <str name="pf">
96
+ all_text_timv^10
97
+ </str>
98
+
99
+ <str name="author_qf">
100
+ author_tesim
101
+ </str>
102
+ <str name="author_pf">
103
+ </str>
104
+ <str name="title_qf">
105
+ title_tesim
106
+ </str>
107
+ <str name="title_pf">
108
+ </str>
109
+ <str name="subject_qf">
110
+ subject_tesim
111
+ </str>
112
+ <str name="subject_pf">
113
+ </str>
114
+
115
+ <str name="fl">
116
+ *,
117
+ score
118
+ </str>
119
+
120
+ <str name="facet">true</str>
121
+ <str name="facet.mincount">1</str>
122
+ <str name="facet.limit">10</str>
123
+ <str name="facet.field">active_fedora_model_ssi</str>
124
+ <str name="facet.field">subject_sim</str>
125
+
126
+ <str name="spellcheck">true</str>
127
+ <str name="spellcheck.dictionary">default</str>
128
+ <str name="spellcheck.onlyMorePopular">true</str>
129
+ <str name="spellcheck.extendedResults">true</str>
130
+ <str name="spellcheck.collate">false</str>
131
+ <str name="spellcheck.count">5</str>
132
+
133
+ </lst>
134
+ <arr name="last-components">
135
+ <str>spellcheck</str>
136
+ </arr>
137
+ </requestHandler>
138
+
139
+ <requestHandler name="permissions" class="solr.SearchHandler" >
140
+ <lst name="defaults">
141
+ <str name="facet">off</str>
142
+ <str name="echoParams">all</str>
143
+ <str name="rows">1</str>
144
+ <str name="q">{!raw f=id v=$id}</str> <!-- use id=666 instead of q=id:666 -->
145
+ <str name="fl">
146
+ id,
147
+ access_ssim,
148
+ discover_access_group_ssim,discover_access_person_ssim,
149
+ read_access_group_ssim,read_access_person_ssim,
150
+ edit_access_group_ssim,edit_access_person_ssim,
151
+ depositor_ti,
152
+ embargo_release_date_dtsi
153
+ inheritable_access_ssim,
154
+ inheritable_discover_access_group_ssim,inheritable_discover_access_person_ssim,
155
+ inheritable_read_access_group_ssim,inheritable_read_access_person_ssim,
156
+ inheritable_edit_access_group_ssim,inheritable_edit_access_person_ssim,
157
+ inheritable_embargo_release_date_dtsi
158
+ </str>
159
+ </lst>
160
+ </requestHandler>
161
+
162
+ <requestHandler name="standard" class="solr.SearchHandler">
163
+ <lst name="defaults">
164
+ <str name="echoParams">explicit</str>
165
+ <str name="defType">lucene</str>
166
+ </lst>
167
+ </requestHandler>
168
+
169
+ <!-- for requests to get a single document; use id=666 instead of q=id:666 -->
170
+ <requestHandler name="document" class="solr.SearchHandler" >
171
+ <lst name="defaults">
172
+ <str name="echoParams">all</str>
173
+ <str name="fl">*</str>
174
+ <str name="rows">1</str>
175
+ <str name="q">{!term f=id v=$id}</str> <!-- use id=666 instead of q=id:666 -->
176
+ </lst>
177
+ </requestHandler>
178
+
179
+ <!-- Spell Check
180
+
181
+ The spell check component can return a list of alternative spelling
182
+ suggestions.
183
+
184
+ http://wiki.apache.org/solr/SpellCheckComponent
185
+ -->
186
+ <searchComponent name="spellcheck" class="solr.SpellCheckComponent">
187
+
188
+ <str name="queryAnalyzerFieldType">textSpell</str>
189
+
190
+ <!-- Multiple "Spell Checkers" can be declared and used by this
191
+ component
192
+ -->
193
+
194
+ <!-- a spellchecker built from a field of the main index, and
195
+ written to disk
196
+ -->
197
+ <lst name="spellchecker">
198
+ <str name="name">default</str>
199
+ <str name="field">spell</str>
200
+ <str name="spellcheckIndexDir">./spell</str>
201
+ <str name="buildOnOptimize">true</str>
202
+ </lst>
203
+ <lst name="spellchecker">
204
+ <str name="name">author</str>
205
+ <str name="field">author_spell</str>
206
+ <str name="spellcheckIndexDir">./spell_author</str>
207
+ <str name="accuracy">0.7</str>
208
+ <str name="buildOnOptimize">true</str>
209
+ </lst>
210
+ <lst name="spellchecker">
211
+ <str name="name">subject</str>
212
+ <str name="field">subject_spell</str>
213
+ <str name="spellcheckIndexDir">./spell_subject</str>
214
+ <str name="accuracy">0.7</str>
215
+ <str name="buildOnOptimize">true</str>
216
+ </lst>
217
+ <lst name="spellchecker">
218
+ <str name="name">title</str>
219
+ <str name="field">title_spell</str>
220
+ <str name="spellcheckIndexDir">./spell_title</str>
221
+ <str name="accuracy">0.7</str>
222
+ <str name="buildOnOptimize">true</str>
223
+ </lst>
224
+
225
+ <!-- a spellchecker that uses a different distance measure -->
226
+ <!--
227
+ <lst name="spellchecker">
228
+ <str name="name">jarowinkler</str>
229
+ <str name="field">spell</str>
230
+ <str name="distanceMeasure">
231
+ org.apache.lucene.search.spell.JaroWinklerDistance
232
+ </str>
233
+ <str name="spellcheckIndexDir">spellcheckerJaro</str>
234
+ </lst>
235
+ -->
236
+
237
+ <!-- a spellchecker that use an alternate comparator
238
+
239
+ comparatorClass be one of:
240
+ 1. score (default)
241
+ 2. freq (Frequency first, then score)
242
+ 3. A fully qualified class name
243
+ -->
244
+ <!--
245
+ <lst name="spellchecker">
246
+ <str name="name">freq</str>
247
+ <str name="field">lowerfilt</str>
248
+ <str name="spellcheckIndexDir">spellcheckerFreq</str>
249
+ <str name="comparatorClass">freq</str>
250
+ <str name="buildOnCommit">true</str>
251
+ -->
252
+
253
+ <!-- A spellchecker that reads the list of words from a file -->
254
+ <!--
255
+ <lst name="spellchecker">
256
+ <str name="classname">solr.FileBasedSpellChecker</str>
257
+ <str name="name">file</str>
258
+ <str name="sourceLocation">spellings.txt</str>
259
+ <str name="characterEncoding">UTF-8</str>
260
+ <str name="spellcheckIndexDir">spellcheckerFile</str>
261
+ </lst>
262
+ -->
263
+ </searchComponent>
264
+
265
+ <searchComponent name="suggest" class="solr.SuggestComponent">
266
+ <lst name="suggester">
267
+ <str name="name">mySuggester</str>
268
+ <str name="lookupImpl">FuzzyLookupFactory</str>
269
+ <str name="suggestAnalyzerFieldType">textSuggest</str>
270
+ <str name="buildOnCommit">true</str>
271
+ <str name="field">suggest</str>
272
+ </lst>
273
+ </searchComponent>
274
+
275
+ <requestHandler name="/suggest" class="solr.SearchHandler" startup="lazy">
276
+ <lst name="defaults">
277
+ <str name="suggest">true</str>
278
+ <str name="suggest.count">5</str>
279
+ <str name="suggest.dictionary">mySuggester</str>
280
+ </lst>
281
+ <arr name="components">
282
+ <str>suggest</str>
283
+ </arr>
284
+ </requestHandler>
285
+
286
+ <requestHandler name="/update/extract" class="org.apache.solr.handler.extraction.ExtractingRequestHandler">
287
+ <lst name="defaults">
288
+ <str name="fmap.Last-Modified">last_modified</str>
289
+ <str name="uprefix">ignored_</str>
290
+ </lst>
291
+ <!--Optional. Specify a path to a tika configuration file. See the Tika docs for details.-->
292
+ <!-- <str name="tika.config">/my/path/to/tika.config</str> -->
293
+ <!-- Optional. Specify one or more date formats to parse. See DateUtil.DEFAULT_DATE_FORMATS
294
+ for default date formats -->
295
+ <!-- <lst name="date.formats"> -->
296
+ <!-- <str>yyyy&#45;MM&#45;dd</str> -->
297
+ <!-- </lst> -->
298
+ </requestHandler>
299
+ </config>
300
+
@@ -0,0 +1,2 @@
1
+ pizza
2
+ history
@@ -0,0 +1,58 @@
1
+ # Licensed to the Apache Software Foundation (ASF) under one or more
2
+ # contributor license agreements. See the NOTICE file distributed with
3
+ # this work for additional information regarding copyright ownership.
4
+ # The ASF licenses this file to You under the Apache License, Version 2.0
5
+ # (the "License"); you may not use this file except in compliance with
6
+ # the License. You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ #-----------------------------------------------------------------------
17
+ # a couple of test stopwords to test that the words are really being
18
+ # configured from this file:
19
+ stopworda
20
+ stopwordb
21
+
22
+ #Standard english stop words taken from Lucene's StopAnalyzer
23
+ a
24
+ an
25
+ and
26
+ are
27
+ as
28
+ at
29
+ be
30
+ but
31
+ by
32
+ for
33
+ if
34
+ in
35
+ into
36
+ is
37
+ it
38
+ no
39
+ not
40
+ of
41
+ on
42
+ or
43
+ s
44
+ such
45
+ t
46
+ that
47
+ the
48
+ their
49
+ then
50
+ there
51
+ these
52
+ they
53
+ this
54
+ to
55
+ was
56
+ will
57
+ with
58
+
@@ -0,0 +1,58 @@
1
+ # Licensed to the Apache Software Foundation (ASF) under one or more
2
+ # contributor license agreements. See the NOTICE file distributed with
3
+ # this work for additional information regarding copyright ownership.
4
+ # The ASF licenses this file to You under the Apache License, Version 2.0
5
+ # (the "License"); you may not use this file except in compliance with
6
+ # the License. You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ #-----------------------------------------------------------------------
17
+ # a couple of test stopwords to test that the words are really being
18
+ # configured from this file:
19
+ stopworda
20
+ stopwordb
21
+
22
+ #Standard english stop words taken from Lucene's StopAnalyzer
23
+ a
24
+ an
25
+ and
26
+ are
27
+ as
28
+ at
29
+ be
30
+ but
31
+ by
32
+ for
33
+ if
34
+ in
35
+ into
36
+ is
37
+ it
38
+ no
39
+ not
40
+ of
41
+ on
42
+ or
43
+ s
44
+ such
45
+ t
46
+ that
47
+ the
48
+ their
49
+ then
50
+ there
51
+ these
52
+ they
53
+ this
54
+ to
55
+ was
56
+ will
57
+ with
58
+
@@ -0,0 +1,31 @@
1
+ # The ASF licenses this file to You under the Apache License, Version 2.0
2
+ # (the "License"); you may not use this file except in compliance with
3
+ # the License. You may obtain a copy of the License at
4
+ #
5
+ # http://www.apache.org/licenses/LICENSE-2.0
6
+ #
7
+ # Unless required by applicable law or agreed to in writing, software
8
+ # distributed under the License is distributed on an "AS IS" BASIS,
9
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ # See the License for the specific language governing permissions and
11
+ # limitations under the License.
12
+
13
+ #-----------------------------------------------------------------------
14
+ #some test synonym mappings unlikely to appear in real input text
15
+ aaa => aaaa
16
+ bbb => bbbb1 bbbb2
17
+ ccc => cccc1,cccc2
18
+ a\=>a => b\=>b
19
+ a\,a => b\,b
20
+ fooaaa,baraaa,bazaaa
21
+
22
+ # Some synonym groups specific to this example
23
+ GB,gib,gigabyte,gigabytes
24
+ MB,mib,megabyte,megabytes
25
+ Television, Televisions, TV, TVs
26
+ #notice we use "gib" instead of "GiB" so any WordDelimiterFilter coming
27
+ #after us won't split it into two words.
28
+
29
+ # Synonym mappings can be used for spelling correction too
30
+ pixima => pixma
31
+
@@ -0,0 +1,132 @@
1
+ <?xml version='1.0' encoding='UTF-8'?>
2
+
3
+ <!--
4
+ * Licensed to the Apache Software Foundation (ASF) under one or more
5
+ * contributor license agreements. See the NOTICE file distributed with
6
+ * this work for additional information regarding copyright ownership.
7
+ * The ASF licenses this file to You under the Apache License, Version 2.0
8
+ * (the "License"); you may not use this file except in compliance with
9
+ * the License. You may obtain a copy of the License at
10
+ *
11
+ * http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ -->
19
+
20
+ <!--
21
+ Simple transform of Solr query results to HTML
22
+ -->
23
+ <xsl:stylesheet version='1.0'
24
+ xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
25
+ >
26
+
27
+ <xsl:output media-type="text/html; charset=UTF-8" encoding="UTF-8"/>
28
+
29
+ <xsl:variable name="title" select="concat('Solr search results (',response/result/@numFound,' documents)')"/>
30
+
31
+ <xsl:template match='/'>
32
+ <html>
33
+ <head>
34
+ <title><xsl:value-of select="$title"/></title>
35
+ <xsl:call-template name="css"/>
36
+ </head>
37
+ <body>
38
+ <h1><xsl:value-of select="$title"/></h1>
39
+ <div class="note">
40
+ This has been formatted by the sample "example.xsl" transform -
41
+ use your own XSLT to get a nicer page
42
+ </div>
43
+ <xsl:apply-templates select="response/result/doc"/>
44
+ </body>
45
+ </html>
46
+ </xsl:template>
47
+
48
+ <xsl:template match="doc">
49
+ <xsl:variable name="pos" select="position()"/>
50
+ <div class="doc">
51
+ <table width="100%">
52
+ <xsl:apply-templates>
53
+ <xsl:with-param name="pos"><xsl:value-of select="$pos"/></xsl:with-param>
54
+ </xsl:apply-templates>
55
+ </table>
56
+ </div>
57
+ </xsl:template>
58
+
59
+ <xsl:template match="doc/*[@name='score']" priority="100">
60
+ <xsl:param name="pos"></xsl:param>
61
+ <tr>
62
+ <td class="name">
63
+ <xsl:value-of select="@name"/>
64
+ </td>
65
+ <td class="value">
66
+ <xsl:value-of select="."/>
67
+
68
+ <xsl:if test="boolean(//lst[@name='explain'])">
69
+ <xsl:element name="a">
70
+ <!-- can't allow whitespace here -->
71
+ <xsl:attribute name="href">javascript:toggle("<xsl:value-of select="concat('exp-',$pos)" />");</xsl:attribute>?</xsl:element>
72
+ <br/>
73
+ <xsl:element name="div">
74
+ <xsl:attribute name="class">exp</xsl:attribute>
75
+ <xsl:attribute name="id">
76
+ <xsl:value-of select="concat('exp-',$pos)" />
77
+ </xsl:attribute>
78
+ <xsl:value-of select="//lst[@name='explain']/str[position()=$pos]"/>
79
+ </xsl:element>
80
+ </xsl:if>
81
+ </td>
82
+ </tr>
83
+ </xsl:template>
84
+
85
+ <xsl:template match="doc/arr" priority="100">
86
+ <tr>
87
+ <td class="name">
88
+ <xsl:value-of select="@name"/>
89
+ </td>
90
+ <td class="value">
91
+ <ul>
92
+ <xsl:for-each select="*">
93
+ <li><xsl:value-of select="."/></li>
94
+ </xsl:for-each>
95
+ </ul>
96
+ </td>
97
+ </tr>
98
+ </xsl:template>
99
+
100
+
101
+ <xsl:template match="doc/*">
102
+ <tr>
103
+ <td class="name">
104
+ <xsl:value-of select="@name"/>
105
+ </td>
106
+ <td class="value">
107
+ <xsl:value-of select="."/>
108
+ </td>
109
+ </tr>
110
+ </xsl:template>
111
+
112
+ <xsl:template match="*"/>
113
+
114
+ <xsl:template name="css">
115
+ <script>
116
+ function toggle(id) {
117
+ var obj = document.getElementById(id);
118
+ obj.style.display = (obj.style.display != 'block') ? 'block' : 'none';
119
+ }
120
+ </script>
121
+ <style type="text/css">
122
+ body { font-family: "Lucida Grande", sans-serif }
123
+ td.name { font-style: italic; font-size:80%; }
124
+ td { vertical-align: top; }
125
+ ul { margin: 0px; margin-left: 1em; padding: 0px; }
126
+ .note { font-size:80%; }
127
+ .doc { margin-top: 1em; border-top: solid grey 1px; }
128
+ .exp { display: none; font-family: monospace; white-space: pre; }
129
+ </style>
130
+ </xsl:template>
131
+
132
+ </xsl:stylesheet>
@@ -0,0 +1,67 @@
1
+ <?xml version='1.0' encoding='UTF-8'?>
2
+
3
+ <!--
4
+ * Licensed to the Apache Software Foundation (ASF) under one or more
5
+ * contributor license agreements. See the NOTICE file distributed with
6
+ * this work for additional information regarding copyright ownership.
7
+ * The ASF licenses this file to You under the Apache License, Version 2.0
8
+ * (the "License"); you may not use this file except in compliance with
9
+ * the License. You may obtain a copy of the License at
10
+ *
11
+ * http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ -->
19
+
20
+ <!--
21
+ Simple transform of Solr query results to Atom
22
+ -->
23
+
24
+ <xsl:stylesheet version='1.0'
25
+ xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
26
+
27
+ <xsl:output
28
+ method="xml"
29
+ encoding="utf-8"
30
+ media-type="text/xml; charset=UTF-8"
31
+ />
32
+
33
+ <xsl:template match='/'>
34
+ <xsl:variable name="query" select="response/lst[@name='responseHeader']/lst[@name='params']/str[@name='q']"/>
35
+ <feed xmlns="http://www.w3.org/2005/Atom">
36
+ <title>Example Solr Atom 1.0 Feed</title>
37
+ <subtitle>
38
+ This has been formatted by the sample "example_atom.xsl" transform -
39
+ use your own XSLT to get a nicer Atom feed.
40
+ </subtitle>
41
+ <author>
42
+ <name>Apache Solr</name>
43
+ <email>solr-user@lucene.apache.org</email>
44
+ </author>
45
+ <link rel="self" type="application/atom+xml"
46
+ href="http://localhost:8983/solr/q={$query}&amp;wt=xslt&amp;tr=atom.xsl"/>
47
+ <updated>
48
+ <xsl:value-of select="response/result/doc[position()=1]/date[@name='timestamp']"/>
49
+ </updated>
50
+ <id>tag:localhost,2007:example</id>
51
+ <xsl:apply-templates select="response/result/doc"/>
52
+ </feed>
53
+ </xsl:template>
54
+
55
+ <!-- search results xslt -->
56
+ <xsl:template match="doc">
57
+ <xsl:variable name="id" select="str[@name='id']"/>
58
+ <entry>
59
+ <title><xsl:value-of select="str[@name='name']"/></title>
60
+ <link href="http://localhost:8983/solr/select?q={$id}"/>
61
+ <id>tag:localhost,2007:<xsl:value-of select="$id"/></id>
62
+ <summary><xsl:value-of select="arr[@name='features']"/></summary>
63
+ <updated><xsl:value-of select="date[@name='timestamp']"/></updated>
64
+ </entry>
65
+ </xsl:template>
66
+
67
+ </xsl:stylesheet>