blacklight 3.8.2 → 4.0.0.pre6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (206) hide show
  1. data/Gemfile +1 -0
  2. data/README.md +1 -1
  3. data/VERSION +1 -1
  4. data/app/assets/javascripts/blacklight/blacklight.js +12 -1
  5. data/app/assets/javascripts/blacklight/bootstrap_dropdowns.js +3 -0
  6. data/app/assets/javascripts/blacklight/checkbox_submit.js +12 -5
  7. data/app/assets/javascripts/blacklight/core.js +0 -1
  8. data/app/assets/javascripts/blacklight/css_dropdowns.js +10 -0
  9. data/app/assets/javascripts/blacklight/facet_expand_contract.js +5 -5
  10. data/app/assets/javascripts/blacklight/lightbox_dialog.js +68 -13
  11. data/app/assets/javascripts/blacklight/select_submit.js +19 -10
  12. data/app/assets/javascripts/improved-modal/bootstrap-modal.js +282 -0
  13. data/app/assets/javascripts/improved-modal/bootstrap-modalmanager.js +353 -0
  14. data/app/assets/stylesheets/blacklight/_blacklight_base.css.scss +16 -5
  15. data/app/assets/stylesheets/blacklight/_bookmark.css.scss +24 -6
  16. data/app/assets/stylesheets/blacklight/_catalog.css.scss +115 -141
  17. data/app/assets/stylesheets/blacklight/_dropdown.css.scss +57 -0
  18. data/app/assets/stylesheets/blacklight/_facets.css.scss +127 -58
  19. data/app/assets/stylesheets/blacklight/_footer.css.scss +20 -0
  20. data/app/assets/stylesheets/blacklight/_header.css.scss +90 -21
  21. data/app/assets/stylesheets/blacklight/_layout.css.scss +10 -9
  22. data/app/assets/stylesheets/blacklight/_modal.css.scss +23 -0
  23. data/app/assets/stylesheets/blacklight/_print.css.scss +0 -7
  24. data/app/assets/stylesheets/blacklight/_responsive.css.scss +3 -0
  25. data/app/assets/stylesheets/blacklight/_search_history.css.scss +2 -4
  26. data/app/assets/stylesheets/blacklight/blacklight.css.scss +0 -1
  27. data/app/assets/stylesheets/blacklight/blacklight_defaults.css.scss +9 -2
  28. data/app/assets/stylesheets/blacklight/responsive_partials/_catalog.css.scss +5 -0
  29. data/app/assets/stylesheets/blacklight/responsive_partials/_facets.css.scss +37 -0
  30. data/app/assets/stylesheets/blacklight/responsive_partials/_header.css.scss +30 -0
  31. data/app/assets/stylesheets/improved-modal/bootstrap-modal.css +199 -0
  32. data/app/controllers/bookmarks_controller.rb +16 -10
  33. data/app/helpers/blacklight/blacklight_helper_behavior.rb +124 -61
  34. data/app/helpers/blacklight/catalog_helper_behavior.rb +5 -3
  35. data/app/helpers/blacklight/facets_helper_behavior.rb +9 -9
  36. data/app/views/_flash_msg.html.erb +9 -4
  37. data/app/views/_user_util_links.html.erb +23 -17
  38. data/app/views/bookmarks/_tools.html.erb +7 -7
  39. data/app/views/bookmarks/index.html.erb +5 -13
  40. data/app/views/catalog/_bookmark_control.html.erb +2 -4
  41. data/app/views/catalog/_bookmark_form.html.erb +1 -1
  42. data/app/views/catalog/_citation.html.erb +21 -20
  43. data/app/views/catalog/_constraints.html.erb +8 -6
  44. data/app/views/catalog/_document_header.html.erb +6 -7
  45. data/app/views/catalog/_document_list.html.erb +1 -7
  46. data/app/views/catalog/_email_form.html.erb +42 -16
  47. data/app/views/catalog/_facet_layout.html.erb +1 -1
  48. data/app/views/catalog/_facet_limit.html.erb +1 -1
  49. data/app/views/catalog/_facet_pagination.html.erb +11 -14
  50. data/app/views/catalog/_facets.html.erb +16 -2
  51. data/app/views/catalog/_home.html.erb +2 -2
  52. data/app/views/catalog/_home_text.html.erb +5 -2
  53. data/app/views/catalog/_index_default.html.erb +2 -2
  54. data/app/views/catalog/_marc_view.html.erb +0 -1
  55. data/app/views/catalog/_paginate_compact.html.erb +5 -0
  56. data/app/views/catalog/_per_page_widget.html.erb +13 -7
  57. data/app/views/catalog/_previous_next_doc.html.erb +14 -4
  58. data/app/views/catalog/_refworks_form.html.erb +2 -2
  59. data/app/views/catalog/_results_pagination.html.erb +4 -1
  60. data/app/views/catalog/_search_form.html.erb +19 -13
  61. data/app/views/catalog/_show_default.html.erb +2 -2
  62. data/app/views/catalog/_show_more_like_this.html.erb +3 -0
  63. data/app/views/catalog/_show_sidebar.html.erb +14 -1
  64. data/app/views/catalog/_show_tools.html.erb +18 -18
  65. data/app/views/catalog/_sms_form.html.erb +35 -10
  66. data/app/views/catalog/_sort_and_per_page.html.erb +5 -3
  67. data/app/views/catalog/_sort_widget.html.erb +12 -6
  68. data/app/views/catalog/citation.html.erb +1 -1
  69. data/app/views/catalog/citation.js.erb +7 -0
  70. data/app/views/catalog/email.html.erb +5 -0
  71. data/app/views/catalog/facet.html.erb +28 -21
  72. data/app/views/catalog/index.html.erb +26 -26
  73. data/app/views/catalog/librarian_view.html.erb +7 -0
  74. data/app/views/catalog/show.html.erb +35 -29
  75. data/app/views/catalog/sms.html.erb +5 -0
  76. data/app/views/kaminari/blacklight/_first_page.html.erb +2 -2
  77. data/app/views/kaminari/blacklight/_gap.html.erb +4 -1
  78. data/app/views/kaminari/blacklight/_last_page.html.erb +2 -2
  79. data/app/views/kaminari/blacklight/_next_page.html.erb +3 -3
  80. data/app/views/kaminari/blacklight/_page.html.erb +4 -3
  81. data/app/views/kaminari/blacklight/_paginator.html.erb +5 -5
  82. data/app/views/kaminari/blacklight/_prev_page.html.erb +3 -3
  83. data/app/views/kaminari/blacklight_compact/_next_page.html.erb +9 -0
  84. data/app/views/kaminari/blacklight_compact/_paginator.html.erb +15 -0
  85. data/app/views/kaminari/blacklight_compact/_prev_page.html.erb +9 -0
  86. data/app/views/layouts/blacklight.html.erb +47 -27
  87. data/app/views/saved_searches/index.html.erb +2 -2
  88. data/app/views/search_history/index.html.erb +12 -7
  89. data/app/views/shared/_footer.html.erb +0 -0
  90. data/app/views/shared/_header_navbar.html.erb +25 -0
  91. data/blacklight.gemspec +2 -5
  92. data/config/locales/blacklight.en.yml +23 -15
  93. data/lib/blacklight.rb +2 -2
  94. data/lib/blacklight/catalog.rb +36 -14
  95. data/lib/blacklight/configuration.rb +10 -2
  96. data/lib/blacklight/mash.rb +151 -0
  97. data/lib/blacklight/solr/document.rb +73 -11
  98. data/lib/blacklight/solr/document/extensions.rb +0 -8
  99. data/lib/blacklight/solr/document/marc_export.rb +7 -2
  100. data/lib/blacklight/solr/document/more_like_this.rb +5 -0
  101. data/lib/blacklight/solr_helper.rb +43 -18
  102. data/lib/blacklight/solr_response.rb +60 -0
  103. data/lib/blacklight/solr_response/facets.rb +58 -0
  104. data/lib/blacklight/solr_response/more_like_this.rb +14 -0
  105. data/lib/blacklight/solr_response/spelling.rb +92 -0
  106. data/lib/generators/blacklight/assets_generator.rb +1 -14
  107. data/lib/generators/blacklight/blacklight_generator.rb +22 -21
  108. data/lib/generators/blacklight/jetty_generator.rb +1 -35
  109. data/{test_support → lib/generators/blacklight/templates}/alternate_controller.rb +0 -0
  110. data/lib/generators/blacklight/templates/blacklight.css.scss +4 -0
  111. data/lib/generators/blacklight/templates/config/SolrMarc/config-test.properties +2 -2
  112. data/lib/generators/blacklight/templates/config/jetty.yml +6 -0
  113. data/lib/generators/blacklight/test_support_generator.rb +35 -0
  114. data/lib/railties/all_tests.rake +5 -23
  115. data/lib/railties/blacklight_cucumber.rake +2 -11
  116. data/lib/railties/blacklight_rspec.rake +2 -12
  117. data/test_support/bin/run-tests.sh +1 -1
  118. data/test_support/bin/setup-test-app.sh +123 -0
  119. data/test_support/bin/test.sh +21 -21
  120. data/test_support/features/bookmarks.feature +9 -3
  121. data/test_support/features/saved_searches.feature +3 -3
  122. data/test_support/features/search.feature +3 -3
  123. data/test_support/features/search_filters.feature +24 -26
  124. data/test_support/features/search_history.feature +9 -10
  125. data/test_support/features/search_sort.feature +4 -6
  126. data/test_support/features/step_definitions/general_steps.rb +0 -4
  127. data/test_support/features/step_definitions/search_result_steps.rb +2 -1
  128. data/test_support/features/step_definitions/search_steps.rb +32 -2
  129. data/test_support/spec/controllers/application_controller_spec.rb +8 -0
  130. data/test_support/spec/controllers/catalog_controller_spec.rb +3 -18
  131. data/test_support/spec/helpers/blacklight_helper_spec.rb +116 -20
  132. data/test_support/spec/helpers/catalog_helper_spec.rb +14 -6
  133. data/test_support/spec/helpers/facets_helper_spec.rb +1 -1
  134. data/test_support/spec/lib/blacklight_solr_document_more_like_this_spec.rb +18 -0
  135. data/test_support/spec/lib/blacklight_solr_document_spec.rb +54 -1
  136. data/test_support/spec/lib/blacklight_solr_response_spec.rb +153 -0
  137. data/test_support/spec/lib/facet_paginator_spec.rb +1 -1
  138. data/test_support/spec/lib/marc_export_spec.rb +14 -6
  139. data/test_support/spec/lib/solr_helper_spec.rb +22 -6
  140. data/test_support/spec/models/solr_docment_spec.rb +1 -4
  141. data/test_support/spec/{features → requests}/alternate_controller_spec.rb +3 -2
  142. data/test_support/spec/views/catalog/_facets.html.erb_spec.rb +20 -4
  143. data/test_support/spec/views/catalog/_show_sidebar.erb_spec.rb +25 -0
  144. metadata +53 -131
  145. data/app/assets/javascripts/blacklight/more_facets.js +0 -16
  146. data/app/assets/javascripts/jquery-1.4.2.min.js +0 -154
  147. data/app/assets/javascripts/jquery-ui-1.8.1.custom.min.js +0 -756
  148. data/app/assets/javascripts/jquery.uiExt.ajaxyDialog.js +0 -180
  149. data/app/assets/stylesheets/blacklight/_formatting.css.scss +0 -164
  150. data/app/assets/stylesheets/blacklight/grids/_susy_grid.css.scss +0 -72
  151. data/app/assets/stylesheets/jquery/ui-lightness/images/ui-anim_basic_16x16.gif +0 -0
  152. data/app/assets/stylesheets/jquery/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  153. data/app/assets/stylesheets/jquery/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
  154. data/app/assets/stylesheets/jquery/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
  155. data/app/assets/stylesheets/jquery/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  156. data/app/assets/stylesheets/jquery/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  157. data/app/assets/stylesheets/jquery/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  158. data/app/assets/stylesheets/jquery/ui-lightness/images/ui-bg_gloss-wave_35_558fd0_500x100.png +0 -0
  159. data/app/assets/stylesheets/jquery/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  160. data/app/assets/stylesheets/jquery/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
  161. data/app/assets/stylesheets/jquery/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
  162. data/app/assets/stylesheets/jquery/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
  163. data/app/assets/stylesheets/jquery/ui-lightness/images/ui-icons_2e4f81_256x240.png +0 -0
  164. data/app/assets/stylesheets/jquery/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
  165. data/app/assets/stylesheets/jquery/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
  166. data/app/assets/stylesheets/jquery/ui-lightness/jquery-ui-1.8.1.custom.css +0 -486
  167. data/app/models/solr_document.rb +0 -5
  168. data/app/views/catalog/email.erb +0 -1
  169. data/app/views/catalog/sms.erb +0 -1
  170. data/doc/Atom-Responses.md +0 -90
  171. data/doc/Blacklight-3.2-Release-Notes-and-Upgrade-Guide.md +0 -191
  172. data/doc/Blacklight-3.3-release-notes-and-upgrade-guide.md +0 -37
  173. data/doc/Blacklight-3.4-release-notes-and-upgrade-guide.md +0 -27
  174. data/doc/Blacklight-3.5-release-notes-and-upgrade-guide.md +0 -44
  175. data/doc/Blacklight-3.6-release-notes-and-upgrade-guide.md +0 -25
  176. data/doc/Blacklight-3.7-release-notes-and-upgrade-guide.md +0 -78
  177. data/doc/Blacklight-3.8-release-notes-and-upgrade-guide.md +0 -11
  178. data/doc/Blacklight-Add-ons.md +0 -28
  179. data/doc/Blacklight-configuration.md +0 -301
  180. data/doc/Blacklight-on-Heroku.md +0 -135
  181. data/doc/Community-principles.md +0 -44
  182. data/doc/Configuring-and-Customizing-Blacklight.md +0 -271
  183. data/doc/Contributing-to-Blacklight.md +0 -25
  184. data/doc/Examples.md +0 -62
  185. data/doc/Extending-or-Modifying-Blacklight-Search-Behavior.md +0 -141
  186. data/doc/Home.md +0 -77
  187. data/doc/How-to-release-a-version.md +0 -37
  188. data/doc/Indexing-your-data-into-solr.md +0 -5
  189. data/doc/Integration-with-Rails-Footnotes.md +0 -20
  190. data/doc/Pagination.md +0 -38
  191. data/doc/Providing-your-own-view-templates.md +0 -109
  192. data/doc/Quickstart.md +0 -116
  193. data/doc/README.md +0 -77
  194. data/doc/README_SOLR.md +0 -245
  195. data/doc/Release-Notes-And-Upgrade-Guides.md +0 -14
  196. data/doc/Sunspot-for-indexing.md +0 -46
  197. data/doc/User-Authentication.md +0 -60
  198. data/doc/testing.md +0 -115
  199. data/lib/generators/blacklight/solr_conf_generator.rb +0 -26
  200. data/lib/generators/blacklight/templates/assets/standard.css.scss +0 -59
  201. data/lib/generators/blacklight/templates/config/blacklight_config.rb +0 -3
  202. data/lib/generators/blacklight/templates/config/compass.rb +0 -2
  203. data/lib/generators/blacklight/templates/solr_conf/schema.xml +0 -689
  204. data/lib/generators/blacklight/templates/solr_conf/solrconfig.xml +0 -1846
  205. data/lib/solrmarc.log.1 +0 -849
  206. data/test_support/spec/controllers/bookmarks_controller_spec.rb +0 -48
@@ -1,5 +0,0 @@
1
- class SolrDocument
2
-
3
- include Blacklight::Solr::Document
4
-
5
- end
@@ -1 +0,0 @@
1
- <%= render :partial => 'email_form' %>
@@ -1 +0,0 @@
1
- <%= render :partial => 'sms_form' %>
@@ -1,90 +0,0 @@
1
- Blacklight will provide atom responses for all catalog/index results. Just add ".atom" on to the end of your path component, `/catalog.atom`, or `/catalog/index.atom`.
2
- ```xml
3
- <?xml version="1.0" encoding="UTF-8"?>
4
- <feed xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns="http://www.w3.org/2005/Atom">
5
- <title>Blacklight Search Results</title>
6
- <author>
7
- <name>Blacklight</name>
8
- </author>
9
- <link href="http://demo.projectblacklight.org/?commit=search&amp;amp;format=atom&amp;amp;q=urdu&amp;amp;search_field=all_fields" rel="self"/>
10
- <link href="http://demo.projectblacklight.org/?commit=search&amp;amp;format=html&amp;amp;q=urdu&amp;amp;search_field=all_fields" rel="alternate" type="text/html"/>
11
- <id>http://demo.projectblacklight.org/?commit=search&amp;amp;format=html&amp;amp;q=urdu&amp;amp;search_field=all_fields&amp;amp;type=text%2Fhtml</id>
12
- <link href="http://demo.projectblacklight.org/?commit=search&amp;amp;format=atom&amp;amp;page=2&amp;amp;q=urdu&amp;amp;search_field=all_fields" rel="next"/>
13
- <link href="http://demo.projectblacklight.org/?commit=search&amp;amp;format=atom&amp;amp;page=1&amp;amp;q=urdu&amp;amp;search_field=all_fields" rel="first"/>
14
- <link href="http://demo.projectblacklight.org/?commit=search&amp;amp;format=atom&amp;amp;page=15&amp;amp;q=urdu&amp;amp;search_field=all_fields" rel="last"/>
15
- <link href="http://demo.projectblacklight.org/catalog/opensearch.xml" rel="search" type="application/opensearchdescription+xml"/>
16
- <opensearch:totalResults>147</opensearch:totalResults>
17
- <opensearch:startIndex>0</opensearch:startIndex>
18
- <opensearch:itemsPerPage>10</opensearch:itemsPerPage>
19
- <opensearch:Query searchTerms="urdu" startPage="1" role="request"/>
20
- <updated>2011-05-11T17:46:58Z</updated>
21
- <entry>
22
- <title>Urdu&#772; d&#803;ra&#772;ma&#772;</title>
23
- <updated>2011-05-11T17:46:58Z</updated>
24
- <link href="http://demo.projectblacklight.org/catalog/2008306442" rel="alternate" type="text/html"/>
25
- <link href="http://demo.projectblacklight.org/catalog/2008306442.dc_xml" rel="alternate" title="dc_xml" type="text/xml" />
26
- <link href="http://demo.projectblacklight.org/catalog/2008306442.xml" rel="alternate" title="xml" type="application/xml" />
27
- <id>http://demo.projectblacklight.org/catalog/2008306442</id>
28
- <author>
29
- <name>Farg&#818;h&#818;a&#772;nah, 1979-</name>
30
- </author>
31
- <summary type="html">
32
- &lt;dl class="defList"&gt;
33
-
34
-
35
- &lt;dt class="blacklight-title_display"&gt;Title:&lt;/dt&gt;
36
- &lt;dd class="blacklight-title_display"&gt;Urdu&#772; d&#803;ra&#772;ma&#772;&lt;/dd&gt;
37
-
38
- &lt;dt class="blacklight-author_display"&gt;Author:&lt;/dt&gt;
39
- &lt;dd class="blacklight-author_display"&gt;Farg&#818;h&#818;a&#772;nah, 1979-&lt;/dd&gt;
40
-
41
-
42
- <!-- [...] -->
43
- &lt;/dl&gt;
44
- </summary>
45
- </entry>
46
- <!-- [...] -->
47
- </feed>
48
- ```
49
-
50
-
51
- The same HTML summary included in your HTML results pages are included as an `atom:summary` element -- the atom template uses the `[[#render_document_partial|https://github.com/projectblacklight/blacklight/blob/master/app/helpers/blacklight/blacklight_helper_behavior.rb#L203]]` helper method to generate this HTML summary, so if you've over-ridden that for your app, it will be used as the `atom:summary` content instead.
52
-
53
- ## API Usage
54
- The Atom response is intended to be pretty full of data, so it can fill many traditional API requests. It makes use of every relevant atom or [[OpenSearch|http://www.opensearch.org/Home]] element that could be conveniently included.
55
-
56
- The Atom response also supports arbitrary format representations in the `atom:content` element. You can include `&content_format=some_format` in your request URL (e.g. `[[/catalog.atom?content_format=oai_dc_xml|http://demo.projectblacklight.org/catalog.atom?q=urdu&content_format=oai_dc_xml]]`). Any format a given document can be exported as using the [[Blacklight document framework|Extending-blacklight-with-the-document-extension-framework]] is available. Not every document can export in every format -- if a format is requested one or more of the items in your atom result can not export as, it will not have an `atom:content` element. Non-XML-based formats are supported, as the content is Base64-encoded (as per Atom spec, unless the format is `text/plain`).
57
- ```xml
58
- <?xml version="1.0" encoding="UTF-8"?>
59
- <feed xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns="http://www.w3.org/2005/Atom">
60
- <title>Blacklight Search Results</title>
61
- <author>
62
- <name>Blacklight</name>
63
- </author>
64
- <link href="http://demo.projectblacklight.org/?content_format=oai_dc_xml&amp;amp;format=atom&amp;amp;per_page=1" rel="self"/>
65
- <!-- [...] -->
66
- <entry>
67
- <title>The book of the dance in the 20th century selections from the Jane Bourne Parton collection of books on the dance</title>
68
- <updated>2011-05-11T17:59:32Z</updated>
69
- <link href="http://demo.projectblacklight.org/catalog/u1" rel="alternate" type="text/html"/>
70
- <link href="http://demo.projectblacklight.org/catalog/u1.dc_xml" rel="alternate" title="dc_xml" type="text/xml" />
71
- <link href="http://demo.projectblacklight.org/catalog/u1.xml" rel="alternate" title="xml" type="application/xml" />
72
- <id>http://demo.projectblacklight.org/catalog/u1</id>
73
- <author>
74
- <name>Roatcap, Adela Spindler</name>
75
- </author>
76
- <summary type="html">
77
- <!-- [...] -->
78
- </summary>
79
- <!-- [ Here is the export format as OAI Dublin Core XML ] -->
80
- <content type="text/xml">
81
- <oai_dc:dc xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd" xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><dc:language>English</dc:language><dc:title>The book of the dance in the 20th century selections from the Jane Bourne Parton collection of books on the dance</dc:title><dc:format>Book</dc:format></oai_dc:dc> </content>
82
- </entry>
83
- </feed>
84
- ```
85
-
86
- This means that if you add on a document extension that provides more export formats for some or all of your documents, that will automatically be available in the atom response.
87
-
88
- If you choose to use the [[Blacklight CQL add-on|https://github.com/projectblacklight/blacklight_cql]], the combination of [[CQL|http://www.loc.gov/standards/sru/specs/cql.html]] requests and Atom responses provides a pretty good more-or-less standards-based API to search results through Blacklight.
89
-
90
- The Atom response generating template is at `app/views/catalog/index.builder.atom`.
@@ -1,191 +0,0 @@
1
- ## Overview
2
-
3
- Blacklight 3.2 introduces a number of new features to Blacklight, including the Rails asset pipeline, a configuration refactor, and support for Solr 3.x by default.
4
-
5
- ### Upgrading to Rails 3.1
6
-
7
- If you are still using Rails 3.0, you should first update your project to work with Rails 3.1. Start by fixing any Rails 3.0 deprecation warnings (as those features may no longer exist or fail silently in Rails 3.1). There are some good resources to help you with the upgrade (e.g. [[http://railscasts.com/episodes/282-upgrading-to-rails-3-1?view=asciicast]]).
8
-
9
- ### Assets (CODEBASE-363)
10
- Blacklight 3.2 uses the Rails 3.1 asset pipeline for all assets, stylesheets and javascript. The CSS has been refactored and now uses SCSS to enable easy changing of some common parameters/colors. In addition, it no longer uses YUI-grids CSS framework. (Instead it uses Susy grid css framework).
11
-
12
- What does this mean for you?
13
-
14
- * Small (hopefully) upgrade costs.
15
-
16
- * Use of the asset pipeline to compress and streamline all css files into one.
17
-
18
- * Easier theming of blacklight.
19
-
20
- After having upgraded to BL 3.2 (and Rails 3.1), the first thing you should do is upgrade to use the asset pipeline. The Blacklight gem's standard behavior for including CSS and Javascript in your app **requires the asset pipeline**. (Of course, if you don't use the CSS or Javascript distributed with Blacklight, or want to roll your own custom way to include it, you could choose to continue without using the asset pipeline)
21
-
22
- Run the Blacklight generator to upgrade from Blacklight 3.1 to 3.2:
23
- ```
24
- $ rails g blacklight
25
- ```
26
-
27
- This should update the `application.css` and `application.js` files with references to the new Blacklight assets. You will still need to move or update your local assets and customizations.
28
-
29
- **Note**
30
-
31
- * Now, if you have you will need to change your layout to use the new ids, look at: [app/views/layouts/blacklight.html.erb](https://github.com/projectblacklight/blacklight/blob/master/) for reference on the new tags (#page, #bd, #hd, #footer, #main, #main_container, #sidebar). The old yui tags have no meaning in the new css.
32
-
33
- * This also means that any local CSS that overrides Blacklight's CSS, if your uses the old yui-grids id's in your CSS selectors, you probably want to change them to use the new id's. (#doc, #doc2, etc,, as well as any .yui-*)
34
-
35
- * You will need to remove the line `require "yui"` from your `./app/assets/stylesheets/application.css`. In previous versions, Blacklight provided the YUI css library as part of the gem. In Blacklight 3.2, because the Blacklight is no longer using YUI, this has been removed. If you wish to continue using YUI, you will need to provide your own copy in your application. You can download the [Blacklight 3.1 YUI file](https://github.com/projectblacklight/blacklight/blob/release-3.1/app/assets/stylesheets/yui.css) or from the (Yahoo YUI site)[http://developer.yahoo.com/yui/2/].
36
-
37
- ### Per-controller configuration (CODEBASE-365)
38
-
39
- In previous versions of Blacklight, configuring Blacklight was done using a global configuration hash called `Blacklight.config` (created in `config/initializers/blacklight_config.rb`). Blacklight 3.2 deprecates this global configuration in favor of a per-controller, DSL-style configuration. Support for the old-style configuration is still available (meaning, if you do absolutely nothing, Blacklight will convert Blacklight.config into the new-style configuration, and your application will probably continue to work), but we strongly recommend applications switch to the new-style configuration.
40
-
41
- The two major changes are moving from the global configuration (`Blacklight.config`) to a Controller-specific method (`blacklight_config`) and replacing the hash-based access with an OpenStruct-based domain-specific language. The new style maintains many of the old semantics, but should be better structured and more clear.
42
-
43
- On your CatalogController, you can configure the Blacklight Catalog:
44
-
45
- ```ruby
46
- class CatalogController < ApplicationController
47
-
48
- include Blacklight::Catalog
49
-
50
- configure_blacklight do |config|
51
- config.default_solr_params = {
52
- :qt => 'search',
53
- :rows => 10
54
- }
55
-
56
- # solr field configuration for search results/index views
57
- config.index.show_link = 'title_display'
58
- config.index.record_display_type = 'format'
59
-
60
- # solr field configuration for document/show views
61
- config.show.html_title = 'title_display'
62
- config.show.heading = 'title_display'
63
- config.show.display_type = 'format'
64
-
65
- # ....
66
- end
67
-
68
- # ...
69
- end
70
-
71
- ```
72
-
73
-
74
- #### Creating a new configuration
75
-
76
- An example of the new style configuration is available at
77
- [[https://github.com/projectblacklight/blacklight/blob/master/lib/generators/blacklight/templates/catalog_controller.rb]] and shows most of the ways one can use the new configuration.
78
-
79
- There are helper methods for adding field configuration (facets, index, and show fields) as well as search and sort fields. All of these methods accept a variety of inputs and should be used in local applications in whatever form is most clear.
80
-
81
- Field + configuration hash
82
-
83
- ```ruby
84
- config.add_facet_field 'format', :label => 'Format'
85
- ```
86
-
87
- Configuration hash
88
-
89
- ```ruby
90
- config.add_sort_field :sort => 'score desc, pub_date_sort desc, title_sort asc', :label => 'relevance'
91
- ```
92
-
93
- Field + block
94
-
95
- ```ruby
96
- config.add_search_field('title') do |field|
97
- # solr_parameters hash are sent to Solr as ordinary url query params.
98
- field.solr_parameters = { :'spellcheck.dictionary' => 'title' }
99
-
100
- # :solr_local_parameters will be sent using Solr LocalParams
101
- # syntax, as eg {! qf=$title_qf }. This is neccesary to use
102
- # Solr parameter de-referencing like $title_qf.
103
- # See: http://wiki.apache.org/solr/LocalParams
104
- field.solr_local_parameters = {
105
- :qf => '$title_qf',
106
- :pf => '$title_pf'
107
- }
108
- end
109
- ```
110
-
111
- #### Using the new configuration
112
-
113
- Within a controller, the configuration can be accessed using the method `blacklight_config`, which is also exposed to helpers or views as a helper method.
114
-
115
- Outside of a controller context (which should be rare, and likely undesirable), the configuration is exposed at the class level as well, e.g.:
116
-
117
- ```ruby
118
- CatalogController.blacklight_config
119
- ```
120
-
121
- Some configuration-driven helper methods have also been moved to the configuration object:
122
-
123
- ```ruby
124
- blacklight_config.default_search_field
125
- blacklight_config.default_sort_field
126
- blacklight_config.max_per_page
127
- ```
128
-
129
- The Blacklight field configuration are stored as ordered hashes, with a key corresponding to the field name:
130
-
131
- ```ruby
132
- CatalogController.blacklight_config.facet_fields
133
-
134
- # {
135
- # "format" => #<Blacklight::Configuration::FacetField:0x1025a0c78
136
- # :label => "Format",
137
- # :field => "format"
138
- # >,
139
- # "pub_date" => #<Blacklight::Configuration::FacetField:0x1025a7aa0
140
- # :label => "Publication Year",
141
- # :field => "pub_date"
142
- # >,
143
- # ...
144
- ```
145
-
146
- Values can be accessed using OpenStruct methods or as a Hash:
147
-
148
- ```ruby
149
- CatalogController.blacklight_config.facet_fields["format"].label # == "Format"
150
- CatalogController.blacklight_config.facet_fields["format"][:label] # == "Format"
151
- ```
152
-
153
- ### Using the new-style config in local overrides
154
- If you have overriden views or helpers in your local application and access `Blacklight.config` directly, you will need to update your overrides. In general, you should be able to search for references to `Blacklight.config` in your local application, replace it with the controller-level method `blacklight_config` and possibly fix up some naming differences.
155
-
156
- ### Facet refactor
157
- Facet helpers and views have been refactored to take advantage of the new configuration style and new features in Rails.
158
-
159
- The old `_facet_limit` view has been split in two,
160
-
161
- * `_facet_limit` : the partial to display the facet values
162
- * `_facet_layout` : a 'partial layout' that displays the facet structure and headers
163
-
164
- In the facet configuration, you can specify the partial to use to render a facet:
165
- ```ruby
166
- config.add_facet_field 'format', :label => 'Format', :partial => 'my_custom_format_facet_display_partial'
167
- ```
168
-
169
- ### Solr 3.5 (CODEBASE-345)
170
- Blacklight-jetty has been updated to Solr 3.5 (previously it was still Solr 1.4). Blacklight is still compatible with both Solr 1.x and 3.x, but the demo application is based on a Solr 3.x configuration.
171
-
172
- #### SolrMarc 2.3.1
173
- Older versions of SolrMarc were incompatible with Solr 3.x. Blacklight is now distributed with SolrMarc 2.3.1. But previous versions of Blacklight erroneously copied a SolrMarc.jar into your local app's lib/SolrMarc.jar when installing Blacklight.
174
-
175
- If you have a previously installed Blacklight, unless you have intentionally installed a local compile of SolrMarc.jar, you should remove the file at local ./lib/SolrMarc.jar, so your app will use the latest version of SolrMarc shipped with Blacklight.
176
-
177
-
178
-
179
- ### Other changes
180
-
181
- * [CODEBASE-325](http://jira.projectblacklight.org/jira/browse/CODEBASE-325) - Allow Blacklight to function correctly when no user authentication system is provided
182
- * [CODEBASE-362](http://jira.projectblacklight.org/jira/browse/CODEBASE-362) - Blacklight facets do not work with integer-type fields
183
- * [CODEBASE-367](http://jira.projectblacklight.org/jira/browse/CODEBASE-367) - Pull in Hydra's jettywrapper to manage jetty
184
- * [CODEBASE-369](http://jira.projectblacklight.org/jira/browse/CODEBASE-369) - Advanced Search has an incompatible character encoding issue under ruby 1.9
185
- * [CODEBASE-371](http://jira.projectblacklight.org/jira/browse/CODEBASE-371) - SolrHelper#get_solr_response_for_field_values does not adequately escape value lists
186
- * [CODEBASE-375](http://jira.projectblacklight.org/jira/browse/CODEBASE-375) - fix rake solr:marc:index task and generator to use distro SolrMarc.jar
187
- * [CODEBASE-376](http://jira.projectblacklight.org/jira/browse/CODEBASE-376) - Look at the did_you_mean.feature scenarios, review for accuracy.
188
- * [CODEBASE-377](http://jira.projectblacklight.org/jira/browse/CODEBASE-377) - Convert opensearch.xml.erb to true XML builder style
189
- * [CODEBASE-379](http://jira.projectblacklight.org/jira/browse/CODEBASE-379) - Factor out use of RSolr's pagination feature and use Solr's start/rows parameters instead
190
- * [CODEBASE-380](http://jira.projectblacklight.org/jira/browse/CODEBASE-380) - ActionMailer deprecations
191
-
@@ -1,37 +0,0 @@
1
- Issues: https://github.com/projectblacklight/blacklight/issues?milestone=2&state=open
2
-
3
- ## Upgrade notes:
4
-
5
- Note: Please make sure to upgrade to at least Blacklight **3.3.1** to avoid problems with compiled assets in 3.3.0.
6
-
7
- If you previously ran the blacklight 3.3.0 generator, after upgrading to 3.3.1: Edit your local `./app/assets/stylesheets/blacklight_themes/standard.css.scss` file, change the line (wrong) `@import 'blacklight/grids/susy';` to instead be (right) `@import 'blacklight/grids/susy_grid';`
8
-
9
- If you previously ran the blacklight 3.2.x or 3.3.0 generator, look in your local `./config/application.rb`, *remove* the line `config.sass.line_comments = Rails.env.development?` if present.
10
-
11
- ### Compass/susy upgrade
12
-
13
- [Compass](https://github.com/chriseppstein/compass) (our CSS framework) and [Susy](http://susy.oddbird.net/) have been updated to a new major release. This will necessitate some changes in installations already running BL 3.2.
14
-
15
- New installations should just use the generator as normal.
16
-
17
- Existing installations should do the following:
18
-
19
- **1.** In your gemfile, in `group :assets`, remove any reference to the compass gem, and add:
20
-
21
- gem 'sass-rails', '~> 3.2.0'
22
- gem 'compass-rails', '~> 1.0.0'
23
- gem 'compass-susy-plugin', '~> 0.9.0'
24
-
25
- **2.** You can remove 'config/initializers/sass.rb'
26
-
27
- **3.** You must add, if you have not already: 'config/compass.rb'
28
-
29
- require 'susy'
30
- project_type = :rails
31
-
32
- **4.** Replace any references in your css:
33
-
34
- `@import "blacklight/grids/susy_framework"` with `@import "susy"`
35
-
36
- `@import "blacklight/grids/susy"` with `@import "blacklight/grids/susy_grid"`
37
-
@@ -1,27 +0,0 @@
1
- # Blacklight 3.4 Release notes
2
- Blacklight 3.4.0 is now available. It fixes a number of bugs and
3
- tests, but also adds a handful of new features.
4
-
5
- - Fixed Rails 3.1 compatibility for rspec tests
6
- - changes to make Blacklight work better with arbitrary solr indexes.
7
- - Use ERb to parse the solr.yml configuration (allowing environment
8
- variables to be referenced in the config)
9
- - fixed #351, saving Selected Items (Folder) to Bookmarks
10
- (SavedRecords), more than 10.
11
- - fixed #398 document fetching/config refactor, which elevates
12
- document-request solr parameters into the controller's
13
- blacklight_config.
14
- - fixed #333, Blacklight should throw more helpful errors if it
15
- unable to connect to Solr
16
- - fixed #96, supporting configurable request handler paths
17
-
18
- The full list of Github issues are at:
19
- https://github.com/projectblacklight/blacklight/issues?milestone=4&state=closed
20
-
21
- Also, the GitHub compare view of this release vs. our last release is
22
- located at:
23
- https://github.com/projectblacklight/blacklight/compare/v3.3.0...v3.4.0
24
-
25
- # Upgrade notes
26
-
27
- No known issues updating from 3.3 to 3.4.
@@ -1,44 +0,0 @@
1
- # Blacklight 3.5 Release Notes And Upgrade Guide
2
-
3
- ## Release Notes
4
- # Blacklight 3.5 Release notes
5
- Blacklight 3.5.0 is now available. It introduces i18n support for Blacklight, allowing applications to change and modify Blacklight-provided text strings without the need to override partials (in addition to providing multi-lingual support).
6
-
7
- - Fix #395, removing hard-coded no-reply@ email addresses from the ```RecordMailer``` (see below for upgrade notes)
8
- - Consistent use of polymorphic routing to the show views for documents. ```solr_document_url``` and ```solr_document_path``` are now part of the engine-provided routes, rather than helper-provided.
9
- - Refactor `blacklight.js` to take advantage of the Rails asset pipeline by moving separate blocks of code into individual files.
10
- - Fix problem with mounting Blacklight applications at a suburi rather than a document.
11
-
12
- The full list of Github issues are at:
13
- https://github.com/projectblacklight/blacklight/issues?milestone=7&state=closed
14
-
15
- Also, the GitHub compare view of this release vs. our last release is
16
- located at:
17
- https://github.com/projectblacklight/blacklight/compare/v3.4.2...release-3.5
18
-
19
-
20
- ## Upgrade Guide
21
-
22
- No known issues updating from 3.4 to 3.5.
23
-
24
- ## i18n
25
-
26
- Blacklight 3.5 introduces i18n (internationalization framework) support. See the Ruby on Rails [[i18n Rails guide|http://guides.rubyonrails.org/i18n.html]] for information on how to use i18n within your application. The list of blacklight-provided (English) translations are available in the engine's [[```config/locales/blacklight.en.yml```|https://github.com/projectblacklight/blacklight/blob/master/config/locales/blacklight.en.yml]]
27
-
28
- ## RecordMailer default email
29
-
30
- In config/environments/development.rb:
31
- ```ruby
32
- ActionMailer::Base.default :from => 'default@development-server.com'
33
- ```
34
-
35
- In config/environments/production.rb:
36
- ```ruby
37
- ActionMailer::Base.default :from => 'default@production-server.com'
38
- ```
39
-
40
- You can also target the RecordMailer directly:
41
-
42
- ```ruby
43
- RecordMailer.default :from => 'no-reply@projectblacklight.org'
44
- ```
@@ -1,25 +0,0 @@
1
- # Blacklight 3.6 Release Notes And Upgrade Guide
2
-
3
- ## Release Notes
4
- # Blacklight 3.6 Release notes
5
- Blacklight 3.6.0 is now available. This is mostly a collection of small patches.
6
-
7
-
8
- - Fix blacklight to be compatible with newly released version of Kaminari
9
- - Split document_header into its own partial
10
- - Utilizing rails own capability to determine partial paths for collections
11
- - #423 using response.total instead of the underlying hash
12
- - many more
13
-
14
-
15
- The full list of Github issues are at:
16
- https://github.com/projectblacklight/blacklight/issues?milestone=8&state=closed
17
-
18
- Also, the GitHub compare view of this release vs. our last release is
19
- located at:
20
- https://github.com/projectblacklight/blacklight/compare/release-3.5...release-3.6
21
-
22
-
23
- ## Upgrade Guide
24
-
25
- No known issues updating from 3.5 to 3.6. If you are overriding app/views/catalog/_document_list.html.erb in your local application, you may want to look at how it is now written in the gem. See https://github.com/projectblacklight/blacklight/commit/b712d79fa88e80155972ce3e9bc7629d7e63c1eb
@@ -1,78 +0,0 @@
1
- ## Bookmarks and Folders merged
2
-
3
- When upgrading to Blacklight 3.7, if you want to keep the 'folders' feature (of session-based, anonymous item selection), you should add this gem to your Gemfile:
4
-
5
- ```
6
- gem 'devise-guests'
7
- ```
8
-
9
- The bookmarks (database persisted, user-based) and folders (session stored, session-based) features have been merged into a single bookmarks feature (database persisted, user-based). These bookmarks are database-persisted and assume an ActiveRecord-based user model.
10
-
11
- The [devise-guests](http://rubygems.org/gems/devise-guests), generated into new applications by default, provides (session-based) guest user functionality to Devise (and, to Blacklight for applications that are using Devise). When a guest user logs in, the bookmarks associated with the guest user are transfered to the logged in user.
12
-
13
- ### Implementation details for those not using devise.
14
-
15
- We've added a new method ```#current_or_guest_user```. By default, this is just the value of ```#current_user``` (provided by Devise, or whatever authentication layer you are using). Applications that want to provide session-based bookmarks should implement ```#current_or_guest_user``` and ``#guest_user``` in the application and return the current user (when logged in) or a session-based guest user record.
16
-
17
- When a user logs in, your application should call ```#transfer_guest_user_actions_to_current_user``` to move the bookmarks and saved searches to the logged in user.
18
-
19
- ## Query Facets
20
-
21
- Blacklight 3.7 adds support for Solr query facets. There's an example of this in the [Blacklight demo](http://demo.projectblacklight.org) with the Publish Date facet.
22
-
23
- The Publish Date facet is using this configuration:
24
-
25
- ```ruby
26
- config.add_facet_field 'example_query_facet_field', :label => 'Publish Date', :query => {
27
- :years_5 => { :label => 'within 5 Years', :fq => "pub_date:[#{Time.now.year - 5 } TO *]" },
28
- :years_10 => { :label => 'within 10 Years', :fq => "pub_date:[#{Time.now.year - 10 } TO *]" },
29
- :years_25 => { :label => 'within 25 Years', :fq => "pub_date:[#{Time.now.year - 25 } TO *]" }
30
- }
31
- ```
32
-
33
- The first argument (which maps to the facet field for plain facets) is used in the Blacklight URL when the facet is selected.
34
-
35
- The ```:query``` hash maps the URL key into a facet label (to show to the user) and a fq to send to `facet.query` and, after selection, the Solr `fq` parameter.
36
-
37
-
38
- ### A small change to the Blacklight configuration to get Blacklight to generate facet.query for you.
39
-
40
- In older versions of Blacklight, the facet field keys mapped directly to the Solr ```facet.field``` parameter. By default, Blacklight generated the following into your CatalogController configuration:
41
-
42
- ```
43
- config.default_solr_params[:'facet.field'] = config.facet_fields.keys
44
- ```
45
-
46
- In the new model, this logic is deferred as part of the Blacklight solr search params logic. The above line should be replaced with:
47
-
48
- ```
49
- # Have BL send all facet field names to Solr, which has been the default
50
- # previously. Simply remove these lines if you'd rather use Solr request
51
- # handler defaults, or have no facets.
52
- config.add_facet_fields_to_solr_request!
53
- ```
54
-
55
- This will add the plain facets to the ```facet.field``` and the query facets to the ```facet.query```.
56
-
57
- ### Adding facet queries to the solr request handler yourself
58
-
59
- If you want to add the facet queries directly to your solr request handler, you should ensure the configuration for the Blacklight facet queries ```fq``` field matches a Solr ```facet.query``` field.
60
-
61
- So, given this Solr response:
62
-
63
- ```xml
64
- <lst name="facet_counts">
65
- <lst name="facet_queries">
66
- <int name="lc_alpha_facet:A">0</int>
67
- </lst>
68
- ...
69
- </lst>
70
- ```
71
-
72
- The Blacklight-side config would look something like:
73
-
74
- ```ruby
75
- config.add_facet_field 'contrived_blacklight_configuration_example', :query => {
76
- :a => { :label => 'starting with A', :fq => "lc_alpha_facet:A" },
77
- }
78
- ```