Skip to content

Commit 05ee822

Browse files
committed
Blacklight 2.3
1 parent 49b2293 commit 05ee822

File tree

2,179 files changed

+146687
-429002
lines changed

Some content is hidden

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

2,179 files changed

+146687
-429002
lines changed

.gitignore

-6
This file was deleted.
File renamed without changes.

rails/LICENSE LICENSE

File renamed without changes.

PRE-REQUISITES.rdoc

+114
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
== Pre-requisites
2+
3+
===Ruby
4+
5+
Ruby version 1.8.7 (or 1.8.6 enterprise) is required. You can find out which version you are running by executing:
6+
ruby -v
7+
Information on installing Ruby can be found here:
8+
http://www.ruby-lang.org/en/downloads
9+
10+
===Ruby Gems
11+
12+
You'll need Ruby Gems version 1.3.1 or later. You can check which version of “gem” you have by running:
13+
gem -v
14+
Information on installing Ruby Gems can be found here:
15+
http://www.rubygems.org/read/chapter/3
16+
17+
To update your Ruby Gems, run (YMMV for various operating systems):
18+
sudo gem install rubygems-update
19+
sudo update_rubygems
20+
21+
You can also manually install Ruby Gems:
22+
wget http://rubyforge.org/frs/download.php/45905/rubygems-1.3.1.tgz
23+
tar xzf rubygems-1.3.1.tgz
24+
cd rubygems-1.3.1
25+
sudo ruby setup.rb
26+
gem -v
27+
28+
These commands should work for Linux and OSX, but we haven't yet written any instructions for Windows installation. If anyone is able to volunteer for this task, please let us know!
29+
30+
===Ruby Gems Sources
31+
32+
Make sure you have the standard ruby gem sources available:
33+
gem sources -l
34+
should show
35+
http://gems.rubyforge.org
36+
http://gems.rubyonrails.org
37+
38+
If you're missing those gem sources, add them like this:
39+
gem sources -a http://gems.rubyforge.org
40+
gem sources -a http://gems.rubyonrails.org
41+
gem sources -a http://gems.github.com
42+
43+
===Git Client
44+
45+
Some of the rubygems required by blacklight are hosted in git repositories. Information on getting the git client installed can be found here:
46+
47+
http://git-scm.com/
48+
http://book.git-scm.com/2_installing_git.html
49+
50+
If you are behind a firewall, you may need to open port 9418 for Git.
51+
52+
53+
===Install Blacklight's Ruby Gem dependencies:
54+
First, build the bundled gems for your local system:
55+
rake gems:build
56+
57+
Now see if you have all of the required gems installed, or whether you're still missing some:
58+
rake gems
59+
60+
The ''rake gems'' command will give you a list of the required gems and their version numbers, and will tell you which ones are installed already.
61+
You can also see vendor/plugins/blacklight/init.rb for the Blacklight plugin dependencies' versions.
62+
An example of a versioned install: sudo gem install rails --version '2.3.2')
63+
64+
You can confirm your gem installations and their release numbers with
65+
66+
gem list
67+
68+
===Database dependencies
69+
You can choose to use any database that has ruby on rails bindings, but sqlite and mysql are used most commonly and are documented here.
70+
71+
* if you are using sqlite3:
72+
sudo gem install sqlite3-ruby
73+
74+
If you want to use sqlite, you will need to install sqlite3 and its ruby bindings
75+
76+
On Red Hat Fedora the command is:
77+
sudo yum install sqlite sqlite-devel ruby-sqlite3
78+
79+
On OSX macports the command is:
80+
sudo port install sqlite3 rb-sqlite3
81+
82+
On FreeBSD the command is:
83+
cd /usr/ports/databases/rubygem-sqlite3 && make install clean
84+
85+
86+
* if you are using mysql, make sure mysql is installed, and run:
87+
sudo gem install mysql
88+
89+
===Dependencies included with Blacklight
90+
91+
* ActsAsTaggableOnSteroids plugin docs: http://agilewebdevelopment.com/plugins/acts_as_taggable_on_steroids
92+
93+
* Resource Controller: http://github.com/giraffesoft/resource_controller/tree/master There is a very good
94+
video tutorial on the resource_controller plugin: http://www.vimeo.com/637894
95+
96+
These gems are vendorized with blacklight and will be built locally by the ''rake gems:build'' command
97+
authlogic-2.0.13
98+
curb-0.3.4
99+
haml-2.0.9
100+
marc-0.2.2
101+
mislav-hanna-0.1.7
102+
mislav-will_paginate-2.3.8
103+
mwmitchell-material_girl-0.0.2
104+
mwmitchell-rsolr-0.8.8
105+
mwmitchell-rsolr-ext-0.7.35
106+
nokogiri-1.3.2
107+
rack-1.0.0
108+
rdoc-2.3.0
109+
rspec-1.2.7
110+
rspec-rails-1.2.7.1
111+
ruby-xslt-0.9.6
112+
webrat-0.4.4
113+
114+

README.rdoc

+128
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
=Blacklight
2+
3+
Please see Project Info below for main information about this project and plugin.
4+
5+
Please see Solr in Blacklight below for information about setting up and configuring Solr.
6+
7+
Note: these instructions appy to releases 2.2.0 and above.
8+
9+
Note: issue commands from your Rails application's root directory.
10+
11+
==How to Install the Blacklight Plugin into Your Rails Project
12+
13+
1. Create your rails app: http://guides.rubyonrails.org/getting_started.html#creating-a-new-rails-project
14+
2. Install Blacklight:
15+
From a release:
16+
script/plugin -v install http://blacklight.rubyforge.org/svn/releases/plugins/blacklight-plugin-2.2.0_RC2/
17+
Or from trunk:
18+
script/plugin -v install http://blacklight.rubyforge.org/svn/trunk/rails/vendor/plugins/blacklight/
19+
20+
Using <tt>script/plugin install</tt> calls the plugin's install.rb script, which does the following:
21+
22+
1. automatically installs the Engines plugin ( http://rails-engines.org )
23+
2. updates config/environment.rb with the necessary lines for Engines and Blacklight
24+
3. copies the vendorized Authlogic gem from vendor/plugins/blacklight/vendor/gems to vendor/gems
25+
4. adds default solr.yml to config dir
26+
5. copies the migration files from vendor/plugins/blacklight/db/migrate to db/migrate
27+
6. copies the default blacklight_config.rb file to config/initializers/blacklight_config.rb
28+
29+
If you need to manually install Blacklight, see Installing Blacklight Manually below, then return to Post Installation.
30+
31+
==Post Installation
32+
33+
Remove public/index.html, app/controllers/application_controller.rb and app/helpers/application_helper.rb:
34+
35+
rm public/index.html
36+
rm app/controllers/application_controller.rb
37+
rm app/helpers/application_helper.rb
38+
39+
Next, run the migrations. By default, Rails uses a SQLite3 database. Configure others in config/databases.yml:
40+
41+
rake db:migrate
42+
43+
You need a running instance of Solr. Just to get going you can use the test instance in the Blacklight plugin:
44+
45+
cd vendor/plugins/blacklight/jetty
46+
java -jar start.jar
47+
48+
This starts an instance of jetty with Solr running on port 8983. If you want to start on another port, use Java's -D argument:
49+
50+
java -Djetty.port=8888 -jar start.jar
51+
52+
This Solr instance has data. Once you start it you can run the Rails app against this.
53+
54+
script/server
55+
56+
Now navigate to http://localhost:3000 and you should see a running app with the test data set!
57+
58+
59+
==Installing Blacklight Manually
60+
61+
This assumes that for some reason you can't install the plugin via <tt>script/plugin install</tt> or
62+
there was a problem and you need to finish manually. Otherwise, see the instructions above.
63+
64+
1. Create your Rails app: http://guides.rubyonrails.org/getting_started.html#creating-a-new-rails-project
65+
2. Get the Blacklight plugin and put it in your plugins directory:
66+
67+
Edge: svn export http://blacklight.rubyforge.org/svn/trunk/rails/vendor/plugins/blacklight vendor/plugins/blacklight
68+
69+
Specific Release:
70+
71+
1. Find the release you want here: http://blacklight.rubyforge.org/svn/releases/plugins/
72+
2. Then navigate to the plugin, for example: http://blacklight.rubyforge.org/svn/releases/plugins/blacklight-plugin-2.2.0
73+
3. Use SVN to export it: svn export http://blacklight.rubyforge.org/svn/releases/plugins/blacklight-plugin-2.2.0
74+
75+
Finally, you can also downlowd the archive and unpack it in vendor/plugins/blacklight:
76+
77+
1. Find the release you want here: http://rubyforge.org/frs/?group_id=5235
78+
2. Download it into vendor/plugins
79+
3. Move to the directory: cd vendor/plugins
80+
4. Unarchive: tar xvzf blacklight-plugin-2.2.0
81+
5. Rename the directory: mv blacklight-plugin-2.2.0 blacklight
82+
83+
3. Install the Engines plugin:
84+
85+
script/plugin install git://github.com/lazyatom/engines.git
86+
87+
If you aren't using or can't use script/plugin, then install it manually:
88+
89+
1. git clone git://github.com/lazyatom/engines.git vendor/plugins/engines
90+
2. rm -rf vendor/plugins/engines/.git
91+
92+
4. Update _config/environment.rb_ with necessary lines:
93+
94+
1. Below require File.join(File.dirname(__FILE__), 'boot'):
95+
96+
require File.join(File.dirname(__FILE__), '../vendor/plugins/engines/boot')
97+
98+
2. Inside Rails::Initializer.run do |config| block:
99+
100+
config.gem 'authlogic'
101+
config.plugin_paths += ["#{RAILS_ROOT}/vendor/plugins/blacklight/vendor/plugins"]
102+
config.plugins = %W(engines blacklight acts_as_taggable_on_steroids resource_controller)
103+
104+
5. Install the Authlogic gem. You can install this as a system gem or copy it from the Blacklight plugin:
105+
106+
* As a system gem:
107+
108+
sudo gem install authlogic
109+
110+
* As a vendorized gem (this is what the Blacklight installer does--see above):
111+
112+
mkdir vendor/gems
113+
cp -rp vendor/plugins/blacklight/vendor/gems/authlogic-<version> vendor/gems/authlogic-<version>
114+
115+
6. Copy solr.yml to config dir:
116+
117+
cp vendor/plugins/blacklight/install/solr.yml config/
118+
119+
7. Copy the migration files to your app:
120+
121+
cp -pR vendor/plugins/blacklight/db/migrate db/migrate
122+
123+
8. Copy the default blacklight_config.rb file to config/initializers:
124+
125+
cp vendor/plugins/blacklight/config/initializers/blacklight_config.rb config/initializers/
126+
127+
9. Go to "Post Installation", above.
128+
File renamed without changes.
File renamed without changes.

Rakefile

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# require 'rake'
2+
# require 'rake/testtask'
3+
# require 'rake/rdoctask'
4+
5+
require(File.join(File.dirname(__FILE__), 'config', 'boot'))
6+
7+
require 'rake'
8+
#require 'rake/clean'
9+
require 'rake/testtask'
10+
require 'rake/rdoctask'
11+
require 'tasks/rails'
12+
13+
# the default rake task
14+
desc "run migrations and call solr:spec and solr:features"
15+
task :default => "test"
16+
17+
# run migrations and call solr:spec and solr:features
18+
desc 'run migrations and call solr:spec and solr:features'
19+
task "test" => ["db:migrate", "solr:spec", "solr:features"] do
20+
end
21+
22+
# Set constants used for publishing releases and rdocs
23+
24+
# The name of your project
25+
PROJECT = "Blacklight"
26+
# Short summary of your project, used in packaging.
27+
PROJECT_SUMMARY = "Blacklight is open source discovery software. Libraries (or anyone else) may use blacklight to enable searching and browsing of their collections online. Blacklight uses Solr to index and search text and/or metadata, and it has a highly configurable Ruby on Rails front-end. Currently, Blacklight can index, search, and provide faceted browsing for MaRC records and several kinds of XML documents, including TEI, EAD, and GDMS. Blacklight was developed at the University of Virginia Library and is made public under an Apache 2.0 license."
28+
# The project's package name (as opposed to its display name). Used for
29+
# RubyForge connectivity and packaging.
30+
UNIX_NAME = "blacklight"
31+
# Your RubyForge user name.
32+
RUBYFORGE_USER = ENV["RUBYFORGE_USER"] || "eos8d"
33+
# Directory on RubyForge where your website's files should be uploaded.
34+
RUBYFORGE_PATH = "/var/www/gforge-projects/blacklight/"
35+
# Output directory for the rdoc html files.
36+
# If you don't have a custom homepage, and want to use the RDoc
37+
# index.html as homepage, just set it to WEBSITE_DIR.
38+
RDOC_HTML_DIR = "html"
39+
# Additional RDoc formatted files, besides the Ruby source files.
40+
RDOC_FILES = FileList["README.rdoc", "Changes.rdoc"]
41+
CURRENT_SVN_BRANCH = "http://blacklight.rubyforge.org/svn/trunk/"
42+
43+
44+
desc 'Generate documentation for the blacklight plugin.'
45+
Rake::RDocTask.new('rdoc') do |t|
46+
t.rdoc_files.include('README.rdoc', 'lib/**/*.rb')
47+
t.main = 'README.rdoc'
48+
t.title = "Blacklight API documentation"
49+
t.options << '--line-numbers' << '--inline-source'
50+
end
51+
52+
desc "Upload website to RubyForge. scp will prompt for your RubyForge password."
53+
task "publish-rdoc" => ["rdoc"] do
54+
rubyforge_path = "/var/www/gforge-projects/#{UNIX_NAME}/"
55+
sh "scp -r #{RDOC_HTML_DIR}/* " +
56+
"#{RUBYFORGE_USER}@rubyforge.org:#{RUBYFORGE_PATH}",
57+
:verbose => true
58+
end
59+

rails/vendor/plugins/blacklight/app/controllers/application_controller.rb app/controllers/application_controller.rb

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Likewise, all the methods added will be available for all controllers.
44
#
55
class ApplicationController < ActionController::Base
6+
67
filter_parameter_logging :password, :password_confirmation
78
helper_method :current_user_session, :current_user
89

0 commit comments

Comments
 (0)