hydra-core 5.0.0.pre11 → 5.0.0.pre12

Sign up to get free protection for your applications and to get access to all the features.
@@ -15,13 +15,14 @@ Gem::Specification.new do |gem|
15
15
  gem.name = "hydra-core"
16
16
  gem.require_paths = ["lib"]
17
17
  gem.version = version
18
- # gem.required_ruby_version = '>= 1.9.3'
18
+
19
+ gem.required_ruby_version = '>= 1.9.3'
19
20
 
20
21
 
21
22
  gem.add_dependency "rails", '~>3.2.3'
22
- gem.add_dependency "blacklight", '~>3.4'
23
+ gem.add_dependency "blacklight", '~>4.0.0.pre4'
23
24
  gem.add_dependency "devise"
24
- gem.add_dependency "active-fedora", '~>5.0.0.rc1'
25
+ gem.add_dependency "active-fedora", '~>5.0.0.rc3'
25
26
  gem.add_dependency 'RedCloth', '=4.2.9'
26
27
  gem.add_dependency 'block_helpers'
27
28
  gem.add_dependency 'sanitize'
@@ -35,6 +36,6 @@ Gem::Specification.new do |gem|
35
36
  gem.add_development_dependency 'jettywrapper', ">=1.3.1"
36
37
  gem.add_development_dependency 'rspec-rails'
37
38
  gem.add_development_dependency 'cucumber-rails', '>=1.2.0'
38
- gem.add_development_dependency 'factory_girl_rails', '<2.0.0' #>=2.0.0 requires ruby 1.9
39
+ gem.add_development_dependency 'factory_girl_rails'
39
40
  gem.add_development_dependency 'solrizer-fedora', '>=2.1.0'
40
41
  end
@@ -73,15 +73,6 @@ EOF
73
73
  end
74
74
  end
75
75
 
76
- #
77
- # Static Assets
78
- #
79
- # Call external generator in AssetsGenerator, which copies static assets like stylesheets, javascript and images
80
- # into the app's public directory
81
- def copy_public_assets
82
- generate "hydra:assets"
83
- end
84
-
85
76
  #
86
77
  # Migrations
87
78
  #
@@ -175,7 +175,7 @@
175
175
  />
176
176
  <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/>
177
177
  <filter class="solr.LowerCaseFilterFactory"/>
178
- <filter class="solr.EnglishPorterFilterFactory" protected="protwords.txt"/>
178
+ <filter class="solr.SnowballPorterFilterFactory" language="English"/>
179
179
  <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
180
180
  </analyzer>
181
181
  <analyzer type="query">
@@ -184,7 +184,7 @@
184
184
  <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
185
185
  <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
186
186
  <filter class="solr.LowerCaseFilterFactory"/>
187
- <filter class="solr.EnglishPorterFilterFactory" protected="protwords.txt"/>
187
+ <filter class="solr.SnowballPorterFilterFactory" language="English"/>
188
188
  <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
189
189
  </analyzer>
190
190
  </fieldType>
@@ -199,7 +199,7 @@
199
199
  <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
200
200
  <filter class="solr.WordDelimiterFilterFactory" generateWordParts="0" generateNumberParts="0" catenateWords="1" catenateNumbers="1" catenateAll="0"/>
201
201
  <filter class="solr.LowerCaseFilterFactory"/>
202
- <filter class="solr.EnglishPorterFilterFactory" protected="protwords.txt"/>
202
+ <filter class="solr.SnowballPorterFilterFactory" language="English"/>
203
203
  <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
204
204
  </analyzer>
205
205
  </fieldType>
@@ -250,6 +250,10 @@
250
250
  <field name="text" type="text" indexed="true" stored="true" multiValued="true"/>
251
251
  <field name="timestamp" type="date" indexed="true" stored="true" default="NOW" multiValued="false"/>
252
252
 
253
+ <!-- These pub_date fields are just for testing hydra and can be removed -->
254
+ <field name="pub_date" type="string" indexed="true" stored="true" multiValued="true"/>
255
+ <field name="pub_date_sort" type="sint" indexed="true" stored="true" multiValued="false"/>
256
+
253
257
  <!-- format is used for facet, display, and choosing which partial to use for the show view, so it must be stored and indexed -->
254
258
  <field name="format" type="string" indexed="true" stored="true"/>
255
259
 
@@ -264,7 +268,7 @@
264
268
 
265
269
  <dynamicField name="random*" type="random" />
266
270
 
267
- <dynamicField name="*_sort" type="string" indexed="true" stored="false" multiValued="true" />
271
+ <dynamicField name="*_sort" type="string" indexed="true" stored="false" multiValued="false" />
268
272
  <dynamicField name="*_facet" type="string" indexed="true" stored="true" multiValued="true" />
269
273
  <dynamicField name="*_display" type="string" indexed="false" stored="true" multiValued="true" />
270
274
 
@@ -274,5 +278,6 @@
274
278
  <defaultSearchField>text</defaultSearchField>
275
279
  <solrQueryParser defaultOperator="AND" />
276
280
  <copyField source="*_facet" dest="text" />
281
+ <copyField source="pub_date" dest="pub_date_sort"/>
277
282
 
278
- </schema>
283
+ </schema>
@@ -17,387 +17,69 @@
17
17
  -->
18
18
 
19
19
  <config>
20
- <!-- Set this to 'false' if you want solr to continue working after it has
21
- encountered an severe configuration error. In a production environment,
22
- you may want solr to keep working even if one handler is mis-configured.
20
+ <luceneMatchVersion>LUCENE_40</luceneMatchVersion>
23
21
 
24
- You may also set this to false using by setting the system property:
25
- -Dsolr.abortOnConfigurationError=false
26
- -->
27
- <abortOnConfigurationError>${solr.abortOnConfigurationError:true}</abortOnConfigurationError>
28
-
29
- <!-- Used to specify an alternate directory to hold all index data
30
- other than the default ./data under the Solr home.
31
- If replication is in use, this should match the replication configuration. -->
32
- <!-- <dataDir>${solr.data.dir:./solr/data/salt}</dataDir>
33
- -->
34
-
35
- <indexDefaults>
36
- <!-- Values here affect all index writers and act as a default unless overridden. -->
37
- <useCompoundFile>false</useCompoundFile>
38
-
39
- <mergeFactor>10</mergeFactor>
40
- <!--
41
- If both ramBufferSizeMB and maxBufferedDocs is set, then Lucene will flush based on whichever limit is hit first.
42
-
43
- -->
44
- <!--<maxBufferedDocs>1000</maxBufferedDocs>-->
45
- <!-- Tell Lucene when to flush documents to disk.
46
- Giving Lucene more memory for indexing means faster indexing at the cost of more RAM
47
-
48
- If both ramBufferSizeMB and maxBufferedDocs is set, then Lucene will flush based on whichever limit is hit first.
49
-
50
- -->
51
- <ramBufferSizeMB>32</ramBufferSizeMB>
52
- <maxMergeDocs>2147483647</maxMergeDocs>
53
- <maxFieldLength>10000</maxFieldLength>
54
- <writeLockTimeout>1000</writeLockTimeout>
55
- <commitLockTimeout>10000</commitLockTimeout>
56
-
57
- <!--
58
- Expert: Turn on Lucene's auto commit capability.
59
- This causes intermediate segment flushes to write a new lucene
60
- index descriptor, enabling it to be opened by an external
61
- IndexReader.
62
- NOTE: Despite the name, this value does not have any relation to Solr's autoCommit functionality
63
- -->
64
- <!--<luceneAutoCommit>false</luceneAutoCommit>-->
65
- <!--
66
- Expert:
67
- The Merge Policy in Lucene controls how merging is handled by Lucene. The default in 2.3 is the LogByteSizeMergePolicy, previous
68
- versions used LogDocMergePolicy.
69
-
70
- LogByteSizeMergePolicy chooses segments to merge based on their size. The Lucene 2.2 default, LogDocMergePolicy chose when
71
- to merge based on number of documents
72
-
73
- Other implementations of MergePolicy must have a no-argument constructor
74
- -->
75
- <!--<mergePolicy>org.apache.lucene.index.LogByteSizeMergePolicy</mergePolicy>-->
76
-
77
- <!--
78
- Expert:
79
- The Merge Scheduler in Lucene controls how merges are performed. The ConcurrentMergeScheduler (Lucene 2.3 default)
80
- can perform merges in the background using separate threads. The SerialMergeScheduler (Lucene 2.2 default) does not.
81
- -->
82
- <!--<mergeScheduler>org.apache.lucene.index.ConcurrentMergeScheduler</mergeScheduler>-->
83
-
84
- <!--
85
- This option specifies which Lucene LockFactory implementation to use.
86
-
87
- single = SingleInstanceLockFactory - suggested for a read-only index
88
- or when there is no possibility of another process trying
89
- to modify the index.
90
- native = NativeFSLockFactory
91
- simple = SimpleFSLockFactory
92
-
93
- (For backwards compatibility with Solr 1.2, 'simple' is the default
94
- if not specified.)
95
- -->
96
- <lockType>single</lockType>
97
- </indexDefaults>
98
-
99
- <mainIndex>
100
- <!-- options specific to the main on-disk lucene index -->
101
- <useCompoundFile>false</useCompoundFile>
102
- <ramBufferSizeMB>32</ramBufferSizeMB>
103
- <mergeFactor>10</mergeFactor>
104
- <!-- Deprecated -->
105
- <!--<maxBufferedDocs>1000</maxBufferedDocs>-->
106
- <maxMergeDocs>2147483647</maxMergeDocs>
107
- <maxFieldLength>10000</maxFieldLength>
108
-
109
- <!-- If true, unlock any held write or commit locks on startup.
110
- This defeats the locking mechanism that allows multiple
111
- processes to safely access a lucene index, and should be
112
- used with care.
113
- This is not needed if lock type is 'none' or 'single'
114
- -->
115
- <unlockOnStartup>false</unlockOnStartup>
116
- </mainIndex>
22
+ <!-- The DirectoryFactory to use for indexes.
23
+ solr.StandardDirectoryFactory, the default, is filesystem based.
24
+ solr.RAMDirectoryFactory is memory based, not persistent, and doesn't work with replication. -->
25
+ <directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.StandardDirectoryFactory}"/>
117
26
 
118
- <!-- Enables JMX if and only if an existing MBeanServer is found, use
119
- this if you want to configure JMX through JVM parameters. Remove
120
- this to disable exposing Solr configuration and statistics to JMX.
121
-
122
- If you want to connect to a particular server, specify the agentId
123
- e.g. <jmx agentId="myAgent" />
124
-
125
- If you want to start a new MBeanServer, specify the serviceUrl
126
- e.g <jmx serviceurl="service:jmx:rmi:///jndi/rmi://localhost:9999/solr" />
127
-
128
- For more details see http://wiki.apache.org/solr/SolrJmx
129
- -->
130
- <jmx />
131
-
132
- <!-- the default high-performance update handler -->
133
- <updateHandler class="solr.DirectUpdateHandler2">
134
-
135
- <!-- A prefix of "solr." for class names is an alias that
136
- causes solr to search appropriate packages, including
137
- org.apache.solr.(search|update|request|core|analysis)
138
- -->
139
-
140
- <!-- Perform a <commit/> automatically under certain conditions:
141
- maxDocs - number of updates since last commit is greater than this
142
- maxTime - oldest uncommited update (in ms) is this long ago
143
- <autoCommit>
144
- <maxDocs>10000</maxDocs>
145
- <maxTime>1000</maxTime>
146
- </autoCommit>
147
- -->
148
-
149
- <!-- The RunExecutableListener executes an external command.
150
- exe - the name of the executable to run
151
- dir - dir to use as the current working directory. default="."
152
- wait - the calling thread waits until the executable returns. default="true"
153
- args - the arguments to pass to the program. default=nothing
154
- env - environment variables to set. default=nothing
155
- -->
156
- <!-- A postCommit event is fired after every commit or optimize command
157
- <listener event="postCommit" class="solr.RunExecutableListener">
158
- <str name="exe">solr/bin/snapshooter</str>
159
- <str name="dir">.</str>
160
- <bool name="wait">true</bool>
161
- <arr name="args"> <str>arg1</str> <str>arg2</str> </arr>
162
- <arr name="env"> <str>MYVAR=val1</str> </arr>
163
- </listener>
164
- -->
165
- <!-- A postOptimize event is fired only after every optimize command, useful
166
- in conjunction with index distribution to only distribute optimized indicies
167
- <listener event="postOptimize" class="solr.RunExecutableListener">
168
- <str name="exe">snapshooter</str>
169
- <str name="dir">solr/bin</str>
170
- <bool name="wait">true</bool>
171
- </listener>
172
- -->
173
-
174
- </updateHandler>
175
-
176
-
177
- <query>
178
- <!-- Maximum number of clauses in a boolean query... can affect
179
- range or prefix queries that expand to big boolean
180
- queries. An exception is thrown if exceeded. -->
181
- <maxBooleanClauses>1024</maxBooleanClauses>
27
+ <lib dir="../lib/contrib/analysis-extras/lib" />
28
+ <lib dir="../lib/contrib/analysis-extras/lucene-libs" />
182
29
 
183
-
184
- <!-- Cache used by SolrIndexSearcher for filters (DocSets),
185
- unordered sets of *all* documents that match a query.
186
- When a new searcher is opened, its caches may be prepopulated
187
- or "autowarmed" using data from caches in the old searcher.
188
- autowarmCount is the number of items to prepopulate. For LRUCache,
189
- the autowarmed items will be the most recently accessed items.
190
- Parameters:
191
- class - the SolrCache implementation (currently only LRUCache)
192
- size - the maximum number of entries in the cache
193
- initialSize - the initial capacity (number of entries) of
194
- the cache. (seel java.util.HashMap)
195
- autowarmCount - the number of entries to prepopulate from
196
- and old cache.
197
- -->
198
- <filterCache
199
- class="solr.LRUCache"
200
- size="512"
201
- initialSize="512"
202
- autowarmCount="128"/>
203
-
204
- <!-- queryResultCache caches results of searches - ordered lists of
205
- document ids (DocList) based on a query, a sort, and the range
206
- of documents requested. -->
207
- <queryResultCache
208
- class="solr.LRUCache"
209
- size="512"
210
- initialSize="512"
211
- autowarmCount="32"/>
212
-
213
- <!-- documentCache caches Lucene Document objects (the stored fields for each document).
214
- Since Lucene internal document ids are transient, this cache will not be autowarmed. -->
215
- <documentCache
216
- class="solr.LRUCache"
217
- size="512"
218
- initialSize="512"
219
- autowarmCount="0"/>
220
-
221
- <!-- If true, stored fields that are not requested will be loaded lazily.
222
-
223
- This can result in a significant speed improvement if the usual case is to
224
- not load all stored fields, especially if the skipped fields are large compressed
225
- text fields.
226
- -->
227
- <enableLazyFieldLoading>true</enableLazyFieldLoading>
228
-
229
- <!-- Example of a generic cache. These caches may be accessed by name
230
- through SolrIndexSearcher.getCache(),cacheLookup(), and cacheInsert().
231
- The purpose is to enable easy caching of user/application level data.
232
- The regenerator argument should be specified as an implementation
233
- of solr.search.CacheRegenerator if autowarming is desired. -->
234
- <!--
235
- <cache name="myUserCache"
236
- class="solr.LRUCache"
237
- size="4096"
238
- initialSize="1024"
239
- autowarmCount="1024"
240
- regenerator="org.mycompany.mypackage.MyRegenerator"
241
- />
242
- -->
243
-
244
- <!-- An optimization that attempts to use a filter to satisfy a search.
245
- If the requested sort does not include score, then the filterCache
246
- will be checked for a filter matching the query. If found, the filter
247
- will be used as the source of document ids, and then the sort will be
248
- applied to that.
249
- <useFilterForSortedQuery>true</useFilterForSortedQuery>
250
- -->
251
-
252
- <!-- An optimization for use with the queryResultCache. When a search
253
- is requested, a superset of the requested number of document ids
254
- are collected. For example, if a search for a particular query
255
- requests matching documents 10 through 19, and queryWindowSize is 50,
256
- then documents 0 through 49 will be collected and cached. Any further
257
- requests in that range can be satisfied via the cache. -->
258
- <queryResultWindowSize>50</queryResultWindowSize>
259
-
260
- <!-- Maximum number of documents to cache for any entry in the
261
- queryResultCache. -->
262
- <queryResultMaxDocsCached>200</queryResultMaxDocsCached>
263
-
264
- <!-- This entry enables an int hash representation for filters (DocSets)
265
- when the number of items in the set is less than maxSize. For smaller
266
- sets, this representation is more memory efficient, more efficient to
267
- iterate over, and faster to take intersections. -->
268
- <HashDocSet maxSize="3000" loadFactor="0.75"/>
269
-
270
- <!-- a newSearcher event is fired whenever a new searcher is being prepared
271
- and there is a current searcher handling requests (aka registered). -->
272
- <!-- QuerySenderListener takes an array of NamedList and executes a
273
- local query request for each NamedList in sequence. -->
274
- <listener event="newSearcher" class="solr.QuerySenderListener">
275
- <arr name="queries">
276
- <lst> <str name="q">solr</str> <str name="start">0</str> <str name="rows">10</str> </lst>
277
- <lst> <str name="q">rocks</str> <str name="start">0</str> <str name="rows">10</str> </lst>
278
- <lst><str name="q">static newSearcher warming query from solrconfig.xml</str></lst>
279
- </arr>
280
- </listener>
281
-
282
- <!-- a firstSearcher event is fired whenever a new searcher is being
283
- prepared but there is no current registered searcher to handle
284
- requests or to gain autowarming data from. -->
285
- <listener event="firstSearcher" class="solr.QuerySenderListener">
286
- <arr name="queries">
287
- <lst> <str name="q">fast_warm</str> <str name="start">0</str> <str name="rows">10</str> </lst>
288
- <lst><str name="q">static firstSearcher warming query from solrconfig.xml</str></lst>
289
- </arr>
290
- </listener>
291
-
292
- <!-- If a search request comes in and there is no current registered searcher,
293
- then immediately register the still warming searcher and use it. If
294
- "false" then all requests will block until the first searcher is done
295
- warming. -->
296
- <useColdSearcher>false</useColdSearcher>
297
-
298
- <!-- Maximum number of searchers that may be warming in the background
299
- concurrently. An error is returned if this limit is exceeded. Recommend
300
- 1-2 for read-only slaves, higher for masters w/o cache warming. -->
301
- <maxWarmingSearchers>2</maxWarmingSearchers>
302
-
303
- </query>
30
+ <dataDir>${solr.data.dir:}</dataDir>
31
+
32
+ <requestHandler name="/replication" class="solr.ReplicationHandler" startup="lazy" />
304
33
 
305
- <!--
306
- Let the dispatch filter handler /select?qt=XXX
307
- handleSelect=true will use consistent error handling for /select and /update
308
- handleSelect=false will use solr1.1 style error formatting
309
- -->
310
34
  <requestDispatcher handleSelect="true" >
311
- <!--Make sure your system has some authentication before enabling remote streaming! -->
312
35
  <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="2048" />
313
-
314
- <!-- Set HTTP caching related parameters (for proxy caches and clients).
315
-
316
- To get the behaviour of Solr 1.2 (ie: no caching related headers)
317
- use the never304="true" option and do not specify a value for
318
- <cacheControl>
319
- -->
320
- <!-- <httpCaching never304="true"> -->
321
- <httpCaching lastModifiedFrom="openTime"
322
- etagSeed="Solr">
323
- <!-- lastModFrom="openTime" is the default, the Last-Modified value
324
- (and validation against If-Modified-Since requests) will all be
325
- relative to when the current Searcher was opened.
326
- You can change it to lastModFrom="dirLastMod" if you want the
327
- value to exactly corrispond to when the physical index was last
328
- modified.
329
-
330
- etagSeed="..." is an option you can change to force the ETag
331
- header (and validation against If-None-Match requests) to be
332
- differnet even if the index has not changed (ie: when making
333
- significant changes to your config file)
334
-
335
- lastModifiedFrom and etagSeed are both ignored if you use the
336
- never304="true" option.
337
- -->
338
- <!-- If you include a <cacheControl> directive, it will be used to
339
- generate a Cache-Control header, as well as an Expires header
340
- if the value contains "max-age="
341
-
342
- By default, no Cache-Control header is generated.
343
-
344
- You can use the <cacheControl> option even if you have set
345
- never304="true"
346
- -->
347
- <!-- <cacheControl>max-age=30, public</cacheControl> -->
348
- </httpCaching>
349
36
  </requestDispatcher>
350
-
351
-
352
- <!-- requestHandler plugins... incoming queries will be dispatched to the
353
- correct handler based on the path or the qt (query type) param.
354
- Names starting with a '/' are accessed with the a path equal to the
355
- registered name. Names without a leading '/' are accessed with:
356
- http://host/app/select?qt=name
357
- If no qt is defined, the requestHandler that declares default="true"
358
- will be used.
359
- -->
360
- <requestHandler name="standard" class="solr.SearchHandler" default="true">
361
- <!-- default values for query parameters -->
362
- <lst name="defaults">
363
- <str name="echoParams">explicit</str>
364
- <!--
365
- <int name="rows">10</int>
366
- <str name="fl">*</str>
367
- <str name="version">2.1</str>
368
- -->
369
- </lst>
370
- </requestHandler>
371
-
372
37
 
38
+
39
+ <requestHandler name="/analysis/field" startup="lazy" class="solr.FieldAnalysisRequestHandler" />
40
+ <requestHandler name="/update" class="solr.UpdateRequestHandler" />
41
+ <requestHandler name="/admin/" class="org.apache.solr.handler.admin.AdminHandlers" />
42
+
43
+ <requestHandler name="/admin/ping" class="solr.PingRequestHandler">
44
+ <lst name="invariants">
45
+ <str name="q">solrpingquery</str>
46
+ </lst>
47
+ <lst name="defaults">
48
+ <str name="echoParams">all</str>
49
+ </lst>
50
+ </requestHandler>
51
+
52
+ <!-- config for the admin interface -->
53
+ <admin>
54
+ <defaultQuery>solr</defaultQuery>
55
+ </admin>
56
+
373
57
  <requestHandler name="search" class="solr.SearchHandler" default="true" >
374
58
  <lst name="defaults">
375
- <str name="defType">dismax</str>
376
- <str name="facet">on</str>
59
+ <str name="defType">dismax</str>
60
+ <str name="facet">on</str>
377
61
  <str name="facet.mincount">1</str>
378
- <str name="echoParams">explicit</str>
379
- <float name="tie">0.01</float>
380
- <str name="qf">id^0.8 id_t^0.8 format text^0.3</str>
381
- <str name="pf">id^0.9 id_t^0.9 text^0.5</str>
62
+ <str name="echoParams">explicit</str>
63
+ <float name="tie">0.01</float>
64
+ <str name="qf">id^0.8 id_t^0.8 format text^0.3</str>
65
+ <str name="pf">id^0.9 id_t^0.9 text^0.5</str>
382
66
  <str name="fl">
383
67
  id,text,title_t,date_t,year_facet,month_facet,medium_t,series_facet,box_facet,folder_facet,has_model_s
384
- </str>
385
- <str name="mm">
68
+ </str>
69
+ <str name="mm">
386
70
  2&lt;-1 5&lt;-2 6&lt;90%
387
- </str>
388
- <int name="ps">100</int>
389
- <str name="q.alt">*:*</str>
390
- <!-- example highlighter config, enable per-query with hl=true -->
391
- <str name="hl.fl">text features name</str>
392
- <!-- for this field, we want no fragmenting, just highlighting -->
393
- <str name="f.name.hl.fragsize">0</str>
394
- <!-- instructs Solr to return the field itself if no query terms are
395
- found -->
396
- <str name="f.name.hl.alternateField">name</str>
397
- <str name="f.text.hl.fragmenter">regex</str> <!-- defined below -->
71
+ </str>
72
+ <int name="ps">100</int>
73
+ <str name="q.alt">*:*</str>
398
74
  </lst>
399
75
  </requestHandler>
400
76
 
77
+ <requestHandler name="standard" class="solr.SearchHandler">
78
+ <lst name="defaults">
79
+ <str name="echoParams">explicit</str>
80
+ </lst>
81
+ </requestHandler>
82
+
401
83
  <requestHandler name="permissions" class="solr.SearchHandler" >
402
84
  <lst name="defaults">
403
85
  <str name="facet">off</str>
@@ -420,68 +102,6 @@
420
102
  </lst>
421
103
  </requestHandler>
422
104
 
423
- <requestHandler name="public_search" class="solr.SearchHandler" >
424
- <lst name="defaults">
425
-
426
- <str name="facet">on</str>
427
- <str name="facet.mincount">1</str>
428
-
429
-
430
- <str name="defType">dismax</str>
431
- <str name="echoParams">explicit</str>
432
- <float name="tie">0.01</float>
433
- <str name="qf">id^0.8 id_t^0.8 format text^0.3</str>
434
- <str name="pf">id^0.9 id_t^0.9 text^0.5</str>
435
- <str name="fl">
436
- id,text,title_t,date_t,year_facet,month_facet,medium_t,series_facet,box_facet,folder_facet,has_model_s
437
- </str>
438
- <str name="mm">
439
- 2&lt;-1 5&lt;-2 6&lt;90%
440
- </str>
441
- <int name="ps">100</int>
442
- <str name="q.alt">*:*</str>
443
- <!-- example highlighter config, enable per-query with hl=true -->
444
- <str name="hl.fl">text features name</str>
445
- <!-- for this field, we want no fragmenting, just highlighting -->
446
- <str name="f.name.hl.fragsize">0</str>
447
- <!-- instructs Solr to return the field itself if no query terms are
448
- found -->
449
- <str name="f.name.hl.alternateField">name</str>
450
- <str name="f.text.hl.fragmenter">regex</str> <!-- defined below -->
451
- </lst>
452
- <lst name="appends">
453
- <str name="fq">access_t:public</str>
454
- </lst>
455
- </requestHandler>
456
-
457
- <requestHandler name="fulltext" class="solr.SearchHandler" >
458
- <lst name="defaults">
459
- <str name="defType">dismax</str>
460
- <str name="facet">on</str>
461
- <str name="facet.mincount">1</str>
462
- <str name="echoParams">explicit</str>
463
- <float name="tie">0.01</float>
464
- <str name="qf">id^0.8 id_t^0.8 format text^0.3</str>
465
- <str name="pf">id^0.9 id_t^0.9 text^0.5</str>
466
- <str name="fl">
467
- id,text,title_t,date_t,year_facet,month_facet,medium_t,series_facet,box_facet,folder_facet
468
- </str>
469
- <str name="mm">
470
- 2&lt;-1 5&lt;-2 6&lt;90%
471
- </str>
472
- <int name="ps">100</int>
473
- <str name="q.alt">*:*</str>
474
- <!-- example highlighter config, enable per-query with hl=true -->
475
- <str name="hl.fl">text features name</str>
476
- <!-- for this field, we want no fragmenting, just highlighting -->
477
- <str name="f.name.hl.fragsize">0</str>
478
- <!-- instructs Solr to return the field itself if no query terms are
479
- found -->
480
- <str name="f.name.hl.alternateField">name</str>
481
- <str name="f.text.hl.fragmenter">regex</str> <!-- defined below -->
482
- </lst>
483
- </requestHandler>
484
-
485
105
  <!-- for requests to get a single document; use id=666 instead of q=id:666 -->
486
106
  <requestHandler name="document" class="solr.SearchHandler" >
487
107
  <lst name="defaults">
@@ -489,155 +109,9 @@
489
109
  <str name="fl">*</str>
490
110
  <str name="rows">1</str>
491
111
  <str name="q">{!raw f=id v=$id}</str> <!-- use id=666 instead of q=id:666 -->
492
-
493
- <str name="facet">on</str>
494
- <str name="facet.mincount">1</str>
495
-
496
- <str name="facet.field">collection_facet</str>
497
- <str name="facet.field">technology_facet</str>
498
- <str name="facet.field">person_facet</str>
499
- <!-- <str name="facet.field">title_t</str> -->
500
- <str name="facet.field">city_facet</str>
501
- <str name="facet.field">organization_facet</str>
502
- <str name="facet.field">company_facet</str>
503
- <str name="facet.field">year_facet</str>
504
- <str name="facet.field">state_facet</str>
505
- <str name="facet.field">series_facet</str>
506
- <str name="facet.field">box_facet</str>
507
- <str name="facet.field">folder_facet</str>
508
- <str name="facet.field">donor_tags_facet</str>
509
- <str name="facet.field">archivist_tags_facet</str>
510
-
511
112
  </lst>
512
113
  </requestHandler>
513
-
514
- <!-- DisMaxRequestHandler allows easy searching across multiple fields
515
- for simple user-entered phrases. It's implementation is now
516
- just the standard SearchHandler with a default query type
517
- of "dismax".
518
- see http://wiki.apache.org/solr/DisMaxRequestHandler
519
- -->
520
- <requestHandler name="dismax" class="solr.SearchHandler" >
521
- <lst name="defaults">
522
- <str name="facet">on</str>
523
- <str name="facet.mincount">1</str>
524
- <str name="echoParams">explicit</str>
525
- <float name="tie">0.01</float>
526
- <str name="qf">
527
- text^0.5
528
- </str>
529
- <str name="pf">
530
- text^0.2
531
- </str>
532
- <str name="bf">
533
- ord(popularity)^0.5 recip(rord(price),1,1000,1000)^0.3
534
- </str>
535
- <str name="fl">
536
- id,text,title_facet,date_t,medium_t,location_t
537
- </str>
538
- <str name="mm">
539
- 2&lt;-1 5&lt;-2 6&lt;90%
540
- </str>
541
- <int name="ps">100</int>
542
- <str name="q">*:*</str>
543
- <str name="q.alt">*:*</str>
544
- <!-- example highlighter config, enable per-query with hl=true -->
545
- <str name="hl.fl">text features name</str>
546
- <!-- for this field, we want no fragmenting, just highlighting -->
547
- <str name="f.name.hl.fragsize">0</str>
548
- <!-- instructs Solr to return the field itself if no query terms are
549
- found -->
550
- <str name="f.name.hl.alternateField">name</str>
551
- <str name="f.text.hl.fragmenter">regex</str> <!-- defined below -->
552
- </lst>
553
- </requestHandler>
554
-
555
- <!-- Note how you can register the same handler multiple times with
556
- different names (and different init parameters)
557
- -->
558
- <requestHandler name="partitioned" class="solr.SearchHandler" >
559
- <lst name="defaults">
560
- <str name="defType">dismax</str>
561
- <str name="echoParams">explicit</str>
562
- <str name="qf">text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0</str>
563
- <str name="mm">2&lt;-1 5&lt;-2 6&lt;90%</str>
564
- <!-- This is an example of using Date Math to specify a constantly
565
- moving date range in a config...
566
- -->
567
- <str name="bq">incubationdate_dt:[* TO NOW/DAY-1MONTH]^2.2</str>
568
- </lst>
569
- <!-- In addition to defaults, "appends" params can be specified
570
- to identify values which should be appended to the list of
571
- multi-val params from the query (or the existing "defaults").
572
114
 
573
- In this example, the param "fq=instock:true" will be appended to
574
- any query time fq params the user may specify, as a mechanism for
575
- partitioning the index, independent of any user selected filtering
576
- that may also be desired (perhaps as a result of faceted searching).
577
-
578
- NOTE: there is *absolutely* nothing a client can do to prevent these
579
- "appends" values from being used, so don't use this mechanism
580
- unless you are sure you always want it.
581
- -->
582
- <lst name="appends">
583
- <str name="fq">inStock:true</str>
584
- </lst>
585
- <!-- "invariants" are a way of letting the Solr maintainer lock down
586
- the options available to Solr clients. Any params values
587
- specified here are used regardless of what values may be specified
588
- in either the query, the "defaults", or the "appends" params.
589
-
590
- In this example, the facet.field and facet.query params are fixed,
591
- limiting the facets clients can use. Faceting is not turned on by
592
- default - but if the client does specify facet=true in the request,
593
- these are the only facets they will be able to see counts for;
594
- regardless of what other facet.field or facet.query params they
595
- may specify.
596
-
597
- NOTE: there is *absolutely* nothing a client can do to prevent these
598
- "invariants" values from being used, so don't use this mechanism
599
- unless you are sure you always want it.
600
- -->
601
- <lst name="invariants">
602
- <str name="facet.field">cat</str>
603
- <str name="facet.field">manu_exact</str>
604
- <str name="facet.query">price:[* TO 500]</str>
605
- <str name="facet.query">price:[500 TO *]</str>
606
- </lst>
607
- </requestHandler>
608
-
609
-
610
- <!--
611
- Search components are registered to SolrCore and used by Search Handlers
612
-
613
- By default, the following components are avaliable:
614
-
615
- <searchComponent name="query" class="org.apache.solr.handler.component.QueryComponent" />
616
- <searchComponent name="facet" class="org.apache.solr.handler.component.FacetComponent" />
617
- <searchComponent name="mlt" class="org.apache.solr.handler.component.MoreLikeThisComponent" />
618
- <searchComponent name="highlight" class="org.apache.solr.handler.component.HighlightComponent" />
619
- <searchComponent name="debug" class="org.apache.solr.handler.component.DebugComponent" />
620
-
621
- Default configuration in a requestHandler would look like:
622
- <arr name="components">
623
- <str>query</str>
624
- <str>facet</str>
625
- <str>mlt</str>
626
- <str>highlight</str>
627
- <str>debug</str>
628
- </arr>
629
-
630
- If you register a searchComponent to one of the standard names, that will be used instead.
631
- To insert handlers before or after the 'standard' components, use:
632
-
633
- <arr name="first-components">
634
- <str>myFirstComponentName</str>
635
- </arr>
636
-
637
- <arr name="last-components">
638
- <str>myLastComponentName</str>
639
- </arr>
640
- -->
641
115
 
642
116
  <!-- The spell check component can return a list of alternative spelling
643
117
  suggestions. -->
@@ -668,172 +142,4 @@
668
142
  <str name="spellcheckIndexDir">./spellcheckerFile</str>
669
143
  </lst>
670
144
  </searchComponent>
671
-
672
- <!-- a request handler utilizing the spellcheck component -->
673
- <requestHandler name="/spellCheckCompRH" class="solr.SearchHandler">
674
- <lst name="defaults">
675
- <!-- omp = Only More Popular -->
676
- <str name="spellcheck.onlyMorePopular">false</str>
677
- <!-- exr = Extended Results -->
678
- <str name="spellcheck.extendedResults">false</str>
679
- <!-- The number of suggestions to return -->
680
- <str name="spellcheck.count">1</str>
681
- </lst>
682
- <arr name="last-components">
683
- <str>spellcheck</str>
684
- </arr>
685
- </requestHandler>
686
-
687
- <!-- a search component that enables you to configure the top results for
688
- a given query regardless of the normal lucene scoring.-->
689
- <searchComponent name="elevator" class="solr.QueryElevationComponent" >
690
- <!-- pick a fieldType to analyze queries -->
691
- <str name="queryFieldType">string</str>
692
- <str name="config-file">elevate.xml</str>
693
- </searchComponent>
694
-
695
- <!-- a request handler utilizing the elevator component -->
696
- <requestHandler name="/elevate" class="solr.SearchHandler" startup="lazy">
697
- <lst name="defaults">
698
- <str name="echoParams">explicit</str>
699
- </lst>
700
- <arr name="last-components">
701
- <str>elevator</str>
702
- </arr>
703
- </requestHandler>
704
-
705
-
706
- <!-- Update request handler.
707
-
708
- Note: Since solr1.1 requestHandlers requires a valid content type header if posted in
709
- the body. For example, curl now requires: -H 'Content-type:text/xml; charset=utf-8'
710
- The response format differs from solr1.1 formatting and returns a standard error code.
711
-
712
- To enable solr1.1 behavior, remove the /update handler or change its path
713
- -->
714
- <requestHandler name="/update" class="solr.XmlUpdateRequestHandler" />
715
-
716
- <!--
717
- Analysis request handler. Since Solr 1.3. Use to returnhow a document is analyzed. Useful
718
- for debugging and as a token server for other types of applications
719
- -->
720
- <requestHandler name="/analysis" class="solr.AnalysisRequestHandler" />
721
-
722
-
723
- <!-- CSV update handler, loaded on demand -->
724
- <requestHandler name="/update/csv" class="solr.CSVRequestHandler" startup="lazy" />
725
-
726
-
727
- <!--
728
- Admin Handlers - This will register all the standard admin RequestHandlers. Adding
729
- this single handler is equivolent to registering:
730
-
731
- <requestHandler name="/admin/luke" class="org.apache.solr.handler.admin.LukeRequestHandler" />
732
- <requestHandler name="/admin/system" class="org.apache.solr.handler.admin.SystemInfoHandler" />
733
- <requestHandler name="/admin/plugins" class="org.apache.solr.handler.admin.PluginInfoHandler" />
734
- <requestHandler name="/admin/threads" class="org.apache.solr.handler.admin.ThreadDumpHandler" />
735
- <requestHandler name="/admin/properties" class="org.apache.solr.handler.admin.PropertiesRequestHandler" />
736
- <requestHandler name="/admin/file" class="org.apache.solr.handler.admin.ShowFileRequestHandler" >
737
-
738
- If you wish to hide files under ${solr.home}/conf, explicitly register the ShowFileRequestHandler using:
739
- <requestHandler name="/admin/file" class="org.apache.solr.handler.admin.ShowFileRequestHandler" >
740
- <lst name="invariants">
741
- <str name="hidden">synonyms.txt</str>
742
- <str name="hidden">anotherfile.txt</str>
743
- </lst>
744
- </requestHandler>
745
- -->
746
- <requestHandler name="/admin/" class="org.apache.solr.handler.admin.AdminHandlers" />
747
-
748
- <!-- ping/healthcheck -->
749
- <requestHandler name="/admin/ping" class="PingRequestHandler">
750
- <lst name="defaults">
751
- <str name="qt">standard</str>
752
- <str name="q">solrpingquery</str>
753
- <str name="echoParams">all</str>
754
- </lst>
755
- </requestHandler>
756
-
757
- <!-- Echo the request contents back to the client -->
758
- <requestHandler name="/debug/dump" class="solr.DumpRequestHandler" >
759
- <lst name="defaults">
760
- <str name="echoParams">explicit</str> <!-- for all params (including the default etc) use: 'all' -->
761
- <str name="echoHandler">true</str>
762
- </lst>
763
- </requestHandler>
764
-
765
- <highlighting>
766
- <!-- Configure the standard fragmenter -->
767
- <!-- This could most likely be commented out in the "default" case -->
768
- <fragmenter name="gap" class="org.apache.solr.highlight.GapFragmenter" default="true">
769
- <lst name="defaults">
770
- <int name="hl.fragsize">100</int>
771
- </lst>
772
- </fragmenter>
773
-
774
- <!-- A regular-expression-based fragmenter (f.i., for sentence extraction) -->
775
- <fragmenter name="regex" class="org.apache.solr.highlight.RegexFragmenter">
776
- <lst name="defaults">
777
- <!-- slightly smaller fragsizes work better because of slop -->
778
- <int name="hl.fragsize">70</int>
779
- <!-- allow 50% slop on fragment sizes -->
780
- <float name="hl.regex.slop">0.5</float>
781
- <!-- a basic sentence pattern -->
782
- <str name="hl.regex.pattern">[-\w ,/\n\"']{20,200}</str>
783
- </lst>
784
- </fragmenter>
785
-
786
- <!-- Configure the standard formatter -->
787
- <formatter name="html" class="org.apache.solr.highlight.HtmlFormatter" default="true">
788
- <lst name="defaults">
789
- <str name="hl.simple.pre"><![CDATA[<em>]]></str>
790
- <str name="hl.simple.post"><![CDATA[</em>]]></str>
791
- </lst>
792
- </formatter>
793
- </highlighting>
794
-
795
-
796
- <!-- queryResponseWriter plugins... query responses will be written using the
797
- writer specified by the 'wt' request parameter matching the name of a registered
798
- writer.
799
- The "default" writer is the default and will be used if 'wt' is not specified
800
- in the request. XMLResponseWriter will be used if nothing is specified here.
801
- The json, python, and ruby writers are also available by default.
802
-
803
- <queryResponseWriter name="xml" class="org.apache.solr.request.XMLResponseWriter" default="true"/>
804
- <queryResponseWriter name="json" class="org.apache.solr.request.JSONResponseWriter"/>
805
- <queryResponseWriter name="python" class="org.apache.solr.request.PythonResponseWriter"/>
806
- <queryResponseWriter name="ruby" class="org.apache.solr.request.RubyResponseWriter"/>
807
- <queryResponseWriter name="php" class="org.apache.solr.request.PHPResponseWriter"/>
808
- <queryResponseWriter name="phps" class="org.apache.solr.request.PHPSerializedResponseWriter"/>
809
-
810
- <queryResponseWriter name="custom" class="com.example.MyResponseWriter"/>
811
- -->
812
-
813
- <!-- XSLT response writer transforms the XML output by any xslt file found
814
- in Solr's conf/xslt directory. Changes to xslt files are checked for
815
- every xsltCacheLifetimeSeconds.
816
- -->
817
- <queryResponseWriter name="xslt" class="org.apache.solr.request.XSLTResponseWriter">
818
- <int name="xsltCacheLifetimeSeconds">5</int>
819
- </queryResponseWriter>
820
-
821
-
822
- <!-- example of registering a query parser
823
- <queryParser name="lucene" class="org.apache.solr.search.LuceneQParserPlugin"/>
824
- -->
825
-
826
- <!-- example of registering a custom function parser
827
- <valueSourceParser name="myfunc" class="com.mycompany.MyValueSourceParser" />
828
- -->
829
-
830
- <!-- config for the admin interface -->
831
- <admin>
832
- <defaultQuery>solr</defaultQuery>
833
-
834
- <!-- configure a healthcheck file for servers behind a loadbalancer
835
- <healthcheck type="file">server-enabled</healthcheck>
836
- -->
837
- </admin>
838
-
839
145
  </config>
@@ -1,4 +1,4 @@
1
1
  module HydraHead
2
- VERSION = "5.0.0.pre11"
2
+ VERSION = "5.0.0.pre12"
3
3
  end
4
4
 
@@ -55,7 +55,9 @@ describe CatalogController do
55
55
  describe "access controls" do
56
56
  before(:all) do
57
57
  fq = "read_access_group_t:public OR edit_access_group_t:public OR discover_access_group_t:public"
58
- @public_only_results = Blacklight.solr.find Hash[:fq=>fq]
58
+ solr_opts = {:fq=>fq}
59
+ response = Blacklight.solr.get('select', :params=> solr_opts)
60
+ @public_only_results = Blacklight::SolrResponse.new(response, solr_opts)
59
61
  end
60
62
 
61
63
  it "should only return public documents if role does not have permissions" do
@@ -13,7 +13,7 @@ describe FacetsHelper do
13
13
  item = stub("item", :value=>'two', :hits=>9)
14
14
 
15
15
  ret_val = helper.render_selected_facet_value("one", item)
16
- ret_val.should == "<span class=\"selected\">two <span class=\"count\">(9)</span></span>"
16
+ ret_val.should == "<span class=\"selected\">two <span class=\"count\">9</span></span>"
17
17
  ret_val.should be_html_safe
18
18
  end
19
19
  end
@@ -27,14 +27,16 @@ task :generate do
27
27
  `cp spec/support/Gemfile spec/internal`
28
28
  puts "Copying generator"
29
29
  `cp -r spec/support/lib/generators spec/internal/lib`
30
- within_test_app do
31
- puts "Bundle install"
32
- `bundle install`
33
- puts "running test_app_generator"
34
- system "rails generate test_app"
35
-
36
- puts "running migrations"
37
- puts `rake db:migrate db:test:prepare`
30
+ Bundler.with_clean_env do
31
+ within_test_app do
32
+ puts "Bundle install"
33
+ `bundle install`
34
+ puts "running test_app_generator"
35
+ system "rails generate test_app"
36
+
37
+ puts "running migrations"
38
+ puts `rake db:migrate db:test:prepare`
39
+ end
38
40
  end
39
41
  end
40
42
  puts "Running specs"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hydra-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0.pre11
4
+ version: 5.0.0.pre12
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-10-31 00:00:00.000000000 Z
13
+ date: 2012-11-15 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -35,7 +35,7 @@ dependencies:
35
35
  requirements:
36
36
  - - ~>
37
37
  - !ruby/object:Gem::Version
38
- version: '3.4'
38
+ version: 4.0.0.pre4
39
39
  type: :runtime
40
40
  prerelease: false
41
41
  version_requirements: !ruby/object:Gem::Requirement
@@ -43,7 +43,7 @@ dependencies:
43
43
  requirements:
44
44
  - - ~>
45
45
  - !ruby/object:Gem::Version
46
- version: '3.4'
46
+ version: 4.0.0.pre4
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: devise
49
49
  requirement: !ruby/object:Gem::Requirement
@@ -67,7 +67,7 @@ dependencies:
67
67
  requirements:
68
68
  - - ~>
69
69
  - !ruby/object:Gem::Version
70
- version: 5.0.0.rc1
70
+ version: 5.0.0.rc3
71
71
  type: :runtime
72
72
  prerelease: false
73
73
  version_requirements: !ruby/object:Gem::Requirement
@@ -75,7 +75,7 @@ dependencies:
75
75
  requirements:
76
76
  - - ~>
77
77
  - !ruby/object:Gem::Version
78
- version: 5.0.0.rc1
78
+ version: 5.0.0.rc3
79
79
  - !ruby/object:Gem::Dependency
80
80
  name: RedCloth
81
81
  requirement: !ruby/object:Gem::Requirement
@@ -179,7 +179,7 @@ dependencies:
179
179
  requirements:
180
180
  - - '='
181
181
  - !ruby/object:Gem::Version
182
- version: 5.0.0.pre11
182
+ version: 5.0.0.pre12
183
183
  type: :runtime
184
184
  prerelease: false
185
185
  version_requirements: !ruby/object:Gem::Requirement
@@ -187,7 +187,7 @@ dependencies:
187
187
  requirements:
188
188
  - - '='
189
189
  - !ruby/object:Gem::Version
190
- version: 5.0.0.pre11
190
+ version: 5.0.0.pre12
191
191
  - !ruby/object:Gem::Dependency
192
192
  name: sqlite3
193
193
  requirement: !ruby/object:Gem::Requirement
@@ -273,17 +273,17 @@ dependencies:
273
273
  requirement: !ruby/object:Gem::Requirement
274
274
  none: false
275
275
  requirements:
276
- - - <
276
+ - - ! '>='
277
277
  - !ruby/object:Gem::Version
278
- version: 2.0.0
278
+ version: '0'
279
279
  type: :development
280
280
  prerelease: false
281
281
  version_requirements: !ruby/object:Gem::Requirement
282
282
  none: false
283
283
  requirements:
284
- - - <
284
+ - - ! '>='
285
285
  - !ruby/object:Gem::Version
286
- version: 2.0.0
286
+ version: '0'
287
287
  - !ruby/object:Gem::Dependency
288
288
  name: solrizer-fedora
289
289
  requirement: !ruby/object:Gem::Requirement
@@ -321,7 +321,6 @@ files:
321
321
  - config/locales/hydra.en.yml
322
322
  - hydra-core.gemspec
323
323
  - lib/application_helper.rb
324
- - lib/generators/hydra/assets_generator.rb
325
324
  - lib/generators/hydra/cucumber_support_generator.rb
326
325
  - lib/generators/hydra/head_generator.rb
327
326
  - lib/generators/hydra/hyhead_fixtures_generator.rb
@@ -403,7 +402,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
403
402
  requirements:
404
403
  - - ! '>='
405
404
  - !ruby/object:Gem::Version
406
- version: '0'
405
+ version: 1.9.3
407
406
  required_rubygems_version: !ruby/object:Gem::Requirement
408
407
  none: false
409
408
  requirements:
@@ -1,50 +0,0 @@
1
- # -*- encoding : utf-8 -*-
2
- # Copy Blacklight assets to public folder in current app.
3
- # If you want to do this on application startup, you can
4
- # add this next line to your one of your environment files --
5
- # generally you'd only want to do this in 'development', and can
6
- # add it to environments/development.rb:
7
- # require File.join(Hydra.root, "lib", "generators", "hydra", "assets_generator.rb")
8
- # Hydra::Assets.start(["--force", "--quiet"])
9
-
10
-
11
- # Need the requires here so we can call the generator from environment.rb
12
- # as suggested above.
13
- require 'rails/generators'
14
- require 'rails/generators/base'
15
- module Hydra
16
- class AssetsGenerator < Rails::Generators::Base
17
- source_root File.expand_path('../templates', __FILE__)
18
-
19
- def assets
20
- if use_asset_pipeline?
21
- insert_into_file "app/assets/stylesheets/application.css", :after => " *= require_self" do
22
- %q{
23
- *
24
- * Required by Hydra
25
- *= require 'hydra/styles'
26
- }
27
- end
28
-
29
- insert_into_file "app/assets/javascripts/application.js", :after => "//= require jquery_ujs" do
30
- %q{
31
- // Required by Hydra
32
- //= require 'jquery.ui.datepicker.js'
33
- }
34
- end
35
- directory("../../../../app/assets/images/blacklight", "public/images/blacklight")
36
- else
37
- # directories are relative to the source_root
38
- directory("../../../../assets/images", "public/images")
39
- directory("../../../../assets/stylesheets", "public/stylesheets")
40
- directory("../../../../assets/javascripts", "public/javascripts")
41
- end
42
- end
43
-
44
- private
45
- def use_asset_pipeline?
46
- (Rails::VERSION::MAJOR >= 3 and Rails::VERSION::MINOR >= 1) and Rails.application.config.assets.enabled
47
- end
48
-
49
- end
50
- end