Skip to content

Commit eea7dd7

Browse files
committed
merging blacklight update to 2.4
1 parent 6cbe1ac commit eea7dd7

File tree

439 files changed

+39997
-608
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

439 files changed

+39997
-608
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ nohup.out
99
coverage.data
1010
coverage/*
1111

12+
public/plugin_assets
13+
public/plugin_assets/**/*
14+
1215
tmp/**/*
1316
tmp/performance
1417

CHANGELOG.txt

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
0.0.0 2010-03-30
2+
3+
Upgraded to Blacklight 2.4 using a git subtree
4+
5+
== Notes
6+
7+
lost support for switching indexes at query time
8+
forced to edit Blacklight's routes.rb to expose catalog/{id}/edit
9+
* setting the edit_catalog_path separately failed
10+
11+
12+
# modified: vendor/plugins/blacklight/lib/blacklight.rb
13+
## this includes a hack to smooth over the usage of Blacklight.solr_config, but SHOULD BE REPLACED
14+
# modified: vendor/plugins/blacklight/lib/blacklight/routes.rb

README.textile

+68-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,70 @@
11
h1. Hydrangea
22

3-
Hydrangea is the first general-purpose Hydra app. It's built on "Blacklight":http://projectblacklight.org, "ActiveFedora":http://yourmediashelf.com/activefedora and "Ruby on Rails":http://rubyonrails.org
3+
Hydrangea is the first general-purpose Hydra app. It's built on "Blacklight":http://projectblacklight.org, "ActiveFedora":http://yourmediashelf.com/activefedora and "Ruby on Rails":http://rubyonrails.org
4+
5+
h2. Basic installation & Running RSpec tests
6+
7+
This is based on Matt Zumwalt's "Hydra Stack: Getting Started"http://docs.google.com/View?id=ddrmhvjh_181gj9b7rcv notes from LibDevConX in March 2010.
8+
9+
Clone the git repository from github and pull the copy of jetty
10+
11+
<pre>
12+
git clone git://github.com/mediashelf/hydrangea.git
13+
cd hydrangea
14+
git submodule init
15+
git submodule update
16+
</pre>
17+
18+
This will pull all of the code. The 'git submodule update' command is pulling a copy of hydra-jetty into the jetty directory within hydrangea.
19+
20+
You are now in your working copy of hydrangea. Use rake to install the gem dependencies (this might not work perfectly - we're still preparing this code for distribution).
21+
22+
<pre>
23+
rake gems:install
24+
</pre>
25+
26+
Run your database migrations (only need to do this once after cloning the git repository).
27+
<pre>
28+
rake db:migrate
29+
</pre>
30+
31+
Now run the bundled copy of Jetty, which has Fedora and Solr installed & configured to work with Hydra.
32+
33+
<pre>
34+
cd jetty
35+
java -jar start.jar
36+
</pre>
37+
38+
... leave that running and open a new terminal window. cd to wherever you checked out hydrangea
39+
40+
Run the Rspec tests to make sure everything is working properly.
41+
<pre>
42+
cd hydrangea
43+
rake hydra:import_fixture pid="druid:tj532xx3843"
44+
rake spec
45+
</pre>
46+
47+
Now run the rails lighttpd server
48+
49+
<pre>
50+
script/server
51+
</pre>
52+
53+
If all goes well, you will be able to see an empty copy of hydrangea at http://localhost:3000
54+
55+
56+
57+
h2. To get cucumber features to pass
58+
59+
You must ingest two more fixtures:
60+
61+
<pre>
62+
rake hydra:import_fixture pid=druid:sb733gr4073
63+
rake hydra:import_fixture pid=druid:bz425fy5289
64+
</pre>
65+
66+
Then run your tests.
67+
68+
<pre>
69+
rake cucumber
70+
</pre>

app/controllers/catalog_controller.rb

+16-6
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def edit
2424
def index
2525
@extra_controller_params ||= {}
2626
enforce_search_permissions
27-
@response = get_search_results( @extra_controller_params )
27+
(@response, @document_list) = get_search_results( @extra_controller_params )
2828
@filters = params[:f] || []
2929
respond_to do |format|
3030
format.html { save_current_search_params }
@@ -100,11 +100,21 @@ def enforce_edit_permissions
100100
end
101101

102102

103-
def get_search_results(extra_controller_params={})
104-
_search_params = self.solr_search_params(extra_controller_params)
105-
index = _search_params[:qt] == 'fulltext' ? :fulltext : :default
106-
Blacklight.solr(index).find(_search_params)
107-
end
103+
#
104+
### This was how get_search_results in SALT deals with switching solr instances
105+
#
106+
# def get_search_results(extra_controller_params={})
107+
# _search_params = self.solr_search_params(extra_controller_params)
108+
# index = _search_params[:qt] == 'fulltext' ? :fulltext : :default
109+
#
110+
# document_list = solr_response.docs.collect {|doc| SolrDocument.new(doc)}
111+
#
112+
# Blacklight.solr(index).find(_search_params)
113+
#
114+
# return [solr_response, document_list]
115+
#
116+
# end
117+
108118

109119
# This method will remove certain params from the session[:search] hash
110120
# if the values are blank? (nil or empty string)
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
require 'active-fedora'
2+
#
3+
# Misc Config for SALT Application
4+
#
5+
6+
7+
# This initializes ActiveFedora with config info from RAOLS_ROOT/lib/fedora.yml
8+
# Among other things, it allows you to access Fedora and Solr (ActiveFedora's copy) as ActiveFedora.fedora and ActiveFedora.solr
9+
ENABLE_SOLR_UPDATES=false
10+
ActiveFedora.init
11+
12+
#
13+
# Loads EAD descriptors
14+
# Attempts to parse any xml files in lib/stanford/ead/
15+
#
16+
# You can access any of the loaded descriptors using Descriptor.retrieve( id ), where "id" is the base filename of the descriptor xml file
17+
18+
# puts "Registering EADs..."
19+
# Dir[File.join( RAILS_ROOT, 'lib', "stanford", "ead", "/*.xml" )].each do |f|
20+
# puts "... EAD id #{File.basename(f, ".xml")}"
21+
# Descriptor.register( File.basename(f, ".xml") )
22+
# end
23+

features/edit_document.feature

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ Feature: Edit a document
88
Given I am logged in as "francis" on the edit document page for druid:sb733gr4073
99
Then the "Date:" inline date edit should contain "1991-00-00"
1010
And the "Type:" dropdown edit should contain "Paper document"
11-
And the "Stories:" inline textarea edit should be empty
1211
## Commented out next line b/c the title is not displaying properly due to a bug in the sample data on the testing image.
1312
# And the "Title:" inline edit should contain "Letter from Ellie Engelmore to Wemara Lichty"
1413

features/facet_more_less_links.feature

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
@facets
1+
@facets @wip
2+
# Marked @wip until we are able to load solr fixtures.
3+
# Currently failing with jetty index because there aren't enough technology facet values in the jetty index to trigger rendering of more/less feature
4+
# This test will pass with the full SALT sample dataset (from SALT disk image)
25
Feature: display more/less links
36
As a user
47
In order to hide facets when there are more than the configurable amount

lib/tasks/hydra.rake

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace :hydra do
44

5-
desc "Export the object identified by pid into spec/fixtures"
5+
desc "Export the object identified by pid into spec/fixtures. Example:rake hydra:harvest_fixture pid=druid:sb733gr4073 source=http://fedoraAdmin:[email protected]:8080/fedora"
66
task :harvest_fixture => :environment do
77

88
# If a source url has been provided, attampt to export from the fedora repository there.

public/plugin_assets/README

100755100644
File mode changed.

public/plugin_assets/blacklight/images/bg.png

100755100644
File mode changed.

public/plugin_assets/blacklight/images/border.png

100755100644
File mode changed.

public/plugin_assets/blacklight/images/bul_sq_gry.gif

100755100644
File mode changed.

public/plugin_assets/blacklight/images/checkmark.gif

100755100644
File mode changed.

public/plugin_assets/blacklight/images/logo.png

100755100644
File mode changed.

public/plugin_assets/blacklight/images/magnifying_glass.gif

100755100644
File mode changed.

public/plugin_assets/blacklight/images/remove.gif

100755100644
File mode changed.

public/plugin_assets/blacklight/images/separator.gif

100755100644
File mode changed.

public/plugin_assets/blacklight/images/start_over.gif

100755100644
File mode changed.

public/plugin_assets/blacklight/javascripts/accordion.js

100755100644
File mode changed.

public/plugin_assets/blacklight/javascripts/application.js

100755100644
File mode changed.

public/plugin_assets/blacklight/javascripts/blacklight.js

100755100644
File mode changed.

public/plugin_assets/blacklight/javascripts/jquery-1.3.1.min.js

100755100644
File mode changed.

public/plugin_assets/blacklight/javascripts/lightbox.js

100755100644
File mode changed.

public/plugin_assets/blacklight/stylesheets/application.css

100755100644
+7-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ th, td {border: 0;}
9696
#documents #results_label {margin-left: 5px;}
9797

9898
/* Result List (http://www.quirksmode.org/css/clearing.html) */
99-
h3.index_title {clear: both; margin: 0px; padding: 0px; width: 650px;}
99+
h3.index_title {clear: both; margin: 0px; padding: 0px; width: 460px;}
100100

101101
dl {margin: 0px; padding: 0px;}
102102
dl.defList {overflow: auto; padding: 0.5em 0;}
@@ -105,6 +105,12 @@ dl.defList dd {text-align: left; margin: 0; padding: 2px 0;}
105105

106106
/* Individual Result Listing */
107107
#document h1 {margin: 0px; padding: 0px 0px 1em 0px;}
108+
#marc_view {padding:5px;}
109+
#marc_view .ind1, #marc_view .ind2 {padding:0 5px; display:inline;}
110+
#marc_view .tag_ind {float:left;}
111+
#marc_view .subfields {padding-left:5em;}
112+
#marc_view .field {clear:both; border-bottom:1px solid #CCCCCC;}
113+
#librarian_view{top:10%;left:-17%;text-align:left;width:700px;} /* Lightbox element */
108114

109115
/* FORMS */
110116
form div.row label {float:left; width:120px; text-align:right; margin-right: .5em;}

public/plugin_assets/blacklight/stylesheets/yui.css

100755100644
File mode changed.

spec/controllers/catalog_controller_spec.rb

+3-7
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
@private_document.save
4949

5050
@public_only_results = Blacklight.solr.find Hash[:phrases=>{:access_t=>"public"}]
51-
@priavte_only_results = Blacklight.solr.find Hash[:phrases=>{:access_t=>"private"}]
51+
@private_only_results = Blacklight.solr.find Hash[:phrases=>{:access_t=>"private"}]
5252

5353
end
5454
after(:all) do
@@ -61,17 +61,13 @@
6161
it "should only return public documents if role does not have permissions" do
6262
request.env["WEBAUTH_USER"]="Mr. Notallowed"
6363
get :index
64-
# assigns["response"].docs.should include(@public_only_results.first)
65-
# assigns["response"].docs.should_not include(@priavte_only_results.first)
66-
67-
assigns["response"].docs.count.should == @public_only_results.docs.count
68-
#assigns["response"].should == @public_only_results
64+
assigns("response").docs.count.should == @public_only_results.docs.count
6965
end
7066
it "should return all documents if role does have permissions" do
7167
request.env["WEBAUTH_USER"]="francis"
7268
get :index
7369
# assigns["response"].docs.should include(@public_only_results.first)
74-
# assigns["response"].docs.should include(@priavte_only_results.first)
70+
# assigns["response"].docs.should include(@private_only_results.first)
7571
assigns["response"].docs.count.should > @public_only_results.docs.count
7672
end
7773
end

0 commit comments

Comments
 (0)