diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index 4110164cb89..8bbcf02f0dd 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -363,6 +363,8 @@ Other Changes * SOLR-1123: Changed JSONResponseWriter to now use application/json as its Content-Type by default. However the Content-Type can be overwritten and is set to text/plain in the example configuration. (Uri Boness, Chris Male) + +* SOLR-2607: Removed deprecated clients/ruby (solr-ruby and flare). (ehatcher) Documentation ---------------------- diff --git a/solr/client/ruby/flare/README b/solr/client/ruby/flare/README deleted file mode 100644 index 9c1858c8816..00000000000 --- a/solr/client/ruby/flare/README +++ /dev/null @@ -1,29 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -== Welcome to Solr Flare - -Flare promises to expose the power of Solr through a Rails-based user interface. Integral to Flare will be general purpose faceted browsing, auto-suggest, folksonomy tagging/annotating, and much more. - - Visit the Solr Flare wiki for more information: http://wiki.apache.org/solr/Flare - -== Getting started - -Launch Solr: - - cd solr - java -jar start.jar - -Launch Rails: - script/server - diff --git a/solr/client/ruby/flare/Rakefile b/solr/client/ruby/flare/Rakefile deleted file mode 100644 index 98a185e02a9..00000000000 --- a/solr/client/ruby/flare/Rakefile +++ /dev/null @@ -1,24 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Add your own tasks in files placed in lib/tasks ending in .rake, -# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. - -require(File.join(File.dirname(__FILE__), 'config', 'boot')) - -require 'rake' -require 'rake/testtask' -require 'rake/rdoctask' - -require 'tasks/rails' - -#require 'solr/solrtasks' \ No newline at end of file diff --git a/solr/client/ruby/flare/app/controllers/application.rb b/solr/client/ruby/flare/app/controllers/application.rb deleted file mode 100644 index eafa2eaa39e..00000000000 --- a/solr/client/ruby/flare/app/controllers/application.rb +++ /dev/null @@ -1,19 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Filters added to this controller apply to all controllers in the application. -# Likewise, all the methods added will be available for all controllers. - -class ApplicationController < ActionController::Base - # Pick a unique cookie name to distinguish our session data from others' - session :session_key => '_flare_session_id' -end diff --git a/solr/client/ruby/flare/app/controllers/i18n_controller.rb b/solr/client/ruby/flare/app/controllers/i18n_controller.rb deleted file mode 100644 index 3ff6b209273..00000000000 --- a/solr/client/ruby/flare/app/controllers/i18n_controller.rb +++ /dev/null @@ -1,19 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# This controller demonstrates the returning of accented characters work from the Solr example data -# and render properly in the browser -class I18nController < ApplicationController - def index - @results = SOLR.query("acute").hits - end -end \ No newline at end of file diff --git a/solr/client/ruby/flare/app/helpers/application_helper.rb b/solr/client/ruby/flare/app/helpers/application_helper.rb deleted file mode 100644 index b72ef869ca0..00000000000 --- a/solr/client/ruby/flare/app/helpers/application_helper.rb +++ /dev/null @@ -1,15 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Methods added to this helper will be available to all templates in the application. -module ApplicationHelper -end diff --git a/solr/client/ruby/flare/app/helpers/browse_helper.rb b/solr/client/ruby/flare/app/helpers/browse_helper.rb deleted file mode 100644 index 7d520e70c3f..00000000000 --- a/solr/client/ruby/flare/app/helpers/browse_helper.rb +++ /dev/null @@ -1,14 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -module BrowseHelper -end diff --git a/solr/client/ruby/flare/app/helpers/simile_helper.rb b/solr/client/ruby/flare/app/helpers/simile_helper.rb deleted file mode 100755 index 716d34979f6..00000000000 --- a/solr/client/ruby/flare/app/helpers/simile_helper.rb +++ /dev/null @@ -1,14 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -module SimileHelper -end \ No newline at end of file diff --git a/solr/client/ruby/flare/app/views/browse/_suggest.rhtml b/solr/client/ruby/flare/app/views/browse/_suggest.rhtml deleted file mode 100755 index 6cb4b05e6fd..00000000000 --- a/solr/client/ruby/flare/app/views/browse/_suggest.rhtml +++ /dev/null @@ -1,24 +0,0 @@ -<% -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -%> - \ No newline at end of file diff --git a/solr/client/ruby/flare/app/views/browse/facet.rhtml b/solr/client/ruby/flare/app/views/browse/facet.rhtml deleted file mode 100755 index bf658cb5e39..00000000000 --- a/solr/client/ruby/flare/app/views/browse/facet.rhtml +++ /dev/null @@ -1,55 +0,0 @@ -<% -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -%> -
-
- <%=link_to '[clear constraints]', :action => 'clear'%> -
- -
-Queries: -
-<% @flare.queries.each_with_index do |q,i| %> -<%=link_to q[:negative] ? "-" : '+', :action => :invert_query, :index => i%> -<%=q[:query]%> -<%= in_place_editor "query_#{i}", :url=> url_for(:action=>"update_query", :index=>i) %> -<%=link_to image_tag("x-close.gif"), :action => :remove_query, :index => i %>
-<% end %> -
-
- -
-Filters: -
-<% @flare.filters.each_with_index do |filter, i| %> - <%=link_to filter[:negative] ? "-" : "+", :action => :invert_filter, :index => i%> - <%=filter[:field]%>:<%=filter[:value]%> - <%=link_to image_tag("x-close.gif"), :action => :remove_filter, :index => i %> -<% end %> -
-
- -
- <%=link_to '[clear constraints]', :action => 'clear'%> -
- -
- -

<%=params[:field]%>

-<% @facets.each do |f| %> - <% if f.name %> - <%= link_to f.name, :action => 'add_filter', :field => params[:field], :value => f.name %> (<%=f.value%>) - <% else %> - <%= link_to '---- NO VALUE ----', :action => 'add_filter', :field => params[:field], :value => "[* TO *]", :negative => true %> (<%=f.value%>) - <% end %> -<% end%> \ No newline at end of file diff --git a/solr/client/ruby/flare/app/views/document/_document_delicious.rhtml b/solr/client/ruby/flare/app/views/document/_document_delicious.rhtml deleted file mode 100755 index dca714bfb77..00000000000 --- a/solr/client/ruby/flare/app/views/document/_document_delicious.rhtml +++ /dev/null @@ -1,30 +0,0 @@ -<% -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -%> - - - <%=image_tag "http://images.amazon.com/images/P/#{doc['id']}.01.MZZZZZZZ" %> - - - - - - - <% doc.each do |k,v|; highlighting = response.highlighted(doc['id'], k) %> - - <% end %> -
<%=link_to doc['title_text'], "http://www.amazon.com/exec/obidos/ASIN/#{doc['id']}"%>
<%=k%>:<%= highlighting ? "...#{highlighting}..." : (v.respond_to?('join') ? v.join(',') : v.to_s)%>
- - - - diff --git a/solr/client/ruby/flare/app/views/document/_document_tang.rhtml b/solr/client/ruby/flare/app/views/document/_document_tang.rhtml deleted file mode 100755 index 5be65f2c5bd..00000000000 --- a/solr/client/ruby/flare/app/views/document/_document_tang.rhtml +++ /dev/null @@ -1,43 +0,0 @@ -<% -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -%> -<% - body_zh_highlighted = response.highlighted(doc['id'], 'body_zh_text') - body_en_highlighted = response.highlighted(doc['id'], 'body_en_text') --%> - - - - - - - - - - - - - - - - -
<%=doc['title_zh_text']%> (<%=doc['title_en_text']%>)
author:<%=doc['author_zh_facet']%> (<%=doc['author_en_facet']%>)
type:<%=doc['type_zh_facet']%> (<%=doc['type_en_facet']%>)
body: -
- <%= body_zh_highlighted ? "...#{body_zh_highlighted}..." : doc['body_zh_text'] %> -
-
- <%= body_en_highlighted ? "...#{body_en_highlighted}..." : doc['body_en_text'] %> -
-
- - diff --git a/solr/client/ruby/flare/app/views/document/_document_uva.rhtml b/solr/client/ruby/flare/app/views/document/_document_uva.rhtml deleted file mode 100755 index 40696a980dc..00000000000 --- a/solr/client/ruby/flare/app/views/document/_document_uva.rhtml +++ /dev/null @@ -1,36 +0,0 @@ -<% -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -%> -<% - virgo_link = "http://virgo.lib.virginia.edu/uhtbin/cgisirsi/uva/0/0/5?searchdata1=#{doc['id'][1..-1]}%7bCKEY%7d" - # url = URI.parse(virgo_link) - # res = Net::HTTP.start(url.host, url.port) {|http| - # http.get("/uhtbin/cgisirsi/uva/0/0/5?searchdata1=#{doc['id'][1..-1]}{CKEY}") - # } - # availability = Regexp.new("Copy\ info\:(.*)td\>", Regexp::MULTILINE).match(res.body)[1] -%> - - - - - - - <% doc.each do |k,v|; highlighting = response.highlighted(doc['id'], k) %> - - <% end %> - - - -
<%= link_to doc['title_text'], virgo_link, {:target => "_blank"}%>
<%=k%>:<%= highlighting ? "...#{highlighting}..." : (v.respond_to?('join') ? v.join(',') : v.to_s)%>
- - diff --git a/solr/client/ruby/flare/app/views/i18n/index.rhtml b/solr/client/ruby/flare/app/views/i18n/index.rhtml deleted file mode 100644 index 98161b0c66e..00000000000 --- a/solr/client/ruby/flare/app/views/i18n/index.rhtml +++ /dev/null @@ -1,16 +0,0 @@ -<% -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -%> -<% @results[0]['features'].each do |f| %> - <%= h f%> -<% end %> \ No newline at end of file diff --git a/solr/client/ruby/flare/app/views/layouts/browse.rhtml b/solr/client/ruby/flare/app/views/layouts/browse.rhtml deleted file mode 100755 index 18a15f51977..00000000000 --- a/solr/client/ruby/flare/app/views/layouts/browse.rhtml +++ /dev/null @@ -1,28 +0,0 @@ -<% -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -%> - - - Solr flare: <%=controller.action_name%> - <%= javascript_include_tag :defaults %> - <%= stylesheet_link_tag 'flare'%> - - -
- - <%= yield %> -
- - diff --git a/solr/client/ruby/flare/config/boot.rb b/solr/client/ruby/flare/config/boot.rb deleted file mode 100644 index ac6267f65e4..00000000000 --- a/solr/client/ruby/flare/config/boot.rb +++ /dev/null @@ -1,57 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Don't change this file. Configuration is done in config/environment.rb and config/environments/*.rb - -unless defined?(RAILS_ROOT) - root_path = File.join(File.dirname(__FILE__), '..') - - unless RUBY_PLATFORM =~ /(:?mswin|mingw)/ - require 'pathname' - root_path = Pathname.new(root_path).cleanpath(true).to_s - end - - RAILS_ROOT = root_path -end - -unless defined?(Rails::Initializer) - if File.directory?("#{RAILS_ROOT}/vendor/rails") - require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer" - else - require 'rubygems' - - environment_without_comments = IO.readlines(File.dirname(__FILE__) + '/environment.rb').reject { |l| l =~ /^#/ }.join - environment_without_comments =~ /[^#]RAILS_GEM_VERSION = '([\d.]+)'/ - rails_gem_version = $1 - - if version = defined?(RAILS_GEM_VERSION) ? RAILS_GEM_VERSION : rails_gem_version - # Asking for 1.1.6 will give you 1.1.6.5206, if available -- makes it easier to use beta gems - rails_gem = Gem.cache.search('rails', "~>#{version}.0").sort_by { |g| g.version.version }.last - - if rails_gem - gem "rails", "=#{rails_gem.version.version}" - require rails_gem.full_gem_path + '/lib/initializer' - else - STDERR.puts %(Cannot find gem for Rails ~>#{version}.0: - Install the missing gem with 'gem install -v=#{version} rails', or - change environment.rb to define RAILS_GEM_VERSION with your desired version. - ) - exit 1 - end - else - gem "rails" - require 'initializer' - end - end - - Rails::Initializer.run(:set_load_path) -end diff --git a/solr/client/ruby/flare/config/database.yml b/solr/client/ruby/flare/config/database.yml deleted file mode 100644 index 29c5c538835..00000000000 --- a/solr/client/ruby/flare/config/database.yml +++ /dev/null @@ -1,51 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# NOTE: Flare currently does not use a database, but there are plans to eventually leverage a relational database -# in conjunction with Solr. When a database is added, lib/tasks/clear_database_prerequisites.rake should be removed. - -# MySQL (default setup). Versions 4.1 and 5.0 are recommended. -# -# Install the MySQL driver: -# gem install mysql -# On MacOS X: -# gem install mysql -- --include=/usr/local/lib -# On Windows: -# gem install mysql -# Choose the win32 build. -# Install MySQL and put its /bin directory on your path. -# -# And be sure to use new-style password hashing: -# http://dev.mysql.com/doc/refman/5.0/en/old-client.html -development: - adapter: mysql - database: flare_development - username: root - password: - host: localhost - -# Warning: The database defined as 'test' will be erased and -# re-generated from your development database when you run 'rake'. -# Do not set this db to the same as development or production. -test: - adapter: mysql - database: flare_test - username: root - password: - host: localhost - -production: - adapter: mysql - database: flare_production - username: root - password: - host: localhost diff --git a/solr/client/ruby/flare/config/environment.rb b/solr/client/ruby/flare/config/environment.rb deleted file mode 100644 index b545733c4b7..00000000000 --- a/solr/client/ruby/flare/config/environment.rb +++ /dev/null @@ -1,105 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Be sure to restart your web server when you modify this file. - -# Uncomment below to force Rails into production mode when -# you don't control web/app server and can't set it the proper way -# ENV['RAILS_ENV'] ||= 'production' - -# Specifies gem version of Rails to use when vendor/rails is not present -RAILS_GEM_VERSION = '1.2.3' unless defined? RAILS_GEM_VERSION - -# Bootstrap the Rails environment, frameworks, and default configuration -require File.join(File.dirname(__FILE__), 'boot') - -Rails::Initializer.run do |config| - # Settings in config/environments/* take precedence over those specified here - - # Skip frameworks you're not going to use (only works if using vendor/rails) - # config.frameworks -= [ :action_web_service, :action_mailer ] - - # Only load the plugins named here, by default all plugins in vendor/plugins are loaded - # config.plugins = %W( exception_notification ssl_requirement ) - - # Add additional load paths for your own custom dirs - # config.load_paths += %W( #{RAILS_ROOT}/extras ) - - # Force all environments to use the same logger level - # (by default production uses :info, the others :debug) - # config.log_level = :debug - - # Use the database for sessions instead of the file system - # (create the session table with 'rake db:sessions:create') - # config.action_controller.session_store = :active_record_store - - # Use SQL instead of Active Record's schema dumper when creating the test database. - # This is necessary if your schema can't be completely dumped by the schema dumper, - # like if you have constraints or database-specific column types - # config.active_record.schema_format = :sql - - # Activate observers that should always be running - # config.active_record.observers = :cacher, :garbage_collector - - # Make Active Record use UTC-base instead of local time - # config.active_record.default_timezone = :utc - - # See Rails::Configuration for more options -end - -# Add new inflection rules using the following format -# (all these examples are active by default): -# Inflector.inflections do |inflect| -# inflect.plural /^(ox)$/i, '\1en' -# inflect.singular /^(ox)en/i, '\1' -# inflect.irregular 'person', 'people' -# inflect.uncountable %w( fish sheep ) -# end - -# Include your application configuration below -# $KCODE = 'UTF8' # Rails 1.2 supposedly sets this automatically - -require 'solr' - -solr_environments = { - # facets: default, all *_facet fields are considered facet fields - # title: default, :title_text is title field - # timeline: default, no timeline support without knowing the field(s) to use - - :development => { - :solr_query_type => :standard, - }, - - :delicious => { - :timeline_dates => :published_year_facet, - :image_proc => Proc.new {|doc| "http://images.amazon.com/images/P/#{doc['id']}.01.MZZZZZZZ"}, - }, - - :tang => { - :solr_query_type => :standard, - }, - - :marc => { - :timeline_dates => :year_facet, - }, - - # TODO: :uva could inherit :marc settings, only overriding the template for VIRGO links - :uva => { - :timeline_dates => :year_facet, - :facets_exclude => [:filename_facet] - }, -} -SOLR_ENV = ENV["SOLR_ENV"] || "development" -SOLR_CONFIG = solr_environments[SOLR_ENV.to_sym] -puts "#{SOLR_ENV}: SOLR_CONFIG = #{SOLR_CONFIG.inspect}" -SOLR_CONFIG[:solr_url] ||= "http://localhost:8983/solr" -#SOLR = Solr::Connection.new(SOLR_CONFIG[:solr_url]) diff --git a/solr/client/ruby/flare/config/environments/development.rb b/solr/client/ruby/flare/config/environments/development.rb deleted file mode 100644 index 63570f610af..00000000000 --- a/solr/client/ruby/flare/config/environments/development.rb +++ /dev/null @@ -1,33 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Settings specified here will take precedence over those in config/environment.rb - -# In the development environment your application's code is reloaded on -# every request. This slows down response time but is perfect for development -# since you don't have to restart the webserver when you make code changes. -config.cache_classes = false - -# Log error messages when you accidentally call methods on nil. -config.whiny_nils = true - -# Enable the breakpoint server that script/breakpointer connects to -config.breakpoint_server = true - -# Show full error reports and disable caching -config.action_controller.consider_all_requests_local = true -config.action_controller.perform_caching = false -config.action_view.cache_template_extensions = false -config.action_view.debug_rjs = true - -# Don't care if the mailer can't send -config.action_mailer.raise_delivery_errors = false diff --git a/solr/client/ruby/flare/config/environments/production.rb b/solr/client/ruby/flare/config/environments/production.rb deleted file mode 100644 index 5f8a29a497a..00000000000 --- a/solr/client/ruby/flare/config/environments/production.rb +++ /dev/null @@ -1,30 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Settings specified here will take precedence over those in config/environment.rb - -# The production environment is meant for finished, "live" apps. -# Code is not reloaded between requests -config.cache_classes = true - -# Use a different logger for distributed setups -# config.logger = SyslogLogger.new - -# Full error reports are disabled and caching is turned on -config.action_controller.consider_all_requests_local = false -config.action_controller.perform_caching = true - -# Enable serving of images, stylesheets, and javascripts from an asset server -# config.action_controller.asset_host = "http://assets.example.com" - -# Disable delivery errors, bad email addresses will be ignored -# config.action_mailer.raise_delivery_errors = false diff --git a/solr/client/ruby/flare/config/environments/test.rb b/solr/client/ruby/flare/config/environments/test.rb deleted file mode 100644 index 1c4e13d697a..00000000000 --- a/solr/client/ruby/flare/config/environments/test.rb +++ /dev/null @@ -1,31 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Settings specified here will take precedence over those in config/environment.rb - -# The test environment is used exclusively to run your application's -# test suite. You never need to work with it otherwise. Remember that -# your test database is "scratch space" for the test suite and is wiped -# and recreated between test runs. Don't rely on the data there! -config.cache_classes = true - -# Log error messages when you accidentally call methods on nil. -config.whiny_nils = true - -# Show full error reports and disable caching -config.action_controller.consider_all_requests_local = true -config.action_controller.perform_caching = false - -# Tell ActionMailer not to deliver emails to the real world. -# The :test delivery method accumulates sent emails in the -# ActionMailer::Base.deliveries array. -config.action_mailer.delivery_method = :test \ No newline at end of file diff --git a/solr/client/ruby/flare/config/routes.rb b/solr/client/ruby/flare/config/routes.rb deleted file mode 100644 index c4a212512e2..00000000000 --- a/solr/client/ruby/flare/config/routes.rb +++ /dev/null @@ -1,40 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -ActionController::Routing::Routes.draw do |map| - # The priority is based upon order of creation: first created -> highest priority. - - # Sample of regular route: - # map.connect 'products/:id', :controller => 'catalog', :action => 'view' - # Keep in mind you can assign values other than :controller and :action - - # Sample of named route: - # map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase' - # This route can be invoked with purchase_url(:id => product.id) - - # You can have the root of your site routed by hooking up '' - # -- just remember to delete public/index.html. - map.connect '', :controller => "browse" - - map.connect 'browse/facet', :controller => "browse", :action => "facet" - - map.connect 'saved/:name', :controller => 'browse', :action => 'show_saved' - - # Allow downloading Web Service WSDL as a file with an extension - # instead of a file named 'wsdl' - # map.connect ':controller/service.wsdl', :action => 'wsdl' - - # Install the default route as the lowest priority. - # map.connect ':controller/:action/:id.:format' - map.connect ':controller/:action.:format' - map.connect ':controller/:action' -end diff --git a/solr/client/ruby/flare/db/schema.rb b/solr/client/ruby/flare/db/schema.rb deleted file mode 100644 index 873a19b6017..00000000000 --- a/solr/client/ruby/flare/db/schema.rb +++ /dev/null @@ -1,11 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. diff --git a/solr/client/ruby/flare/lib/tasks/clear_database_prerequisites.rake b/solr/client/ruby/flare/lib/tasks/clear_database_prerequisites.rake deleted file mode 100755 index 831d7513021..00000000000 --- a/solr/client/ruby/flare/lib/tasks/clear_database_prerequisites.rake +++ /dev/null @@ -1,17 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Added this .rake file to keep Rake happy without a database. -# Remove once a database is in the picture. -["test:units", "test:functionals", "recent", "test:integration"].each do |name| - Rake::Task[name].prerequisites.clear -end diff --git a/solr/client/ruby/flare/lib/tasks/routes.rake b/solr/client/ruby/flare/lib/tasks/routes.rake deleted file mode 100755 index 3fecf372f25..00000000000 --- a/solr/client/ruby/flare/lib/tasks/routes.rake +++ /dev/null @@ -1,22 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Borrowed from , by Josh Susser -desc "Print out all the currently defined routes, with names." -task :routes => :environment do - name_col_width = ActionController::Routing::Routes.named_routes.routes.keys.sort {|a,b| a.to_s.size <=> b.to_s.size}.last.to_s.size - ActionController::Routing::Routes.routes.each do |route| - name = ActionController::Routing::Routes.named_routes.routes.index(route).to_s - name = name.ljust(name_col_width + 1) - puts "#{name}#{route}" - end -end \ No newline at end of file diff --git a/solr/client/ruby/flare/public/.htaccess b/solr/client/ruby/flare/public/.htaccess deleted file mode 100644 index 8a74972cf74..00000000000 --- a/solr/client/ruby/flare/public/.htaccess +++ /dev/null @@ -1,52 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# General Apache options -AddHandler fastcgi-script .fcgi -AddHandler cgi-script .cgi -Options +FollowSymLinks +ExecCGI - -# If you don't want Rails to look in certain directories, -# use the following rewrite rules so that Apache won't rewrite certain requests -# -# Example: -# RewriteCond %{REQUEST_URI} ^/notrails.* -# RewriteRule .* - [L] - -# Redirect all requests not available on the filesystem to Rails -# By default the cgi dispatcher is used which is very slow -# -# For better performance replace the dispatcher with the fastcgi one -# -# Example: -# RewriteRule ^(.*)$ dispatch.fcgi [QSA,L] -RewriteEngine On - -# If your Rails application is accessed via an Alias directive, -# then you MUST also set the RewriteBase in this htaccess file. -# -# Example: -# Alias /myrailsapp /path/to/myrailsapp/public -# RewriteBase /myrailsapp - -RewriteRule ^$ index.html [QSA] -RewriteRule ^([^.]+)$ $1.html [QSA] -RewriteCond %{REQUEST_FILENAME} !-f -RewriteRule ^(.*)$ dispatch.cgi [QSA,L] - -# In case Rails experiences terminal errors -# Instead of displaying this message you can supply a file here which will be rendered instead -# -# Example: -# ErrorDocument 500 /500.html - -ErrorDocument 500 "

Application error

Rails application failed to start properly" \ No newline at end of file diff --git a/solr/client/ruby/flare/public/404.html b/solr/client/ruby/flare/public/404.html deleted file mode 100644 index dd0fca84cd5..00000000000 --- a/solr/client/ruby/flare/public/404.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - The page you were looking for doesn't exist (404) - - - - - -
-

The page you were looking for doesn't exist.

-

You may have mistyped the address or the page may have moved.

-
- - \ No newline at end of file diff --git a/solr/client/ruby/flare/public/500.html b/solr/client/ruby/flare/public/500.html deleted file mode 100644 index d20477dada4..00000000000 --- a/solr/client/ruby/flare/public/500.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - We're sorry, but something went wrong - - - - - -
-

We're sorry, but something went wrong.

-

We've been notified about this issue and we'll take a look at it shortly.

-
- - \ No newline at end of file diff --git a/solr/client/ruby/flare/public/dispatch.cgi b/solr/client/ruby/flare/public/dispatch.cgi deleted file mode 100755 index cb8f7d3959b..00000000000 --- a/solr/client/ruby/flare/public/dispatch.cgi +++ /dev/null @@ -1,22 +0,0 @@ -#!/opt/local/bin/ruby - -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT) - -# If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like: -# "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely impaired -require "dispatcher" - -ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) } if defined?(Apache::RubyRun) -Dispatcher.dispatch \ No newline at end of file diff --git a/solr/client/ruby/flare/public/dispatch.fcgi b/solr/client/ruby/flare/public/dispatch.fcgi deleted file mode 100755 index 1a5278db81d..00000000000 --- a/solr/client/ruby/flare/public/dispatch.fcgi +++ /dev/null @@ -1,37 +0,0 @@ -#!/opt/local/bin/ruby - -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# -# You may specify the path to the FastCGI crash log (a log of unhandled -# exceptions which forced the FastCGI instance to exit, great for debugging) -# and the number of requests to process before running garbage collection. -# -# By default, the FastCGI crash log is RAILS_ROOT/log/fastcgi.crash.log -# and the GC period is nil (turned off). A reasonable number of requests -# could range from 10-100 depending on the memory footprint of your app. -# -# Example: -# # Default log path, normal GC behavior. -# RailsFCGIHandler.process! -# -# # Default log path, 50 requests between GC. -# RailsFCGIHandler.process! nil, 50 -# -# # Custom log path, normal GC behavior. -# RailsFCGIHandler.process! '/var/log/myapp_fcgi_crash.log' -# -require File.dirname(__FILE__) + "/../config/environment" -require 'fcgi_handler' - -RailsFCGIHandler.process! diff --git a/solr/client/ruby/flare/public/dispatch.rb b/solr/client/ruby/flare/public/dispatch.rb deleted file mode 100755 index cb8f7d3959b..00000000000 --- a/solr/client/ruby/flare/public/dispatch.rb +++ /dev/null @@ -1,22 +0,0 @@ -#!/opt/local/bin/ruby - -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT) - -# If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like: -# "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely impaired -require "dispatcher" - -ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) } if defined?(Apache::RubyRun) -Dispatcher.dispatch \ No newline at end of file diff --git a/solr/client/ruby/flare/public/favicon.ico b/solr/client/ruby/flare/public/favicon.ico deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/solr/client/ruby/flare/public/images/flare.jpg b/solr/client/ruby/flare/public/images/flare.jpg deleted file mode 100644 index 5db42029267..00000000000 Binary files a/solr/client/ruby/flare/public/images/flare.jpg and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_0.png b/solr/client/ruby/flare/public/images/pie_0.png deleted file mode 100644 index c7e434fd2d1..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_0.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_1.png b/solr/client/ruby/flare/public/images/pie_1.png deleted file mode 100644 index 392792e7c26..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_1.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_10.png b/solr/client/ruby/flare/public/images/pie_10.png deleted file mode 100644 index d53fb2b59b8..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_10.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_100.png b/solr/client/ruby/flare/public/images/pie_100.png deleted file mode 100644 index 87b6d1dfc15..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_100.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_11.png b/solr/client/ruby/flare/public/images/pie_11.png deleted file mode 100644 index 83c15e6df80..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_11.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_12.png b/solr/client/ruby/flare/public/images/pie_12.png deleted file mode 100644 index 651972f9c69..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_12.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_13.png b/solr/client/ruby/flare/public/images/pie_13.png deleted file mode 100644 index b35afb402e9..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_13.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_14.png b/solr/client/ruby/flare/public/images/pie_14.png deleted file mode 100644 index db2c2a14e30..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_14.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_15.png b/solr/client/ruby/flare/public/images/pie_15.png deleted file mode 100644 index be4b333d6a3..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_15.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_16.png b/solr/client/ruby/flare/public/images/pie_16.png deleted file mode 100644 index 2e48df15919..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_16.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_17.png b/solr/client/ruby/flare/public/images/pie_17.png deleted file mode 100644 index 5cac956520f..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_17.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_18.png b/solr/client/ruby/flare/public/images/pie_18.png deleted file mode 100644 index 98de0d4b591..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_18.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_19.png b/solr/client/ruby/flare/public/images/pie_19.png deleted file mode 100644 index 5a61a37cd58..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_19.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_2.png b/solr/client/ruby/flare/public/images/pie_2.png deleted file mode 100644 index 70216715ff9..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_2.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_20.png b/solr/client/ruby/flare/public/images/pie_20.png deleted file mode 100644 index d7a72cdf7ba..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_20.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_21.png b/solr/client/ruby/flare/public/images/pie_21.png deleted file mode 100644 index 793eccf499b..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_21.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_22.png b/solr/client/ruby/flare/public/images/pie_22.png deleted file mode 100644 index a7bbd04e1db..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_22.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_23.png b/solr/client/ruby/flare/public/images/pie_23.png deleted file mode 100644 index accde96ec9a..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_23.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_24.png b/solr/client/ruby/flare/public/images/pie_24.png deleted file mode 100644 index 6a41639d29e..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_24.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_25.png b/solr/client/ruby/flare/public/images/pie_25.png deleted file mode 100644 index a739ad3a278..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_25.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_26.png b/solr/client/ruby/flare/public/images/pie_26.png deleted file mode 100644 index 90754c77313..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_26.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_27.png b/solr/client/ruby/flare/public/images/pie_27.png deleted file mode 100644 index d4dc92e16f2..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_27.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_28.png b/solr/client/ruby/flare/public/images/pie_28.png deleted file mode 100644 index ea48936701a..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_28.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_29.png b/solr/client/ruby/flare/public/images/pie_29.png deleted file mode 100644 index feb2839c045..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_29.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_3.png b/solr/client/ruby/flare/public/images/pie_3.png deleted file mode 100644 index e422f53f09f..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_3.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_30.png b/solr/client/ruby/flare/public/images/pie_30.png deleted file mode 100644 index b32ee15866a..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_30.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_31.png b/solr/client/ruby/flare/public/images/pie_31.png deleted file mode 100644 index f5787d29c1a..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_31.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_32.png b/solr/client/ruby/flare/public/images/pie_32.png deleted file mode 100644 index a38f4310da0..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_32.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_33.png b/solr/client/ruby/flare/public/images/pie_33.png deleted file mode 100644 index 2c7683c4796..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_33.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_34.png b/solr/client/ruby/flare/public/images/pie_34.png deleted file mode 100644 index 811f39b1d53..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_34.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_35.png b/solr/client/ruby/flare/public/images/pie_35.png deleted file mode 100644 index c138c2a6a96..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_35.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_36.png b/solr/client/ruby/flare/public/images/pie_36.png deleted file mode 100644 index 8784ea9bc38..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_36.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_37.png b/solr/client/ruby/flare/public/images/pie_37.png deleted file mode 100644 index b3868db1bb2..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_37.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_38.png b/solr/client/ruby/flare/public/images/pie_38.png deleted file mode 100644 index d5022502b5a..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_38.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_39.png b/solr/client/ruby/flare/public/images/pie_39.png deleted file mode 100644 index d94768f50af..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_39.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_4.png b/solr/client/ruby/flare/public/images/pie_4.png deleted file mode 100644 index f60eedcdb73..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_4.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_40.png b/solr/client/ruby/flare/public/images/pie_40.png deleted file mode 100644 index e8d5feb73aa..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_40.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_41.png b/solr/client/ruby/flare/public/images/pie_41.png deleted file mode 100644 index 90cb845c09b..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_41.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_42.png b/solr/client/ruby/flare/public/images/pie_42.png deleted file mode 100644 index 8e9de1fb4bb..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_42.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_43.png b/solr/client/ruby/flare/public/images/pie_43.png deleted file mode 100644 index 5e434d85f9f..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_43.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_44.png b/solr/client/ruby/flare/public/images/pie_44.png deleted file mode 100644 index cd3ec7b9abe..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_44.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_45.png b/solr/client/ruby/flare/public/images/pie_45.png deleted file mode 100644 index bac04603b31..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_45.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_46.png b/solr/client/ruby/flare/public/images/pie_46.png deleted file mode 100644 index e3ec9d3b63c..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_46.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_47.png b/solr/client/ruby/flare/public/images/pie_47.png deleted file mode 100644 index 6acf6f4fc85..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_47.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_48.png b/solr/client/ruby/flare/public/images/pie_48.png deleted file mode 100644 index f2d846d3ff5..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_48.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_49.png b/solr/client/ruby/flare/public/images/pie_49.png deleted file mode 100644 index 7c529cb2fb7..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_49.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_5.png b/solr/client/ruby/flare/public/images/pie_5.png deleted file mode 100644 index b84f7aac475..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_5.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_50.png b/solr/client/ruby/flare/public/images/pie_50.png deleted file mode 100644 index b493ab679ce..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_50.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_51.png b/solr/client/ruby/flare/public/images/pie_51.png deleted file mode 100644 index 3e709186f54..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_51.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_52.png b/solr/client/ruby/flare/public/images/pie_52.png deleted file mode 100644 index d7297d0e97b..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_52.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_53.png b/solr/client/ruby/flare/public/images/pie_53.png deleted file mode 100644 index c1702322970..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_53.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_54.png b/solr/client/ruby/flare/public/images/pie_54.png deleted file mode 100644 index e2c44e88448..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_54.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_55.png b/solr/client/ruby/flare/public/images/pie_55.png deleted file mode 100644 index 6048cfb1e34..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_55.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_56.png b/solr/client/ruby/flare/public/images/pie_56.png deleted file mode 100644 index 0876ecd16db..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_56.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_57.png b/solr/client/ruby/flare/public/images/pie_57.png deleted file mode 100644 index f9b5a7c72e8..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_57.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_58.png b/solr/client/ruby/flare/public/images/pie_58.png deleted file mode 100644 index 37a4bf640c0..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_58.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_59.png b/solr/client/ruby/flare/public/images/pie_59.png deleted file mode 100644 index 0f142ff043d..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_59.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_6.png b/solr/client/ruby/flare/public/images/pie_6.png deleted file mode 100644 index 80a254fe390..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_6.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_60.png b/solr/client/ruby/flare/public/images/pie_60.png deleted file mode 100644 index 53e8de1998d..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_60.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_61.png b/solr/client/ruby/flare/public/images/pie_61.png deleted file mode 100644 index d4fffe1fe4c..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_61.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_62.png b/solr/client/ruby/flare/public/images/pie_62.png deleted file mode 100644 index 0e4c2f46452..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_62.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_63.png b/solr/client/ruby/flare/public/images/pie_63.png deleted file mode 100644 index e772689e37c..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_63.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_64.png b/solr/client/ruby/flare/public/images/pie_64.png deleted file mode 100644 index fc3f3474c2f..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_64.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_65.png b/solr/client/ruby/flare/public/images/pie_65.png deleted file mode 100644 index 172f3b7fb67..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_65.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_66.png b/solr/client/ruby/flare/public/images/pie_66.png deleted file mode 100644 index 79ed69a958c..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_66.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_67.png b/solr/client/ruby/flare/public/images/pie_67.png deleted file mode 100644 index 9fac515394f..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_67.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_68.png b/solr/client/ruby/flare/public/images/pie_68.png deleted file mode 100644 index 004e1e9d1c8..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_68.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_69.png b/solr/client/ruby/flare/public/images/pie_69.png deleted file mode 100644 index cca9feafefd..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_69.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_7.png b/solr/client/ruby/flare/public/images/pie_7.png deleted file mode 100644 index 728645765b9..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_7.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_70.png b/solr/client/ruby/flare/public/images/pie_70.png deleted file mode 100644 index 48c20ab743f..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_70.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_71.png b/solr/client/ruby/flare/public/images/pie_71.png deleted file mode 100644 index 3b1d234fa39..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_71.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_72.png b/solr/client/ruby/flare/public/images/pie_72.png deleted file mode 100644 index 6fce418f03e..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_72.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_73.png b/solr/client/ruby/flare/public/images/pie_73.png deleted file mode 100644 index 8755f0b7263..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_73.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_74.png b/solr/client/ruby/flare/public/images/pie_74.png deleted file mode 100644 index 15babc93d6c..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_74.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_75.png b/solr/client/ruby/flare/public/images/pie_75.png deleted file mode 100644 index d82d493df23..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_75.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_76.png b/solr/client/ruby/flare/public/images/pie_76.png deleted file mode 100644 index 33a407d8097..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_76.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_77.png b/solr/client/ruby/flare/public/images/pie_77.png deleted file mode 100644 index 62e51485944..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_77.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_78.png b/solr/client/ruby/flare/public/images/pie_78.png deleted file mode 100644 index a587a5e5c1c..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_78.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_79.png b/solr/client/ruby/flare/public/images/pie_79.png deleted file mode 100644 index 129cb97595a..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_79.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_8.png b/solr/client/ruby/flare/public/images/pie_8.png deleted file mode 100644 index 2558b4087c0..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_8.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_80.png b/solr/client/ruby/flare/public/images/pie_80.png deleted file mode 100644 index 5a3bd064708..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_80.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_81.png b/solr/client/ruby/flare/public/images/pie_81.png deleted file mode 100644 index 979864a0175..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_81.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_82.png b/solr/client/ruby/flare/public/images/pie_82.png deleted file mode 100644 index 552c197b7ba..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_82.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_83.png b/solr/client/ruby/flare/public/images/pie_83.png deleted file mode 100644 index 3ad2893fc47..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_83.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_84.png b/solr/client/ruby/flare/public/images/pie_84.png deleted file mode 100644 index 51d2c8f9230..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_84.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_85.png b/solr/client/ruby/flare/public/images/pie_85.png deleted file mode 100644 index 04d27d3a8aa..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_85.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_86.png b/solr/client/ruby/flare/public/images/pie_86.png deleted file mode 100644 index 1bfe9d33a53..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_86.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_87.png b/solr/client/ruby/flare/public/images/pie_87.png deleted file mode 100644 index c67e639e912..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_87.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_88.png b/solr/client/ruby/flare/public/images/pie_88.png deleted file mode 100644 index b04da7f8f39..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_88.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_89.png b/solr/client/ruby/flare/public/images/pie_89.png deleted file mode 100644 index b63660772fa..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_89.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_9.png b/solr/client/ruby/flare/public/images/pie_9.png deleted file mode 100644 index 65357ada0fd..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_9.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_90.png b/solr/client/ruby/flare/public/images/pie_90.png deleted file mode 100644 index 3da1cdfb39b..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_90.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_91.png b/solr/client/ruby/flare/public/images/pie_91.png deleted file mode 100644 index 8ecaae90893..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_91.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_92.png b/solr/client/ruby/flare/public/images/pie_92.png deleted file mode 100644 index 615abaa103a..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_92.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_93.png b/solr/client/ruby/flare/public/images/pie_93.png deleted file mode 100644 index f48b02f81b5..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_93.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_94.png b/solr/client/ruby/flare/public/images/pie_94.png deleted file mode 100644 index 465007e33e2..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_94.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_95.png b/solr/client/ruby/flare/public/images/pie_95.png deleted file mode 100644 index bda6ea9270f..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_95.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_96.png b/solr/client/ruby/flare/public/images/pie_96.png deleted file mode 100644 index 3742638c32d..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_96.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_97.png b/solr/client/ruby/flare/public/images/pie_97.png deleted file mode 100644 index 68dfb67617a..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_97.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_98.png b/solr/client/ruby/flare/public/images/pie_98.png deleted file mode 100644 index ae28b963a18..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_98.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/pie_99.png b/solr/client/ruby/flare/public/images/pie_99.png deleted file mode 100644 index 19e27575d2d..00000000000 Binary files a/solr/client/ruby/flare/public/images/pie_99.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/rails.png b/solr/client/ruby/flare/public/images/rails.png deleted file mode 100644 index b8441f182e0..00000000000 Binary files a/solr/client/ruby/flare/public/images/rails.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/simile-exhibit.png b/solr/client/ruby/flare/public/images/simile-exhibit.png deleted file mode 100644 index 0b42e7884a3..00000000000 Binary files a/solr/client/ruby/flare/public/images/simile-exhibit.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/solr_small.png b/solr/client/ruby/flare/public/images/solr_small.png deleted file mode 100644 index 326e3cd5771..00000000000 Binary files a/solr/client/ruby/flare/public/images/solr_small.png and /dev/null differ diff --git a/solr/client/ruby/flare/public/images/x-close.gif b/solr/client/ruby/flare/public/images/x-close.gif deleted file mode 100644 index 27e7bc36e45..00000000000 Binary files a/solr/client/ruby/flare/public/images/x-close.gif and /dev/null differ diff --git a/solr/client/ruby/flare/public/javascripts/application.js b/solr/client/ruby/flare/public/javascripts/application.js deleted file mode 100644 index 2cbbc17a8b2..00000000000 --- a/solr/client/ruby/flare/public/javascripts/application.js +++ /dev/null @@ -1,16 +0,0 @@ -/* -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -*/ - -// Place your application-specific JavaScript functions and classes here -// This file is automatically included by javascript_include_tag :defaults diff --git a/solr/client/ruby/flare/public/javascripts/controls.js b/solr/client/ruby/flare/public/javascripts/controls.js deleted file mode 100644 index 8c273f874f9..00000000000 --- a/solr/client/ruby/flare/public/javascripts/controls.js +++ /dev/null @@ -1,833 +0,0 @@ -// Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) -// (c) 2005, 2006 Ivan Krstic (http://blogs.law.harvard.edu/ivan) -// (c) 2005, 2006 Jon Tirsen (http://www.tirsen.com) -// Contributors: -// Richard Livsey -// Rahul Bhargava -// Rob Wills -// -// script.aculo.us is freely distributable under the terms of an MIT-style license. -// For details, see the script.aculo.us web site: http://script.aculo.us/ - -// Autocompleter.Base handles all the autocompletion functionality -// that's independent of the data source for autocompletion. This -// includes drawing the autocompletion menu, observing keyboard -// and mouse events, and similar. -// -// Specific autocompleters need to provide, at the very least, -// a getUpdatedChoices function that will be invoked every time -// the text inside the monitored textbox changes. This method -// should get the text for which to provide autocompletion by -// invoking this.getToken(), NOT by directly accessing -// this.element.value. This is to allow incremental tokenized -// autocompletion. Specific auto-completion logic (AJAX, etc) -// belongs in getUpdatedChoices. -// -// Tokenized incremental autocompletion is enabled automatically -// when an autocompleter is instantiated with the 'tokens' option -// in the options parameter, e.g.: -// new Ajax.Autocompleter('id','upd', '/url/', { tokens: ',' }); -// will incrementally autocomplete with a comma as the token. -// Additionally, ',' in the above example can be replaced with -// a token array, e.g. { tokens: [',', '\n'] } which -// enables autocompletion on multiple tokens. This is most -// useful when one of the tokens is \n (a newline), as it -// allows smart autocompletion after linebreaks. - -if(typeof Effect == 'undefined') - throw("controls.js requires including script.aculo.us' effects.js library"); - -var Autocompleter = {} -Autocompleter.Base = function() {}; -Autocompleter.Base.prototype = { - baseInitialize: function(element, update, options) { - this.element = $(element); - this.update = $(update); - this.hasFocus = false; - this.changed = false; - this.active = false; - this.index = 0; - this.entryCount = 0; - - if(this.setOptions) - this.setOptions(options); - else - this.options = options || {}; - - this.options.paramName = this.options.paramName || this.element.name; - this.options.tokens = this.options.tokens || []; - this.options.frequency = this.options.frequency || 0.4; - this.options.minChars = this.options.minChars || 1; - this.options.onShow = this.options.onShow || - function(element, update){ - if(!update.style.position || update.style.position=='absolute') { - update.style.position = 'absolute'; - Position.clone(element, update, { - setHeight: false, - offsetTop: element.offsetHeight - }); - } - Effect.Appear(update,{duration:0.15}); - }; - this.options.onHide = this.options.onHide || - function(element, update){ new Effect.Fade(update,{duration:0.15}) }; - - if(typeof(this.options.tokens) == 'string') - this.options.tokens = new Array(this.options.tokens); - - this.observer = null; - - this.element.setAttribute('autocomplete','off'); - - Element.hide(this.update); - - Event.observe(this.element, "blur", this.onBlur.bindAsEventListener(this)); - Event.observe(this.element, "keypress", this.onKeyPress.bindAsEventListener(this)); - }, - - show: function() { - if(Element.getStyle(this.update, 'display')=='none') this.options.onShow(this.element, this.update); - if(!this.iefix && - (navigator.appVersion.indexOf('MSIE')>0) && - (navigator.userAgent.indexOf('Opera')<0) && - (Element.getStyle(this.update, 'position')=='absolute')) { - new Insertion.After(this.update, - ''); - this.iefix = $(this.update.id+'_iefix'); - } - if(this.iefix) setTimeout(this.fixIEOverlapping.bind(this), 50); - }, - - fixIEOverlapping: function() { - Position.clone(this.update, this.iefix, {setTop:(!this.update.style.height)}); - this.iefix.style.zIndex = 1; - this.update.style.zIndex = 2; - Element.show(this.iefix); - }, - - hide: function() { - this.stopIndicator(); - if(Element.getStyle(this.update, 'display')!='none') this.options.onHide(this.element, this.update); - if(this.iefix) Element.hide(this.iefix); - }, - - startIndicator: function() { - if(this.options.indicator) Element.show(this.options.indicator); - }, - - stopIndicator: function() { - if(this.options.indicator) Element.hide(this.options.indicator); - }, - - onKeyPress: function(event) { - if(this.active) - switch(event.keyCode) { - case Event.KEY_TAB: - case Event.KEY_RETURN: - this.selectEntry(); - Event.stop(event); - case Event.KEY_ESC: - this.hide(); - this.active = false; - Event.stop(event); - return; - case Event.KEY_LEFT: - case Event.KEY_RIGHT: - return; - case Event.KEY_UP: - this.markPrevious(); - this.render(); - if(navigator.appVersion.indexOf('AppleWebKit')>0) Event.stop(event); - return; - case Event.KEY_DOWN: - this.markNext(); - this.render(); - if(navigator.appVersion.indexOf('AppleWebKit')>0) Event.stop(event); - return; - } - else - if(event.keyCode==Event.KEY_TAB || event.keyCode==Event.KEY_RETURN || - (navigator.appVersion.indexOf('AppleWebKit') > 0 && event.keyCode == 0)) return; - - this.changed = true; - this.hasFocus = true; - - if(this.observer) clearTimeout(this.observer); - this.observer = - setTimeout(this.onObserverEvent.bind(this), this.options.frequency*1000); - }, - - activate: function() { - this.changed = false; - this.hasFocus = true; - this.getUpdatedChoices(); - }, - - onHover: function(event) { - var element = Event.findElement(event, 'LI'); - if(this.index != element.autocompleteIndex) - { - this.index = element.autocompleteIndex; - this.render(); - } - Event.stop(event); - }, - - onClick: function(event) { - var element = Event.findElement(event, 'LI'); - this.index = element.autocompleteIndex; - this.selectEntry(); - this.hide(); - }, - - onBlur: function(event) { - // needed to make click events working - setTimeout(this.hide.bind(this), 250); - this.hasFocus = false; - this.active = false; - }, - - render: function() { - if(this.entryCount > 0) { - for (var i = 0; i < this.entryCount; i++) - this.index==i ? - Element.addClassName(this.getEntry(i),"selected") : - Element.removeClassName(this.getEntry(i),"selected"); - - if(this.hasFocus) { - this.show(); - this.active = true; - } - } else { - this.active = false; - this.hide(); - } - }, - - markPrevious: function() { - if(this.index > 0) this.index-- - else this.index = this.entryCount-1; - this.getEntry(this.index).scrollIntoView(true); - }, - - markNext: function() { - if(this.index < this.entryCount-1) this.index++ - else this.index = 0; - this.getEntry(this.index).scrollIntoView(false); - }, - - getEntry: function(index) { - return this.update.firstChild.childNodes[index]; - }, - - getCurrentEntry: function() { - return this.getEntry(this.index); - }, - - selectEntry: function() { - this.active = false; - this.updateElement(this.getCurrentEntry()); - }, - - updateElement: function(selectedElement) { - if (this.options.updateElement) { - this.options.updateElement(selectedElement); - return; - } - var value = ''; - if (this.options.select) { - var nodes = document.getElementsByClassName(this.options.select, selectedElement) || []; - if(nodes.length>0) value = Element.collectTextNodes(nodes[0], this.options.select); - } else - value = Element.collectTextNodesIgnoreClass(selectedElement, 'informal'); - - var lastTokenPos = this.findLastToken(); - if (lastTokenPos != -1) { - var newValue = this.element.value.substr(0, lastTokenPos + 1); - var whitespace = this.element.value.substr(lastTokenPos + 1).match(/^\s+/); - if (whitespace) - newValue += whitespace[0]; - this.element.value = newValue + value; - } else { - this.element.value = value; - } - this.element.focus(); - - if (this.options.afterUpdateElement) - this.options.afterUpdateElement(this.element, selectedElement); - }, - - updateChoices: function(choices) { - if(!this.changed && this.hasFocus) { - this.update.innerHTML = choices; - Element.cleanWhitespace(this.update); - Element.cleanWhitespace(this.update.down()); - - if(this.update.firstChild && this.update.down().childNodes) { - this.entryCount = - this.update.down().childNodes.length; - for (var i = 0; i < this.entryCount; i++) { - var entry = this.getEntry(i); - entry.autocompleteIndex = i; - this.addObservers(entry); - } - } else { - this.entryCount = 0; - } - - this.stopIndicator(); - this.index = 0; - - if(this.entryCount==1 && this.options.autoSelect) { - this.selectEntry(); - this.hide(); - } else { - this.render(); - } - } - }, - - addObservers: function(element) { - Event.observe(element, "mouseover", this.onHover.bindAsEventListener(this)); - Event.observe(element, "click", this.onClick.bindAsEventListener(this)); - }, - - onObserverEvent: function() { - this.changed = false; - if(this.getToken().length>=this.options.minChars) { - this.startIndicator(); - this.getUpdatedChoices(); - } else { - this.active = false; - this.hide(); - } - }, - - getToken: function() { - var tokenPos = this.findLastToken(); - if (tokenPos != -1) - var ret = this.element.value.substr(tokenPos + 1).replace(/^\s+/,'').replace(/\s+$/,''); - else - var ret = this.element.value; - - return /\n/.test(ret) ? '' : ret; - }, - - findLastToken: function() { - var lastTokenPos = -1; - - for (var i=0; i lastTokenPos) - lastTokenPos = thisTokenPos; - } - return lastTokenPos; - } -} - -Ajax.Autocompleter = Class.create(); -Object.extend(Object.extend(Ajax.Autocompleter.prototype, Autocompleter.Base.prototype), { - initialize: function(element, update, url, options) { - this.baseInitialize(element, update, options); - this.options.asynchronous = true; - this.options.onComplete = this.onComplete.bind(this); - this.options.defaultParams = this.options.parameters || null; - this.url = url; - }, - - getUpdatedChoices: function() { - entry = encodeURIComponent(this.options.paramName) + '=' + - encodeURIComponent(this.getToken()); - - this.options.parameters = this.options.callback ? - this.options.callback(this.element, entry) : entry; - - if(this.options.defaultParams) - this.options.parameters += '&' + this.options.defaultParams; - - new Ajax.Request(this.url, this.options); - }, - - onComplete: function(request) { - this.updateChoices(request.responseText); - } - -}); - -// The local array autocompleter. Used when you'd prefer to -// inject an array of autocompletion options into the page, rather -// than sending out Ajax queries, which can be quite slow sometimes. -// -// The constructor takes four parameters. The first two are, as usual, -// the id of the monitored textbox, and id of the autocompletion menu. -// The third is the array you want to autocomplete from, and the fourth -// is the options block. -// -// Extra local autocompletion options: -// - choices - How many autocompletion choices to offer -// -// - partialSearch - If false, the autocompleter will match entered -// text only at the beginning of strings in the -// autocomplete array. Defaults to true, which will -// match text at the beginning of any *word* in the -// strings in the autocomplete array. If you want to -// search anywhere in the string, additionally set -// the option fullSearch to true (default: off). -// -// - fullSsearch - Search anywhere in autocomplete array strings. -// -// - partialChars - How many characters to enter before triggering -// a partial match (unlike minChars, which defines -// how many characters are required to do any match -// at all). Defaults to 2. -// -// - ignoreCase - Whether to ignore case when autocompleting. -// Defaults to true. -// -// It's possible to pass in a custom function as the 'selector' -// option, if you prefer to write your own autocompletion logic. -// In that case, the other options above will not apply unless -// you support them. - -Autocompleter.Local = Class.create(); -Autocompleter.Local.prototype = Object.extend(new Autocompleter.Base(), { - initialize: function(element, update, array, options) { - this.baseInitialize(element, update, options); - this.options.array = array; - }, - - getUpdatedChoices: function() { - this.updateChoices(this.options.selector(this)); - }, - - setOptions: function(options) { - this.options = Object.extend({ - choices: 10, - partialSearch: true, - partialChars: 2, - ignoreCase: true, - fullSearch: false, - selector: function(instance) { - var ret = []; // Beginning matches - var partial = []; // Inside matches - var entry = instance.getToken(); - var count = 0; - - for (var i = 0; i < instance.options.array.length && - ret.length < instance.options.choices ; i++) { - - var elem = instance.options.array[i]; - var foundPos = instance.options.ignoreCase ? - elem.toLowerCase().indexOf(entry.toLowerCase()) : - elem.indexOf(entry); - - while (foundPos != -1) { - if (foundPos == 0 && elem.length != entry.length) { - ret.push("
  • " + elem.substr(0, entry.length) + "" + - elem.substr(entry.length) + "
  • "); - break; - } else if (entry.length >= instance.options.partialChars && - instance.options.partialSearch && foundPos != -1) { - if (instance.options.fullSearch || /\s/.test(elem.substr(foundPos-1,1))) { - partial.push("
  • " + elem.substr(0, foundPos) + "" + - elem.substr(foundPos, entry.length) + "" + elem.substr( - foundPos + entry.length) + "
  • "); - break; - } - } - - foundPos = instance.options.ignoreCase ? - elem.toLowerCase().indexOf(entry.toLowerCase(), foundPos + 1) : - elem.indexOf(entry, foundPos + 1); - - } - } - if (partial.length) - ret = ret.concat(partial.slice(0, instance.options.choices - ret.length)) - return ""; - } - }, options || {}); - } -}); - -// AJAX in-place editor -// -// see documentation on http://wiki.script.aculo.us/scriptaculous/show/Ajax.InPlaceEditor - -// Use this if you notice weird scrolling problems on some browsers, -// the DOM might be a bit confused when this gets called so do this -// waits 1 ms (with setTimeout) until it does the activation -Field.scrollFreeActivate = function(field) { - setTimeout(function() { - Field.activate(field); - }, 1); -} - -Ajax.InPlaceEditor = Class.create(); -Ajax.InPlaceEditor.defaultHighlightColor = "#FFFF99"; -Ajax.InPlaceEditor.prototype = { - initialize: function(element, url, options) { - this.url = url; - this.element = $(element); - - this.options = Object.extend({ - paramName: "value", - okButton: true, - okText: "ok", - cancelLink: true, - cancelText: "cancel", - savingText: "Saving...", - clickToEditText: "Click to edit", - okText: "ok", - rows: 1, - onComplete: function(transport, element) { - new Effect.Highlight(element, {startcolor: this.options.highlightcolor}); - }, - onFailure: function(transport) { - alert("Error communicating with the server: " + transport.responseText.stripTags()); - }, - callback: function(form) { - return Form.serialize(form); - }, - handleLineBreaks: true, - loadingText: 'Loading...', - savingClassName: 'inplaceeditor-saving', - loadingClassName: 'inplaceeditor-loading', - formClassName: 'inplaceeditor-form', - highlightcolor: Ajax.InPlaceEditor.defaultHighlightColor, - highlightendcolor: "#FFFFFF", - externalControl: null, - submitOnBlur: false, - ajaxOptions: {}, - evalScripts: false - }, options || {}); - - if(!this.options.formId && this.element.id) { - this.options.formId = this.element.id + "-inplaceeditor"; - if ($(this.options.formId)) { - // there's already a form with that name, don't specify an id - this.options.formId = null; - } - } - - if (this.options.externalControl) { - this.options.externalControl = $(this.options.externalControl); - } - - this.originalBackground = Element.getStyle(this.element, 'background-color'); - if (!this.originalBackground) { - this.originalBackground = "transparent"; - } - - this.element.title = this.options.clickToEditText; - - this.onclickListener = this.enterEditMode.bindAsEventListener(this); - this.mouseoverListener = this.enterHover.bindAsEventListener(this); - this.mouseoutListener = this.leaveHover.bindAsEventListener(this); - Event.observe(this.element, 'click', this.onclickListener); - Event.observe(this.element, 'mouseover', this.mouseoverListener); - Event.observe(this.element, 'mouseout', this.mouseoutListener); - if (this.options.externalControl) { - Event.observe(this.options.externalControl, 'click', this.onclickListener); - Event.observe(this.options.externalControl, 'mouseover', this.mouseoverListener); - Event.observe(this.options.externalControl, 'mouseout', this.mouseoutListener); - } - }, - enterEditMode: function(evt) { - if (this.saving) return; - if (this.editing) return; - this.editing = true; - this.onEnterEditMode(); - if (this.options.externalControl) { - Element.hide(this.options.externalControl); - } - Element.hide(this.element); - this.createForm(); - this.element.parentNode.insertBefore(this.form, this.element); - if (!this.options.loadTextURL) Field.scrollFreeActivate(this.editField); - // stop the event to avoid a page refresh in Safari - if (evt) { - Event.stop(evt); - } - return false; - }, - createForm: function() { - this.form = document.createElement("form"); - this.form.id = this.options.formId; - Element.addClassName(this.form, this.options.formClassName) - this.form.onsubmit = this.onSubmit.bind(this); - - this.createEditField(); - - if (this.options.textarea) { - var br = document.createElement("br"); - this.form.appendChild(br); - } - - if (this.options.okButton) { - okButton = document.createElement("input"); - okButton.type = "submit"; - okButton.value = this.options.okText; - okButton.className = 'editor_ok_button'; - this.form.appendChild(okButton); - } - - if (this.options.cancelLink) { - cancelLink = document.createElement("a"); - cancelLink.href = "#"; - cancelLink.appendChild(document.createTextNode(this.options.cancelText)); - cancelLink.onclick = this.onclickCancel.bind(this); - cancelLink.className = 'editor_cancel'; - this.form.appendChild(cancelLink); - } - }, - hasHTMLLineBreaks: function(string) { - if (!this.options.handleLineBreaks) return false; - return string.match(/
    /i); - }, - convertHTMLLineBreaks: function(string) { - return string.replace(/
    /gi, "\n").replace(//gi, "\n").replace(/<\/p>/gi, "\n").replace(/

    /gi, ""); - }, - createEditField: function() { - var text; - if(this.options.loadTextURL) { - text = this.options.loadingText; - } else { - text = this.getText(); - } - - var obj = this; - - if (this.options.rows == 1 && !this.hasHTMLLineBreaks(text)) { - this.options.textarea = false; - var textField = document.createElement("input"); - textField.obj = this; - textField.type = "text"; - textField.name = this.options.paramName; - textField.value = text; - textField.style.backgroundColor = this.options.highlightcolor; - textField.className = 'editor_field'; - var size = this.options.size || this.options.cols || 0; - if (size != 0) textField.size = size; - if (this.options.submitOnBlur) - textField.onblur = this.onSubmit.bind(this); - this.editField = textField; - } else { - this.options.textarea = true; - var textArea = document.createElement("textarea"); - textArea.obj = this; - textArea.name = this.options.paramName; - textArea.value = this.convertHTMLLineBreaks(text); - textArea.rows = this.options.rows; - textArea.cols = this.options.cols || 40; - textArea.className = 'editor_field'; - if (this.options.submitOnBlur) - textArea.onblur = this.onSubmit.bind(this); - this.editField = textArea; - } - - if(this.options.loadTextURL) { - this.loadExternalText(); - } - this.form.appendChild(this.editField); - }, - getText: function() { - return this.element.innerHTML; - }, - loadExternalText: function() { - Element.addClassName(this.form, this.options.loadingClassName); - this.editField.disabled = true; - new Ajax.Request( - this.options.loadTextURL, - Object.extend({ - asynchronous: true, - onComplete: this.onLoadedExternalText.bind(this) - }, this.options.ajaxOptions) - ); - }, - onLoadedExternalText: function(transport) { - Element.removeClassName(this.form, this.options.loadingClassName); - this.editField.disabled = false; - this.editField.value = transport.responseText.stripTags(); - Field.scrollFreeActivate(this.editField); - }, - onclickCancel: function() { - this.onComplete(); - this.leaveEditMode(); - return false; - }, - onFailure: function(transport) { - this.options.onFailure(transport); - if (this.oldInnerHTML) { - this.element.innerHTML = this.oldInnerHTML; - this.oldInnerHTML = null; - } - return false; - }, - onSubmit: function() { - // onLoading resets these so we need to save them away for the Ajax call - var form = this.form; - var value = this.editField.value; - - // do this first, sometimes the ajax call returns before we get a chance to switch on Saving... - // which means this will actually switch on Saving... *after* we've left edit mode causing Saving... - // to be displayed indefinitely - this.onLoading(); - - if (this.options.evalScripts) { - new Ajax.Request( - this.url, Object.extend({ - parameters: this.options.callback(form, value), - onComplete: this.onComplete.bind(this), - onFailure: this.onFailure.bind(this), - asynchronous:true, - evalScripts:true - }, this.options.ajaxOptions)); - } else { - new Ajax.Updater( - { success: this.element, - // don't update on failure (this could be an option) - failure: null }, - this.url, Object.extend({ - parameters: this.options.callback(form, value), - onComplete: this.onComplete.bind(this), - onFailure: this.onFailure.bind(this) - }, this.options.ajaxOptions)); - } - // stop the event to avoid a page refresh in Safari - if (arguments.length > 1) { - Event.stop(arguments[0]); - } - return false; - }, - onLoading: function() { - this.saving = true; - this.removeForm(); - this.leaveHover(); - this.showSaving(); - }, - showSaving: function() { - this.oldInnerHTML = this.element.innerHTML; - this.element.innerHTML = this.options.savingText; - Element.addClassName(this.element, this.options.savingClassName); - this.element.style.backgroundColor = this.originalBackground; - Element.show(this.element); - }, - removeForm: function() { - if(this.form) { - if (this.form.parentNode) Element.remove(this.form); - this.form = null; - } - }, - enterHover: function() { - if (this.saving) return; - this.element.style.backgroundColor = this.options.highlightcolor; - if (this.effect) { - this.effect.cancel(); - } - Element.addClassName(this.element, this.options.hoverClassName) - }, - leaveHover: function() { - if (this.options.backgroundColor) { - this.element.style.backgroundColor = this.oldBackground; - } - Element.removeClassName(this.element, this.options.hoverClassName) - if (this.saving) return; - this.effect = new Effect.Highlight(this.element, { - startcolor: this.options.highlightcolor, - endcolor: this.options.highlightendcolor, - restorecolor: this.originalBackground - }); - }, - leaveEditMode: function() { - Element.removeClassName(this.element, this.options.savingClassName); - this.removeForm(); - this.leaveHover(); - this.element.style.backgroundColor = this.originalBackground; - Element.show(this.element); - if (this.options.externalControl) { - Element.show(this.options.externalControl); - } - this.editing = false; - this.saving = false; - this.oldInnerHTML = null; - this.onLeaveEditMode(); - }, - onComplete: function(transport) { - this.leaveEditMode(); - this.options.onComplete.bind(this)(transport, this.element); - }, - onEnterEditMode: function() {}, - onLeaveEditMode: function() {}, - dispose: function() { - if (this.oldInnerHTML) { - this.element.innerHTML = this.oldInnerHTML; - } - this.leaveEditMode(); - Event.stopObserving(this.element, 'click', this.onclickListener); - Event.stopObserving(this.element, 'mouseover', this.mouseoverListener); - Event.stopObserving(this.element, 'mouseout', this.mouseoutListener); - if (this.options.externalControl) { - Event.stopObserving(this.options.externalControl, 'click', this.onclickListener); - Event.stopObserving(this.options.externalControl, 'mouseover', this.mouseoverListener); - Event.stopObserving(this.options.externalControl, 'mouseout', this.mouseoutListener); - } - } -}; - -Ajax.InPlaceCollectionEditor = Class.create(); -Object.extend(Ajax.InPlaceCollectionEditor.prototype, Ajax.InPlaceEditor.prototype); -Object.extend(Ajax.InPlaceCollectionEditor.prototype, { - createEditField: function() { - if (!this.cached_selectTag) { - var selectTag = document.createElement("select"); - var collection = this.options.collection || []; - var optionTag; - collection.each(function(e,i) { - optionTag = document.createElement("option"); - optionTag.value = (e instanceof Array) ? e[0] : e; - if((typeof this.options.value == 'undefined') && - ((e instanceof Array) ? this.element.innerHTML == e[1] : e == optionTag.value)) optionTag.selected = true; - if(this.options.value==optionTag.value) optionTag.selected = true; - optionTag.appendChild(document.createTextNode((e instanceof Array) ? e[1] : e)); - selectTag.appendChild(optionTag); - }.bind(this)); - this.cached_selectTag = selectTag; - } - - this.editField = this.cached_selectTag; - if(this.options.loadTextURL) this.loadExternalText(); - this.form.appendChild(this.editField); - this.options.callback = function(form, value) { - return "value=" + encodeURIComponent(value); - } - } -}); - -// Delayed observer, like Form.Element.Observer, -// but waits for delay after last key input -// Ideal for live-search fields - -Form.Element.DelayedObserver = Class.create(); -Form.Element.DelayedObserver.prototype = { - initialize: function(element, delay, callback) { - this.delay = delay || 0.5; - this.element = $(element); - this.callback = callback; - this.timer = null; - this.lastValue = $F(this.element); - Event.observe(this.element,'keyup',this.delayedListener.bindAsEventListener(this)); - }, - delayedListener: function(event) { - if(this.lastValue == $F(this.element)) return; - if(this.timer) clearTimeout(this.timer); - this.timer = setTimeout(this.onTimerEvent.bind(this), this.delay * 1000); - this.lastValue = $F(this.element); - }, - onTimerEvent: function() { - this.timer = null; - this.callback(this.element, $F(this.element)); - } -}; diff --git a/solr/client/ruby/flare/public/javascripts/dragdrop.js b/solr/client/ruby/flare/public/javascripts/dragdrop.js deleted file mode 100644 index c71ddb82746..00000000000 --- a/solr/client/ruby/flare/public/javascripts/dragdrop.js +++ /dev/null @@ -1,942 +0,0 @@ -// Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) -// (c) 2005, 2006 Sammi Williams (http://www.oriontransfer.co.nz, sammi@oriontransfer.co.nz) -// -// script.aculo.us is freely distributable under the terms of an MIT-style license. -// For details, see the script.aculo.us web site: http://script.aculo.us/ - -if(typeof Effect == 'undefined') - throw("dragdrop.js requires including script.aculo.us' effects.js library"); - -var Droppables = { - drops: [], - - remove: function(element) { - this.drops = this.drops.reject(function(d) { return d.element==$(element) }); - }, - - add: function(element) { - element = $(element); - var options = Object.extend({ - greedy: true, - hoverclass: null, - tree: false - }, arguments[1] || {}); - - // cache containers - if(options.containment) { - options._containers = []; - var containment = options.containment; - if((typeof containment == 'object') && - (containment.constructor == Array)) { - containment.each( function(c) { options._containers.push($(c)) }); - } else { - options._containers.push($(containment)); - } - } - - if(options.accept) options.accept = [options.accept].flatten(); - - Element.makePositioned(element); // fix IE - options.element = element; - - this.drops.push(options); - }, - - findDeepestChild: function(drops) { - deepest = drops[0]; - - for (i = 1; i < drops.length; ++i) - if (Element.isParent(drops[i].element, deepest.element)) - deepest = drops[i]; - - return deepest; - }, - - isContained: function(element, drop) { - var containmentNode; - if(drop.tree) { - containmentNode = element.treeNode; - } else { - containmentNode = element.parentNode; - } - return drop._containers.detect(function(c) { return containmentNode == c }); - }, - - isAffected: function(point, element, drop) { - return ( - (drop.element!=element) && - ((!drop._containers) || - this.isContained(element, drop)) && - ((!drop.accept) || - (Element.classNames(element).detect( - function(v) { return drop.accept.include(v) } ) )) && - Position.within(drop.element, point[0], point[1]) ); - }, - - deactivate: function(drop) { - if(drop.hoverclass) - Element.removeClassName(drop.element, drop.hoverclass); - this.last_active = null; - }, - - activate: function(drop) { - if(drop.hoverclass) - Element.addClassName(drop.element, drop.hoverclass); - this.last_active = drop; - }, - - show: function(point, element) { - if(!this.drops.length) return; - var affected = []; - - if(this.last_active) this.deactivate(this.last_active); - this.drops.each( function(drop) { - if(Droppables.isAffected(point, element, drop)) - affected.push(drop); - }); - - if(affected.length>0) { - drop = Droppables.findDeepestChild(affected); - Position.within(drop.element, point[0], point[1]); - if(drop.onHover) - drop.onHover(element, drop.element, Position.overlap(drop.overlap, drop.element)); - - Droppables.activate(drop); - } - }, - - fire: function(event, element) { - if(!this.last_active) return; - Position.prepare(); - - if (this.isAffected([Event.pointerX(event), Event.pointerY(event)], element, this.last_active)) - if (this.last_active.onDrop) - this.last_active.onDrop(element, this.last_active.element, event); - }, - - reset: function() { - if(this.last_active) - this.deactivate(this.last_active); - } -} - -var Draggables = { - drags: [], - observers: [], - - register: function(draggable) { - if(this.drags.length == 0) { - this.eventMouseUp = this.endDrag.bindAsEventListener(this); - this.eventMouseMove = this.updateDrag.bindAsEventListener(this); - this.eventKeypress = this.keyPress.bindAsEventListener(this); - - Event.observe(document, "mouseup", this.eventMouseUp); - Event.observe(document, "mousemove", this.eventMouseMove); - Event.observe(document, "keypress", this.eventKeypress); - } - this.drags.push(draggable); - }, - - unregister: function(draggable) { - this.drags = this.drags.reject(function(d) { return d==draggable }); - if(this.drags.length == 0) { - Event.stopObserving(document, "mouseup", this.eventMouseUp); - Event.stopObserving(document, "mousemove", this.eventMouseMove); - Event.stopObserving(document, "keypress", this.eventKeypress); - } - }, - - activate: function(draggable) { - if(draggable.options.delay) { - this._timeout = setTimeout(function() { - Draggables._timeout = null; - window.focus(); - Draggables.activeDraggable = draggable; - }.bind(this), draggable.options.delay); - } else { - window.focus(); // allows keypress events if window isn't currently focused, fails for Safari - this.activeDraggable = draggable; - } - }, - - deactivate: function() { - this.activeDraggable = null; - }, - - updateDrag: function(event) { - if(!this.activeDraggable) return; - var pointer = [Event.pointerX(event), Event.pointerY(event)]; - // Mozilla-based browsers fire successive mousemove events with - // the same coordinates, prevent needless redrawing (moz bug?) - if(this._lastPointer && (this._lastPointer.inspect() == pointer.inspect())) return; - this._lastPointer = pointer; - - this.activeDraggable.updateDrag(event, pointer); - }, - - endDrag: function(event) { - if(this._timeout) { - clearTimeout(this._timeout); - this._timeout = null; - } - if(!this.activeDraggable) return; - this._lastPointer = null; - this.activeDraggable.endDrag(event); - this.activeDraggable = null; - }, - - keyPress: function(event) { - if(this.activeDraggable) - this.activeDraggable.keyPress(event); - }, - - addObserver: function(observer) { - this.observers.push(observer); - this._cacheObserverCallbacks(); - }, - - removeObserver: function(element) { // element instead of observer fixes mem leaks - this.observers = this.observers.reject( function(o) { return o.element==element }); - this._cacheObserverCallbacks(); - }, - - notify: function(eventName, draggable, event) { // 'onStart', 'onEnd', 'onDrag' - if(this[eventName+'Count'] > 0) - this.observers.each( function(o) { - if(o[eventName]) o[eventName](eventName, draggable, event); - }); - if(draggable.options[eventName]) draggable.options[eventName](draggable, event); - }, - - _cacheObserverCallbacks: function() { - ['onStart','onEnd','onDrag'].each( function(eventName) { - Draggables[eventName+'Count'] = Draggables.observers.select( - function(o) { return o[eventName]; } - ).length; - }); - } -} - -/*--------------------------------------------------------------------------*/ - -var Draggable = Class.create(); -Draggable._dragging = {}; - -Draggable.prototype = { - initialize: function(element) { - var defaults = { - handle: false, - reverteffect: function(element, top_offset, left_offset) { - var dur = Math.sqrt(Math.abs(top_offset^2)+Math.abs(left_offset^2))*0.02; - new Effect.Move(element, { x: -left_offset, y: -top_offset, duration: dur, - queue: {scope:'_draggable', position:'end'} - }); - }, - endeffect: function(element) { - var toOpacity = typeof element._opacity == 'number' ? element._opacity : 1.0; - new Effect.Opacity(element, {duration:0.2, from:0.7, to:toOpacity, - queue: {scope:'_draggable', position:'end'}, - afterFinish: function(){ - Draggable._dragging[element] = false - } - }); - }, - zindex: 1000, - revert: false, - scroll: false, - scrollSensitivity: 20, - scrollSpeed: 15, - snap: false, // false, or xy or [x,y] or function(x,y){ return [x,y] } - delay: 0 - }; - - if(!arguments[1] || typeof arguments[1].endeffect == 'undefined') - Object.extend(defaults, { - starteffect: function(element) { - element._opacity = Element.getOpacity(element); - Draggable._dragging[element] = true; - new Effect.Opacity(element, {duration:0.2, from:element._opacity, to:0.7}); - } - }); - - var options = Object.extend(defaults, arguments[1] || {}); - - this.element = $(element); - - if(options.handle && (typeof options.handle == 'string')) - this.handle = this.element.down('.'+options.handle, 0); - - if(!this.handle) this.handle = $(options.handle); - if(!this.handle) this.handle = this.element; - - if(options.scroll && !options.scroll.scrollTo && !options.scroll.outerHTML) { - options.scroll = $(options.scroll); - this._isScrollChild = Element.childOf(this.element, options.scroll); - } - - Element.makePositioned(this.element); // fix IE - - this.delta = this.currentDelta(); - this.options = options; - this.dragging = false; - - this.eventMouseDown = this.initDrag.bindAsEventListener(this); - Event.observe(this.handle, "mousedown", this.eventMouseDown); - - Draggables.register(this); - }, - - destroy: function() { - Event.stopObserving(this.handle, "mousedown", this.eventMouseDown); - Draggables.unregister(this); - }, - - currentDelta: function() { - return([ - parseInt(Element.getStyle(this.element,'left') || '0'), - parseInt(Element.getStyle(this.element,'top') || '0')]); - }, - - initDrag: function(event) { - if(typeof Draggable._dragging[this.element] != 'undefined' && - Draggable._dragging[this.element]) return; - if(Event.isLeftClick(event)) { - // abort on form elements, fixes a Firefox issue - var src = Event.element(event); - if(src.tagName && ( - src.tagName=='INPUT' || - src.tagName=='SELECT' || - src.tagName=='OPTION' || - src.tagName=='BUTTON' || - src.tagName=='TEXTAREA')) return; - - var pointer = [Event.pointerX(event), Event.pointerY(event)]; - var pos = Position.cumulativeOffset(this.element); - this.offset = [0,1].map( function(i) { return (pointer[i] - pos[i]) }); - - Draggables.activate(this); - Event.stop(event); - } - }, - - startDrag: function(event) { - this.dragging = true; - - if(this.options.zindex) { - this.originalZ = parseInt(Element.getStyle(this.element,'z-index') || 0); - this.element.style.zIndex = this.options.zindex; - } - - if(this.options.ghosting) { - this._clone = this.element.cloneNode(true); - Position.absolutize(this.element); - this.element.parentNode.insertBefore(this._clone, this.element); - } - - if(this.options.scroll) { - if (this.options.scroll == window) { - var where = this._getWindowScroll(this.options.scroll); - this.originalScrollLeft = where.left; - this.originalScrollTop = where.top; - } else { - this.originalScrollLeft = this.options.scroll.scrollLeft; - this.originalScrollTop = this.options.scroll.scrollTop; - } - } - - Draggables.notify('onStart', this, event); - - if(this.options.starteffect) this.options.starteffect(this.element); - }, - - updateDrag: function(event, pointer) { - if(!this.dragging) this.startDrag(event); - Position.prepare(); - Droppables.show(pointer, this.element); - Draggables.notify('onDrag', this, event); - - this.draw(pointer); - if(this.options.change) this.options.change(this); - - if(this.options.scroll) { - this.stopScrolling(); - - var p; - if (this.options.scroll == window) { - with(this._getWindowScroll(this.options.scroll)) { p = [ left, top, left+width, top+height ]; } - } else { - p = Position.page(this.options.scroll); - p[0] += this.options.scroll.scrollLeft + Position.deltaX; - p[1] += this.options.scroll.scrollTop + Position.deltaY; - p.push(p[0]+this.options.scroll.offsetWidth); - p.push(p[1]+this.options.scroll.offsetHeight); - } - var speed = [0,0]; - if(pointer[0] < (p[0]+this.options.scrollSensitivity)) speed[0] = pointer[0]-(p[0]+this.options.scrollSensitivity); - if(pointer[1] < (p[1]+this.options.scrollSensitivity)) speed[1] = pointer[1]-(p[1]+this.options.scrollSensitivity); - if(pointer[0] > (p[2]-this.options.scrollSensitivity)) speed[0] = pointer[0]-(p[2]-this.options.scrollSensitivity); - if(pointer[1] > (p[3]-this.options.scrollSensitivity)) speed[1] = pointer[1]-(p[3]-this.options.scrollSensitivity); - this.startScrolling(speed); - } - - // fix AppleWebKit rendering - if(navigator.appVersion.indexOf('AppleWebKit')>0) window.scrollBy(0,0); - - Event.stop(event); - }, - - finishDrag: function(event, success) { - this.dragging = false; - - if(this.options.ghosting) { - Position.relativize(this.element); - Element.remove(this._clone); - this._clone = null; - } - - if(success) Droppables.fire(event, this.element); - Draggables.notify('onEnd', this, event); - - var revert = this.options.revert; - if(revert && typeof revert == 'function') revert = revert(this.element); - - var d = this.currentDelta(); - if(revert && this.options.reverteffect) { - this.options.reverteffect(this.element, - d[1]-this.delta[1], d[0]-this.delta[0]); - } else { - this.delta = d; - } - - if(this.options.zindex) - this.element.style.zIndex = this.originalZ; - - if(this.options.endeffect) - this.options.endeffect(this.element); - - Draggables.deactivate(this); - Droppables.reset(); - }, - - keyPress: function(event) { - if(event.keyCode!=Event.KEY_ESC) return; - this.finishDrag(event, false); - Event.stop(event); - }, - - endDrag: function(event) { - if(!this.dragging) return; - this.stopScrolling(); - this.finishDrag(event, true); - Event.stop(event); - }, - - draw: function(point) { - var pos = Position.cumulativeOffset(this.element); - if(this.options.ghosting) { - var r = Position.realOffset(this.element); - pos[0] += r[0] - Position.deltaX; pos[1] += r[1] - Position.deltaY; - } - - var d = this.currentDelta(); - pos[0] -= d[0]; pos[1] -= d[1]; - - if(this.options.scroll && (this.options.scroll != window && this._isScrollChild)) { - pos[0] -= this.options.scroll.scrollLeft-this.originalScrollLeft; - pos[1] -= this.options.scroll.scrollTop-this.originalScrollTop; - } - - var p = [0,1].map(function(i){ - return (point[i]-pos[i]-this.offset[i]) - }.bind(this)); - - if(this.options.snap) { - if(typeof this.options.snap == 'function') { - p = this.options.snap(p[0],p[1],this); - } else { - if(this.options.snap instanceof Array) { - p = p.map( function(v, i) { - return Math.round(v/this.options.snap[i])*this.options.snap[i] }.bind(this)) - } else { - p = p.map( function(v) { - return Math.round(v/this.options.snap)*this.options.snap }.bind(this)) - } - }} - - var style = this.element.style; - if((!this.options.constraint) || (this.options.constraint=='horizontal')) - style.left = p[0] + "px"; - if((!this.options.constraint) || (this.options.constraint=='vertical')) - style.top = p[1] + "px"; - - if(style.visibility=="hidden") style.visibility = ""; // fix gecko rendering - }, - - stopScrolling: function() { - if(this.scrollInterval) { - clearInterval(this.scrollInterval); - this.scrollInterval = null; - Draggables._lastScrollPointer = null; - } - }, - - startScrolling: function(speed) { - if(!(speed[0] || speed[1])) return; - this.scrollSpeed = [speed[0]*this.options.scrollSpeed,speed[1]*this.options.scrollSpeed]; - this.lastScrolled = new Date(); - this.scrollInterval = setInterval(this.scroll.bind(this), 10); - }, - - scroll: function() { - var current = new Date(); - var delta = current - this.lastScrolled; - this.lastScrolled = current; - if(this.options.scroll == window) { - with (this._getWindowScroll(this.options.scroll)) { - if (this.scrollSpeed[0] || this.scrollSpeed[1]) { - var d = delta / 1000; - this.options.scroll.scrollTo( left + d*this.scrollSpeed[0], top + d*this.scrollSpeed[1] ); - } - } - } else { - this.options.scroll.scrollLeft += this.scrollSpeed[0] * delta / 1000; - this.options.scroll.scrollTop += this.scrollSpeed[1] * delta / 1000; - } - - Position.prepare(); - Droppables.show(Draggables._lastPointer, this.element); - Draggables.notify('onDrag', this); - if (this._isScrollChild) { - Draggables._lastScrollPointer = Draggables._lastScrollPointer || $A(Draggables._lastPointer); - Draggables._lastScrollPointer[0] += this.scrollSpeed[0] * delta / 1000; - Draggables._lastScrollPointer[1] += this.scrollSpeed[1] * delta / 1000; - if (Draggables._lastScrollPointer[0] < 0) - Draggables._lastScrollPointer[0] = 0; - if (Draggables._lastScrollPointer[1] < 0) - Draggables._lastScrollPointer[1] = 0; - this.draw(Draggables._lastScrollPointer); - } - - if(this.options.change) this.options.change(this); - }, - - _getWindowScroll: function(w) { - var T, L, W, H; - with (w.document) { - if (w.document.documentElement && documentElement.scrollTop) { - T = documentElement.scrollTop; - L = documentElement.scrollLeft; - } else if (w.document.body) { - T = body.scrollTop; - L = body.scrollLeft; - } - if (w.innerWidth) { - W = w.innerWidth; - H = w.innerHeight; - } else if (w.document.documentElement && documentElement.clientWidth) { - W = documentElement.clientWidth; - H = documentElement.clientHeight; - } else { - W = body.offsetWidth; - H = body.offsetHeight - } - } - return { top: T, left: L, width: W, height: H }; - } -} - -/*--------------------------------------------------------------------------*/ - -var SortableObserver = Class.create(); -SortableObserver.prototype = { - initialize: function(element, observer) { - this.element = $(element); - this.observer = observer; - this.lastValue = Sortable.serialize(this.element); - }, - - onStart: function() { - this.lastValue = Sortable.serialize(this.element); - }, - - onEnd: function() { - Sortable.unmark(); - if(this.lastValue != Sortable.serialize(this.element)) - this.observer(this.element) - } -} - -var Sortable = { - SERIALIZE_RULE: /^[^_\-](?:[A-Za-z0-9\-\_]*)[_](.*)$/, - - sortables: {}, - - _findRootElement: function(element) { - while (element.tagName != "BODY") { - if(element.id && Sortable.sortables[element.id]) return element; - element = element.parentNode; - } - }, - - options: function(element) { - element = Sortable._findRootElement($(element)); - if(!element) return; - return Sortable.sortables[element.id]; - }, - - destroy: function(element){ - var s = Sortable.options(element); - - if(s) { - Draggables.removeObserver(s.element); - s.droppables.each(function(d){ Droppables.remove(d) }); - s.draggables.invoke('destroy'); - - delete Sortable.sortables[s.element.id]; - } - }, - - create: function(element) { - element = $(element); - var options = Object.extend({ - element: element, - tag: 'li', // assumes li children, override with tag: 'tagname' - dropOnEmpty: false, - tree: false, - treeTag: 'ul', - overlap: 'vertical', // one of 'vertical', 'horizontal' - constraint: 'vertical', // one of 'vertical', 'horizontal', false - containment: element, // also takes array of elements (or id's); or false - handle: false, // or a CSS class - only: false, - delay: 0, - hoverclass: null, - ghosting: false, - scroll: false, - scrollSensitivity: 20, - scrollSpeed: 15, - format: this.SERIALIZE_RULE, - onChange: Prototype.emptyFunction, - onUpdate: Prototype.emptyFunction - }, arguments[1] || {}); - - // clear any old sortable with same element - this.destroy(element); - - // build options for the draggables - var options_for_draggable = { - revert: true, - scroll: options.scroll, - scrollSpeed: options.scrollSpeed, - scrollSensitivity: options.scrollSensitivity, - delay: options.delay, - ghosting: options.ghosting, - constraint: options.constraint, - handle: options.handle }; - - if(options.starteffect) - options_for_draggable.starteffect = options.starteffect; - - if(options.reverteffect) - options_for_draggable.reverteffect = options.reverteffect; - else - if(options.ghosting) options_for_draggable.reverteffect = function(element) { - element.style.top = 0; - element.style.left = 0; - }; - - if(options.endeffect) - options_for_draggable.endeffect = options.endeffect; - - if(options.zindex) - options_for_draggable.zindex = options.zindex; - - // build options for the droppables - var options_for_droppable = { - overlap: options.overlap, - containment: options.containment, - tree: options.tree, - hoverclass: options.hoverclass, - onHover: Sortable.onHover - } - - var options_for_tree = { - onHover: Sortable.onEmptyHover, - overlap: options.overlap, - containment: options.containment, - hoverclass: options.hoverclass - } - - // fix for gecko engine - Element.cleanWhitespace(element); - - options.draggables = []; - options.droppables = []; - - // drop on empty handling - if(options.dropOnEmpty || options.tree) { - Droppables.add(element, options_for_tree); - options.droppables.push(element); - } - - (this.findElements(element, options) || []).each( function(e) { - // handles are per-draggable - var handle = options.handle ? - $(e).down('.'+options.handle,0) : e; - options.draggables.push( - new Draggable(e, Object.extend(options_for_draggable, { handle: handle }))); - Droppables.add(e, options_for_droppable); - if(options.tree) e.treeNode = element; - options.droppables.push(e); - }); - - if(options.tree) { - (Sortable.findTreeElements(element, options) || []).each( function(e) { - Droppables.add(e, options_for_tree); - e.treeNode = element; - options.droppables.push(e); - }); - } - - // keep reference - this.sortables[element.id] = options; - - // for onupdate - Draggables.addObserver(new SortableObserver(element, options.onUpdate)); - - }, - - // return all suitable-for-sortable elements in a guaranteed order - findElements: function(element, options) { - return Element.findChildren( - element, options.only, options.tree ? true : false, options.tag); - }, - - findTreeElements: function(element, options) { - return Element.findChildren( - element, options.only, options.tree ? true : false, options.treeTag); - }, - - onHover: function(element, dropon, overlap) { - if(Element.isParent(dropon, element)) return; - - if(overlap > .33 && overlap < .66 && Sortable.options(dropon).tree) { - return; - } else if(overlap>0.5) { - Sortable.mark(dropon, 'before'); - if(dropon.previousSibling != element) { - var oldParentNode = element.parentNode; - element.style.visibility = "hidden"; // fix gecko rendering - dropon.parentNode.insertBefore(element, dropon); - if(dropon.parentNode!=oldParentNode) - Sortable.options(oldParentNode).onChange(element); - Sortable.options(dropon.parentNode).onChange(element); - } - } else { - Sortable.mark(dropon, 'after'); - var nextElement = dropon.nextSibling || null; - if(nextElement != element) { - var oldParentNode = element.parentNode; - element.style.visibility = "hidden"; // fix gecko rendering - dropon.parentNode.insertBefore(element, nextElement); - if(dropon.parentNode!=oldParentNode) - Sortable.options(oldParentNode).onChange(element); - Sortable.options(dropon.parentNode).onChange(element); - } - } - }, - - onEmptyHover: function(element, dropon, overlap) { - var oldParentNode = element.parentNode; - var droponOptions = Sortable.options(dropon); - - if(!Element.isParent(dropon, element)) { - var index; - - var children = Sortable.findElements(dropon, {tag: droponOptions.tag, only: droponOptions.only}); - var child = null; - - if(children) { - var offset = Element.offsetSize(dropon, droponOptions.overlap) * (1.0 - overlap); - - for (index = 0; index < children.length; index += 1) { - if (offset - Element.offsetSize (children[index], droponOptions.overlap) >= 0) { - offset -= Element.offsetSize (children[index], droponOptions.overlap); - } else if (offset - (Element.offsetSize (children[index], droponOptions.overlap) / 2) >= 0) { - child = index + 1 < children.length ? children[index + 1] : null; - break; - } else { - child = children[index]; - break; - } - } - } - - dropon.insertBefore(element, child); - - Sortable.options(oldParentNode).onChange(element); - droponOptions.onChange(element); - } - }, - - unmark: function() { - if(Sortable._marker) Sortable._marker.hide(); - }, - - mark: function(dropon, position) { - // mark on ghosting only - var sortable = Sortable.options(dropon.parentNode); - if(sortable && !sortable.ghosting) return; - - if(!Sortable._marker) { - Sortable._marker = - ($('dropmarker') || Element.extend(document.createElement('DIV'))). - hide().addClassName('dropmarker').setStyle({position:'absolute'}); - document.getElementsByTagName("body").item(0).appendChild(Sortable._marker); - } - var offsets = Position.cumulativeOffset(dropon); - Sortable._marker.setStyle({left: offsets[0]+'px', top: offsets[1] + 'px'}); - - if(position=='after') - if(sortable.overlap == 'horizontal') - Sortable._marker.setStyle({left: (offsets[0]+dropon.clientWidth) + 'px'}); - else - Sortable._marker.setStyle({top: (offsets[1]+dropon.clientHeight) + 'px'}); - - Sortable._marker.show(); - }, - - _tree: function(element, options, parent) { - var children = Sortable.findElements(element, options) || []; - - for (var i = 0; i < children.length; ++i) { - var match = children[i].id.match(options.format); - - if (!match) continue; - - var child = { - id: encodeURIComponent(match ? match[1] : null), - element: element, - parent: parent, - children: [], - position: parent.children.length, - container: $(children[i]).down(options.treeTag) - } - - /* Get the element containing the children and recurse over it */ - if (child.container) - this._tree(child.container, options, child) - - parent.children.push (child); - } - - return parent; - }, - - tree: function(element) { - element = $(element); - var sortableOptions = this.options(element); - var options = Object.extend({ - tag: sortableOptions.tag, - treeTag: sortableOptions.treeTag, - only: sortableOptions.only, - name: element.id, - format: sortableOptions.format - }, arguments[1] || {}); - - var root = { - id: null, - parent: null, - children: [], - container: element, - position: 0 - } - - return Sortable._tree(element, options, root); - }, - - /* Construct a [i] index for a particular node */ - _constructIndex: function(node) { - var index = ''; - do { - if (node.id) index = '[' + node.position + ']' + index; - } while ((node = node.parent) != null); - return index; - }, - - sequence: function(element) { - element = $(element); - var options = Object.extend(this.options(element), arguments[1] || {}); - - return $(this.findElements(element, options) || []).map( function(item) { - return item.id.match(options.format) ? item.id.match(options.format)[1] : ''; - }); - }, - - setSequence: function(element, new_sequence) { - element = $(element); - var options = Object.extend(this.options(element), arguments[2] || {}); - - var nodeMap = {}; - this.findElements(element, options).each( function(n) { - if (n.id.match(options.format)) - nodeMap[n.id.match(options.format)[1]] = [n, n.parentNode]; - n.parentNode.removeChild(n); - }); - - new_sequence.each(function(ident) { - var n = nodeMap[ident]; - if (n) { - n[1].appendChild(n[0]); - delete nodeMap[ident]; - } - }); - }, - - serialize: function(element) { - element = $(element); - var options = Object.extend(Sortable.options(element), arguments[1] || {}); - var name = encodeURIComponent( - (arguments[1] && arguments[1].name) ? arguments[1].name : element.id); - - if (options.tree) { - return Sortable.tree(element, arguments[1]).children.map( function (item) { - return [name + Sortable._constructIndex(item) + "[id]=" + - encodeURIComponent(item.id)].concat(item.children.map(arguments.callee)); - }).flatten().join('&'); - } else { - return Sortable.sequence(element, arguments[1]).map( function(item) { - return name + "[]=" + encodeURIComponent(item); - }).join('&'); - } - } -} - -// Returns true if child is contained within element -Element.isParent = function(child, element) { - if (!child.parentNode || child == element) return false; - if (child.parentNode == element) return true; - return Element.isParent(child.parentNode, element); -} - -Element.findChildren = function(element, only, recursive, tagName) { - if(!element.hasChildNodes()) return null; - tagName = tagName.toUpperCase(); - if(only) only = [only].flatten(); - var elements = []; - $A(element.childNodes).each( function(e) { - if(e.tagName && e.tagName.toUpperCase()==tagName && - (!only || (Element.classNames(e).detect(function(v) { return only.include(v) })))) - elements.push(e); - if(recursive) { - var grandchildren = Element.findChildren(e, only, recursive, tagName); - if(grandchildren) elements.push(grandchildren); - } - }); - - return (elements.length>0 ? elements.flatten() : []); -} - -Element.offsetSize = function (element, type) { - return element['offset' + ((type=='vertical' || type=='height') ? 'Height' : 'Width')]; -} diff --git a/solr/client/ruby/flare/public/javascripts/effects.js b/solr/client/ruby/flare/public/javascripts/effects.js deleted file mode 100644 index 3b02eda2b29..00000000000 --- a/solr/client/ruby/flare/public/javascripts/effects.js +++ /dev/null @@ -1,1088 +0,0 @@ -// Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) -// Contributors: -// Justin Palmer (http://encytemedia.com/) -// Mark Pilgrim (http://diveintomark.org/) -// Martin Bialasinki -// -// script.aculo.us is freely distributable under the terms of an MIT-style license. -// For details, see the script.aculo.us web site: http://script.aculo.us/ - -// converts rgb() and #xxx to #xxxxxx format, -// returns self (or first argument) if not convertable -String.prototype.parseColor = function() { - var color = '#'; - if(this.slice(0,4) == 'rgb(') { - var cols = this.slice(4,this.length-1).split(','); - var i=0; do { color += parseInt(cols[i]).toColorPart() } while (++i<3); - } else { - if(this.slice(0,1) == '#') { - if(this.length==4) for(var i=1;i<4;i++) color += (this.charAt(i) + this.charAt(i)).toLowerCase(); - if(this.length==7) color = this.toLowerCase(); - } - } - return(color.length==7 ? color : (arguments[0] || this)); -} - -/*--------------------------------------------------------------------------*/ - -Element.collectTextNodes = function(element) { - return $A($(element).childNodes).collect( function(node) { - return (node.nodeType==3 ? node.nodeValue : - (node.hasChildNodes() ? Element.collectTextNodes(node) : '')); - }).flatten().join(''); -} - -Element.collectTextNodesIgnoreClass = function(element, className) { - return $A($(element).childNodes).collect( function(node) { - return (node.nodeType==3 ? node.nodeValue : - ((node.hasChildNodes() && !Element.hasClassName(node,className)) ? - Element.collectTextNodesIgnoreClass(node, className) : '')); - }).flatten().join(''); -} - -Element.setContentZoom = function(element, percent) { - element = $(element); - element.setStyle({fontSize: (percent/100) + 'em'}); - if(navigator.appVersion.indexOf('AppleWebKit')>0) window.scrollBy(0,0); - return element; -} - -Element.getOpacity = function(element){ - element = $(element); - var opacity; - if (opacity = element.getStyle('opacity')) - return parseFloat(opacity); - if (opacity = (element.getStyle('filter') || '').match(/alpha\(opacity=(.*)\)/)) - if(opacity[1]) return parseFloat(opacity[1]) / 100; - return 1.0; -} - -Element.setOpacity = function(element, value){ - element= $(element); - if (value == 1){ - element.setStyle({ opacity: - (/Gecko/.test(navigator.userAgent) && !/Konqueror|Safari|KHTML/.test(navigator.userAgent)) ? - 0.999999 : 1.0 }); - if(/MSIE/.test(navigator.userAgent) && !window.opera) - element.setStyle({filter: Element.getStyle(element,'filter').replace(/alpha\([^\)]*\)/gi,'')}); - } else { - if(value < 0.00001) value = 0; - element.setStyle({opacity: value}); - if(/MSIE/.test(navigator.userAgent) && !window.opera) - element.setStyle( - { filter: element.getStyle('filter').replace(/alpha\([^\)]*\)/gi,'') + - 'alpha(opacity='+value*100+')' }); - } - return element; -} - -Element.getInlineOpacity = function(element){ - return $(element).style.opacity || ''; -} - -Element.forceRerendering = function(element) { - try { - element = $(element); - var n = document.createTextNode(' '); - element.appendChild(n); - element.removeChild(n); - } catch(e) { } -}; - -/*--------------------------------------------------------------------------*/ - -Array.prototype.call = function() { - var args = arguments; - this.each(function(f){ f.apply(this, args) }); -} - -/*--------------------------------------------------------------------------*/ - -var Effect = { - _elementDoesNotExistError: { - name: 'ElementDoesNotExistError', - message: 'The specified DOM element does not exist, but is required for this effect to operate' - }, - tagifyText: function(element) { - if(typeof Builder == 'undefined') - throw("Effect.tagifyText requires including script.aculo.us' builder.js library"); - - var tagifyStyle = 'position:relative'; - if(/MSIE/.test(navigator.userAgent) && !window.opera) tagifyStyle += ';zoom:1'; - - element = $(element); - $A(element.childNodes).each( function(child) { - if(child.nodeType==3) { - child.nodeValue.toArray().each( function(character) { - element.insertBefore( - Builder.node('span',{style: tagifyStyle}, - character == ' ' ? String.fromCharCode(160) : character), - child); - }); - Element.remove(child); - } - }); - }, - multiple: function(element, effect) { - var elements; - if(((typeof element == 'object') || - (typeof element == 'function')) && - (element.length)) - elements = element; - else - elements = $(element).childNodes; - - var options = Object.extend({ - speed: 0.1, - delay: 0.0 - }, arguments[2] || {}); - var masterDelay = options.delay; - - $A(elements).each( function(element, index) { - new effect(element, Object.extend(options, { delay: index * options.speed + masterDelay })); - }); - }, - PAIRS: { - 'slide': ['SlideDown','SlideUp'], - 'blind': ['BlindDown','BlindUp'], - 'appear': ['Appear','Fade'] - }, - toggle: function(element, effect) { - element = $(element); - effect = (effect || 'appear').toLowerCase(); - var options = Object.extend({ - queue: { position:'end', scope:(element.id || 'global'), limit: 1 } - }, arguments[2] || {}); - Effect[element.visible() ? - Effect.PAIRS[effect][1] : Effect.PAIRS[effect][0]](element, options); - } -}; - -var Effect2 = Effect; // deprecated - -/* ------------- transitions ------------- */ - -Effect.Transitions = { - linear: Prototype.K, - sinoidal: function(pos) { - return (-Math.cos(pos*Math.PI)/2) + 0.5; - }, - reverse: function(pos) { - return 1-pos; - }, - flicker: function(pos) { - return ((-Math.cos(pos*Math.PI)/4) + 0.75) + Math.random()/4; - }, - wobble: function(pos) { - return (-Math.cos(pos*Math.PI*(9*pos))/2) + 0.5; - }, - pulse: function(pos, pulses) { - pulses = pulses || 5; - return ( - Math.round((pos % (1/pulses)) * pulses) == 0 ? - ((pos * pulses * 2) - Math.floor(pos * pulses * 2)) : - 1 - ((pos * pulses * 2) - Math.floor(pos * pulses * 2)) - ); - }, - none: function(pos) { - return 0; - }, - full: function(pos) { - return 1; - } -}; - -/* ------------- core effects ------------- */ - -Effect.ScopedQueue = Class.create(); -Object.extend(Object.extend(Effect.ScopedQueue.prototype, Enumerable), { - initialize: function() { - this.effects = []; - this.interval = null; - }, - _each: function(iterator) { - this.effects._each(iterator); - }, - add: function(effect) { - var timestamp = new Date().getTime(); - - var position = (typeof effect.options.queue == 'string') ? - effect.options.queue : effect.options.queue.position; - - switch(position) { - case 'front': - // move unstarted effects after this effect - this.effects.findAll(function(e){ return e.state=='idle' }).each( function(e) { - e.startOn += effect.finishOn; - e.finishOn += effect.finishOn; - }); - break; - case 'with-last': - timestamp = this.effects.pluck('startOn').max() || timestamp; - break; - case 'end': - // start effect after last queued effect has finished - timestamp = this.effects.pluck('finishOn').max() || timestamp; - break; - } - - effect.startOn += timestamp; - effect.finishOn += timestamp; - - if(!effect.options.queue.limit || (this.effects.length < effect.options.queue.limit)) - this.effects.push(effect); - - if(!this.interval) - this.interval = setInterval(this.loop.bind(this), 40); - }, - remove: function(effect) { - this.effects = this.effects.reject(function(e) { return e==effect }); - if(this.effects.length == 0) { - clearInterval(this.interval); - this.interval = null; - } - }, - loop: function() { - var timePos = new Date().getTime(); - this.effects.invoke('loop', timePos); - } -}); - -Effect.Queues = { - instances: $H(), - get: function(queueName) { - if(typeof queueName != 'string') return queueName; - - if(!this.instances[queueName]) - this.instances[queueName] = new Effect.ScopedQueue(); - - return this.instances[queueName]; - } -} -Effect.Queue = Effect.Queues.get('global'); - -Effect.DefaultOptions = { - transition: Effect.Transitions.sinoidal, - duration: 1.0, // seconds - fps: 25.0, // max. 25fps due to Effect.Queue implementation - sync: false, // true for combining - from: 0.0, - to: 1.0, - delay: 0.0, - queue: 'parallel' -} - -Effect.Base = function() {}; -Effect.Base.prototype = { - position: null, - start: function(options) { - this.options = Object.extend(Object.extend({},Effect.DefaultOptions), options || {}); - this.currentFrame = 0; - this.state = 'idle'; - this.startOn = this.options.delay*1000; - this.finishOn = this.startOn + (this.options.duration*1000); - this.event('beforeStart'); - if(!this.options.sync) - Effect.Queues.get(typeof this.options.queue == 'string' ? - 'global' : this.options.queue.scope).add(this); - }, - loop: function(timePos) { - if(timePos >= this.startOn) { - if(timePos >= this.finishOn) { - this.render(1.0); - this.cancel(); - this.event('beforeFinish'); - if(this.finish) this.finish(); - this.event('afterFinish'); - return; - } - var pos = (timePos - this.startOn) / (this.finishOn - this.startOn); - var frame = Math.round(pos * this.options.fps * this.options.duration); - if(frame > this.currentFrame) { - this.render(pos); - this.currentFrame = frame; - } - } - }, - render: function(pos) { - if(this.state == 'idle') { - this.state = 'running'; - this.event('beforeSetup'); - if(this.setup) this.setup(); - this.event('afterSetup'); - } - if(this.state == 'running') { - if(this.options.transition) pos = this.options.transition(pos); - pos *= (this.options.to-this.options.from); - pos += this.options.from; - this.position = pos; - this.event('beforeUpdate'); - if(this.update) this.update(pos); - this.event('afterUpdate'); - } - }, - cancel: function() { - if(!this.options.sync) - Effect.Queues.get(typeof this.options.queue == 'string' ? - 'global' : this.options.queue.scope).remove(this); - this.state = 'finished'; - }, - event: function(eventName) { - if(this.options[eventName + 'Internal']) this.options[eventName + 'Internal'](this); - if(this.options[eventName]) this.options[eventName](this); - }, - inspect: function() { - return '#'; - } -} - -Effect.Parallel = Class.create(); -Object.extend(Object.extend(Effect.Parallel.prototype, Effect.Base.prototype), { - initialize: function(effects) { - this.effects = effects || []; - this.start(arguments[1]); - }, - update: function(position) { - this.effects.invoke('render', position); - }, - finish: function(position) { - this.effects.each( function(effect) { - effect.render(1.0); - effect.cancel(); - effect.event('beforeFinish'); - if(effect.finish) effect.finish(position); - effect.event('afterFinish'); - }); - } -}); - -Effect.Event = Class.create(); -Object.extend(Object.extend(Effect.Event.prototype, Effect.Base.prototype), { - initialize: function() { - var options = Object.extend({ - duration: 0 - }, arguments[0] || {}); - this.start(options); - }, - update: Prototype.emptyFunction -}); - -Effect.Opacity = Class.create(); -Object.extend(Object.extend(Effect.Opacity.prototype, Effect.Base.prototype), { - initialize: function(element) { - this.element = $(element); - if(!this.element) throw(Effect._elementDoesNotExistError); - // make this work on IE on elements without 'layout' - if(/MSIE/.test(navigator.userAgent) && !window.opera && (!this.element.currentStyle.hasLayout)) - this.element.setStyle({zoom: 1}); - var options = Object.extend({ - from: this.element.getOpacity() || 0.0, - to: 1.0 - }, arguments[1] || {}); - this.start(options); - }, - update: function(position) { - this.element.setOpacity(position); - } -}); - -Effect.Move = Class.create(); -Object.extend(Object.extend(Effect.Move.prototype, Effect.Base.prototype), { - initialize: function(element) { - this.element = $(element); - if(!this.element) throw(Effect._elementDoesNotExistError); - var options = Object.extend({ - x: 0, - y: 0, - mode: 'relative' - }, arguments[1] || {}); - this.start(options); - }, - setup: function() { - // Bug in Opera: Opera returns the "real" position of a static element or - // relative element that does not have top/left explicitly set. - // ==> Always set top and left for position relative elements in your stylesheets - // (to 0 if you do not need them) - this.element.makePositioned(); - this.originalLeft = parseFloat(this.element.getStyle('left') || '0'); - this.originalTop = parseFloat(this.element.getStyle('top') || '0'); - if(this.options.mode == 'absolute') { - // absolute movement, so we need to calc deltaX and deltaY - this.options.x = this.options.x - this.originalLeft; - this.options.y = this.options.y - this.originalTop; - } - }, - update: function(position) { - this.element.setStyle({ - left: Math.round(this.options.x * position + this.originalLeft) + 'px', - top: Math.round(this.options.y * position + this.originalTop) + 'px' - }); - } -}); - -// for backwards compatibility -Effect.MoveBy = function(element, toTop, toLeft) { - return new Effect.Move(element, - Object.extend({ x: toLeft, y: toTop }, arguments[3] || {})); -}; - -Effect.Scale = Class.create(); -Object.extend(Object.extend(Effect.Scale.prototype, Effect.Base.prototype), { - initialize: function(element, percent) { - this.element = $(element); - if(!this.element) throw(Effect._elementDoesNotExistError); - var options = Object.extend({ - scaleX: true, - scaleY: true, - scaleContent: true, - scaleFromCenter: false, - scaleMode: 'box', // 'box' or 'contents' or {} with provided values - scaleFrom: 100.0, - scaleTo: percent - }, arguments[2] || {}); - this.start(options); - }, - setup: function() { - this.restoreAfterFinish = this.options.restoreAfterFinish || false; - this.elementPositioning = this.element.getStyle('position'); - - this.originalStyle = {}; - ['top','left','width','height','fontSize'].each( function(k) { - this.originalStyle[k] = this.element.style[k]; - }.bind(this)); - - this.originalTop = this.element.offsetTop; - this.originalLeft = this.element.offsetLeft; - - var fontSize = this.element.getStyle('font-size') || '100%'; - ['em','px','%','pt'].each( function(fontSizeType) { - if(fontSize.indexOf(fontSizeType)>0) { - this.fontSize = parseFloat(fontSize); - this.fontSizeType = fontSizeType; - } - }.bind(this)); - - this.factor = (this.options.scaleTo - this.options.scaleFrom)/100; - - this.dims = null; - if(this.options.scaleMode=='box') - this.dims = [this.element.offsetHeight, this.element.offsetWidth]; - if(/^content/.test(this.options.scaleMode)) - this.dims = [this.element.scrollHeight, this.element.scrollWidth]; - if(!this.dims) - this.dims = [this.options.scaleMode.originalHeight, - this.options.scaleMode.originalWidth]; - }, - update: function(position) { - var currentScale = (this.options.scaleFrom/100.0) + (this.factor * position); - if(this.options.scaleContent && this.fontSize) - this.element.setStyle({fontSize: this.fontSize * currentScale + this.fontSizeType }); - this.setDimensions(this.dims[0] * currentScale, this.dims[1] * currentScale); - }, - finish: function(position) { - if(this.restoreAfterFinish) this.element.setStyle(this.originalStyle); - }, - setDimensions: function(height, width) { - var d = {}; - if(this.options.scaleX) d.width = Math.round(width) + 'px'; - if(this.options.scaleY) d.height = Math.round(height) + 'px'; - if(this.options.scaleFromCenter) { - var topd = (height - this.dims[0])/2; - var leftd = (width - this.dims[1])/2; - if(this.elementPositioning == 'absolute') { - if(this.options.scaleY) d.top = this.originalTop-topd + 'px'; - if(this.options.scaleX) d.left = this.originalLeft-leftd + 'px'; - } else { - if(this.options.scaleY) d.top = -topd + 'px'; - if(this.options.scaleX) d.left = -leftd + 'px'; - } - } - this.element.setStyle(d); - } -}); - -Effect.Highlight = Class.create(); -Object.extend(Object.extend(Effect.Highlight.prototype, Effect.Base.prototype), { - initialize: function(element) { - this.element = $(element); - if(!this.element) throw(Effect._elementDoesNotExistError); - var options = Object.extend({ startcolor: '#ffff99' }, arguments[1] || {}); - this.start(options); - }, - setup: function() { - // Prevent executing on elements not in the layout flow - if(this.element.getStyle('display')=='none') { this.cancel(); return; } - // Disable background image during the effect - this.oldStyle = { - backgroundImage: this.element.getStyle('background-image') }; - this.element.setStyle({backgroundImage: 'none'}); - if(!this.options.endcolor) - this.options.endcolor = this.element.getStyle('background-color').parseColor('#ffffff'); - if(!this.options.restorecolor) - this.options.restorecolor = this.element.getStyle('background-color'); - // init color calculations - this._base = $R(0,2).map(function(i){ return parseInt(this.options.startcolor.slice(i*2+1,i*2+3),16) }.bind(this)); - this._delta = $R(0,2).map(function(i){ return parseInt(this.options.endcolor.slice(i*2+1,i*2+3),16)-this._base[i] }.bind(this)); - }, - update: function(position) { - this.element.setStyle({backgroundColor: $R(0,2).inject('#',function(m,v,i){ - return m+(Math.round(this._base[i]+(this._delta[i]*position)).toColorPart()); }.bind(this)) }); - }, - finish: function() { - this.element.setStyle(Object.extend(this.oldStyle, { - backgroundColor: this.options.restorecolor - })); - } -}); - -Effect.ScrollTo = Class.create(); -Object.extend(Object.extend(Effect.ScrollTo.prototype, Effect.Base.prototype), { - initialize: function(element) { - this.element = $(element); - this.start(arguments[1] || {}); - }, - setup: function() { - Position.prepare(); - var offsets = Position.cumulativeOffset(this.element); - if(this.options.offset) offsets[1] += this.options.offset; - var max = window.innerHeight ? - window.height - window.innerHeight : - document.body.scrollHeight - - (document.documentElement.clientHeight ? - document.documentElement.clientHeight : document.body.clientHeight); - this.scrollStart = Position.deltaY; - this.delta = (offsets[1] > max ? max : offsets[1]) - this.scrollStart; - }, - update: function(position) { - Position.prepare(); - window.scrollTo(Position.deltaX, - this.scrollStart + (position*this.delta)); - } -}); - -/* ------------- combination effects ------------- */ - -Effect.Fade = function(element) { - element = $(element); - var oldOpacity = element.getInlineOpacity(); - var options = Object.extend({ - from: element.getOpacity() || 1.0, - to: 0.0, - afterFinishInternal: function(effect) { - if(effect.options.to!=0) return; - effect.element.hide().setStyle({opacity: oldOpacity}); - }}, arguments[1] || {}); - return new Effect.Opacity(element,options); -} - -Effect.Appear = function(element) { - element = $(element); - var options = Object.extend({ - from: (element.getStyle('display') == 'none' ? 0.0 : element.getOpacity() || 0.0), - to: 1.0, - // force Safari to render floated elements properly - afterFinishInternal: function(effect) { - effect.element.forceRerendering(); - }, - beforeSetup: function(effect) { - effect.element.setOpacity(effect.options.from).show(); - }}, arguments[1] || {}); - return new Effect.Opacity(element,options); -} - -Effect.Puff = function(element) { - element = $(element); - var oldStyle = { - opacity: element.getInlineOpacity(), - position: element.getStyle('position'), - top: element.style.top, - left: element.style.left, - width: element.style.width, - height: element.style.height - }; - return new Effect.Parallel( - [ new Effect.Scale(element, 200, - { sync: true, scaleFromCenter: true, scaleContent: true, restoreAfterFinish: true }), - new Effect.Opacity(element, { sync: true, to: 0.0 } ) ], - Object.extend({ duration: 1.0, - beforeSetupInternal: function(effect) { - Position.absolutize(effect.effects[0].element) - }, - afterFinishInternal: function(effect) { - effect.effects[0].element.hide().setStyle(oldStyle); } - }, arguments[1] || {}) - ); -} - -Effect.BlindUp = function(element) { - element = $(element); - element.makeClipping(); - return new Effect.Scale(element, 0, - Object.extend({ scaleContent: false, - scaleX: false, - restoreAfterFinish: true, - afterFinishInternal: function(effect) { - effect.element.hide().undoClipping(); - } - }, arguments[1] || {}) - ); -} - -Effect.BlindDown = function(element) { - element = $(element); - var elementDimensions = element.getDimensions(); - return new Effect.Scale(element, 100, Object.extend({ - scaleContent: false, - scaleX: false, - scaleFrom: 0, - scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width}, - restoreAfterFinish: true, - afterSetup: function(effect) { - effect.element.makeClipping().setStyle({height: '0px'}).show(); - }, - afterFinishInternal: function(effect) { - effect.element.undoClipping(); - } - }, arguments[1] || {})); -} - -Effect.SwitchOff = function(element) { - element = $(element); - var oldOpacity = element.getInlineOpacity(); - return new Effect.Appear(element, Object.extend({ - duration: 0.4, - from: 0, - transition: Effect.Transitions.flicker, - afterFinishInternal: function(effect) { - new Effect.Scale(effect.element, 1, { - duration: 0.3, scaleFromCenter: true, - scaleX: false, scaleContent: false, restoreAfterFinish: true, - beforeSetup: function(effect) { - effect.element.makePositioned().makeClipping(); - }, - afterFinishInternal: function(effect) { - effect.element.hide().undoClipping().undoPositioned().setStyle({opacity: oldOpacity}); - } - }) - } - }, arguments[1] || {})); -} - -Effect.DropOut = function(element) { - element = $(element); - var oldStyle = { - top: element.getStyle('top'), - left: element.getStyle('left'), - opacity: element.getInlineOpacity() }; - return new Effect.Parallel( - [ new Effect.Move(element, {x: 0, y: 100, sync: true }), - new Effect.Opacity(element, { sync: true, to: 0.0 }) ], - Object.extend( - { duration: 0.5, - beforeSetup: function(effect) { - effect.effects[0].element.makePositioned(); - }, - afterFinishInternal: function(effect) { - effect.effects[0].element.hide().undoPositioned().setStyle(oldStyle); - } - }, arguments[1] || {})); -} - -Effect.Shake = function(element) { - element = $(element); - var oldStyle = { - top: element.getStyle('top'), - left: element.getStyle('left') }; - return new Effect.Move(element, - { x: 20, y: 0, duration: 0.05, afterFinishInternal: function(effect) { - new Effect.Move(effect.element, - { x: -40, y: 0, duration: 0.1, afterFinishInternal: function(effect) { - new Effect.Move(effect.element, - { x: 40, y: 0, duration: 0.1, afterFinishInternal: function(effect) { - new Effect.Move(effect.element, - { x: -40, y: 0, duration: 0.1, afterFinishInternal: function(effect) { - new Effect.Move(effect.element, - { x: 40, y: 0, duration: 0.1, afterFinishInternal: function(effect) { - new Effect.Move(effect.element, - { x: -20, y: 0, duration: 0.05, afterFinishInternal: function(effect) { - effect.element.undoPositioned().setStyle(oldStyle); - }}) }}) }}) }}) }}) }}); -} - -Effect.SlideDown = function(element) { - element = $(element).cleanWhitespace(); - // SlideDown need to have the content of the element wrapped in a container element with fixed height! - var oldInnerBottom = element.down().getStyle('bottom'); - var elementDimensions = element.getDimensions(); - return new Effect.Scale(element, 100, Object.extend({ - scaleContent: false, - scaleX: false, - scaleFrom: window.opera ? 0 : 1, - scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width}, - restoreAfterFinish: true, - afterSetup: function(effect) { - effect.element.makePositioned(); - effect.element.down().makePositioned(); - if(window.opera) effect.element.setStyle({top: ''}); - effect.element.makeClipping().setStyle({height: '0px'}).show(); - }, - afterUpdateInternal: function(effect) { - effect.element.down().setStyle({bottom: - (effect.dims[0] - effect.element.clientHeight) + 'px' }); - }, - afterFinishInternal: function(effect) { - effect.element.undoClipping().undoPositioned(); - effect.element.down().undoPositioned().setStyle({bottom: oldInnerBottom}); } - }, arguments[1] || {}) - ); -} - -Effect.SlideUp = function(element) { - element = $(element).cleanWhitespace(); - var oldInnerBottom = element.down().getStyle('bottom'); - return new Effect.Scale(element, window.opera ? 0 : 1, - Object.extend({ scaleContent: false, - scaleX: false, - scaleMode: 'box', - scaleFrom: 100, - restoreAfterFinish: true, - beforeStartInternal: function(effect) { - effect.element.makePositioned(); - effect.element.down().makePositioned(); - if(window.opera) effect.element.setStyle({top: ''}); - effect.element.makeClipping().show(); - }, - afterUpdateInternal: function(effect) { - effect.element.down().setStyle({bottom: - (effect.dims[0] - effect.element.clientHeight) + 'px' }); - }, - afterFinishInternal: function(effect) { - effect.element.hide().undoClipping().undoPositioned().setStyle({bottom: oldInnerBottom}); - effect.element.down().undoPositioned(); - } - }, arguments[1] || {}) - ); -} - -// Bug in opera makes the TD containing this element expand for a instance after finish -Effect.Squish = function(element) { - return new Effect.Scale(element, window.opera ? 1 : 0, { - restoreAfterFinish: true, - beforeSetup: function(effect) { - effect.element.makeClipping(); - }, - afterFinishInternal: function(effect) { - effect.element.hide().undoClipping(); - } - }); -} - -Effect.Grow = function(element) { - element = $(element); - var options = Object.extend({ - direction: 'center', - moveTransition: Effect.Transitions.sinoidal, - scaleTransition: Effect.Transitions.sinoidal, - opacityTransition: Effect.Transitions.full - }, arguments[1] || {}); - var oldStyle = { - top: element.style.top, - left: element.style.left, - height: element.style.height, - width: element.style.width, - opacity: element.getInlineOpacity() }; - - var dims = element.getDimensions(); - var initialMoveX, initialMoveY; - var moveX, moveY; - - switch (options.direction) { - case 'top-left': - initialMoveX = initialMoveY = moveX = moveY = 0; - break; - case 'top-right': - initialMoveX = dims.width; - initialMoveY = moveY = 0; - moveX = -dims.width; - break; - case 'bottom-left': - initialMoveX = moveX = 0; - initialMoveY = dims.height; - moveY = -dims.height; - break; - case 'bottom-right': - initialMoveX = dims.width; - initialMoveY = dims.height; - moveX = -dims.width; - moveY = -dims.height; - break; - case 'center': - initialMoveX = dims.width / 2; - initialMoveY = dims.height / 2; - moveX = -dims.width / 2; - moveY = -dims.height / 2; - break; - } - - return new Effect.Move(element, { - x: initialMoveX, - y: initialMoveY, - duration: 0.01, - beforeSetup: function(effect) { - effect.element.hide().makeClipping().makePositioned(); - }, - afterFinishInternal: function(effect) { - new Effect.Parallel( - [ new Effect.Opacity(effect.element, { sync: true, to: 1.0, from: 0.0, transition: options.opacityTransition }), - new Effect.Move(effect.element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition }), - new Effect.Scale(effect.element, 100, { - scaleMode: { originalHeight: dims.height, originalWidth: dims.width }, - sync: true, scaleFrom: window.opera ? 1 : 0, transition: options.scaleTransition, restoreAfterFinish: true}) - ], Object.extend({ - beforeSetup: function(effect) { - effect.effects[0].element.setStyle({height: '0px'}).show(); - }, - afterFinishInternal: function(effect) { - effect.effects[0].element.undoClipping().undoPositioned().setStyle(oldStyle); - } - }, options) - ) - } - }); -} - -Effect.Shrink = function(element) { - element = $(element); - var options = Object.extend({ - direction: 'center', - moveTransition: Effect.Transitions.sinoidal, - scaleTransition: Effect.Transitions.sinoidal, - opacityTransition: Effect.Transitions.none - }, arguments[1] || {}); - var oldStyle = { - top: element.style.top, - left: element.style.left, - height: element.style.height, - width: element.style.width, - opacity: element.getInlineOpacity() }; - - var dims = element.getDimensions(); - var moveX, moveY; - - switch (options.direction) { - case 'top-left': - moveX = moveY = 0; - break; - case 'top-right': - moveX = dims.width; - moveY = 0; - break; - case 'bottom-left': - moveX = 0; - moveY = dims.height; - break; - case 'bottom-right': - moveX = dims.width; - moveY = dims.height; - break; - case 'center': - moveX = dims.width / 2; - moveY = dims.height / 2; - break; - } - - return new Effect.Parallel( - [ new Effect.Opacity(element, { sync: true, to: 0.0, from: 1.0, transition: options.opacityTransition }), - new Effect.Scale(element, window.opera ? 1 : 0, { sync: true, transition: options.scaleTransition, restoreAfterFinish: true}), - new Effect.Move(element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition }) - ], Object.extend({ - beforeStartInternal: function(effect) { - effect.effects[0].element.makePositioned().makeClipping(); - }, - afterFinishInternal: function(effect) { - effect.effects[0].element.hide().undoClipping().undoPositioned().setStyle(oldStyle); } - }, options) - ); -} - -Effect.Pulsate = function(element) { - element = $(element); - var options = arguments[1] || {}; - var oldOpacity = element.getInlineOpacity(); - var transition = options.transition || Effect.Transitions.sinoidal; - var reverser = function(pos){ return transition(1-Effect.Transitions.pulse(pos, options.pulses)) }; - reverser.bind(transition); - return new Effect.Opacity(element, - Object.extend(Object.extend({ duration: 2.0, from: 0, - afterFinishInternal: function(effect) { effect.element.setStyle({opacity: oldOpacity}); } - }, options), {transition: reverser})); -} - -Effect.Fold = function(element) { - element = $(element); - var oldStyle = { - top: element.style.top, - left: element.style.left, - width: element.style.width, - height: element.style.height }; - element.makeClipping(); - return new Effect.Scale(element, 5, Object.extend({ - scaleContent: false, - scaleX: false, - afterFinishInternal: function(effect) { - new Effect.Scale(element, 1, { - scaleContent: false, - scaleY: false, - afterFinishInternal: function(effect) { - effect.element.hide().undoClipping().setStyle(oldStyle); - } }); - }}, arguments[1] || {})); -}; - -Effect.Morph = Class.create(); -Object.extend(Object.extend(Effect.Morph.prototype, Effect.Base.prototype), { - initialize: function(element) { - this.element = $(element); - if(!this.element) throw(Effect._elementDoesNotExistError); - var options = Object.extend({ - style: '' - }, arguments[1] || {}); - this.start(options); - }, - setup: function(){ - function parseColor(color){ - if(!color || ['rgba(0, 0, 0, 0)','transparent'].include(color)) color = '#ffffff'; - color = color.parseColor(); - return $R(0,2).map(function(i){ - return parseInt( color.slice(i*2+1,i*2+3), 16 ) - }); - } - this.transforms = this.options.style.parseStyle().map(function(property){ - var originalValue = this.element.getStyle(property[0]); - return $H({ - style: property[0], - originalValue: property[1].unit=='color' ? - parseColor(originalValue) : parseFloat(originalValue || 0), - targetValue: property[1].unit=='color' ? - parseColor(property[1].value) : property[1].value, - unit: property[1].unit - }); - }.bind(this)).reject(function(transform){ - return ( - (transform.originalValue == transform.targetValue) || - ( - transform.unit != 'color' && - (isNaN(transform.originalValue) || isNaN(transform.targetValue)) - ) - ) - }); - }, - update: function(position) { - var style = $H(), value = null; - this.transforms.each(function(transform){ - value = transform.unit=='color' ? - $R(0,2).inject('#',function(m,v,i){ - return m+(Math.round(transform.originalValue[i]+ - (transform.targetValue[i] - transform.originalValue[i])*position)).toColorPart() }) : - transform.originalValue + Math.round( - ((transform.targetValue - transform.originalValue) * position) * 1000)/1000 + transform.unit; - style[transform.style] = value; - }); - this.element.setStyle(style); - } -}); - -Effect.Transform = Class.create(); -Object.extend(Effect.Transform.prototype, { - initialize: function(tracks){ - this.tracks = []; - this.options = arguments[1] || {}; - this.addTracks(tracks); - }, - addTracks: function(tracks){ - tracks.each(function(track){ - var data = $H(track).values().first(); - this.tracks.push($H({ - ids: $H(track).keys().first(), - effect: Effect.Morph, - options: { style: data } - })); - }.bind(this)); - return this; - }, - play: function(){ - return new Effect.Parallel( - this.tracks.map(function(track){ - var elements = [$(track.ids) || $$(track.ids)].flatten(); - return elements.map(function(e){ return new track.effect(e, Object.extend({ sync:true }, track.options)) }); - }).flatten(), - this.options - ); - } -}); - -Element.CSS_PROPERTIES = ['azimuth', 'backgroundAttachment', 'backgroundColor', 'backgroundImage', - 'backgroundPosition', 'backgroundRepeat', 'borderBottomColor', 'borderBottomStyle', - 'borderBottomWidth', 'borderCollapse', 'borderLeftColor', 'borderLeftStyle', 'borderLeftWidth', - 'borderRightColor', 'borderRightStyle', 'borderRightWidth', 'borderSpacing', 'borderTopColor', - 'borderTopStyle', 'borderTopWidth', 'bottom', 'captionSide', 'clear', 'clip', 'color', 'content', - 'counterIncrement', 'counterReset', 'cssFloat', 'cueAfter', 'cueBefore', 'cursor', 'direction', - 'display', 'elevation', 'emptyCells', 'fontFamily', 'fontSize', 'fontSizeAdjust', 'fontStretch', - 'fontStyle', 'fontVariant', 'fontWeight', 'height', 'left', 'letterSpacing', 'lineHeight', - 'listStyleImage', 'listStylePosition', 'listStyleType', 'marginBottom', 'marginLeft', 'marginRight', - 'marginTop', 'markerOffset', 'marks', 'maxHeight', 'maxWidth', 'minHeight', 'minWidth', 'opacity', - 'orphans', 'outlineColor', 'outlineOffset', 'outlineStyle', 'outlineWidth', 'overflowX', 'overflowY', - 'paddingBottom', 'paddingLeft', 'paddingRight', 'paddingTop', 'page', 'pageBreakAfter', 'pageBreakBefore', - 'pageBreakInside', 'pauseAfter', 'pauseBefore', 'pitch', 'pitchRange', 'position', 'quotes', - 'richness', 'right', 'size', 'speakHeader', 'speakNumeral', 'speakPunctuation', 'speechRate', 'stress', - 'tableLayout', 'textAlign', 'textDecoration', 'textIndent', 'textShadow', 'textTransform', 'top', - 'unicodeBidi', 'verticalAlign', 'visibility', 'voiceFamily', 'volume', 'whiteSpace', 'widows', - 'width', 'wordSpacing', 'zIndex']; - -Element.CSS_LENGTH = /^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/; - -String.prototype.parseStyle = function(){ - var element = Element.extend(document.createElement('div')); - element.innerHTML = '

    '; - var style = element.down().style, styleRules = $H(); - - Element.CSS_PROPERTIES.each(function(property){ - if(style[property]) styleRules[property] = style[property]; - }); - - var result = $H(); - - styleRules.each(function(pair){ - var property = pair[0], value = pair[1], unit = null; - - if(value.parseColor('#zzzzzz') != '#zzzzzz') { - value = value.parseColor(); - unit = 'color'; - } else if(Element.CSS_LENGTH.test(value)) - var components = value.match(/^([\+\-]?[0-9\.]+)(.*)$/), - value = parseFloat(components[1]), unit = (components.length == 3) ? components[2] : null; - - result[property.underscore().dasherize()] = $H({ value:value, unit:unit }); - }.bind(this)); - - return result; -}; - -Element.morph = function(element, style) { - new Effect.Morph(element, Object.extend({ style: style }, arguments[2] || {})); - return element; -}; - -['setOpacity','getOpacity','getInlineOpacity','forceRerendering','setContentZoom', - 'collectTextNodes','collectTextNodesIgnoreClass','morph'].each( - function(f) { Element.Methods[f] = Element[f]; } -); - -Element.Methods.visualEffect = function(element, effect, options) { - s = effect.gsub(/_/, '-').camelize(); - effect_class = s.charAt(0).toUpperCase() + s.substring(1); - new Effect[effect_class](element, options); - return $(element); -}; - -Element.addMethods(); \ No newline at end of file diff --git a/solr/client/ruby/flare/public/javascripts/prototype.js b/solr/client/ruby/flare/public/javascripts/prototype.js deleted file mode 100644 index 505822177b8..00000000000 --- a/solr/client/ruby/flare/public/javascripts/prototype.js +++ /dev/null @@ -1,2515 +0,0 @@ -/* Prototype JavaScript framework, version 1.5.0 - * (c) 2005-2007 Sam Stephenson - * - * Prototype is freely distributable under the terms of an MIT-style license. - * For details, see the Prototype web site: http://prototype.conio.net/ - * -/*--------------------------------------------------------------------------*/ - -var Prototype = { - Version: '1.5.0', - BrowserFeatures: { - XPath: !!document.evaluate - }, - - ScriptFragment: '(?:)((\n|\r|.)*?)(?:<\/script>)', - emptyFunction: function() {}, - K: function(x) { return x } -} - -var Class = { - create: function() { - return function() { - this.initialize.apply(this, arguments); - } - } -} - -var Abstract = new Object(); - -Object.extend = function(destination, source) { - for (var property in source) { - destination[property] = source[property]; - } - return destination; -} - -Object.extend(Object, { - inspect: function(object) { - try { - if (object === undefined) return 'undefined'; - if (object === null) return 'null'; - return object.inspect ? object.inspect() : object.toString(); - } catch (e) { - if (e instanceof RangeError) return '...'; - throw e; - } - }, - - keys: function(object) { - var keys = []; - for (var property in object) - keys.push(property); - return keys; - }, - - values: function(object) { - var values = []; - for (var property in object) - values.push(object[property]); - return values; - }, - - clone: function(object) { - return Object.extend({}, object); - } -}); - -Function.prototype.bind = function() { - var __method = this, args = $A(arguments), object = args.shift(); - return function() { - return __method.apply(object, args.concat($A(arguments))); - } -} - -Function.prototype.bindAsEventListener = function(object) { - var __method = this, args = $A(arguments), object = args.shift(); - return function(event) { - return __method.apply(object, [( event || window.event)].concat(args).concat($A(arguments))); - } -} - -Object.extend(Number.prototype, { - toColorPart: function() { - var digits = this.toString(16); - if (this < 16) return '0' + digits; - return digits; - }, - - succ: function() { - return this + 1; - }, - - times: function(iterator) { - $R(0, this, true).each(iterator); - return this; - } -}); - -var Try = { - these: function() { - var returnValue; - - for (var i = 0, length = arguments.length; i < length; i++) { - var lambda = arguments[i]; - try { - returnValue = lambda(); - break; - } catch (e) {} - } - - return returnValue; - } -} - -/*--------------------------------------------------------------------------*/ - -var PeriodicalExecuter = Class.create(); -PeriodicalExecuter.prototype = { - initialize: function(callback, frequency) { - this.callback = callback; - this.frequency = frequency; - this.currentlyExecuting = false; - - this.registerCallback(); - }, - - registerCallback: function() { - this.timer = setInterval(this.onTimerEvent.bind(this), this.frequency * 1000); - }, - - stop: function() { - if (!this.timer) return; - clearInterval(this.timer); - this.timer = null; - }, - - onTimerEvent: function() { - if (!this.currentlyExecuting) { - try { - this.currentlyExecuting = true; - this.callback(this); - } finally { - this.currentlyExecuting = false; - } - } - } -} -String.interpret = function(value){ - return value == null ? '' : String(value); -} - -Object.extend(String.prototype, { - gsub: function(pattern, replacement) { - var result = '', source = this, match; - replacement = arguments.callee.prepareReplacement(replacement); - - while (source.length > 0) { - if (match = source.match(pattern)) { - result += source.slice(0, match.index); - result += String.interpret(replacement(match)); - source = source.slice(match.index + match[0].length); - } else { - result += source, source = ''; - } - } - return result; - }, - - sub: function(pattern, replacement, count) { - replacement = this.gsub.prepareReplacement(replacement); - count = count === undefined ? 1 : count; - - return this.gsub(pattern, function(match) { - if (--count < 0) return match[0]; - return replacement(match); - }); - }, - - scan: function(pattern, iterator) { - this.gsub(pattern, iterator); - return this; - }, - - truncate: function(length, truncation) { - length = length || 30; - truncation = truncation === undefined ? '...' : truncation; - return this.length > length ? - this.slice(0, length - truncation.length) + truncation : this; - }, - - strip: function() { - return this.replace(/^\s+/, '').replace(/\s+$/, ''); - }, - - stripTags: function() { - return this.replace(/<\/?[^>]+>/gi, ''); - }, - - stripScripts: function() { - return this.replace(new RegExp(Prototype.ScriptFragment, 'img'), ''); - }, - - extractScripts: function() { - var matchAll = new RegExp(Prototype.ScriptFragment, 'img'); - var matchOne = new RegExp(Prototype.ScriptFragment, 'im'); - return (this.match(matchAll) || []).map(function(scriptTag) { - return (scriptTag.match(matchOne) || ['', ''])[1]; - }); - }, - - evalScripts: function() { - return this.extractScripts().map(function(script) { return eval(script) }); - }, - - escapeHTML: function() { - var div = document.createElement('div'); - var text = document.createTextNode(this); - div.appendChild(text); - return div.innerHTML; - }, - - unescapeHTML: function() { - var div = document.createElement('div'); - div.innerHTML = this.stripTags(); - return div.childNodes[0] ? (div.childNodes.length > 1 ? - $A(div.childNodes).inject('',function(memo,node){ return memo+node.nodeValue }) : - div.childNodes[0].nodeValue) : ''; - }, - - toQueryParams: function(separator) { - var match = this.strip().match(/([^?#]*)(#.*)?$/); - if (!match) return {}; - - return match[1].split(separator || '&').inject({}, function(hash, pair) { - if ((pair = pair.split('='))[0]) { - var name = decodeURIComponent(pair[0]); - var value = pair[1] ? decodeURIComponent(pair[1]) : undefined; - - if (hash[name] !== undefined) { - if (hash[name].constructor != Array) - hash[name] = [hash[name]]; - if (value) hash[name].push(value); - } - else hash[name] = value; - } - return hash; - }); - }, - - toArray: function() { - return this.split(''); - }, - - succ: function() { - return this.slice(0, this.length - 1) + - String.fromCharCode(this.charCodeAt(this.length - 1) + 1); - }, - - camelize: function() { - var parts = this.split('-'), len = parts.length; - if (len == 1) return parts[0]; - - var camelized = this.charAt(0) == '-' - ? parts[0].charAt(0).toUpperCase() + parts[0].substring(1) - : parts[0]; - - for (var i = 1; i < len; i++) - camelized += parts[i].charAt(0).toUpperCase() + parts[i].substring(1); - - return camelized; - }, - - capitalize: function(){ - return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase(); - }, - - underscore: function() { - return this.gsub(/::/, '/').gsub(/([A-Z]+)([A-Z][a-z])/,'#{1}_#{2}').gsub(/([a-z\d])([A-Z])/,'#{1}_#{2}').gsub(/-/,'_').toLowerCase(); - }, - - dasherize: function() { - return this.gsub(/_/,'-'); - }, - - inspect: function(useDoubleQuotes) { - var escapedString = this.replace(/\\/g, '\\\\'); - if (useDoubleQuotes) - return '"' + escapedString.replace(/"/g, '\\"') + '"'; - else - return "'" + escapedString.replace(/'/g, '\\\'') + "'"; - } -}); - -String.prototype.gsub.prepareReplacement = function(replacement) { - if (typeof replacement == 'function') return replacement; - var template = new Template(replacement); - return function(match) { return template.evaluate(match) }; -} - -String.prototype.parseQuery = String.prototype.toQueryParams; - -var Template = Class.create(); -Template.Pattern = /(^|.|\r|\n)(#\{(.*?)\})/; -Template.prototype = { - initialize: function(template, pattern) { - this.template = template.toString(); - this.pattern = pattern || Template.Pattern; - }, - - evaluate: function(object) { - return this.template.gsub(this.pattern, function(match) { - var before = match[1]; - if (before == '\\') return match[2]; - return before + String.interpret(object[match[3]]); - }); - } -} - -var $break = new Object(); -var $continue = new Object(); - -var Enumerable = { - each: function(iterator) { - var index = 0; - try { - this._each(function(value) { - try { - iterator(value, index++); - } catch (e) { - if (e != $continue) throw e; - } - }); - } catch (e) { - if (e != $break) throw e; - } - return this; - }, - - eachSlice: function(number, iterator) { - var index = -number, slices = [], array = this.toArray(); - while ((index += number) < array.length) - slices.push(array.slice(index, index+number)); - return slices.map(iterator); - }, - - all: function(iterator) { - var result = true; - this.each(function(value, index) { - result = result && !!(iterator || Prototype.K)(value, index); - if (!result) throw $break; - }); - return result; - }, - - any: function(iterator) { - var result = false; - this.each(function(value, index) { - if (result = !!(iterator || Prototype.K)(value, index)) - throw $break; - }); - return result; - }, - - collect: function(iterator) { - var results = []; - this.each(function(value, index) { - results.push((iterator || Prototype.K)(value, index)); - }); - return results; - }, - - detect: function(iterator) { - var result; - this.each(function(value, index) { - if (iterator(value, index)) { - result = value; - throw $break; - } - }); - return result; - }, - - findAll: function(iterator) { - var results = []; - this.each(function(value, index) { - if (iterator(value, index)) - results.push(value); - }); - return results; - }, - - grep: function(pattern, iterator) { - var results = []; - this.each(function(value, index) { - var stringValue = value.toString(); - if (stringValue.match(pattern)) - results.push((iterator || Prototype.K)(value, index)); - }) - return results; - }, - - include: function(object) { - var found = false; - this.each(function(value) { - if (value == object) { - found = true; - throw $break; - } - }); - return found; - }, - - inGroupsOf: function(number, fillWith) { - fillWith = fillWith === undefined ? null : fillWith; - return this.eachSlice(number, function(slice) { - while(slice.length < number) slice.push(fillWith); - return slice; - }); - }, - - inject: function(memo, iterator) { - this.each(function(value, index) { - memo = iterator(memo, value, index); - }); - return memo; - }, - - invoke: function(method) { - var args = $A(arguments).slice(1); - return this.map(function(value) { - return value[method].apply(value, args); - }); - }, - - max: function(iterator) { - var result; - this.each(function(value, index) { - value = (iterator || Prototype.K)(value, index); - if (result == undefined || value >= result) - result = value; - }); - return result; - }, - - min: function(iterator) { - var result; - this.each(function(value, index) { - value = (iterator || Prototype.K)(value, index); - if (result == undefined || value < result) - result = value; - }); - return result; - }, - - partition: function(iterator) { - var trues = [], falses = []; - this.each(function(value, index) { - ((iterator || Prototype.K)(value, index) ? - trues : falses).push(value); - }); - return [trues, falses]; - }, - - pluck: function(property) { - var results = []; - this.each(function(value, index) { - results.push(value[property]); - }); - return results; - }, - - reject: function(iterator) { - var results = []; - this.each(function(value, index) { - if (!iterator(value, index)) - results.push(value); - }); - return results; - }, - - sortBy: function(iterator) { - return this.map(function(value, index) { - return {value: value, criteria: iterator(value, index)}; - }).sort(function(left, right) { - var a = left.criteria, b = right.criteria; - return a < b ? -1 : a > b ? 1 : 0; - }).pluck('value'); - }, - - toArray: function() { - return this.map(); - }, - - zip: function() { - var iterator = Prototype.K, args = $A(arguments); - if (typeof args.last() == 'function') - iterator = args.pop(); - - var collections = [this].concat(args).map($A); - return this.map(function(value, index) { - return iterator(collections.pluck(index)); - }); - }, - - size: function() { - return this.toArray().length; - }, - - inspect: function() { - return '#'; - } -} - -Object.extend(Enumerable, { - map: Enumerable.collect, - find: Enumerable.detect, - select: Enumerable.findAll, - member: Enumerable.include, - entries: Enumerable.toArray -}); -var $A = Array.from = function(iterable) { - if (!iterable) return []; - if (iterable.toArray) { - return iterable.toArray(); - } else { - var results = []; - for (var i = 0, length = iterable.length; i < length; i++) - results.push(iterable[i]); - return results; - } -} - -Object.extend(Array.prototype, Enumerable); - -if (!Array.prototype._reverse) - Array.prototype._reverse = Array.prototype.reverse; - -Object.extend(Array.prototype, { - _each: function(iterator) { - for (var i = 0, length = this.length; i < length; i++) - iterator(this[i]); - }, - - clear: function() { - this.length = 0; - return this; - }, - - first: function() { - return this[0]; - }, - - last: function() { - return this[this.length - 1]; - }, - - compact: function() { - return this.select(function(value) { - return value != null; - }); - }, - - flatten: function() { - return this.inject([], function(array, value) { - return array.concat(value && value.constructor == Array ? - value.flatten() : [value]); - }); - }, - - without: function() { - var values = $A(arguments); - return this.select(function(value) { - return !values.include(value); - }); - }, - - indexOf: function(object) { - for (var i = 0, length = this.length; i < length; i++) - if (this[i] == object) return i; - return -1; - }, - - reverse: function(inline) { - return (inline !== false ? this : this.toArray())._reverse(); - }, - - reduce: function() { - return this.length > 1 ? this : this[0]; - }, - - uniq: function() { - return this.inject([], function(array, value) { - return array.include(value) ? array : array.concat([value]); - }); - }, - - clone: function() { - return [].concat(this); - }, - - size: function() { - return this.length; - }, - - inspect: function() { - return '[' + this.map(Object.inspect).join(', ') + ']'; - } -}); - -Array.prototype.toArray = Array.prototype.clone; - -function $w(string){ - string = string.strip(); - return string ? string.split(/\s+/) : []; -} - -if(window.opera){ - Array.prototype.concat = function(){ - var array = []; - for(var i = 0, length = this.length; i < length; i++) array.push(this[i]); - for(var i = 0, length = arguments.length; i < length; i++) { - if(arguments[i].constructor == Array) { - for(var j = 0, arrayLength = arguments[i].length; j < arrayLength; j++) - array.push(arguments[i][j]); - } else { - array.push(arguments[i]); - } - } - return array; - } -} -var Hash = function(obj) { - Object.extend(this, obj || {}); -}; - -Object.extend(Hash, { - toQueryString: function(obj) { - var parts = []; - - this.prototype._each.call(obj, function(pair) { - if (!pair.key) return; - - if (pair.value && pair.value.constructor == Array) { - var values = pair.value.compact(); - if (values.length < 2) pair.value = values.reduce(); - else { - key = encodeURIComponent(pair.key); - values.each(function(value) { - value = value != undefined ? encodeURIComponent(value) : ''; - parts.push(key + '=' + encodeURIComponent(value)); - }); - return; - } - } - if (pair.value == undefined) pair[1] = ''; - parts.push(pair.map(encodeURIComponent).join('=')); - }); - - return parts.join('&'); - } -}); - -Object.extend(Hash.prototype, Enumerable); -Object.extend(Hash.prototype, { - _each: function(iterator) { - for (var key in this) { - var value = this[key]; - if (value && value == Hash.prototype[key]) continue; - - var pair = [key, value]; - pair.key = key; - pair.value = value; - iterator(pair); - } - }, - - keys: function() { - return this.pluck('key'); - }, - - values: function() { - return this.pluck('value'); - }, - - merge: function(hash) { - return $H(hash).inject(this, function(mergedHash, pair) { - mergedHash[pair.key] = pair.value; - return mergedHash; - }); - }, - - remove: function() { - var result; - for(var i = 0, length = arguments.length; i < length; i++) { - var value = this[arguments[i]]; - if (value !== undefined){ - if (result === undefined) result = value; - else { - if (result.constructor != Array) result = [result]; - result.push(value) - } - } - delete this[arguments[i]]; - } - return result; - }, - - toQueryString: function() { - return Hash.toQueryString(this); - }, - - inspect: function() { - return '#'; - } -}); - -function $H(object) { - if (object && object.constructor == Hash) return object; - return new Hash(object); -}; -ObjectRange = Class.create(); -Object.extend(ObjectRange.prototype, Enumerable); -Object.extend(ObjectRange.prototype, { - initialize: function(start, end, exclusive) { - this.start = start; - this.end = end; - this.exclusive = exclusive; - }, - - _each: function(iterator) { - var value = this.start; - while (this.include(value)) { - iterator(value); - value = value.succ(); - } - }, - - include: function(value) { - if (value < this.start) - return false; - if (this.exclusive) - return value < this.end; - return value <= this.end; - } -}); - -var $R = function(start, end, exclusive) { - return new ObjectRange(start, end, exclusive); -} - -var Ajax = { - getTransport: function() { - return Try.these( - function() {return new XMLHttpRequest()}, - function() {return new ActiveXObject('Msxml2.XMLHTTP')}, - function() {return new ActiveXObject('Microsoft.XMLHTTP')} - ) || false; - }, - - activeRequestCount: 0 -} - -Ajax.Responders = { - responders: [], - - _each: function(iterator) { - this.responders._each(iterator); - }, - - register: function(responder) { - if (!this.include(responder)) - this.responders.push(responder); - }, - - unregister: function(responder) { - this.responders = this.responders.without(responder); - }, - - dispatch: function(callback, request, transport, json) { - this.each(function(responder) { - if (typeof responder[callback] == 'function') { - try { - responder[callback].apply(responder, [request, transport, json]); - } catch (e) {} - } - }); - } -}; - -Object.extend(Ajax.Responders, Enumerable); - -Ajax.Responders.register({ - onCreate: function() { - Ajax.activeRequestCount++; - }, - onComplete: function() { - Ajax.activeRequestCount--; - } -}); - -Ajax.Base = function() {}; -Ajax.Base.prototype = { - setOptions: function(options) { - this.options = { - method: 'post', - asynchronous: true, - contentType: 'application/x-www-form-urlencoded', - encoding: 'UTF-8', - parameters: '' - } - Object.extend(this.options, options || {}); - - this.options.method = this.options.method.toLowerCase(); - if (typeof this.options.parameters == 'string') - this.options.parameters = this.options.parameters.toQueryParams(); - } -} - -Ajax.Request = Class.create(); -Ajax.Request.Events = - ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete']; - -Ajax.Request.prototype = Object.extend(new Ajax.Base(), { - _complete: false, - - initialize: function(url, options) { - this.transport = Ajax.getTransport(); - this.setOptions(options); - this.request(url); - }, - - request: function(url) { - this.url = url; - this.method = this.options.method; - var params = this.options.parameters; - - if (!['get', 'post'].include(this.method)) { - // simulate other verbs over post - params['_method'] = this.method; - this.method = 'post'; - } - - params = Hash.toQueryString(params); - if (params && /Konqueror|Safari|KHTML/.test(navigator.userAgent)) params += '&_=' - - // when GET, append parameters to URL - if (this.method == 'get' && params) - this.url += (this.url.indexOf('?') > -1 ? '&' : '?') + params; - - try { - Ajax.Responders.dispatch('onCreate', this, this.transport); - - this.transport.open(this.method.toUpperCase(), this.url, - this.options.asynchronous); - - if (this.options.asynchronous) - setTimeout(function() { this.respondToReadyState(1) }.bind(this), 10); - - this.transport.onreadystatechange = this.onStateChange.bind(this); - this.setRequestHeaders(); - - var body = this.method == 'post' ? (this.options.postBody || params) : null; - - this.transport.send(body); - - /* Force Firefox to handle ready state 4 for synchronous requests */ - if (!this.options.asynchronous && this.transport.overrideMimeType) - this.onStateChange(); - - } - catch (e) { - this.dispatchException(e); - } - }, - - onStateChange: function() { - var readyState = this.transport.readyState; - if (readyState > 1 && !((readyState == 4) && this._complete)) - this.respondToReadyState(this.transport.readyState); - }, - - setRequestHeaders: function() { - var headers = { - 'X-Requested-With': 'XMLHttpRequest', - 'X-Prototype-Version': Prototype.Version, - 'Accept': 'text/javascript, text/html, application/xml, text/xml, */*' - }; - - if (this.method == 'post') { - headers['Content-type'] = this.options.contentType + - (this.options.encoding ? '; charset=' + this.options.encoding : ''); - - /* Force "Connection: close" for older Mozilla browsers to work - * around a bug where XMLHttpRequest sends an incorrect - * Content-length header. See Mozilla Bugzilla #246651. - */ - if (this.transport.overrideMimeType && - (navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < 2005) - headers['Connection'] = 'close'; - } - - // user-defined headers - if (typeof this.options.requestHeaders == 'object') { - var extras = this.options.requestHeaders; - - if (typeof extras.push == 'function') - for (var i = 0, length = extras.length; i < length; i += 2) - headers[extras[i]] = extras[i+1]; - else - $H(extras).each(function(pair) { headers[pair.key] = pair.value }); - } - - for (var name in headers) - this.transport.setRequestHeader(name, headers[name]); - }, - - success: function() { - return !this.transport.status - || (this.transport.status >= 200 && this.transport.status < 300); - }, - - respondToReadyState: function(readyState) { - var state = Ajax.Request.Events[readyState]; - var transport = this.transport, json = this.evalJSON(); - - if (state == 'Complete') { - try { - this._complete = true; - (this.options['on' + this.transport.status] - || this.options['on' + (this.success() ? 'Success' : 'Failure')] - || Prototype.emptyFunction)(transport, json); - } catch (e) { - this.dispatchException(e); - } - - if ((this.getHeader('Content-type') || 'text/javascript').strip(). - match(/^(text|application)\/(x-)?(java|ecma)script(;.*)?$/i)) - this.evalResponse(); - } - - try { - (this.options['on' + state] || Prototype.emptyFunction)(transport, json); - Ajax.Responders.dispatch('on' + state, this, transport, json); - } catch (e) { - this.dispatchException(e); - } - - if (state == 'Complete') { - // avoid memory leak in MSIE: clean up - this.transport.onreadystatechange = Prototype.emptyFunction; - } - }, - - getHeader: function(name) { - try { - return this.transport.getResponseHeader(name); - } catch (e) { return null } - }, - - evalJSON: function() { - try { - var json = this.getHeader('X-JSON'); - return json ? eval('(' + json + ')') : null; - } catch (e) { return null } - }, - - evalResponse: function() { - try { - return eval(this.transport.responseText); - } catch (e) { - this.dispatchException(e); - } - }, - - dispatchException: function(exception) { - (this.options.onException || Prototype.emptyFunction)(this, exception); - Ajax.Responders.dispatch('onException', this, exception); - } -}); - -Ajax.Updater = Class.create(); - -Object.extend(Object.extend(Ajax.Updater.prototype, Ajax.Request.prototype), { - initialize: function(container, url, options) { - this.container = { - success: (container.success || container), - failure: (container.failure || (container.success ? null : container)) - } - - this.transport = Ajax.getTransport(); - this.setOptions(options); - - var onComplete = this.options.onComplete || Prototype.emptyFunction; - this.options.onComplete = (function(transport, param) { - this.updateContent(); - onComplete(transport, param); - }).bind(this); - - this.request(url); - }, - - updateContent: function() { - var receiver = this.container[this.success() ? 'success' : 'failure']; - var response = this.transport.responseText; - - if (!this.options.evalScripts) response = response.stripScripts(); - - if (receiver = $(receiver)) { - if (this.options.insertion) - new this.options.insertion(receiver, response); - else - receiver.update(response); - } - - if (this.success()) { - if (this.onComplete) - setTimeout(this.onComplete.bind(this), 10); - } - } -}); - -Ajax.PeriodicalUpdater = Class.create(); -Ajax.PeriodicalUpdater.prototype = Object.extend(new Ajax.Base(), { - initialize: function(container, url, options) { - this.setOptions(options); - this.onComplete = this.options.onComplete; - - this.frequency = (this.options.frequency || 2); - this.decay = (this.options.decay || 1); - - this.updater = {}; - this.container = container; - this.url = url; - - this.start(); - }, - - start: function() { - this.options.onComplete = this.updateComplete.bind(this); - this.onTimerEvent(); - }, - - stop: function() { - this.updater.options.onComplete = undefined; - clearTimeout(this.timer); - (this.onComplete || Prototype.emptyFunction).apply(this, arguments); - }, - - updateComplete: function(request) { - if (this.options.decay) { - this.decay = (request.responseText == this.lastText ? - this.decay * this.options.decay : 1); - - this.lastText = request.responseText; - } - this.timer = setTimeout(this.onTimerEvent.bind(this), - this.decay * this.frequency * 1000); - }, - - onTimerEvent: function() { - this.updater = new Ajax.Updater(this.container, this.url, this.options); - } -}); -function $(element) { - if (arguments.length > 1) { - for (var i = 0, elements = [], length = arguments.length; i < length; i++) - elements.push($(arguments[i])); - return elements; - } - if (typeof element == 'string') - element = document.getElementById(element); - return Element.extend(element); -} - -if (Prototype.BrowserFeatures.XPath) { - document._getElementsByXPath = function(expression, parentElement) { - var results = []; - var query = document.evaluate(expression, $(parentElement) || document, - null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); - for (var i = 0, length = query.snapshotLength; i < length; i++) - results.push(query.snapshotItem(i)); - return results; - }; -} - -document.getElementsByClassName = function(className, parentElement) { - if (Prototype.BrowserFeatures.XPath) { - var q = ".//*[contains(concat(' ', @class, ' '), ' " + className + " ')]"; - return document._getElementsByXPath(q, parentElement); - } else { - var children = ($(parentElement) || document.body).getElementsByTagName('*'); - var elements = [], child; - for (var i = 0, length = children.length; i < length; i++) { - child = children[i]; - if (Element.hasClassName(child, className)) - elements.push(Element.extend(child)); - } - return elements; - } -}; - -/*--------------------------------------------------------------------------*/ - -if (!window.Element) - var Element = new Object(); - -Element.extend = function(element) { - if (!element || _nativeExtensions || element.nodeType == 3) return element; - - if (!element._extended && element.tagName && element != window) { - var methods = Object.clone(Element.Methods), cache = Element.extend.cache; - - if (element.tagName == 'FORM') - Object.extend(methods, Form.Methods); - if (['INPUT', 'TEXTAREA', 'SELECT'].include(element.tagName)) - Object.extend(methods, Form.Element.Methods); - - Object.extend(methods, Element.Methods.Simulated); - - for (var property in methods) { - var value = methods[property]; - if (typeof value == 'function' && !(property in element)) - element[property] = cache.findOrStore(value); - } - } - - element._extended = true; - return element; -}; - -Element.extend.cache = { - findOrStore: function(value) { - return this[value] = this[value] || function() { - return value.apply(null, [this].concat($A(arguments))); - } - } -}; - -Element.Methods = { - visible: function(element) { - return $(element).style.display != 'none'; - }, - - toggle: function(element) { - element = $(element); - Element[Element.visible(element) ? 'hide' : 'show'](element); - return element; - }, - - hide: function(element) { - $(element).style.display = 'none'; - return element; - }, - - show: function(element) { - $(element).style.display = ''; - return element; - }, - - remove: function(element) { - element = $(element); - element.parentNode.removeChild(element); - return element; - }, - - update: function(element, html) { - html = typeof html == 'undefined' ? '' : html.toString(); - $(element).innerHTML = html.stripScripts(); - setTimeout(function() {html.evalScripts()}, 10); - return element; - }, - - replace: function(element, html) { - element = $(element); - html = typeof html == 'undefined' ? '' : html.toString(); - if (element.outerHTML) { - element.outerHTML = html.stripScripts(); - } else { - var range = element.ownerDocument.createRange(); - range.selectNodeContents(element); - element.parentNode.replaceChild( - range.createContextualFragment(html.stripScripts()), element); - } - setTimeout(function() {html.evalScripts()}, 10); - return element; - }, - - inspect: function(element) { - element = $(element); - var result = '<' + element.tagName.toLowerCase(); - $H({'id': 'id', 'className': 'class'}).each(function(pair) { - var property = pair.first(), attribute = pair.last(); - var value = (element[property] || '').toString(); - if (value) result += ' ' + attribute + '=' + value.inspect(true); - }); - return result + '>'; - }, - - recursivelyCollect: function(element, property) { - element = $(element); - var elements = []; - while (element = element[property]) - if (element.nodeType == 1) - elements.push(Element.extend(element)); - return elements; - }, - - ancestors: function(element) { - return $(element).recursivelyCollect('parentNode'); - }, - - descendants: function(element) { - return $A($(element).getElementsByTagName('*')); - }, - - immediateDescendants: function(element) { - if (!(element = $(element).firstChild)) return []; - while (element && element.nodeType != 1) element = element.nextSibling; - if (element) return [element].concat($(element).nextSiblings()); - return []; - }, - - previousSiblings: function(element) { - return $(element).recursivelyCollect('previousSibling'); - }, - - nextSiblings: function(element) { - return $(element).recursivelyCollect('nextSibling'); - }, - - siblings: function(element) { - element = $(element); - return element.previousSiblings().reverse().concat(element.nextSiblings()); - }, - - match: function(element, selector) { - if (typeof selector == 'string') - selector = new Selector(selector); - return selector.match($(element)); - }, - - up: function(element, expression, index) { - return Selector.findElement($(element).ancestors(), expression, index); - }, - - down: function(element, expression, index) { - return Selector.findElement($(element).descendants(), expression, index); - }, - - previous: function(element, expression, index) { - return Selector.findElement($(element).previousSiblings(), expression, index); - }, - - next: function(element, expression, index) { - return Selector.findElement($(element).nextSiblings(), expression, index); - }, - - getElementsBySelector: function() { - var args = $A(arguments), element = $(args.shift()); - return Selector.findChildElements(element, args); - }, - - getElementsByClassName: function(element, className) { - return document.getElementsByClassName(className, element); - }, - - readAttribute: function(element, name) { - element = $(element); - if (document.all && !window.opera) { - var t = Element._attributeTranslations; - if (t.values[name]) return t.values[name](element, name); - if (t.names[name]) name = t.names[name]; - var attribute = element.attributes[name]; - if(attribute) return attribute.nodeValue; - } - return element.getAttribute(name); - }, - - getHeight: function(element) { - return $(element).getDimensions().height; - }, - - getWidth: function(element) { - return $(element).getDimensions().width; - }, - - classNames: function(element) { - return new Element.ClassNames(element); - }, - - hasClassName: function(element, className) { - if (!(element = $(element))) return; - var elementClassName = element.className; - if (elementClassName.length == 0) return false; - if (elementClassName == className || - elementClassName.match(new RegExp("(^|\\s)" + className + "(\\s|$)"))) - return true; - return false; - }, - - addClassName: function(element, className) { - if (!(element = $(element))) return; - Element.classNames(element).add(className); - return element; - }, - - removeClassName: function(element, className) { - if (!(element = $(element))) return; - Element.classNames(element).remove(className); - return element; - }, - - toggleClassName: function(element, className) { - if (!(element = $(element))) return; - Element.classNames(element)[element.hasClassName(className) ? 'remove' : 'add'](className); - return element; - }, - - observe: function() { - Event.observe.apply(Event, arguments); - return $A(arguments).first(); - }, - - stopObserving: function() { - Event.stopObserving.apply(Event, arguments); - return $A(arguments).first(); - }, - - // removes whitespace-only text node children - cleanWhitespace: function(element) { - element = $(element); - var node = element.firstChild; - while (node) { - var nextNode = node.nextSibling; - if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) - element.removeChild(node); - node = nextNode; - } - return element; - }, - - empty: function(element) { - return $(element).innerHTML.match(/^\s*$/); - }, - - descendantOf: function(element, ancestor) { - element = $(element), ancestor = $(ancestor); - while (element = element.parentNode) - if (element == ancestor) return true; - return false; - }, - - scrollTo: function(element) { - element = $(element); - var pos = Position.cumulativeOffset(element); - window.scrollTo(pos[0], pos[1]); - return element; - }, - - getStyle: function(element, style) { - element = $(element); - if (['float','cssFloat'].include(style)) - style = (typeof element.style.styleFloat != 'undefined' ? 'styleFloat' : 'cssFloat'); - style = style.camelize(); - var value = element.style[style]; - if (!value) { - if (document.defaultView && document.defaultView.getComputedStyle) { - var css = document.defaultView.getComputedStyle(element, null); - value = css ? css[style] : null; - } else if (element.currentStyle) { - value = element.currentStyle[style]; - } - } - - if((value == 'auto') && ['width','height'].include(style) && (element.getStyle('display') != 'none')) - value = element['offset'+style.capitalize()] + 'px'; - - if (window.opera && ['left', 'top', 'right', 'bottom'].include(style)) - if (Element.getStyle(element, 'position') == 'static') value = 'auto'; - if(style == 'opacity') { - if(value) return parseFloat(value); - if(value = (element.getStyle('filter') || '').match(/alpha\(opacity=(.*)\)/)) - if(value[1]) return parseFloat(value[1]) / 100; - return 1.0; - } - return value == 'auto' ? null : value; - }, - - setStyle: function(element, style) { - element = $(element); - for (var name in style) { - var value = style[name]; - if(name == 'opacity') { - if (value == 1) { - value = (/Gecko/.test(navigator.userAgent) && - !/Konqueror|Safari|KHTML/.test(navigator.userAgent)) ? 0.999999 : 1.0; - if(/MSIE/.test(navigator.userAgent) && !window.opera) - element.style.filter = element.getStyle('filter').replace(/alpha\([^\)]*\)/gi,''); - } else if(value == '') { - if(/MSIE/.test(navigator.userAgent) && !window.opera) - element.style.filter = element.getStyle('filter').replace(/alpha\([^\)]*\)/gi,''); - } else { - if(value < 0.00001) value = 0; - if(/MSIE/.test(navigator.userAgent) && !window.opera) - element.style.filter = element.getStyle('filter').replace(/alpha\([^\)]*\)/gi,'') + - 'alpha(opacity='+value*100+')'; - } - } else if(['float','cssFloat'].include(name)) name = (typeof element.style.styleFloat != 'undefined') ? 'styleFloat' : 'cssFloat'; - element.style[name.camelize()] = value; - } - return element; - }, - - getDimensions: function(element) { - element = $(element); - var display = $(element).getStyle('display'); - if (display != 'none' && display != null) // Safari bug - return {width: element.offsetWidth, height: element.offsetHeight}; - - // All *Width and *Height properties give 0 on elements with display none, - // so enable the element temporarily - var els = element.style; - var originalVisibility = els.visibility; - var originalPosition = els.position; - var originalDisplay = els.display; - els.visibility = 'hidden'; - els.position = 'absolute'; - els.display = 'block'; - var originalWidth = element.clientWidth; - var originalHeight = element.clientHeight; - els.display = originalDisplay; - els.position = originalPosition; - els.visibility = originalVisibility; - return {width: originalWidth, height: originalHeight}; - }, - - makePositioned: function(element) { - element = $(element); - var pos = Element.getStyle(element, 'position'); - if (pos == 'static' || !pos) { - element._madePositioned = true; - element.style.position = 'relative'; - // Opera returns the offset relative to the positioning context, when an - // element is position relative but top and left have not been defined - if (window.opera) { - element.style.top = 0; - element.style.left = 0; - } - } - return element; - }, - - undoPositioned: function(element) { - element = $(element); - if (element._madePositioned) { - element._madePositioned = undefined; - element.style.position = - element.style.top = - element.style.left = - element.style.bottom = - element.style.right = ''; - } - return element; - }, - - makeClipping: function(element) { - element = $(element); - if (element._overflow) return element; - element._overflow = element.style.overflow || 'auto'; - if ((Element.getStyle(element, 'overflow') || 'visible') != 'hidden') - element.style.overflow = 'hidden'; - return element; - }, - - undoClipping: function(element) { - element = $(element); - if (!element._overflow) return element; - element.style.overflow = element._overflow == 'auto' ? '' : element._overflow; - element._overflow = null; - return element; - } -}; - -Object.extend(Element.Methods, {childOf: Element.Methods.descendantOf}); - -Element._attributeTranslations = {}; - -Element._attributeTranslations.names = { - colspan: "colSpan", - rowspan: "rowSpan", - valign: "vAlign", - datetime: "dateTime", - accesskey: "accessKey", - tabindex: "tabIndex", - enctype: "encType", - maxlength: "maxLength", - readonly: "readOnly", - longdesc: "longDesc" -}; - -Element._attributeTranslations.values = { - _getAttr: function(element, attribute) { - return element.getAttribute(attribute, 2); - }, - - _flag: function(element, attribute) { - return $(element).hasAttribute(attribute) ? attribute : null; - }, - - style: function(element) { - return element.style.cssText.toLowerCase(); - }, - - title: function(element) { - var node = element.getAttributeNode('title'); - return node.specified ? node.nodeValue : null; - } -}; - -Object.extend(Element._attributeTranslations.values, { - href: Element._attributeTranslations.values._getAttr, - src: Element._attributeTranslations.values._getAttr, - disabled: Element._attributeTranslations.values._flag, - checked: Element._attributeTranslations.values._flag, - readonly: Element._attributeTranslations.values._flag, - multiple: Element._attributeTranslations.values._flag -}); - -Element.Methods.Simulated = { - hasAttribute: function(element, attribute) { - var t = Element._attributeTranslations; - attribute = t.names[attribute] || attribute; - return $(element).getAttributeNode(attribute).specified; - } -}; - -// IE is missing .innerHTML support for TABLE-related elements -if (document.all && !window.opera){ - Element.Methods.update = function(element, html) { - element = $(element); - html = typeof html == 'undefined' ? '' : html.toString(); - var tagName = element.tagName.toUpperCase(); - if (['THEAD','TBODY','TR','TD'].include(tagName)) { - var div = document.createElement('div'); - switch (tagName) { - case 'THEAD': - case 'TBODY': - div.innerHTML = '' + html.stripScripts() + '
    '; - depth = 2; - break; - case 'TR': - div.innerHTML = '' + html.stripScripts() + '
    '; - depth = 3; - break; - case 'TD': - div.innerHTML = '
    ' + html.stripScripts() + '
    '; - depth = 4; - } - $A(element.childNodes).each(function(node){ - element.removeChild(node) - }); - depth.times(function(){ div = div.firstChild }); - - $A(div.childNodes).each( - function(node){ element.appendChild(node) }); - } else { - element.innerHTML = html.stripScripts(); - } - setTimeout(function() {html.evalScripts()}, 10); - return element; - } -}; - -Object.extend(Element, Element.Methods); - -var _nativeExtensions = false; - -if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)) - ['', 'Form', 'Input', 'TextArea', 'Select'].each(function(tag) { - var className = 'HTML' + tag + 'Element'; - if(window[className]) return; - var klass = window[className] = {}; - klass.prototype = document.createElement(tag ? tag.toLowerCase() : 'div').__proto__; - }); - -Element.addMethods = function(methods) { - Object.extend(Element.Methods, methods || {}); - - function copy(methods, destination, onlyIfAbsent) { - onlyIfAbsent = onlyIfAbsent || false; - var cache = Element.extend.cache; - for (var property in methods) { - var value = methods[property]; - if (!onlyIfAbsent || !(property in destination)) - destination[property] = cache.findOrStore(value); - } - } - - if (typeof HTMLElement != 'undefined') { - copy(Element.Methods, HTMLElement.prototype); - copy(Element.Methods.Simulated, HTMLElement.prototype, true); - copy(Form.Methods, HTMLFormElement.prototype); - [HTMLInputElement, HTMLTextAreaElement, HTMLSelectElement].each(function(klass) { - copy(Form.Element.Methods, klass.prototype); - }); - _nativeExtensions = true; - } -} - -var Toggle = new Object(); -Toggle.display = Element.toggle; - -/*--------------------------------------------------------------------------*/ - -Abstract.Insertion = function(adjacency) { - this.adjacency = adjacency; -} - -Abstract.Insertion.prototype = { - initialize: function(element, content) { - this.element = $(element); - this.content = content.stripScripts(); - - if (this.adjacency && this.element.insertAdjacentHTML) { - try { - this.element.insertAdjacentHTML(this.adjacency, this.content); - } catch (e) { - var tagName = this.element.tagName.toUpperCase(); - if (['TBODY', 'TR'].include(tagName)) { - this.insertContent(this.contentFromAnonymousTable()); - } else { - throw e; - } - } - } else { - this.range = this.element.ownerDocument.createRange(); - if (this.initializeRange) this.initializeRange(); - this.insertContent([this.range.createContextualFragment(this.content)]); - } - - setTimeout(function() {content.evalScripts()}, 10); - }, - - contentFromAnonymousTable: function() { - var div = document.createElement('div'); - div.innerHTML = '' + this.content + '
    '; - return $A(div.childNodes[0].childNodes[0].childNodes); - } -} - -var Insertion = new Object(); - -Insertion.Before = Class.create(); -Insertion.Before.prototype = Object.extend(new Abstract.Insertion('beforeBegin'), { - initializeRange: function() { - this.range.setStartBefore(this.element); - }, - - insertContent: function(fragments) { - fragments.each((function(fragment) { - this.element.parentNode.insertBefore(fragment, this.element); - }).bind(this)); - } -}); - -Insertion.Top = Class.create(); -Insertion.Top.prototype = Object.extend(new Abstract.Insertion('afterBegin'), { - initializeRange: function() { - this.range.selectNodeContents(this.element); - this.range.collapse(true); - }, - - insertContent: function(fragments) { - fragments.reverse(false).each((function(fragment) { - this.element.insertBefore(fragment, this.element.firstChild); - }).bind(this)); - } -}); - -Insertion.Bottom = Class.create(); -Insertion.Bottom.prototype = Object.extend(new Abstract.Insertion('beforeEnd'), { - initializeRange: function() { - this.range.selectNodeContents(this.element); - this.range.collapse(this.element); - }, - - insertContent: function(fragments) { - fragments.each((function(fragment) { - this.element.appendChild(fragment); - }).bind(this)); - } -}); - -Insertion.After = Class.create(); -Insertion.After.prototype = Object.extend(new Abstract.Insertion('afterEnd'), { - initializeRange: function() { - this.range.setStartAfter(this.element); - }, - - insertContent: function(fragments) { - fragments.each((function(fragment) { - this.element.parentNode.insertBefore(fragment, - this.element.nextSibling); - }).bind(this)); - } -}); - -/*--------------------------------------------------------------------------*/ - -Element.ClassNames = Class.create(); -Element.ClassNames.prototype = { - initialize: function(element) { - this.element = $(element); - }, - - _each: function(iterator) { - this.element.className.split(/\s+/).select(function(name) { - return name.length > 0; - })._each(iterator); - }, - - set: function(className) { - this.element.className = className; - }, - - add: function(classNameToAdd) { - if (this.include(classNameToAdd)) return; - this.set($A(this).concat(classNameToAdd).join(' ')); - }, - - remove: function(classNameToRemove) { - if (!this.include(classNameToRemove)) return; - this.set($A(this).without(classNameToRemove).join(' ')); - }, - - toString: function() { - return $A(this).join(' '); - } -}; - -Object.extend(Element.ClassNames.prototype, Enumerable); -var Selector = Class.create(); -Selector.prototype = { - initialize: function(expression) { - this.params = {classNames: []}; - this.expression = expression.toString().strip(); - this.parseExpression(); - this.compileMatcher(); - }, - - parseExpression: function() { - function abort(message) { throw 'Parse error in selector: ' + message; } - - if (this.expression == '') abort('empty expression'); - - var params = this.params, expr = this.expression, match, modifier, clause, rest; - while (match = expr.match(/^(.*)\[([a-z0-9_:-]+?)(?:([~\|!]?=)(?:"([^"]*)"|([^\]\s]*)))?\]$/i)) { - params.attributes = params.attributes || []; - params.attributes.push({name: match[2], operator: match[3], value: match[4] || match[5] || ''}); - expr = match[1]; - } - - if (expr == '*') return this.params.wildcard = true; - - while (match = expr.match(/^([^a-z0-9_-])?([a-z0-9_-]+)(.*)/i)) { - modifier = match[1], clause = match[2], rest = match[3]; - switch (modifier) { - case '#': params.id = clause; break; - case '.': params.classNames.push(clause); break; - case '': - case undefined: params.tagName = clause.toUpperCase(); break; - default: abort(expr.inspect()); - } - expr = rest; - } - - if (expr.length > 0) abort(expr.inspect()); - }, - - buildMatchExpression: function() { - var params = this.params, conditions = [], clause; - - if (params.wildcard) - conditions.push('true'); - if (clause = params.id) - conditions.push('element.readAttribute("id") == ' + clause.inspect()); - if (clause = params.tagName) - conditions.push('element.tagName.toUpperCase() == ' + clause.inspect()); - if ((clause = params.classNames).length > 0) - for (var i = 0, length = clause.length; i < length; i++) - conditions.push('element.hasClassName(' + clause[i].inspect() + ')'); - if (clause = params.attributes) { - clause.each(function(attribute) { - var value = 'element.readAttribute(' + attribute.name.inspect() + ')'; - var splitValueBy = function(delimiter) { - return value + ' && ' + value + '.split(' + delimiter.inspect() + ')'; - } - - switch (attribute.operator) { - case '=': conditions.push(value + ' == ' + attribute.value.inspect()); break; - case '~=': conditions.push(splitValueBy(' ') + '.include(' + attribute.value.inspect() + ')'); break; - case '|=': conditions.push( - splitValueBy('-') + '.first().toUpperCase() == ' + attribute.value.toUpperCase().inspect() - ); break; - case '!=': conditions.push(value + ' != ' + attribute.value.inspect()); break; - case '': - case undefined: conditions.push('element.hasAttribute(' + attribute.name.inspect() + ')'); break; - default: throw 'Unknown operator ' + attribute.operator + ' in selector'; - } - }); - } - - return conditions.join(' && '); - }, - - compileMatcher: function() { - this.match = new Function('element', 'if (!element.tagName) return false; \ - element = $(element); \ - return ' + this.buildMatchExpression()); - }, - - findElements: function(scope) { - var element; - - if (element = $(this.params.id)) - if (this.match(element)) - if (!scope || Element.childOf(element, scope)) - return [element]; - - scope = (scope || document).getElementsByTagName(this.params.tagName || '*'); - - var results = []; - for (var i = 0, length = scope.length; i < length; i++) - if (this.match(element = scope[i])) - results.push(Element.extend(element)); - - return results; - }, - - toString: function() { - return this.expression; - } -} - -Object.extend(Selector, { - matchElements: function(elements, expression) { - var selector = new Selector(expression); - return elements.select(selector.match.bind(selector)).map(Element.extend); - }, - - findElement: function(elements, expression, index) { - if (typeof expression == 'number') index = expression, expression = false; - return Selector.matchElements(elements, expression || '*')[index || 0]; - }, - - findChildElements: function(element, expressions) { - return expressions.map(function(expression) { - return expression.match(/[^\s"]+(?:"[^"]*"[^\s"]+)*/g).inject([null], function(results, expr) { - var selector = new Selector(expr); - return results.inject([], function(elements, result) { - return elements.concat(selector.findElements(result || element)); - }); - }); - }).flatten(); - } -}); - -function $$() { - return Selector.findChildElements(document, $A(arguments)); -} -var Form = { - reset: function(form) { - $(form).reset(); - return form; - }, - - serializeElements: function(elements, getHash) { - var data = elements.inject({}, function(result, element) { - if (!element.disabled && element.name) { - var key = element.name, value = $(element).getValue(); - if (value != undefined) { - if (result[key]) { - if (result[key].constructor != Array) result[key] = [result[key]]; - result[key].push(value); - } - else result[key] = value; - } - } - return result; - }); - - return getHash ? data : Hash.toQueryString(data); - } -}; - -Form.Methods = { - serialize: function(form, getHash) { - return Form.serializeElements(Form.getElements(form), getHash); - }, - - getElements: function(form) { - return $A($(form).getElementsByTagName('*')).inject([], - function(elements, child) { - if (Form.Element.Serializers[child.tagName.toLowerCase()]) - elements.push(Element.extend(child)); - return elements; - } - ); - }, - - getInputs: function(form, typeName, name) { - form = $(form); - var inputs = form.getElementsByTagName('input'); - - if (!typeName && !name) return $A(inputs).map(Element.extend); - - for (var i = 0, matchingInputs = [], length = inputs.length; i < length; i++) { - var input = inputs[i]; - if ((typeName && input.type != typeName) || (name && input.name != name)) - continue; - matchingInputs.push(Element.extend(input)); - } - - return matchingInputs; - }, - - disable: function(form) { - form = $(form); - form.getElements().each(function(element) { - element.blur(); - element.disabled = 'true'; - }); - return form; - }, - - enable: function(form) { - form = $(form); - form.getElements().each(function(element) { - element.disabled = ''; - }); - return form; - }, - - findFirstElement: function(form) { - return $(form).getElements().find(function(element) { - return element.type != 'hidden' && !element.disabled && - ['input', 'select', 'textarea'].include(element.tagName.toLowerCase()); - }); - }, - - focusFirstElement: function(form) { - form = $(form); - form.findFirstElement().activate(); - return form; - } -} - -Object.extend(Form, Form.Methods); - -/*--------------------------------------------------------------------------*/ - -Form.Element = { - focus: function(element) { - $(element).focus(); - return element; - }, - - select: function(element) { - $(element).select(); - return element; - } -} - -Form.Element.Methods = { - serialize: function(element) { - element = $(element); - if (!element.disabled && element.name) { - var value = element.getValue(); - if (value != undefined) { - var pair = {}; - pair[element.name] = value; - return Hash.toQueryString(pair); - } - } - return ''; - }, - - getValue: function(element) { - element = $(element); - var method = element.tagName.toLowerCase(); - return Form.Element.Serializers[method](element); - }, - - clear: function(element) { - $(element).value = ''; - return element; - }, - - present: function(element) { - return $(element).value != ''; - }, - - activate: function(element) { - element = $(element); - element.focus(); - if (element.select && ( element.tagName.toLowerCase() != 'input' || - !['button', 'reset', 'submit'].include(element.type) ) ) - element.select(); - return element; - }, - - disable: function(element) { - element = $(element); - element.disabled = true; - return element; - }, - - enable: function(element) { - element = $(element); - element.blur(); - element.disabled = false; - return element; - } -} - -Object.extend(Form.Element, Form.Element.Methods); -var Field = Form.Element; -var $F = Form.Element.getValue; - -/*--------------------------------------------------------------------------*/ - -Form.Element.Serializers = { - input: function(element) { - switch (element.type.toLowerCase()) { - case 'checkbox': - case 'radio': - return Form.Element.Serializers.inputSelector(element); - default: - return Form.Element.Serializers.textarea(element); - } - }, - - inputSelector: function(element) { - return element.checked ? element.value : null; - }, - - textarea: function(element) { - return element.value; - }, - - select: function(element) { - return this[element.type == 'select-one' ? - 'selectOne' : 'selectMany'](element); - }, - - selectOne: function(element) { - var index = element.selectedIndex; - return index >= 0 ? this.optionValue(element.options[index]) : null; - }, - - selectMany: function(element) { - var values, length = element.length; - if (!length) return null; - - for (var i = 0, values = []; i < length; i++) { - var opt = element.options[i]; - if (opt.selected) values.push(this.optionValue(opt)); - } - return values; - }, - - optionValue: function(opt) { - // extend element because hasAttribute may not be native - return Element.extend(opt).hasAttribute('value') ? opt.value : opt.text; - } -} - -/*--------------------------------------------------------------------------*/ - -Abstract.TimedObserver = function() {} -Abstract.TimedObserver.prototype = { - initialize: function(element, frequency, callback) { - this.frequency = frequency; - this.element = $(element); - this.callback = callback; - - this.lastValue = this.getValue(); - this.registerCallback(); - }, - - registerCallback: function() { - setInterval(this.onTimerEvent.bind(this), this.frequency * 1000); - }, - - onTimerEvent: function() { - var value = this.getValue(); - var changed = ('string' == typeof this.lastValue && 'string' == typeof value - ? this.lastValue != value : String(this.lastValue) != String(value)); - if (changed) { - this.callback(this.element, value); - this.lastValue = value; - } - } -} - -Form.Element.Observer = Class.create(); -Form.Element.Observer.prototype = Object.extend(new Abstract.TimedObserver(), { - getValue: function() { - return Form.Element.getValue(this.element); - } -}); - -Form.Observer = Class.create(); -Form.Observer.prototype = Object.extend(new Abstract.TimedObserver(), { - getValue: function() { - return Form.serialize(this.element); - } -}); - -/*--------------------------------------------------------------------------*/ - -Abstract.EventObserver = function() {} -Abstract.EventObserver.prototype = { - initialize: function(element, callback) { - this.element = $(element); - this.callback = callback; - - this.lastValue = this.getValue(); - if (this.element.tagName.toLowerCase() == 'form') - this.registerFormCallbacks(); - else - this.registerCallback(this.element); - }, - - onElementEvent: function() { - var value = this.getValue(); - if (this.lastValue != value) { - this.callback(this.element, value); - this.lastValue = value; - } - }, - - registerFormCallbacks: function() { - Form.getElements(this.element).each(this.registerCallback.bind(this)); - }, - - registerCallback: function(element) { - if (element.type) { - switch (element.type.toLowerCase()) { - case 'checkbox': - case 'radio': - Event.observe(element, 'click', this.onElementEvent.bind(this)); - break; - default: - Event.observe(element, 'change', this.onElementEvent.bind(this)); - break; - } - } - } -} - -Form.Element.EventObserver = Class.create(); -Form.Element.EventObserver.prototype = Object.extend(new Abstract.EventObserver(), { - getValue: function() { - return Form.Element.getValue(this.element); - } -}); - -Form.EventObserver = Class.create(); -Form.EventObserver.prototype = Object.extend(new Abstract.EventObserver(), { - getValue: function() { - return Form.serialize(this.element); - } -}); -if (!window.Event) { - var Event = new Object(); -} - -Object.extend(Event, { - KEY_BACKSPACE: 8, - KEY_TAB: 9, - KEY_RETURN: 13, - KEY_ESC: 27, - KEY_LEFT: 37, - KEY_UP: 38, - KEY_RIGHT: 39, - KEY_DOWN: 40, - KEY_DELETE: 46, - KEY_HOME: 36, - KEY_END: 35, - KEY_PAGEUP: 33, - KEY_PAGEDOWN: 34, - - element: function(event) { - return event.target || event.srcElement; - }, - - isLeftClick: function(event) { - return (((event.which) && (event.which == 1)) || - ((event.button) && (event.button == 1))); - }, - - pointerX: function(event) { - return event.pageX || (event.clientX + - (document.documentElement.scrollLeft || document.body.scrollLeft)); - }, - - pointerY: function(event) { - return event.pageY || (event.clientY + - (document.documentElement.scrollTop || document.body.scrollTop)); - }, - - stop: function(event) { - if (event.preventDefault) { - event.preventDefault(); - event.stopPropagation(); - } else { - event.returnValue = false; - event.cancelBubble = true; - } - }, - - // find the first node with the given tagName, starting from the - // node the event was triggered on; traverses the DOM upwards - findElement: function(event, tagName) { - var element = Event.element(event); - while (element.parentNode && (!element.tagName || - (element.tagName.toUpperCase() != tagName.toUpperCase()))) - element = element.parentNode; - return element; - }, - - observers: false, - - _observeAndCache: function(element, name, observer, useCapture) { - if (!this.observers) this.observers = []; - if (element.addEventListener) { - this.observers.push([element, name, observer, useCapture]); - element.addEventListener(name, observer, useCapture); - } else if (element.attachEvent) { - this.observers.push([element, name, observer, useCapture]); - element.attachEvent('on' + name, observer); - } - }, - - unloadCache: function() { - if (!Event.observers) return; - for (var i = 0, length = Event.observers.length; i < length; i++) { - Event.stopObserving.apply(this, Event.observers[i]); - Event.observers[i][0] = null; - } - Event.observers = false; - }, - - observe: function(element, name, observer, useCapture) { - element = $(element); - useCapture = useCapture || false; - - if (name == 'keypress' && - (navigator.appVersion.match(/Konqueror|Safari|KHTML/) - || element.attachEvent)) - name = 'keydown'; - - Event._observeAndCache(element, name, observer, useCapture); - }, - - stopObserving: function(element, name, observer, useCapture) { - element = $(element); - useCapture = useCapture || false; - - if (name == 'keypress' && - (navigator.appVersion.match(/Konqueror|Safari|KHTML/) - || element.detachEvent)) - name = 'keydown'; - - if (element.removeEventListener) { - element.removeEventListener(name, observer, useCapture); - } else if (element.detachEvent) { - try { - element.detachEvent('on' + name, observer); - } catch (e) {} - } - } -}); - -/* prevent memory leaks in IE */ -if (navigator.appVersion.match(/\bMSIE\b/)) - Event.observe(window, 'unload', Event.unloadCache, false); -var Position = { - // set to true if needed, warning: firefox performance problems - // NOT neeeded for page scrolling, only if draggable contained in - // scrollable elements - includeScrollOffsets: false, - - // must be called before calling withinIncludingScrolloffset, every time the - // page is scrolled - prepare: function() { - this.deltaX = window.pageXOffset - || document.documentElement.scrollLeft - || document.body.scrollLeft - || 0; - this.deltaY = window.pageYOffset - || document.documentElement.scrollTop - || document.body.scrollTop - || 0; - }, - - realOffset: function(element) { - var valueT = 0, valueL = 0; - do { - valueT += element.scrollTop || 0; - valueL += element.scrollLeft || 0; - element = element.parentNode; - } while (element); - return [valueL, valueT]; - }, - - cumulativeOffset: function(element) { - var valueT = 0, valueL = 0; - do { - valueT += element.offsetTop || 0; - valueL += element.offsetLeft || 0; - element = element.offsetParent; - } while (element); - return [valueL, valueT]; - }, - - positionedOffset: function(element) { - var valueT = 0, valueL = 0; - do { - valueT += element.offsetTop || 0; - valueL += element.offsetLeft || 0; - element = element.offsetParent; - if (element) { - if(element.tagName=='BODY') break; - var p = Element.getStyle(element, 'position'); - if (p == 'relative' || p == 'absolute') break; - } - } while (element); - return [valueL, valueT]; - }, - - offsetParent: function(element) { - if (element.offsetParent) return element.offsetParent; - if (element == document.body) return element; - - while ((element = element.parentNode) && element != document.body) - if (Element.getStyle(element, 'position') != 'static') - return element; - - return document.body; - }, - - // caches x/y coordinate pair to use with overlap - within: function(element, x, y) { - if (this.includeScrollOffsets) - return this.withinIncludingScrolloffsets(element, x, y); - this.xcomp = x; - this.ycomp = y; - this.offset = this.cumulativeOffset(element); - - return (y >= this.offset[1] && - y < this.offset[1] + element.offsetHeight && - x >= this.offset[0] && - x < this.offset[0] + element.offsetWidth); - }, - - withinIncludingScrolloffsets: function(element, x, y) { - var offsetcache = this.realOffset(element); - - this.xcomp = x + offsetcache[0] - this.deltaX; - this.ycomp = y + offsetcache[1] - this.deltaY; - this.offset = this.cumulativeOffset(element); - - return (this.ycomp >= this.offset[1] && - this.ycomp < this.offset[1] + element.offsetHeight && - this.xcomp >= this.offset[0] && - this.xcomp < this.offset[0] + element.offsetWidth); - }, - - // within must be called directly before - overlap: function(mode, element) { - if (!mode) return 0; - if (mode == 'vertical') - return ((this.offset[1] + element.offsetHeight) - this.ycomp) / - element.offsetHeight; - if (mode == 'horizontal') - return ((this.offset[0] + element.offsetWidth) - this.xcomp) / - element.offsetWidth; - }, - - page: function(forElement) { - var valueT = 0, valueL = 0; - - var element = forElement; - do { - valueT += element.offsetTop || 0; - valueL += element.offsetLeft || 0; - - // Safari fix - if (element.offsetParent==document.body) - if (Element.getStyle(element,'position')=='absolute') break; - - } while (element = element.offsetParent); - - element = forElement; - do { - if (!window.opera || element.tagName=='BODY') { - valueT -= element.scrollTop || 0; - valueL -= element.scrollLeft || 0; - } - } while (element = element.parentNode); - - return [valueL, valueT]; - }, - - clone: function(source, target) { - var options = Object.extend({ - setLeft: true, - setTop: true, - setWidth: true, - setHeight: true, - offsetTop: 0, - offsetLeft: 0 - }, arguments[2] || {}) - - // find page position of source - source = $(source); - var p = Position.page(source); - - // find coordinate system to use - target = $(target); - var delta = [0, 0]; - var parent = null; - // delta [0,0] will do fine with position: fixed elements, - // position:absolute needs offsetParent deltas - if (Element.getStyle(target,'position') == 'absolute') { - parent = Position.offsetParent(target); - delta = Position.page(parent); - } - - // correct by body offsets (fixes Safari) - if (parent == document.body) { - delta[0] -= document.body.offsetLeft; - delta[1] -= document.body.offsetTop; - } - - // set position - if(options.setLeft) target.style.left = (p[0] - delta[0] + options.offsetLeft) + 'px'; - if(options.setTop) target.style.top = (p[1] - delta[1] + options.offsetTop) + 'px'; - if(options.setWidth) target.style.width = source.offsetWidth + 'px'; - if(options.setHeight) target.style.height = source.offsetHeight + 'px'; - }, - - absolutize: function(element) { - element = $(element); - if (element.style.position == 'absolute') return; - Position.prepare(); - - var offsets = Position.positionedOffset(element); - var top = offsets[1]; - var left = offsets[0]; - var width = element.clientWidth; - var height = element.clientHeight; - - element._originalLeft = left - parseFloat(element.style.left || 0); - element._originalTop = top - parseFloat(element.style.top || 0); - element._originalWidth = element.style.width; - element._originalHeight = element.style.height; - - element.style.position = 'absolute'; - element.style.top = top + 'px'; - element.style.left = left + 'px'; - element.style.width = width + 'px'; - element.style.height = height + 'px'; - }, - - relativize: function(element) { - element = $(element); - if (element.style.position == 'relative') return; - Position.prepare(); - - element.style.position = 'relative'; - var top = parseFloat(element.style.top || 0) - (element._originalTop || 0); - var left = parseFloat(element.style.left || 0) - (element._originalLeft || 0); - - element.style.top = top + 'px'; - element.style.left = left + 'px'; - element.style.height = element._originalHeight; - element.style.width = element._originalWidth; - } -} - -// Safari returns margins on body which is incorrect if the child is absolutely -// positioned. For performance reasons, redefine Position.cumulativeOffset for -// KHTML/WebKit only. -if (/Konqueror|Safari|KHTML/.test(navigator.userAgent)) { - Position.cumulativeOffset = function(element) { - var valueT = 0, valueL = 0; - do { - valueT += element.offsetTop || 0; - valueL += element.offsetLeft || 0; - if (element.offsetParent == document.body) - if (Element.getStyle(element, 'position') == 'absolute') break; - - element = element.offsetParent; - } while (element); - - return [valueL, valueT]; - } -} - -Element.addMethods(); \ No newline at end of file diff --git a/solr/client/ruby/flare/public/plugin_assets/README b/solr/client/ruby/flare/public/plugin_assets/README deleted file mode 100644 index 6576ab55bca..00000000000 --- a/solr/client/ruby/flare/public/plugin_assets/README +++ /dev/null @@ -1,17 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -Files in this directory are automatically generated from your Rails Engines. -They are copied from the 'public' directories of each engine into this directory -each time Rails starts (server, console... any time 'start_engine' is called). -Any edits you make will NOT persist across the next server restart; instead you -should edit the files within the /assets/ directory itself. diff --git a/solr/client/ruby/flare/public/stylesheets/flare.css b/solr/client/ruby/flare/public/stylesheets/flare.css deleted file mode 100644 index 17150ab1f37..00000000000 --- a/solr/client/ruby/flare/public/stylesheets/flare.css +++ /dev/null @@ -1,180 +0,0 @@ -/* -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -*/ - -body { - font-family: Verdana, Geneva, Arial, helvetica, sans-serif; - font-size: 12px; - margin: 15px; -} - -#header { - font-size: 22px; - margin-bottom: -10px; - width: 200px; - border-top: 4px solid #D43D1A; - border-left: 4px solid #EE4000; - background:url(../images/flare.jpg) no-repeat left top; -} - -#header a { - color: #EE4000; -} - -#header a:hover { - color: #CD3700; -} - -a img { - border: 0; -} - -td { - font-family: Verdana, Geneva, Arial, helvetica, sans-serif; - font-size: 11px; -} -a, a:visited { - color: #cc6633; - text-decoration: none; -} -a:hover { - color: #ff9933; - text-decoration: none; -} - -h2 { - font-size: 16px; - font-weight: normal; - } - -h4 { - font-size: 13px; - font-weight: normal; - letter-spacing: .2em; - } - -h4 a { - font-size: 11px; - letter-spacing: normal; - } - -h4 a:hover { - text-decoration: none; - } - -em { - color: #000; -} - -#sidebar { - float: right; - width: 339px; - font-size: 11px; - line-height: 20px; - margin-bottom: 20px; - padding: 10px; -} - -.searchbar { - line-height: 12px; -} - -#sidebar ul { - list-style: none; - margin-left: -20px; - margin-top: -10px; -} - -#sidebar img { - vertical-align: middle; -} - -#sidebar .exhibit { - float: right; -} - -#variables { - padding: 20px; -} - -.varheader { - font-size: 14px; - font-weight: normal; - letter-spacing: .2em; -} - -#queries img { - vertical-align: baseline; - width:14px; -} - -#queries { - margin-left: 10px; - color: #666; -} - -#filters img { - vertical-align: baseline; - width:14px; -} - -#filters { - margin-left: 10px; - color: #666; -} - -.clear { - padding: 10px 0 10px 0px; - font-size: 11px; -} - -.resultsheader { - font-size: 14px; - font-weight: normal; - letter-spacing: .2em; - margin-bottom: -20px; -} - -#results { - padding: 20px; - margin-right: 380px; -} - -.resultsPager { - padding: 4px; - margin-top: 30px; - margin-bottom: 20px; - border: 1px solid #A2C9EF; - background-color: #E4F1FD; -} - -.title { - font-size: 13px; - color: #000; - letter-spacing: .1em; -} - -.entry { - color: #666; -} - -.field { - color: #999; - font-style: italic; -} - -div.auto_complete { - padding-left: 20px; - padding-top: 10px; - background: #fff; -} diff --git a/solr/client/ruby/flare/script/about b/solr/client/ruby/flare/script/about deleted file mode 100755 index f30f07e13c4..00000000000 --- a/solr/client/ruby/flare/script/about +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env ruby -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require File.dirname(__FILE__) + '/../config/boot' -require 'commands/about' \ No newline at end of file diff --git a/solr/client/ruby/flare/script/breakpointer b/solr/client/ruby/flare/script/breakpointer deleted file mode 100755 index ce02815cbd9..00000000000 --- a/solr/client/ruby/flare/script/breakpointer +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env ruby -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require File.dirname(__FILE__) + '/../config/boot' -require 'commands/breakpointer' \ No newline at end of file diff --git a/solr/client/ruby/flare/script/console b/solr/client/ruby/flare/script/console deleted file mode 100755 index 7c2f7a4cb01..00000000000 --- a/solr/client/ruby/flare/script/console +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env ruby -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require File.dirname(__FILE__) + '/../config/boot' -require 'commands/console' \ No newline at end of file diff --git a/solr/client/ruby/flare/script/destroy b/solr/client/ruby/flare/script/destroy deleted file mode 100755 index 96ca14a0457..00000000000 --- a/solr/client/ruby/flare/script/destroy +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env ruby -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require File.dirname(__FILE__) + '/../config/boot' -require 'commands/destroy' \ No newline at end of file diff --git a/solr/client/ruby/flare/script/generate b/solr/client/ruby/flare/script/generate deleted file mode 100755 index 6c6fcb0d942..00000000000 --- a/solr/client/ruby/flare/script/generate +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env ruby -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require File.dirname(__FILE__) + '/../config/boot' -require 'commands/generate' \ No newline at end of file diff --git a/solr/client/ruby/flare/script/performance/benchmarker b/solr/client/ruby/flare/script/performance/benchmarker deleted file mode 100755 index 5bedc810749..00000000000 --- a/solr/client/ruby/flare/script/performance/benchmarker +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env ruby -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require File.dirname(__FILE__) + '/../../config/boot' -require 'commands/performance/benchmarker' diff --git a/solr/client/ruby/flare/script/performance/profiler b/solr/client/ruby/flare/script/performance/profiler deleted file mode 100755 index 3daeaabdfdd..00000000000 --- a/solr/client/ruby/flare/script/performance/profiler +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env ruby -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require File.dirname(__FILE__) + '/../../config/boot' -require 'commands/performance/profiler' diff --git a/solr/client/ruby/flare/script/pie.rb b/solr/client/ruby/flare/script/pie.rb deleted file mode 100755 index 7f9d94403cd..00000000000 --- a/solr/client/ruby/flare/script/pie.rb +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env ruby -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require 'rubygems' -require 'sparklines' - -0.upto(100) do |i| - Sparklines.plot_to_file("public/images/pie_#{i}.png", - [i], :type => 'pie', - :share_color => "#D43D1A", - :remain_color => "#dcdcdc" -# :background_color => "#ededed" - ) -end - - diff --git a/solr/client/ruby/flare/script/plugin b/solr/client/ruby/flare/script/plugin deleted file mode 100755 index 3ba193491f1..00000000000 --- a/solr/client/ruby/flare/script/plugin +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env ruby -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require File.dirname(__FILE__) + '/../config/boot' -require 'commands/plugin' \ No newline at end of file diff --git a/solr/client/ruby/flare/script/process/inspector b/solr/client/ruby/flare/script/process/inspector deleted file mode 100755 index 5653e9199f1..00000000000 --- a/solr/client/ruby/flare/script/process/inspector +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env ruby -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require File.dirname(__FILE__) + '/../../config/boot' -require 'commands/process/inspector' diff --git a/solr/client/ruby/flare/script/process/reaper b/solr/client/ruby/flare/script/process/reaper deleted file mode 100755 index 7dd181a1cad..00000000000 --- a/solr/client/ruby/flare/script/process/reaper +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env ruby -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require File.dirname(__FILE__) + '/../../config/boot' -require 'commands/process/reaper' diff --git a/solr/client/ruby/flare/script/process/spawner b/solr/client/ruby/flare/script/process/spawner deleted file mode 100755 index 2e9b27d85ca..00000000000 --- a/solr/client/ruby/flare/script/process/spawner +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env ruby -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require File.dirname(__FILE__) + '/../../config/boot' -require 'commands/process/spawner' diff --git a/solr/client/ruby/flare/script/runner b/solr/client/ruby/flare/script/runner deleted file mode 100755 index 05ba1575781..00000000000 --- a/solr/client/ruby/flare/script/runner +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env ruby -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require File.dirname(__FILE__) + '/../config/boot' -require 'commands/runner' \ No newline at end of file diff --git a/solr/client/ruby/flare/script/server b/solr/client/ruby/flare/script/server deleted file mode 100755 index 5ddadff82b7..00000000000 --- a/solr/client/ruby/flare/script/server +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env ruby -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require File.dirname(__FILE__) + '/../config/boot' -require 'commands/server' \ No newline at end of file diff --git a/solr/client/ruby/flare/test/functional/browse_controller_test.rb b/solr/client/ruby/flare/test/functional/browse_controller_test.rb deleted file mode 100644 index d206f16121b..00000000000 --- a/solr/client/ruby/flare/test/functional/browse_controller_test.rb +++ /dev/null @@ -1,30 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require File.dirname(__FILE__) + '/../test_helper' -require 'browse_controller' - -# Re-raise errors caught by the controller. -class BrowseController; def rescue_action(e) raise e end; end - -class BrowseControllerTest < Test::Unit::TestCase - def setup - @controller = BrowseController.new - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - end - - # Replace this with your real tests. - def test_truth - assert true - end -end diff --git a/solr/client/ruby/flare/test/test_helper.rb b/solr/client/ruby/flare/test/test_helper.rb deleted file mode 100644 index cc17dfff1a0..00000000000 --- a/solr/client/ruby/flare/test/test_helper.rb +++ /dev/null @@ -1,47 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -ENV["RAILS_ENV"] = "test" -require File.expand_path(File.dirname(__FILE__) + "/../config/environment") - -# Added the following requires, and commented out test_help and the self.* calls -# such that tests can run without a database. (Based on Fowler's Rails Recipes) -require 'application' -require 'test/unit' -require 'action_controller/test_process' -require 'breakpoint' -#require 'test_help' - -class Test::Unit::TestCase - # Transactional fixtures accelerate your tests by wrapping each test method - # in a transaction that's rolled back on completion. This ensures that the - # test database remains unchanged so your fixtures don't have to be reloaded - # between every test method. Fewer database queries means faster tests. - # - # Read Mike Clark's excellent walkthrough at - # http://clarkware.com/cgi/blosxom/2005/10/24#Rails10FastTesting - # - # Every Active Record database supports transactions except MyISAM tables - # in MySQL. Turn off transactional fixtures in this case; however, if you - # don't care one way or the other, switching from MyISAM to InnoDB tables - # is recommended. - #self.use_transactional_fixtures = true - - # Instantiated fixtures are slow, but give you @david where otherwise you - # would need people(:david). If you don't want to migrate your existing - # test cases which use the @david style and don't mind the speed hit (each - # instantiated fixtures translates to a database query per test method), - # then set this back to true. - #self.use_instantiated_fixtures = false - - # Add more helper methods to be used by all tests here... -end diff --git a/solr/client/ruby/flare/vendor/plugins/engines/CHANGELOG b/solr/client/ruby/flare/vendor/plugins/engines/CHANGELOG deleted file mode 100644 index 05a0e1a015e..00000000000 --- a/solr/client/ruby/flare/vendor/plugins/engines/CHANGELOG +++ /dev/null @@ -1,241 +0,0 @@ -= 1.2.0 - MASSIVE INTERNAL REFACTORING - - -* !!!Support for Rails < 1.2 has been dropped!!!; if you are using Rails =< 1.1.6, please use Engines 1.1.6, available from http://svn.rails-engines.org/engines/tags/rel_1.1.6 - -* Engines are dead! Long live plugins! There is now no meaningful notion of an engine - all plugins can take advantage of the more powerful features that the engines plugin provides by including app directories, etc. - -* Init_engine.rb is no longer used; please use the plugin-standard init.rb instead. - -* Engines.start is no longer required; please use the config.plugins array provided by Rails instead - -* To get the most benefit from Engines, set config.plugins to ["engines", "*"] to load the engines plugin first, and then all other plugins in their normal order after. - -* Access all loaded plugins via the new Rails.plugins array, and by name using Rails.plugins[:plugin_name]. - -* Access plugin metadata loaded automatically from about.yml: Rails.plugins[:name].about. Plugin#version is provided directly, for easy access. - -* Module.config is has been removed - use mattr_accessor instead, and initialize your default values via the init.rb mechanism. - -* Public asset helpers have been rewritten; instead of engine_stylesheet, now use stylesheet_link_tag :name, :plugin => "plugin_name" - -* Plugin migrations have been reworked to integrate into the main migration stream. Please run script/generate plugin_migration to create plugin migrations in your main application. - -* The fixture method for loading fixtures against any class has been removed; instead, engines will now provide a mechanism for loading fixtures from all plugins, by mirroring fixtures into a common location. - -* All references to engines have been removed; For example, any rake tasks which applied to engines now apply to all plugins. The default Rails rake tasks for plugins are overridden where necessary. - -* Layouts can now be shared via plugins - inspiration gratefully taken from PluginAWeek's plugin_routing :) - -* Actual routing from plugins is now possible, by including routes.rb in your plugin directory and using the from_plugin method in config/routes.rb (Ticket #182) - -* Controllers are no longer loaded twice if they're not present in the normal app/ directory (Ticket #177) - -* The preferred location for javascripts/stylesheets/etc is now 'assets' rather than 'public' - -* Ensure that plugins started before routing have their controllers appropriately added to config.controller_paths (Ticket #258) - -* Removed Engines.version - it's not longer relevant, now we're loading version information from about.yml files. - -* Added a huge amount of documentation to all new modules. - -* Added new warning message if installation of engines 1.2.x is attempted in a Rails 1.1.x application - -* Added details of the removal of the config method to UPGRADING - -* Removed the plugins:info rake task in favour of adding information to script/about via the Rails::Info module (Ticket #261) - -* Improved handling of testing and documentation tasks for plugins - - - -= 1.1.4 - -* Fixed creation of multipart emails (Ticket #190) - -* Added a temporary fix to the code-mixing issue. In your engine's test/test_helper.rb, please add the following lines: - - # Ensure that the code mixing and view loading from the application is disabled - Engines.disable_app_views_loading = true - Engines.disable_app_code_mixing = true - - which will prevent code mixing for controllers and helpers, and loading views from the application. One thing to remember is to load any controllers/helpers using 'require_or_load' in your tests, to ensure that the engine behaviour is respected (Ticket #135) - -* Added tasks to easily test engines individually (Ticket #120) - -* Fixture extensions will now fail with an exception if the corresponding class cannot be loaded (Ticket #138) - -* Patch for new routing/controller loading in Rails 1.1.6. The routing code is now replaced with the contents of config.controller_paths, along with controller paths from any started engines (Ticket #196) - -* Rails' Configuration instance is now stored, and available from all engines and plugins. - - - -= 1.1.3 - -* Fixed README to show 'models' rather than 'model' class (Ticket #167) -* Fixed dependency loading to work with Rails 1.1.4 (Ticket #180) - - - -= 1.1.2 - -* Added better fix to version checking (Ticket #130, jdell@gbdev.com). - -* Fixed generated init_engine.rb so that VERSION module doesn't cause probems (Ticket #131, japgolly@gmail.com) - -* Fixed error with Rails 1.0 when trying to ignore the engine_schema_info table (Ticket #132, snowblink@gmail.com) - -* Re-added old style rake tasks (Ticket #133) - -* No longer adding all subdirectories of /app or /lib, as this can cause issues when files are grouped in modules (Ticket #149, kasatani@gmail.com) - -* Fixed engine precidence ordering for Rails 1.1 (Ticket #146) - -* Added new Engines.each method to assist in processing the engines in the desired order (Ticket #146) - -* Fixed annoying error message at appears when starting the console in development mode (Ticket #134) - -* Engines is now super-careful about loading the correct version of Rails from vendor (Ticket #154) - - - -= 1.1.1 - -* Fixed migration rake task failing when given a specific version (Ticket #115) - -* Added new rake task "test:engines" which will test engines (and other plugins) but ensure that the test database is cloned from development beforehand (Ticket #125) - -* Fixed issue where 'engine_schema_info' table was included in schema dumps (Ticket #87) - -* Fixed multi-part emails (Ticket #121) - -* Added an 'install.rb' file to new engines created by the bundled generator, which installs the engines plugin automatically if it doesn't already exist (Ticket #122) - -* Added a default VERSION module to generated engines (Ticket #123) - -* Refactored copying of engine's public files to a method of an Engine instance. You can now call Engines.get(:engine_name).copy_public_files (Ticket #108) - -* Changed engine generator templates from .rb files to .erb files (Ticket #106) - -* Fixed the test_helper.erb file to use the correct testing extensions and not load any schema - the schema will be cloned automatically via rake test:engines - -* Fixed problem when running with Rails 1.1.1 where version wasn't determined correctly (Ticket #129) - -* Fixed bug preventing engines from loading when both Rails 1.1.0 and 1.1.1 gems are installed and in use. - -* Updated version (d'oh!) - - - -= 1.1.0 - -* Improved regexp matching for Rails 1.0 engines with peculiar paths - -* Engine instance objects can be accessed via Engines[:name], an alias for Engines.get(:name) (Ticket #99) - -* init_engine.rb is now processed as the final step in the Engine.start process, so it can access files within the lib directory, which is now in the $LOAD_PATH at that point. (Ticket #99) - -* Clarified MIT license (Ticket #98) - -* Updated Rake tasks to integrate smoothly with Rails 1.1 namespaces - -* Changed the version to "1.1.0 (svn)" - -* Added more information about using the plugin with Edge Rails to the README - -* moved extensions into lib/engines/ directory to enable use of Engines module in extension code. - -* Added conditional require_or_load method which attempts to detect the current Rails version. To use the Edge Rails version of the loading mechanism, add the line: - -* Engines.config :edge, true - -* to your environment.rb file. - -* Merged changes from /branches/edge and /branches/rb_1.0 into /trunk - -* engine_schema_info now respects the prefix/suffixes set for ActiveRecord::Base (Ticket #67) - -* added ActiveRecord::Base.wrapped_table_name(name) method to assist in determining the correct table name - - - -= 1.0.6 - -* Added ability to determine version information for engines: rake engine_info - -* Added a custom logger for the Engines module, to stop pollution of the Rails logs. - -* Added some more tests (in particular, see rails_engines/applications/engines_test). - -* Another attempt at solving Ticket #53 - controllers and helpers should now be loadable from modules, and if a full path (including RAILS_ROOT/ENGINES_ROOT) is given, it should be safely stripped from the require filename such that corresponding files can be located in any active engines. In other words, controller/helper overloading should now completely work, even if the controllers/helpers are in modules. - -* Added (finally) patch from Ticket #22 - ActionMailer helpers should now load - -* Removed support for Engines.start :engine, :engine_name => 'whatever'. It was pointless. - -* Fixed engine name referencing; engine_stylesheet/engine_javascript can now happily use shorthand engine names (i.e. :test == :test_engine) (Ticket #45) - -* Fixed minor documentation error ('Engine.start' ==> 'Engines.start') (Ticket #57) - -* Fixed double inclusion of RAILS_ROOT in engine_migrate rake task (Ticket #61) - -* Added ability to force config values even if given as a hash (Ticket #62) - - - -= 1.0.5 - -* Fixed bug stopping fixtures from loading with PostgreSQL - - - -= 1.0.4 - -* Another attempt at loading controllers within modules (Ticket #56) - - - -= 1.0.3 - -* Fixed serious dependency bug stopping controllers being loaded (Ticket #56) - - - -= 1.0.2 - -* Fixed bug with overloading controllers in modules from /app directory - -* Fixed exception thrown when public files couldn't be created; exception is now logged (Ticket #52) - -* Fixed problem with generated test_helper.rb file via File.expand_path (Ticket #50) - - - -= 1.0.1 - -* Added engine generator for creation of new engines - -* Fixed 'Engine' typo in README - -* Fixed bug in fixtures extensions - -* Fixed /lib path management bug - -* Added method to determine public directory location from Engine object - -* Fixed bug in the error message in get_engine_dir() - -* Added proper component loading - -* Added preliminary tests for the config() methods module - - - -= pre-v170 - -* Fixed copyright notices to point to DHH, rather than me. - -* Moved extension require statements into lib/engines.rb, so the will be loaded if another module/file calls require 'engines - -* Added a CHANGELOG file (this file) diff --git a/solr/client/ruby/flare/vendor/plugins/engines/MIT-LICENSE b/solr/client/ruby/flare/vendor/plugins/engines/MIT-LICENSE deleted file mode 100644 index 17a3b22b61c..00000000000 --- a/solr/client/ruby/flare/vendor/plugins/engines/MIT-LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -Copyright (c) 2007 James Adam - -The MIT License - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file diff --git a/solr/client/ruby/flare/vendor/plugins/engines/README b/solr/client/ruby/flare/vendor/plugins/engines/README deleted file mode 100644 index 415e97fcd8c..00000000000 --- a/solr/client/ruby/flare/vendor/plugins/engines/README +++ /dev/null @@ -1,64 +0,0 @@ -The engines plugin enhances Rails' own plugin framework, making it simple to share controllers, helpers, models, public assets, routes and migrations in plugins. - -For more information, see http://rails-engines.org - -= Using the plugin - -With engines 1.2, no extra configuration in environment.rb is required. Having the plugin installed will automatically enable sharing of code within plugin/app/ directories. Developers should be aware that the config.plugins parameter can be used to control plugin load order, if this is important for your application. - -=== config.plugins - -With Rails 1.2, the config.plugins list can be used to specify the order in which plugins are loaded. It's recommended (although not required) that you load the engines plugin first, and any other plugins later. The engines plugin enhances Rails' processing of config.plugins for occasions where you only care about the order of a small selection of your application's plugins. For instance, if you want to load +engines+ first, and anything else afterwards, then - - config.plugins = ["engines", "*"] - -will ensure that engines is loaded first, and everything else (in whatever order Rails chooses) afterwards. - -== Better plugins - -In addition to the regular set of plugin-supported files (lib, init.rb, tasks, generators, tests), plugins can carry the following when the engines plugin is also installed. - - -=== Controllers, Helpers, and Views - -Include these files in an app directory just like you would in a normal Rails application. If you need to override a method, view or partial, create the corresponding file in your main app directory and it will be used instead. - -* Controllers & Helpers: See Engines::RailsExtensions::Dependencies for more information. -* Views: See Engines::RailsExtensions::Templates for more information. - -=== Models - -Model code can similarly be placed in an app/models/ directory. Unfortunately, it's not possible to automatically override methods within a model; if your application needs to change the way a model behaves, consider creating a subclass, or replacing the model entirely within your application's app/models/ directory. See Engines::RailsExtensions::Dependencies for more information. - -IMPORTANT NOTE: when you load code from within plugins, it is typically not handled well by Rails in terms of unloading and reloading changes. Look here for more information - http://rails-engines.org/development/common-issues-when-overloading-code-from-plugins/ - -=== Routes - -Include your route declarations in a routes.rb file at the root of your plugins, e.g.: - - connect "/my/url", :controller => "some_controller" - my_named_route "do_stuff", :controller => "blah", :action => "stuff" - # etc. - -You can then load these files into your application by declaring their inclusion in the application's config/routes.rb: - - map.from_plugin :plugin_name - -See Engines::RailsExtensions::Routing for more information. - -=== Migrations - -Migrations record the changes in your database as your application evolves. With engines 1.2, migrations from plugins can also join in this evolution as first-class entities. To add migrations to a plugin, include a db/migrate/ folder and add migrations there as normal. These migrations can then be integrated into the main flow of database evolution by running the plugin_migration generator: - - script/generate plugin_migration - -This will produce a migration in your application. Running this migration (via rake db:migrate, as normal) will migrate the database according to the latest migrations in each plugin. See Engines::RailsExtensions::Migrations for more information. - - -=== More powerful Rake tasks - -The engines plugin enhances and adds to the suite of default rake tasks for working with plugins. The doc:plugins task now includes controllers, helpers and models under app, and anything other code found under the plugin's code_paths attribute. New testing tasks have been added to run unit, functional and integration tests from plugins, whilst making it easier to load fixtures from plugins. See Engines::Testing for more details about testing, and run - - rake -T - -to see the set of rake tasks available. \ No newline at end of file diff --git a/solr/client/ruby/flare/vendor/plugins/engines/Rakefile b/solr/client/ruby/flare/vendor/plugins/engines/Rakefile deleted file mode 100644 index 3c346c860d4..00000000000 --- a/solr/client/ruby/flare/vendor/plugins/engines/Rakefile +++ /dev/null @@ -1,32 +0,0 @@ -require 'rake' -require 'rake/rdoctask' -require 'tmpdir' - -task :default => :doc - -desc 'Generate documentation for the engines plugin.' -Rake::RDocTask.new(:doc) do |doc| - doc.rdoc_dir = 'doc' - doc.title = 'Engines' - doc.main = "README" - doc.rdoc_files.include("README", "UPGRADING", "CHANGELOG", "MIT-LICENSE") - doc.rdoc_files.include('lib/**/*.rb') - doc.options << '--line-numbers' << '--inline-source' -end - -desc 'Run the engine plugin tests within their test harness' -task :cruise do - # checkout the project into a temporary directory - version = "rails_1.2" - test_dir = "#{Dir.tmpdir}/engines_plugin_#{version}_test" - puts "Checking out test harness for #{version} into #{test_dir}" - `svn co http://svn.rails-engines.org/test/engines/#{version} #{test_dir}` - - # run all the tests in this project - Dir.chdir(test_dir) - load 'Rakefile' - puts "Running all tests in test harness" - ['db:migrate', 'test', 'test:plugins'].each do |t| - Rake::Task[t].invoke - end -end \ No newline at end of file diff --git a/solr/client/ruby/flare/vendor/plugins/engines/UPGRADING b/solr/client/ruby/flare/vendor/plugins/engines/UPGRADING deleted file mode 100644 index af3debd29c1..00000000000 --- a/solr/client/ruby/flare/vendor/plugins/engines/UPGRADING +++ /dev/null @@ -1,93 +0,0 @@ -= Upgrading from Engines 1.1.x to Engines 1.2.x - - -The 1.2 release of the engines plugin represents a significant rewrite of the internals. Now less intrusive into the core frameworks, it's even simpler for plugin developers to make more flexible plugins than Rails typically allows. - -However, as a consequence of change, you may need to make some adjustments to your application to get the most benefit. These are outlined below: - - -== In your application - -The following changes will affect code in applications which use the engines plugin - -=== Change the engine_schema table to plugin_schema - -Because the engines plugin now works universally for any Rails plugin, the table used to store migration information has been renamed appropriately. We can also play nicely with other plugin_migration implementations by supporting this convention. - - -=== Rename RAILS_ROOT/public/engine_files to RAILS_ROOT/public/plugin_assets - -Similarly, any plugin can now share stylesheets, images and so on via an assets folder, so the destination within the main public directory has been renamed to reflect this. You can simply delete the RAILS_ROOT/public/engine_files directory; the new one will be generated the next time your application starts. - - -=== The engine_image, engine_stylesheet and engine_javascript helpers have been replaced with enhanced versions of the normal Rails asset helpers - -Now, it's simple to include an image from any plugin, by adding a plugin key to the helper's options hash: - - image_tag "image.png", :plugin => "my_plugin" - -A similar convention exists for stylesheets and javascript files. Additionally, the old behaviour of automatically including assets which match the "engine"'s name has been dropped - only the files you explicitly request are included. - - -=== Engines.start is replaced with config.plugins - -Rails' native configuration object now includes an array for specifying which plugins are loaded, and in what order. The engines plugin enhances this feature with a "*" wildcard, so that you can load any order-sensitive plugins, and then the rest in any order. - - config.plugins = ["engines", "some_plugin", "another_plugin", "*"] - -It's worth noting that the engines plugin no longer needs to be specifically loaded first, so most people can happily ignore the config.plugins array without any problems. - - -=== The "config" method for "engine"-style configuration is no longer loaded by default. - -See below. - - -=== Any "engines" type rake tasks are now "plugin" tasks. - -The following rake tasks are now provided by the engines plugin for operating on your application's plugins (whenever a task can operate on a single plugin, this can be controlled by specifying PLUGIN= on the commandline): - - db:fixtures:plugins:load # load fixtures from plugins. - - test:plugins:units # Run tests from within /test/units - test:plugins:functional # Run tests from within /test/functional - test:plugins:integration # Run tests from within /test/integration - test:plugins # Run all tests from within /test/* - - doc:plugins # Run full rdoc against all source files within all plugins - doc:plugins: # Run full rdoc against all source files within the given plugin - - - -== In your "engine"-style plugins - -If you have developed or are using plugins that leverage engines enhancements, you need to be aware of the following changes in engines 1.2. - -=== init_engine.rb is no longer required - -Please now create init.rb files, just as you'd find in "normal" plugins. Remember - there's no such thing as "an engine" anymore. - - -=== The "fixture" method for loading tests from arbitrary files - -Supporting this was just too difficult, and it seems like the combination of Rails' own lack of enhancements regarding this feature, along with the mind-shift against static fixtures, meant that it simply was too much work to continue to support. - -The only reason this mechanism originally existed was to support plugins which couldn't predict the names of the tables that models might be stored in. This is now a discouraged behaviour. - - -=== Engines.current.version has changed its behaviour slightly. - -The engines plugin used to provide a simple way to store version information about plugins. This has now been superceded by including that information in an about.yml file, which any plugin can use. - - -=== The "config" method is not included, by default. - -Where previously developers could use the "config" method to define configuration, this is now deprecated in favour of using mattr_accessor directly in the Module. However, if you still *need* to use the config method, it is included but must be explicitly required, probably near the top of environment.rb: - - require File.join(RAILS_ROOT, "vendor", "plugins", "engines", - "lib", "engines", "deprecated_config_support") - - -=== Public assets should now be stored in a subdirectory of your plugin called "assets", rather than "public". - -This clarifies the nature of this directory; it is not made public itself, but rather is a container for files which should be made accessible from the web. diff --git a/solr/client/ruby/flare/vendor/plugins/engines/about.yml b/solr/client/ruby/flare/vendor/plugins/engines/about.yml deleted file mode 100644 index aee53e2c5e2..00000000000 --- a/solr/client/ruby/flare/vendor/plugins/engines/about.yml +++ /dev/null @@ -1,7 +0,0 @@ -author: James Adam -email: james.adam@gmail.com -homepage: http://www.rails-engines.org -summary: Enhances the plugin mechanism to perform more flexible sharing -description: The Rails Engines plugin allows the sharing of almost any type of code or asset that you could use in a Rails application, including controllers, models, stylesheets, and views. -license: MIT -version: 1.2.0 \ No newline at end of file diff --git a/solr/client/ruby/flare/vendor/plugins/engines/generators/plugin_migration/USAGE b/solr/client/ruby/flare/vendor/plugins/engines/generators/plugin_migration/USAGE deleted file mode 100644 index ac39b504abe..00000000000 --- a/solr/client/ruby/flare/vendor/plugins/engines/generators/plugin_migration/USAGE +++ /dev/null @@ -1,45 +0,0 @@ -Description: - The plugin migration generator assists in working with schema additions - required by plugins. Instead of running migrations from plugins directly, - the generator creates a regular Rails migration which will be responsible - for migrating the plugins from their current version to the latest version - installed. - - This is important because the set of application migrations remains an - accurate record of the state of the database, even as plugins are installed - and removed during the development process. - -Example: - ./script/generate plugin_migration [ ...] - - This will generate: - - RAILS_ROOT - |- db - |-migrate - |- xxx_plugin_migrations.rb - - which contains the migrations for the given plugin(s). - - -Advanced Usage: - -There may be situations where you need *complete* control over the migrations -of plugins in your application, migrating a certainly plugin down to X, and -another plugin up to Y, where neither X or Y are the latest migrations for those -plugins. - -For those unfortunate few, I have two pieces of advice: - - 1. Why? This is a code smell [http://c2.com/xp/CodeSmell.html]. - - 2. Well, OK. Don't panic. You can completely control plugin migrations by - creating your own migrations. To manually migrate a plugin to a specific - version, simply use - - Rails.plugins[:your_plugin_name].migrate(version) - - where version is the integer of the migration this plugin should end - up at. - -With great power comes great responsibility. Use this wisely. \ No newline at end of file diff --git a/solr/client/ruby/flare/vendor/plugins/engines/generators/plugin_migration/plugin_migration_generator.rb b/solr/client/ruby/flare/vendor/plugins/engines/generators/plugin_migration/plugin_migration_generator.rb deleted file mode 100644 index 906a9111e5b..00000000000 --- a/solr/client/ruby/flare/vendor/plugins/engines/generators/plugin_migration/plugin_migration_generator.rb +++ /dev/null @@ -1,79 +0,0 @@ -# Generates a migration which migrates all plugins to their latest versions -# within the database. -class PluginMigrationGenerator < Rails::Generator::Base - - def initialize(runtime_args, runtime_options={}) - super - @options = {:assigns => {}} - - ensure_plugin_schema_table_exists - get_plugins_to_migrate(runtime_args) - - if @plugins_to_migrate.empty? - puts "All plugins are migrated to their latest versions" - exit(0) - end - - @options[:migration_file_name] = build_migration_name - @options[:assigns][:class_name] = build_migration_name.classify - end - - def manifest - record do |m| - m.migration_template 'plugin_migration.erb', 'db/migrate', @options - end - end - - protected - - # Create the plugin schema table if it doesn't already exist. See - # Engines::RailsExtensions::Migrations#initialize_schema_information_with_engine_additions - def ensure_plugin_schema_table_exists - ActiveRecord::Base.connection.initialize_schema_information - end - - # Determine all the plugins which have migrations that aren't present - # according to the plugin schema information from the database. - def get_plugins_to_migrate(plugin_names) - - # First, grab all the plugins which exist and have migrations - @plugins_to_migrate = if plugin_names.empty? - Rails.plugins - else - plugin_names.map do |name| - Rails.plugins[name] ? Rails.plugins[name] : raise("Cannot find the plugin '#{name}'") - end - end - - @plugins_to_migrate.reject! { |p| p.latest_migration.nil? } - - # Then find the current versions from the database - @current_versions = {} - @plugins_to_migrate.each do |plugin| - @current_versions[plugin.name] = Engines::PluginMigrator.current_version(plugin) - end - - # Then find the latest versions from their migration directories - @new_versions = {} - @plugins_to_migrate.each do |plugin| - @new_versions[plugin.name] = plugin.latest_migration - end - - # Remove any plugins that don't need migration - @plugins_to_migrate.map { |p| p.name }.each do |name| - @plugins_to_migrate.delete(Rails.plugins[name]) if @current_versions[name] == @new_versions[name] - end - - @options[:assigns][:plugins] = @plugins_to_migrate - @options[:assigns][:new_versions] = @new_versions - @options[:assigns][:current_versions] = @current_versions - end - - # Construct a unique migration name based on the plugins involved and the - # versions they should reach after this migration is run. - def build_migration_name - @plugins_to_migrate.map do |plugin| - "#{plugin.name}_to_version_#{@new_versions[plugin.name]}" - end.join("_and_") - end -end \ No newline at end of file diff --git a/solr/client/ruby/flare/vendor/plugins/engines/generators/plugin_migration/templates/plugin_migration.erb b/solr/client/ruby/flare/vendor/plugins/engines/generators/plugin_migration/templates/plugin_migration.erb deleted file mode 100644 index 7a5f48a97af..00000000000 --- a/solr/client/ruby/flare/vendor/plugins/engines/generators/plugin_migration/templates/plugin_migration.erb +++ /dev/null @@ -1,13 +0,0 @@ -class <%= class_name %> < ActiveRecord::Migration - def self.up - <%- plugins.each do |plugin| -%> - Rails.plugins["<%= plugin.name %>"].migrate(<%= new_versions[plugin.name] %>) - <%- end -%> - end - - def self.down - <%- plugins.each do |plugin| -%> - Rails.plugins["<%= plugin.name %>"].migrate(<%= current_versions[plugin.name] %>) - <%- end -%> - end -end diff --git a/solr/client/ruby/flare/vendor/plugins/engines/init.rb b/solr/client/ruby/flare/vendor/plugins/engines/init.rb deleted file mode 100644 index 63914ccca2d..00000000000 --- a/solr/client/ruby/flare/vendor/plugins/engines/init.rb +++ /dev/null @@ -1,40 +0,0 @@ -begin - silence_warnings { require 'rails/version' } # it may already be loaded - unless Rails::VERSION::MAJOR >= 1 && Rails::VERSION::MINOR >= 2 - raise "This version of the engines plugin requires Rails 1.2 or later!" - end -end - -# First, require the engines module & core methods -require "engines" - -# Load this before we get actually start engines -require "engines/rails_extensions/rails_initializer" - -# Start the engines mechanism. -Engines.init(config, self) - -# Now that we've defined the engines module, load up any extensions -[:rails, - :rails_initializer, - :dependencies, - :active_record, - :migrations, - :templates, - :public_asset_helpers, - :routing -].each do |f| - require "engines/rails_extensions/#{f}" -end - -# Load the testing extensions, if we are in the test environment. -require "engines/testing" if RAILS_ENV == "test" - -# Load the Rails::Info module so that plugins can insert information into it. -begin - require 'rails/info' -rescue Exception - # If this file can't be loaded, it's probably because we're running in an - # environment where Rails' builtins aren't yet in the load path. - # For the moment, just ignore this. See Ticket #261 -end \ No newline at end of file diff --git a/solr/client/ruby/flare/vendor/plugins/engines/install.rb b/solr/client/ruby/flare/vendor/plugins/engines/install.rb deleted file mode 100644 index 7bff225a136..00000000000 --- a/solr/client/ruby/flare/vendor/plugins/engines/install.rb +++ /dev/null @@ -1,32 +0,0 @@ -$LOAD_PATH.unshift File.join(File.dirname(__FILE__), "..", "..", "rails", "railties", "lib") -silence_warnings { require 'rails/version' } # it may already be loaded. - -unless Rails::VERSION::MAJOR >= 1 && Rails::VERSION::MINOR >= 2 - puts <<-end_of_warning - - !!!=== IMPORTANT NOTE ===!!! - -Support for Rails < 1.2 has been dropped; if you are using -Rails =< 1.1.6, please use Engines 1.1.6, available from: - - >> http://svn.rails-engines.org/engines/tags/rel_1.1.6 - -For more details about changes in Engines 1.2, please see -the changelog or the website: - - >> http://www.rails-engines.org - -end_of_warning -else - puts <<-end_of_message - -The engines plugin is now installed. Feels good, right? Yeah. -You knew it would. - -Once the warm, fuzzy glow has subsided, be sure to read the contents -of the README and UPGRADING files if you're migrating this application -from Rails 1.1.x to 1.2.x. - -Have a great day! -end_of_message -end \ No newline at end of file diff --git a/solr/client/ruby/flare/vendor/plugins/engines/lib/engines.rb b/solr/client/ruby/flare/vendor/plugins/engines/lib/engines.rb deleted file mode 100644 index 8128716c579..00000000000 --- a/solr/client/ruby/flare/vendor/plugins/engines/lib/engines.rb +++ /dev/null @@ -1,323 +0,0 @@ -# This file contains the Engines module, which holds most of the logic regarding -# the startup and management of plugins. See Engines for more details. -# -# The engines plugin adds to Rails' existing behaviour by producing the +Rails.plugins+ -# PluginList, a list of all loaded plugins in a form which can be easily queried -# and manipulated. Each instance of Plugin has methods which are used to enhance -# their behaviour, including mirroring public assets, add controllers, helpers -# and views and even migration. -# -# = init.rb -# -# When the engines plugin loads, it first includes the -# Engines::RailsExtensions::RailsInitializer module into Rails::Initializer, -# overriding a number of the methods used to load plugins. -# -# Once this is loaded, Engines.init is called to prepare the application -# and create the relevant new datastructures (including Rails.plugins). -# -# Finally, each of the extension modules from Engines::RailsExtensionsis -# loaded and included into the relevant Rails classes and modules, enhancing -# their behaviour to work better with files from plugins. - -require "engines/plugin_list" -require "engines/plugin" - -# TODO: define a better logger. -def logger - RAILS_DEFAULT_LOGGER -end - -# The Engines module contains most of the methods used during the enhanced -# startup of Rails plugins. -# -# When the Engines plugin loads (its init.rb file is evaluated), the -# Engines.init method is called. This kickstarts the plugins hooks into -# the initialization process. -# -# == Parameters -# -# The Engines module has a number of public configuration parameters: -# -# [+public_directory+] The directory into which plugin assets should be -# mirrored. Defaults to RAILS_ROOT/public/plugin_assets. -# [+schema_info_table+] The table to use when storing plugin migration -# version information. Defaults to +plugin_schema_info+. -# [+rails_initializer+] A reference of the Rails initializer instance that -# was used to startup Rails. This is often useful -# when working with the startup process; see -# Engines::RailsExtensions::RailsInitializer for more -# information -# -# Additionally, there are a few flags which control the behaviour of -# some of the features the engines plugin adds to Rails: -# -# [+disable_application_view_loading+] A boolean flag determining whether -# or not views should be loaded from -# the main app/views directory. -# Defaults to false; probably only -# useful when testing your plugin. -# [+disable_application_code_loading+] A boolean flag determining whether -# or not to load controllers/helpers -# from the main +app+ directory, -# if corresponding code exists within -# a plugin. Defaults to false; again, -# probably only useful when testing -# your plugin. -# [+disable_code_mixing+] A boolean flag indicating whether all plugin -# copies of a particular controller/helper should -# be loaded and allowed to override each other, -# or if the first matching file should be loaded -# instead. Defaults to false. -# -module Engines - # The name of the public directory to mirror public engine assets into. - # Defaults to RAILS_ROOT/public/plugin_assets. - mattr_accessor :public_directory - self.public_directory = File.join(RAILS_ROOT, 'public', 'plugin_assets') - - # The table in which to store plugin schema information. Defaults to - # "plugin_schema_info". - mattr_accessor :schema_info_table - self.schema_info_table = "plugin_schema_info" - - # A reference to the current Rails::Initializer instance - mattr_accessor :rails_initializer - - - #-- - # These attributes control the behaviour of the engines extensions - #++ - - # Set this to true if views should *only* be loaded from plugins - mattr_accessor :disable_application_view_loading - self.disable_application_view_loading = false - - # Set this to true if controller/helper code shouldn't be loaded - # from the application - mattr_accessor :disable_application_code_loading - self.disable_application_code_loading = false - - # Set this ti true if code should not be mixed (i.e. it will be loaded - # from the first valid path on $LOAD_PATH) - mattr_accessor :disable_code_mixing - self.disable_code_mixing = false - - - private - - # A memo of the bottom of Rails' default load path - mattr_accessor :rails_final_load_path - # A memo of the bottom of Rails Dependencies load path - mattr_accessor :rails_final_dependency_load_path - - public - - # Initializes the engines plugin and prepares Rails to start loading - # plugins using engines extensions. Within this method: - # - # 1. Copies of the Rails configuration and initializer are stored; - # 2. The Rails.plugins PluginList instance is created; - # 3. Any plugins which were loaded before the engines plugin are given - # the engines treatment via #enhance_loaded_plugins. - # 4. The base public directory (into which plugin assets are mirrored) - # is created, if necessary - #initialize_base_public_directory - # 5. config.plugins is checked to see if a wildcard was present - - # #check_for_star_wildcard - # - def self.init(rails_configuration, rails_initializer) - # First, determine if we're running in legacy mode - @legacy_support = self.const_defined?(:LegacySupport) && LegacySupport - - # Store some information about the plugin subsystem - Rails.configuration = rails_configuration - - # We need a hook into this so we can get freaky with the plugin loading itself - self.rails_initializer = rails_initializer - - @load_all_plugins = false - - store_load_path_markers - - Rails.plugins ||= PluginList.new - enhance_loaded_plugins # including this one, as it happens. - - initialize_base_public_directory - - check_for_star_wildcard - - logger.debug "engines has started." - end - - # You can enable legacy support by defining the LegacySupport constant - # in the Engines module before Rails loads, i.e. at the *top* of environment.rb, - # add: - # - # module Engines - # LegacySupport = true - # end - # - # Legacy Support doesn't actually do anything at the moment. If necessary - # we may support older-style 'engines' using this flag. - def self.legacy_support? - @legacy_support - end - - # A reference to the currently-loading/loaded plugin. This is present to support - # legacy engines; it's preferred to use Rails.plugins[name] in your plugin's - # init.rb file in order to get your Plugin instance. - def self.current - Rails.plugins.last - end - - # This is set to true if a "*" widlcard is present at the end of - # the config.plugins array. - def self.load_all_plugins? - @load_all_plugins - end - - # Stores a record of the last paths which Rails added to each of the load path - # attributes ($LOAD_PATH, Dependencies.load_paths and - # ActionController::Routing.controller_paths) that influence how code is loaded - # We need this to ensure that we place our additions to the load path *after* - # all Rails' defaults - def self.store_load_path_markers - self.rails_final_load_path = $LOAD_PATH.last - logger.debug "Rails final load path: #{self.rails_final_load_path}" - self.rails_final_dependency_load_path = ::Dependencies.load_paths.last - logger.debug "Rails final dependency load path: #{self.rails_final_dependency_load_path}" - end - - # Create Plugin instances for plugins loaded before the engines plugin was. - # Once a Plugin instance is created, the Plugin#load method is then called - # to fully load the plugin. See Plugin#load for more details about how a - # plugin is started once engines is involved. - def self.enhance_loaded_plugins - Engines.rails_initializer.loaded_plugins.each do |name| - plugin_path = File.join(self.find_plugin_path(name), name) - unless Rails.plugins[name] - plugin = Plugin.new(name, plugin_path) - logger.debug "enginizing plugin: #{plugin.name} from #{plugin_path}" - plugin.load # injects the extra directories into the load path, and mirrors public files - Rails.plugins << plugin - end - end - logger.debug "plugins is now: #{Rails.plugins.map { |p| p.name }.join(", ")}" - end - - # Ensure that the plugin asset subdirectory of RAILS_ROOT/public exists, and - # that we've added a little warning message to instruct developers not to mess with - # the files inside, since they're automatically generated. - def self.initialize_base_public_directory - if !File.exist?(self.public_directory) - # create the public/engines directory, with a warning message in it. - logger.debug "Creating public engine files directory '#{self.public_directory}'" - FileUtils.mkdir(self.public_directory) - message = %{Files in this directory are automatically generated from your Rails Engines. -They are copied from the 'public' directories of each engine into this directory -each time Rails starts (server, console... any time 'start_engine' is called). -Any edits you make will NOT persist across the next server restart; instead you -should edit the files within the /assets/ directory itself.} - target = File.join(public_directory, "README") - File.open(target, 'w') { |f| f.puts(message) } unless File.exist?(target) - end - end - - # Check for a "*" at the end of the plugins list; if one is found, note that - # we should load all other plugins once Rails has finished initializing, and - # remove the "*". - def self.check_for_star_wildcard - if Rails.configuration.plugins && Rails.configuration.plugins.last == "*" - Rails.configuration.plugins.pop - @load_all_plugins = true - end - end - - - #- - # The following code is called once all plugins are loaded, and Rails is almost - # finished initialization - #+ - - # Once the Rails Initializer has finished, the engines plugin takes over - # and performs any post-processing tasks it may have, including: - # - # * Loading any remaining plugins if config.plugins ended with a '*'. - # * Updating Rails::Info with version information, if possible. - # - def self.after_initialize - if self.load_all_plugins? - logger.debug "loading remaining plugins from #{Rails.configuration.plugin_paths.inspect}" - # this will actually try to load ALL plugins again, but any that have already - # been loaded will be ignored. - rails_initializer.load_all_plugins - update_rails_info_with_loaded_plugins - end - end - - # Updates Rails::Info with the list of loaded plugins, and version information for - # each plugin. This information is then available via script/about, or through - # the builtin rails_info controller. - def self.update_rails_info_with_loaded_plugins - if defined?(Rails::Info) # since it may not be available by default in some environments... - # don't do anything if it's not there. - Rails::Info.property("Loaded plugins") { Rails.plugins.map { |p| p.name }.join(", ") } - Rails.plugins.each do |plugin| - Rails::Info.property("#{plugin.name} version") { plugin.version.blank? ? "(unknown)" : plugin.version } - end - end - end - - #- - # helper methods to find and deal with plugin paths and names - #+ - - # Returns the path within +Rails.configuration.plugin_paths+ which includes - # a plugin with the given name. - def self.find_plugin_path(name) - Rails.configuration.plugin_paths.find do |path| - File.exist?(File.join(path, name.to_s)) - end - end - - # Returns the name for the plugin at the given path. - # (Note this method also appears in Rails::Initializer extensions) - def self.plugin_name(path) - File.basename(path) - end - - # A general purpose method to mirror a directory (+source+) into a destination - # directory, including all files and subdirectories. Files will not be mirrored - # if they are identical already (checked via FileUtils#identical?). - def self.mirror_files_from(source, destination) - return unless File.directory?(source) - - # TODO: use Rake::FileList#pathmap? - - source_files = Dir[source + "/**/*"] - source_dirs = source_files.select { |d| File.directory?(d) } - source_files -= source_dirs - - source_dirs.each do |dir| - # strip down these paths so we have simple, relative paths we can - # add to the destination - target_dir = File.join(destination, dir.gsub(source, '')) - begin - FileUtils.mkdir_p(target_dir) - rescue Exception => e - raise "Could not create directory #{target_dir}: \n" + e - end - end - - source_files.each do |file| - begin - target = File.join(destination, file.gsub(source, '')) - unless File.exist?(target) && FileUtils.identical?(file, target) - FileUtils.cp(file, target) - end - rescue Exception => e - raise "Could not copy #{file} to #{target}: \n" + e - end - end - end -end \ No newline at end of file diff --git a/solr/client/ruby/flare/vendor/plugins/engines/lib/engines/deprecated_config_support.rb b/solr/client/ruby/flare/vendor/plugins/engines/lib/engines/deprecated_config_support.rb deleted file mode 100644 index 62c43d3a95f..00000000000 --- a/solr/client/ruby/flare/vendor/plugins/engines/lib/engines/deprecated_config_support.rb +++ /dev/null @@ -1,135 +0,0 @@ -# This file contains support for the now-deprecated +config+ method that the engines -# plugin provided before version 1.2. Instead of using this, plugin authors are -# now encouraged to create their own Module configuration mechanisms; the -# +mattr_accessor+ mechanism provided by ActiveSupport is ideal for this: -# -# module MyPlugin -# mattr_accessor :config_value -# self.config_value = "default" -# end -# -# == Using the deprecated config method -# -# If you require the config method to be present, change your environment.rb -# file such that the very top of the file looks like this: -# -# require File.join(File.dirname(__FILE__), 'boot') -# require File.join(RAILS_ROOT, "vendor", "plugins", "engines", -# "lib", "engines", "deprecated_config_support") -# - - -# Adds the +config+ and +default_constant+ methods to Module. -# -# *IMPORTANT NOTE* - these methods are deprecated. Only use them when you have no -# other choice. See link:files/lib/engines/deprecated_config_support_rb.html for more -# information. -class Module - # Defines a constant within a module/class ONLY if that constant does - # not already exist. - # - # This can be used to implement defaults in plugins/engines/libraries, e.g. - # if a plugin module exists: - # module MyPlugin - # default_constant :MyDefault, "the_default_value" - # end - # - # then developers can override this default by defining that constant at - # some point *before* the module/plugin gets loaded (such as environment.rb) - def default_constant(name, value) - if !(name.is_a?(String) or name.is_a?(Symbol)) - raise "Cannot use a #{name.class.name} ['#{name}'] object as a constant name" - end - if !self.const_defined?(name) - self.class_eval("#{name} = #{value.inspect}") - end - end - - # A mechanism for defining configuration of Modules. With this - # mechanism, default values for configuration can be provided within shareable - # code, and the end user can customise the configuration without having to - # provide all values. - # - # Example: - # - # module MyModule - # config :param_one, "some value" - # config :param_two, 12345 - # end - # - # Those values can now be accessed by the following method - # - # MyModule.config :param_one - # => "some value" - # MyModule.config :param_two - # => 12345 - # - # ... or, if you have overrriden the method 'config' - # - # MyModule::CONFIG[:param_one] - # => "some value" - # MyModule::CONFIG[:param_two] - # => 12345 - # - # Once a value is stored in the configuration, it will not be altered - # by subsequent assignments, unless a special flag is given: - # - # (later on in your code, most likely in another file) - # module MyModule - # config :param_one, "another value" - # config :param_two, 98765, :force - # end - # - # The configuration is now: - # - # MyModule.config :param_one - # => "some value" # not changed - # MyModule.config :param_two - # => 98765 - # - # Configuration values can also be given as a Hash: - # - # MyModule.config :param1 => 'value1', :param2 => 'value2' - # - # Setting of these values can also be forced: - # - # MyModule.config :param1 => 'value3', :param2 => 'value4', :force => true - # - # A value of anything other than false or nil given for the :force key will - # result in the new values *always* being set. - def config(*args) - - raise "config expects at least one argument" if args.empty? - - # extract the arguments - if args[0].is_a?(Hash) - override = args[0][:force] - args[0].delete(:force) - args[0].each { |key, value| _handle_config(key, value, override)} - else - _handle_config(*args) - end - end - - private - # Actually set the config values - def _handle_config(name, value=nil, override=false) - if !self.const_defined?("CONFIG") - self.class_eval("CONFIG = {}") - end - - if value != nil - if override or self::CONFIG[name] == nil - self::CONFIG[name] = value - end - else - # if we pass an array of config keys to config(), - # get the array of values back - if name.is_a? Array - name.map { |c| self::CONFIG[c] } - else - self::CONFIG[name] - end - end - end -end \ No newline at end of file diff --git a/solr/client/ruby/flare/vendor/plugins/engines/lib/engines/plugin.rb b/solr/client/ruby/flare/vendor/plugins/engines/lib/engines/plugin.rb deleted file mode 100644 index 63d1db2ce87..00000000000 --- a/solr/client/ruby/flare/vendor/plugins/engines/lib/engines/plugin.rb +++ /dev/null @@ -1,214 +0,0 @@ -# An instance of Plugin is created for each plugin loaded by Rails, and -# stored in the Rails.plugins PluginList -# (see Engines::RailsExtensions::RailsInitializer for more details). -# -# Once the engines plugin is loaded, other plugins can take advantage of -# their own instances by accessing either Engines.current, or the preferred mechanism -# -# Rails.plugins[:plugin_name] -# -# Useful properties of this object include Plugin#version, which plugin developers -# can set in their init.rb scripts: -# -# Rails.plugins[:my_plugin].version = "1.4.2" -# -# Plugin developers can also access the contents of their about.yml files -# via Plugin#about, which returns a Hash if the about.yml file exists for -# this plugin. Note that if about.yml contains a "version" key, it will -# automatically be loaded into the version attribute described above. -# -# If this plugin contains paths in directories other than app/controllers, -# app/helpers, app/models and components, authors can -# declare this by adding extra paths to #code_paths: -# -# Rails.plugin[:my_plugin].code_paths << "app/sweepers" << "vendor/my_lib" -# -# Other properties of the Plugin instance can also be set. -class Plugin - - # The name of this plugin - attr_accessor :name - - # The directory in which this plugin is located - attr_accessor :root - - # The version of this plugin - attr_accessor :version - - # The about.yml information as a Hash, if it exists - attr_accessor :about - - # Plugins can add code paths to this attribute in init.rb if they - # need plugin directories to be added to the load path, i.e. - # - # plugin.code_paths << 'app/other_classes' - # - # Defaults to ["app/controllers", "app/helpers", "app/models", "components"] - # (see #default_code_paths). NOTE: if you want to set this, you must - # ensure that the engines plugin is loaded before any plugins which - # reference this since it's not available before the engines plugin has worked - # its magic. - attr_accessor :code_paths - - # Plugins can add paths to this attribute in init.rb if they need - # controllers loaded from additional locations. See also #default_controller_paths, and - # the caveat surrounding the #code_paths accessor. - attr_accessor :controller_paths - - # The directory in this plugin to mirror into the shared directory - # under +public+. See Engines.initialize_base_public_directory - # for more information. - # - # Defaults to "assets" (see default_public_directory). - attr_accessor :public_directory - - protected - - # The default set of code paths which will be added to $LOAD_PATH - # and Dependencies.load_paths - def default_code_paths - # lib will actually be removed from the load paths when we call - # uniq! in #inject_into_load_paths, but it's important to keep it - # around (for the documentation tasks, for instance). - %w(app/controllers app/helpers app/models components lib) - end - - # The default set of code paths which will be added to the routing system - def default_controller_paths - %w(app/controllers components) - end - - # Attempts to detect the directory to use for public files. - # If +assets+ exists in the plugin, this will be used. If +assets+ is missing - # but +public+ is found, +public+ will be used. - def default_public_directory - %w(assets public).select { |dir| File.directory?(File.join(root, dir)) }.first || "assets" - end - - public - - # Creates a new Plugin instance, and loads any other data from about.yml - def initialize(name, path) - @name = name - @root = path - - @code_paths = default_code_paths - @controller_paths = default_controller_paths - @public_directory = default_public_directory - - load_about_information - end - - # Load the information from about.yml. This Hash is then accessible - # from #about. - # - # If about.yml includes a "version", this will be assigned - # automatically into #version. - def load_about_information - about_path = File.join(self.root, 'about.yml') - if File.exist?(about_path) - @about = YAML.load(File.open(about_path).read) - @about.stringify_keys! - @version = @about["version"] - end - end - - # Load the plugin. Since Rails takes care of evaluating init.rb and - # adding +lib+ to the $LOAD_PATH, we don't need to do that here (see - # Engines::RailsExtensions::RailsInitializer.load_plugins_with_engine_additions). - # - # Here we add controller/helper code to the appropriate load paths (see - # #inject_into_load_path) and mirror the plugin assets into the shared public - # directory (#mirror_public_assets). - def load - logger.debug "Plugin '#{name}': starting load." - - inject_into_load_path - mirror_public_assets - - logger.debug "Plugin '#{name}': loaded." - end - - # Adds all directories in the +app+ and +lib+ directories within the engine - # to the three relevant load paths mechanism that Rails might use: - # - # * $LOAD_PATH - # * Dependencies.load_paths - # * ActionController::Routing.controller_paths - # - def inject_into_load_path - - load_path_index = $LOAD_PATH.index(Engines.rails_final_load_path) - dependency_index = ::Dependencies.load_paths.index(Engines.rails_final_dependency_load_path) - - # Add relevant paths under the engine root to the load path - code_paths.map { |p| File.join(root, p) }.each do |path| - if File.directory?(path) - # Add to the load paths - $LOAD_PATH.insert(load_path_index + 1, path) - # Add to the dependency system, for autoloading. - ::Dependencies.load_paths.insert(dependency_index + 1, path) - end - end - - # Add controllers to the Routing system specifically. We actually add our paths - # to the configuration too, since routing is started AFTER plugins are. Plugins - # which are loaded by engines specifically (i.e. because of the '*' in - # +config.plugins+) will need their paths added directly to the routing system, - # since at that point it has already been configured. - controller_paths.map { |p| File.join(root, p) }.each do |path| - if File.directory?(path) - ActionController::Routing.controller_paths << path - Rails.configuration.controller_paths << path - end - end - - $LOAD_PATH.uniq! - ::Dependencies.load_paths.uniq! - ActionController::Routing.controller_paths.uniq! - Rails.configuration.controller_paths.uniq! - end - - # Replicates the subdirectories under the plugins's +assets+ (or +public+) directory into - # the corresponding public directory. See also Plugin#public_directory for more. - def mirror_public_assets - - begin - source = File.join(root, self.public_directory) - # if there is no public directory, just return after this file - return if !File.exist?(source) - - logger.debug "Attempting to copy plugin plugin asset files from '#{source}' to '#{Engines.public_directory}'" - - Engines.mirror_files_from(source, File.join(Engines.public_directory, name)) - - rescue Exception => e - logger.warn "WARNING: Couldn't create the public file structure for plugin '#{name}'; Error follows:" - logger.warn e - end - end - - # The path to this plugin's public files - def public_asset_directory - "#{File.basename(Engines.public_directory)}/#{name}" - end - - # The directory containing this plugin's migrations (plugin/db/migrate) - def migration_directory - File.join(self.root, 'db', 'migrate') - end - - # Returns the version number of the latest migration for this plugin. Returns - # nil if this plugin has no migrations. - def latest_migration - migrations = Dir[migration_directory+"/*.rb"] - return nil if migrations.empty? - migrations.map { |p| File.basename(p) }.sort.last.match(/0*(\d+)\_/)[1].to_i - end - - # Migrate this plugin to the given version. See Engines::PluginMigrator for more - # information. - def migrate(version = nil) - Engines::PluginMigrator.migrate_plugin(self, version) - end -end \ No newline at end of file diff --git a/solr/client/ruby/flare/vendor/plugins/engines/lib/engines/plugin_list.rb b/solr/client/ruby/flare/vendor/plugins/engines/lib/engines/plugin_list.rb deleted file mode 100644 index a89d9899b40..00000000000 --- a/solr/client/ruby/flare/vendor/plugins/engines/lib/engines/plugin_list.rb +++ /dev/null @@ -1,31 +0,0 @@ -# The PluginList class is an array, enhanced to allow access to loaded plugins -# by name, and iteration over loaded plugins in order of priority. This array is used -# by Engines::RailsExtensions::RailsInitializer to create the Rails.plugins array. -# -# Each loaded plugin has a corresponding Plugin instance within this array, and -# the order the plugins were loaded is reflected in the entries in this array. -# -# For more information, see the Rails module. -class PluginList < Array - # Finds plugins with the set with the given name (accepts Strings or Symbols), or - # index. So, Rails.plugins[0] returns the first-loaded Plugin, and Rails.plugins[:engines] - # returns the Plugin instance for the engines plugin itself. - def [](name_or_index) - if name_or_index.is_a?(Fixnum) - super - else - self.find { |plugin| plugin.name.to_s == name_or_index.to_s } - end - end - - # Go through each plugin, highest priority first (last loaded first). Effectively, - # this is like Rails.plugins.reverse, except when given a block, when it behaves - # like Rails.plugins.reverse.each. - def by_precedence(&block) - if block_given? - reverse.each { |x| yield x } - else - reverse - end - end -end \ No newline at end of file diff --git a/solr/client/ruby/flare/vendor/plugins/engines/lib/engines/plugin_migrator.rb b/solr/client/ruby/flare/vendor/plugins/engines/lib/engines/plugin_migrator.rb deleted file mode 100644 index 795d36e715b..00000000000 --- a/solr/client/ruby/flare/vendor/plugins/engines/lib/engines/plugin_migrator.rb +++ /dev/null @@ -1,60 +0,0 @@ -# The PluginMigrator class contains the logic to run migrations from -# within plugin directories. The directory in which a plugin's migrations -# should be is determined by the Plugin#migration_directory method. -# -# To migrate a plugin, you can simple call the migrate method (Plugin#migrate) -# with the version number that plugin should be at. The plugin's migrations -# will then be used to migrate up (or down) to the given version. -# -# For more information, see Engines::RailsExtensions::Migrations -class Engines::PluginMigrator < ActiveRecord::Migrator - - # We need to be able to set the 'current' engine being migrated. - cattr_accessor :current_plugin - - # Runs the migrations from a plugin, up (or down) to the version given - def self.migrate_plugin(plugin, version) - self.current_plugin = plugin - migrate(plugin.migration_directory, version) - end - - # Returns the name of the table used to store schema information about - # installed plugins. - # - # See Engines.schema_info_table for more details. - def self.schema_info_table_name - ActiveRecord::Base.wrapped_table_name Engines.schema_info_table - end - - # Returns the current version of the given plugin - def self.current_version(plugin=current_plugin) - result = ActiveRecord::Base.connection.select_one(<<-ESQL - SELECT version FROM #{schema_info_table_name} - WHERE plugin_name = '#{plugin.name}' - ESQL - ) - if result - result["version"].to_i - else - # There probably isn't an entry for this engine in the migration info table. - # We need to create that entry, and set the version to 0 - ActiveRecord::Base.connection.execute(<<-ESQL - INSERT INTO #{schema_info_table_name} (version, plugin_name) - VALUES (0,'#{plugin.name}') - ESQL - ) - 0 - end - end - - # Sets the version of the plugin in Engines::PluginMigrator.current_plugin to - # the given version. - def set_schema_version(version) - ActiveRecord::Base.connection.update(<<-ESQL - UPDATE #{self.class.schema_info_table_name} - SET version = #{down? ? version.to_i - 1 : version.to_i} - WHERE plugin_name = '#{self.current_plugin.name}' - ESQL - ) - end -end diff --git a/solr/client/ruby/flare/vendor/plugins/engines/lib/engines/rails_extensions.rb b/solr/client/ruby/flare/vendor/plugins/engines/lib/engines/rails_extensions.rb deleted file mode 100644 index 36e76a919c0..00000000000 --- a/solr/client/ruby/flare/vendor/plugins/engines/lib/engines/rails_extensions.rb +++ /dev/null @@ -1,6 +0,0 @@ -# This module contains all the extensions that the engines plugin makes to -# Rails core. Explanations of how each extension works are included as RDoc -# documentation for each of the modules listed. -module Engines::RailsExtensions - # let's not rely *entirely* on Rails' magic modules. Not just yet. -end \ No newline at end of file diff --git a/solr/client/ruby/flare/vendor/plugins/engines/lib/engines/rails_extensions/active_record.rb b/solr/client/ruby/flare/vendor/plugins/engines/lib/engines/rails_extensions/active_record.rb deleted file mode 100644 index 15bb045ac7c..00000000000 --- a/solr/client/ruby/flare/vendor/plugins/engines/lib/engines/rails_extensions/active_record.rb +++ /dev/null @@ -1,19 +0,0 @@ -# Here we add a single helpful method to ActiveRecord::Base. This method may be deprecated -# in the future, since support for the Module#config mechanism which required it has -# also been dropped. -module Engines::RailsExtensions::ActiveRecord - # NOTE: Currently the Migrations system will ALWAYS wrap given table names - # in the prefix/suffix, so any table name set via ActiveRecord::Base#set_table_name, - # for instance will always get wrapped in the process of migration. For this - # reason, whatever value you give to the config will be wrapped when set_table_name - # is used in the model. - # - # This method is useful for determining the actual name (including prefix and - # suffix) that Rails will use for a model, given a particular set_table_name - # parameter. - def wrapped_table_name(name) - table_name_prefix + name + table_name_suffix - end -end - -::ActiveRecord::Base.extend(Engines::RailsExtensions::ActiveRecord) \ No newline at end of file diff --git a/solr/client/ruby/flare/vendor/plugins/engines/lib/engines/rails_extensions/dependencies.rb b/solr/client/ruby/flare/vendor/plugins/engines/lib/engines/rails_extensions/dependencies.rb deleted file mode 100644 index 07da01fdc2e..00000000000 --- a/solr/client/ruby/flare/vendor/plugins/engines/lib/engines/rails_extensions/dependencies.rb +++ /dev/null @@ -1,143 +0,0 @@ -# One of the magic features that that engines plugin provides is the ability to -# override selected methods in controllers and helpers from your application. -# This is achieved by trapping requests to load those files, and then mixing in -# code from plugins (in the order the plugins were loaded) before finally loading -# any versions from the main +app+ directory. -# -# The behaviour of this extension is output to the log file for help when -# debugging. -# -# == Example -# -# A plugin contains the following controller in plugin/app/controllers/my_controller.rb: -# -# class MyController < ApplicationController -# def index -# @name = "HAL 9000" -# end -# def list -# @robots = Robot.find(:all) -# end -# end -# -# In one application that uses this plugin, we decide that the name used in the -# index action should be "Robbie", not "HAL 9000". To override this single method, -# we create the corresponding controller in our application -# (RAILS_ROOT/app/controllers/my_controller.rb), and redefine the method: -# -# class MyController < ApplicationController -# def index -# @name = "Robbie" -# end -# end -# -# The list method remains as it was defined in the plugin controller. -# -# The same basic principle applies to helpers, and also views and partials (although -# view overriding is performed in Engines::RailsExtensions::Templates; see that -# module for more information). -# -# === What about models? -# -# Unfortunately, it's not possible to provide this kind of magic for models. -# The only reason why it's possible for controllers and helpers is because -# they can be recognised by their filenames ("whatever_controller", "jazz_helper"), -# whereas models appear the same as any other typical Ruby library ("node", -# "user", "image", etc.). -# -# If mixing were allowed in models, it would mean code mixing for *every* -# file that was loaded via +require_or_load+, and this could result in -# problems where, for example, a Node model might start to include -# functionality from another file called "node" somewhere else in the -# $LOAD_PATH. -# -# One way to overcome this is to provide model functionality as a module in -# a plugin, which developers can then include into their own model -# implementations. -# -# Another option is to provide an abstract model (see the ActiveRecord::Base -# documentation) and have developers subclass this model in their own -# application if they must. -# -# --- -# -# The Engines::RailsExtensions::Dependencies module includes a method to -# override Dependencies.require_or_load, which is called to load code needed -# by Rails as it encounters constants that aren't defined. -# -# This method is enhanced with the code-mixing features described above. -# -module Engines::RailsExtensions::Dependencies - def self.included(base) #:nodoc: - base.class_eval { alias_method_chain :require_or_load, :engine_additions } - end - - # Attempt to load the given file from any plugins, as well as the application. - # This performs the 'code mixing' magic, allowing application controllers and - # helpers to override single methods from those in plugins. - # If the file can be found in any plugins, it will be loaded first from those - # locations. Finally, the application version is loaded, using Ruby's behaviour - # to replace existing methods with their new definitions. - # - # If Engines.disable_code_mixing == true, the first controller/helper on the - # $LOAD_PATH will be used (plugins' +app+ directories are always lower on the - # $LOAD_PATH than the main +app+ directory). - # - # If Engines.disable_application_code_loading == true, controllers will - # not be loaded from the main +app+ directory *if* they are present in any - # plugins. - # - # Returns true if the file could be loaded (from anywhere); false otherwise - - # mirroring the behaviour of +require_or_load+ from Rails (which mirrors - # that of Ruby's own +require+, I believe). - def require_or_load_with_engine_additions(file_name, const_path=nil) - return require_or_load_without_engine_additions(file_name, const_path) if Engines.disable_code_mixing - - file_loaded = false - - # try and load the plugin code first - # can't use model, as there's nothing in the name to indicate that the file is a 'model' file - # rather than a library or anything else. - ['controller', 'helper'].each do |file_type| - # if we recognise this type - # (this regexp splits out the module/filename from any instances of app/#{type}, so that - # modules are still respected.) - if file_name =~ /^(.*app\/#{file_type}s\/)?(.*_#{file_type})(\.rb)?$/ - base_name = $2 - # ... go through the plugins from first started to last, so that - # code with a high precedence (started later) will override lower precedence - # implementations - Rails.plugins.each do |plugin| - plugin_file_name = File.expand_path(File.join(plugin.root, 'app', "#{file_type}s", base_name)) - logger.debug("checking plugin '#{plugin.name}' for '#{base_name}'") - if File.file?("#{plugin_file_name}.rb") - logger.debug("==> loading from plugin '#{plugin.name}'") - file_loaded = true if require_or_load_without_engine_additions(plugin_file_name, const_path) - end - end - - # finally, load any application-specific controller classes using the 'proper' - # rails load mechanism, EXCEPT when we're testing engines and could load this file - # from an engine - if Engines.disable_application_code_loading - logger.debug("loading from application disabled.") - else - # Ensure we are only loading from the /app directory at this point - app_file_name = File.join(RAILS_ROOT, 'app', "#{file_type}s", "#{base_name}") - if File.file?("#{app_file_name}.rb") - logger.debug("loading from application: #{base_name}") - file_loaded = true if require_or_load_without_engine_additions(app_file_name, const_path) - else - logger.debug("(file not found in application)") - end - end - end - end - - # if we managed to load a file, return true. If not, default to the original method. - # Note that this relies on the RHS of a boolean || not to be evaluated if the LHS is true. - file_loaded || require_or_load_without_engine_additions(file_name, const_path) - end -end - -::Dependencies.send(:include, Engines::RailsExtensions::Dependencies) \ No newline at end of file diff --git a/solr/client/ruby/flare/vendor/plugins/engines/lib/engines/rails_extensions/migrations.rb b/solr/client/ruby/flare/vendor/plugins/engines/lib/engines/rails_extensions/migrations.rb deleted file mode 100644 index 2c4d93ab7a5..00000000000 --- a/solr/client/ruby/flare/vendor/plugins/engines/lib/engines/rails_extensions/migrations.rb +++ /dev/null @@ -1,155 +0,0 @@ -# Contains the enhancements to Rails' migrations system to support the -# Engines::PluginMigrator. See Engines::RailsExtensions::Migrations for more -# information. - -require "engines/plugin_migrator" - -# = Plugins and Migrations: Background -# -# Rails uses migrations to describe changes to the databases as your application -# evolves. Each change to your application - adding and removing models, most -# commonly - might require tweaks to your schema in the form of new tables, or new -# columns on existing tables, or possibly the removal of tables or columns. Migrations -# can even include arbitrary code to *transform* data as the underlying schema -# changes. -# -# The point is that at any particular stage in your application's development, -# migrations serve to transform the database into a state where it is compatible -# and appropriate at that time. -# -# == What about plugins? -# -# If you want to share models using plugins, chances are that you might also -# want to include the corresponding migrations to create tables for those models. -# With the engines plugin installed, plugins can carry migration data easily: -# -# vendor/ -# | -# plugins/ -# | -# my_plugin/ -# |- init.rb -# |- lib/ -# |- db/ -# |-migrate/ -# |- 001_do_something.rb -# |- 002_and_something_else.rb -# |- ... -# -# When you install a plugin which contains migrations, you are undertaking a -# further step in the development of your application, the same as the addition -# of any other code. With this in mind, you may want to 'roll back' the -# installation of this plugin at some point, and the database should be able -# to migrate back to the point without this plugin in it too. -# -# == An example -# -# For example, our current application is at version 14 (according to the -# +schema_info+ table), when we decide that we want to add a tagging plugin. The -# tagging plugin chosen includes migrations to create the tables it requires -# (say, _tags_ and _taggings_, for instance), along with the models and helpers -# one might expect. -# -# After installing this plugin, these tables should be created in our database. -# Rather than running the migrations directly from the plugin, they should be -# integrated into our main migration stream in order to accurately reflect the -# state of our application's database *at this moment in time*. -# -# $ script/generate plugin_migration -# exists db/migrate -# create db/migrate/015_migrate_tagging_plugin_to_version_3.rb -# -# This migration will take our application to version 15, and contains the following, -# typical migration code: -# -# class MigrateTaggingPluginToVersion3 < ActiveRecord::Migration -# def self.up -# Rails.plugins[:tagging].migrate(3) -# end -# def self.down -# Rails.plugins[:tagging].migrate(0) -# end -# end -# -# When we migrate our application up, using rake db:migrate as normal, -# the plugin will be migrated up to its latest version (3 in this example). If we -# ever decide to migrate the application back to the state it was in at version 14, -# the plugin migrations will be taken back down to version 0 (which, typically, -# would remove all tables the plugin migrations define). -# -# == Upgrading plugins -# -# It might happen that later in an application's life, we update to a new version of -# the tagging plugin which requires some changes to our database. The tagging plugin -# provides these changes in the form of its own migrations. -# -# In this case, we just need to re-run the plugin_migration generator to create a -# new migration from the current revision to the newest one: -# -# $ script/generate plugin_migration -# exists db/migrate -# create db/migrate/023_migrate_tagging_plugin_to_version_5.rb -# -# The contents of this migration are: -# -# class MigrateTaggingPluginToVersion3 < ActiveRecord::Migration -# def self.up -# Rails.plugins[:tagging].migrate(5) -# end -# def self.down -# Rails.plugins[:tagging].migrate(3) -# end -# end -# -# Notice that if we were to migrate down to revision 22 or lower, the tagging plugin -# will be migrated back down to version 3 - the version we were previously at. -# -# -# = Creating migrations in plugins -# -# In order to use the plugin migration functionality that engines provides, a plugin -# only needs to provide regular migrations in a db/migrate folder within it. -# -# = Explicitly migrating plugins -# -# It's possible to migrate plugins within your own migrations, or any other code. -# Simply get the Plugin instance, and its Plugin#migrate method with the version -# you wish to end up at: -# -# Rails.plugins[:whatever].migrate(version) -# -# --- -# -# The Engines::RailsExtensions::Migrations module defines extensions for Rails' -# migration systems. Specifically: -# -# * Adding a hook to initialize_schema_information to create the plugin schema -# info table. -# -module Engines::RailsExtensions::Migrations - def self.included(base) # :nodoc: - base.class_eval { alias_method_chain :initialize_schema_information, :engine_additions } - end - - # Create the schema tables, and ensure that the plugin schema table - # is also initialized. The plugin schema info table is defined by - # Engines::PluginMigrator.schema_info_table_name. - def initialize_schema_information_with_engine_additions - initialize_schema_information_without_engine_additions - - # create the plugin schema stuff. - begin - execute <<-ESQL - CREATE TABLE #{Engines::PluginMigrator.schema_info_table_name} - (plugin_name #{type_to_sql(:string)}, version #{type_to_sql(:integer)}) - ESQL - rescue ActiveRecord::StatementInvalid - # Schema has been initialized - end - end -end - -::ActiveRecord::ConnectionAdapters::SchemaStatements.send(:include, Engines::RailsExtensions::Migrations) - -# Set ActiveRecord to ignore the plugin schema table by default -::ActiveRecord::SchemaDumper.ignore_tables << Engines.schema_info_table \ No newline at end of file diff --git a/solr/client/ruby/flare/vendor/plugins/engines/lib/engines/rails_extensions/public_asset_helpers.rb b/solr/client/ruby/flare/vendor/plugins/engines/lib/engines/rails_extensions/public_asset_helpers.rb deleted file mode 100644 index 7f7a02e3de8..00000000000 --- a/solr/client/ruby/flare/vendor/plugins/engines/lib/engines/rails_extensions/public_asset_helpers.rb +++ /dev/null @@ -1,116 +0,0 @@ -# The engines plugin makes it trivial to share public assets using plugins. -# To do this, include an assets directory within your plugin, and put -# your javascripts, stylesheets and images in subdirectories of that folder: -# -# my_plugin -# |- init.rb -# |- lib/ -# |- assets/ -# |- javascripts/ -# | |- my_functions.js -# | -# |- stylesheets/ -# | |- my_styles.css -# | -# |- images/ -# |- my_face.jpg -# -# Files within the asset structure are automatically mirrored into -# a publicly-accessible folder each time your application starts (see -# Plugin#mirror_public_assets). -# -# -# == Using plugin assets in views -# -# It's also simple to use Rails' helpers in your views to use plugin assets. -# The default helper methods have been enhanced by the engines plugin to accept -# a :plugin option, indicating the plugin containing the desired asset. -# -# For example, it's easy to use plugin assets in your layouts: -# -# <%= stylesheet_link_tag "my_styles", :plugin => "my_plugin", :media => "screen" %> -# <%= javascript_include_tag "my_functions", :plugin => "my_plugin" %> -# -# ... and similarly in views and partials, it's easy to use plugin images: -# -# <%= image_tag "my_face", :plugin => "my_plugin" %> -# -# <%= image_path "my_face", :plugin => "my_plugin" %> -# -# Where the default helpers allow the specification of more than one file (i.e. the -# javascript and stylesheet helpers), you can do similarly for multiple assets from -# within a single plugin. -# -# --- -# -# This module enhances four of the methods from ActionView::Helpers::AssetTagHelper: -# -# * stylesheet_link_tag -# * javascript_include_tag -# * image_path -# * image_tag -# -# Each one of these methods now accepts the key/value pair :plugin => "plugin_name", -# which can be used to specify the originating plugin for any assets. -# -module Engines::RailsExtensions::PublicAssetHelpers - def self.included(base) #:nodoc: - base.class_eval do - [:stylesheet_link_tag, :javascript_include_tag, :image_path, :image_tag].each do |m| - alias_method_chain m, :engine_additions - end - end - end - - # Adds plugin functionality to Rails' default stylesheet_link_tag method. - def stylesheet_link_tag_with_engine_additions(*sources) - stylesheet_link_tag_without_engine_additions(*Engines::RailsExtensions::PublicAssetHelpers.pluginify_sources("stylesheets", *sources)) - end - - # Adds plugin functionality to Rails' default javascript_include_tag method. - def javascript_include_tag_with_engine_additions(*sources) - javascript_include_tag_without_engine_additions(*Engines::RailsExtensions::PublicAssetHelpers.pluginify_sources("javascripts", *sources)) - end - - #-- - # Our modified image_path now takes a 'plugin' option, though it doesn't require it - #++ - - # Adds plugin functionality to Rails' default image_path method. - def image_path_with_engine_additions(source, options={}) - options.stringify_keys! - source = Engines::RailsExtensions::PublicAssetHelpers.plugin_asset_path(options["plugin"], "images", source) if options["plugin"] - image_path_without_engine_additions(source) - end - - # Adds plugin functionality to Rails' default image_tag method. - def image_tag_with_engine_additions(source, options={}) - options.stringify_keys! - if options["plugin"] - source = Engines::RailsExtensions::PublicAssetHelpers.plugin_asset_path(options["plugin"], "images", source) - options.delete("plugin") - end - image_tag_without_engine_additions(source, options) - end - - #-- - # The following are methods on this module directly because of the weird-freaky way - # Rails creates the helper instance that views actually get - #++ - - # Convert sources to the paths for the given plugin, if any plugin option is given - def self.pluginify_sources(type, *sources) - options = sources.last.is_a?(Hash) ? sources.pop.stringify_keys : { } - sources.map! { |s| plugin_asset_path(options["plugin"], type, s) } if options["plugin"] - options.delete("plugin") # we don't want it appearing in the HTML - sources << options # re-add options - end - - # Returns the publicly-addressable relative URI for the given asset, type and plugin - def self.plugin_asset_path(plugin_name, type, asset) - raise "No plugin called '#{plugin_name}' - please use the full name of a loaded plugin." if Rails.plugins[plugin_name].nil? - "/#{Rails.plugins[plugin_name].public_asset_directory}/#{type}/#{asset}" - end -end - -::ActionView::Helpers::AssetTagHelper.send(:include, Engines::RailsExtensions::PublicAssetHelpers) \ No newline at end of file diff --git a/solr/client/ruby/flare/vendor/plugins/engines/lib/engines/rails_extensions/rails.rb b/solr/client/ruby/flare/vendor/plugins/engines/lib/engines/rails_extensions/rails.rb deleted file mode 100644 index 5ae0a3ac13f..00000000000 --- a/solr/client/ruby/flare/vendor/plugins/engines/lib/engines/rails_extensions/rails.rb +++ /dev/null @@ -1,20 +0,0 @@ -# In order to give a richer infrastructure for dealing with plugins, the engines -# plugin adds two new attributes to the Rails module: -# -# [+plugins+] A PluginList instance which holds the currently loaded plugins -# [+configuration+] The current Rails::Configuration instance, so that we can -# query any parameters that might be set *after* Rails has -# loaded, as well as during plugin initialization -# -#-- -# Here we just re-open the Rails module and add our custom accessors; it -# may be cleaner to seperate them into a module, but in this case that seems -# like overkill. -#++ -module Rails - # The set of all loaded plugins - mattr_accessor :plugins - - # The Rails::Initializer::Configuration object - mattr_accessor :configuration -end diff --git a/solr/client/ruby/flare/vendor/plugins/engines/lib/engines/rails_extensions/rails_initializer.rb b/solr/client/ruby/flare/vendor/plugins/engines/lib/engines/rails_extensions/rails_initializer.rb deleted file mode 100644 index 5686b526e98..00000000000 --- a/solr/client/ruby/flare/vendor/plugins/engines/lib/engines/rails_extensions/rails_initializer.rb +++ /dev/null @@ -1,86 +0,0 @@ -# Enhances the Rails::Initializer class to be a bit smarter about -# plugins. See Engines::RailsExtensions::RailsInitializer for more -# details. - -require "engines/rails_extensions/rails" -require 'engines/plugin_list' - -# The engines plugin changes the way that Rails actually loads other plugins. -# It creates instances of the Plugin class to represent each plugin, stored -# in the Rails.plugins PluginList. -# -# --- -# -# Three methods from the original Rails::Initializer module are overridden -# by Engines::RailsExtensions::RailsInitializer: -# -# [+load_plugin+] which now creates Plugin instances and calls Plugin#load -# [+after_initialize+] which now performs Engines.after_initialize in addition -# to the given config block -# [plugin_enabled?] which now respects the result of -# Engines.load_all_plugins? -# -module Engines::RailsExtensions::RailsInitializer - def self.included(base) #:nodoc: - base.class_eval do - alias_method_chain :load_plugin, :engine_additions - alias_method_chain :after_initialize, :engine_additions - alias_method_chain :plugin_enabled?, :engine_additions - end - end - - # Loads all plugins in configuration.plugin_paths, regardless of the contents - # of configuration.plugins - def load_all_plugins - # a nil value implies we don't care about plugins; load 'em all in a reliable order - find_plugins(configuration.plugin_paths).sort.each { |path| load_plugin path } - end - - # Loads a plugin, performing the extra load path/public file magic of - # engines by calling Plugin#load. - def load_plugin_with_engine_additions(directory) - name = plugin_name(directory) - return false if loaded_plugins.include?(name) - - logger.debug "loading plugin from #{directory} with engine additions" - - # add the Plugin object - plugin = Plugin.new(plugin_name(directory), directory) - Rails.plugins << plugin - - # do the other stuff that load_plugin used to do. This includes - # allowing the plugin's init.rb to set configuration options on - # it's instance, which can then be used in it's initialization - load_plugin_without_engine_additions(directory) - - # perform additional loading tasks like mirroring public assets - # and adding app directories to the appropriate load paths - plugin.load - - true - end - - # Allow the engines plugin to do whatever it needs to do after Rails has - # loaded, and then call the actual after_initialize block. Currently, this - # is call Engines.after_initialize. - def after_initialize_with_engine_additions - Engines.after_initialize - after_initialize_without_engine_additions - end - - protected - - # Returns true if the plugin at the given path should be loaded; false - # otherwise. If Engines.load_all_plugins? is true, this method will return - # true regardless of the path given. - def plugin_enabled_with_engine_additions?(path) - Engines.load_all_plugins? || plugin_enabled_without_engine_additions?(path) - end - - # Returns the name of the plugin at the given path. - def plugin_name(path) - File.basename(path) - end -end - -::Rails::Initializer.send(:include, Engines::RailsExtensions::RailsInitializer) \ No newline at end of file diff --git a/solr/client/ruby/flare/vendor/plugins/engines/lib/engines/rails_extensions/routing.rb b/solr/client/ruby/flare/vendor/plugins/engines/lib/engines/rails_extensions/routing.rb deleted file mode 100644 index f21d61ec216..00000000000 --- a/solr/client/ruby/flare/vendor/plugins/engines/lib/engines/rails_extensions/routing.rb +++ /dev/null @@ -1,77 +0,0 @@ -# Effective use of Rails' routes can help create a tidy and elegant set of URLs, -# and is a significant part of creating an external API for your web application. -# -# When developing plugins which contain controllers, it seems obvious that including -# the corresponding routes would be extremely useful. This is particularly true -# when exposing RESTful resources using the new REST-ian features of Rails 1.2. -# -# == Including routes in your plugin -# -# The engines plugin makes it possible to include a set of routes within your plugin -# very simply, as it turns out. In your plugin, you simply include a routes.rb -# file like the one below at the root of your plugin: -# -# connect "/login", :controller => "my_plugin/account", :action => "login" -# -# # add a named route -# logout "/logout", :controller => "my_plugin/account", :action => "logout" -# -# # some restful stuff -# resources :things do |t| -# t.resources :other_things -# end -# -# Everywhere in a normal RAILS_ROOT/config/routes.rb file -# where you might have map.connect, you just use connect in your -# plugin's routes.rb. -# -# === Hooking it up in your application -# -# While it would be possible to have each plugin's routes automagically included into -# the application's route set, to do so would actually be a stunningly bad idea. Route -# priority is the key issue here. You, the application developer, needs to be in complete -# control when it comes to specifying the priority of routes in your application, since -# the ordering of your routes directly affects how Rails will interpret incoming requests. -# -# To add plugin routes into your application's routes.rb file, you need to explicitly -# map them in using the Engines::RailsExtensions::Routing#from_plugin method: -# -# ApplicationController::Routing::Routes.draw do |map| -# -# map.connect "/app_stuff", :controller => "application_thing" # etc... -# -# # This line includes the routes from the given plugin at this point, giving you -# # control over the priority of your application routes -# map.from_plugin :your_plugin -# -# map.connect ":controller/:action/:id" -# end -# -# By including routes in plugins which have controllers, you can now share in a simple way -# a compact and elegant URL scheme which corresponds to those controllers. -# -# --- -# -# The Engines::RailsExtensions::Routing module defines extensions to Rails' -# routing (ActionController::Routing) mechanism such that routes can be loaded -# from a given plugin. -# -# The key method is Engines::RailsExtensions::Routing#from_plugin, which can be called -# within your application's config/routes.rb file to load plugin routes at that point. -# -module Engines::RailsExtensions::Routing - # Loads the set of routes from within a plugin and evaluates them at this - # point within an application's main routes.rb file. - # - # Plugin routes are loaded from /routes.rb. - def from_plugin(name) - # At the point in which routing is loaded, we cannot guarantee that all - # plugins are in Rails.plugins, so instead we need to use find_plugin_path - path = Engines.find_plugin_path(name) - routes_path = File.join(path, name.to_s, "routes.rb") - logger.debug "loading routes from #{routes_path}" - eval(IO.read(routes_path), binding, routes_path) if File.file?(routes_path) - end -end - -::ActionController::Routing::RouteSet::Mapper.send(:include, Engines::RailsExtensions::Routing) \ No newline at end of file diff --git a/solr/client/ruby/flare/vendor/plugins/engines/lib/engines/rails_extensions/templates.rb b/solr/client/ruby/flare/vendor/plugins/engines/lib/engines/rails_extensions/templates.rb deleted file mode 100644 index 6cad6e261e9..00000000000 --- a/solr/client/ruby/flare/vendor/plugins/engines/lib/engines/rails_extensions/templates.rb +++ /dev/null @@ -1,140 +0,0 @@ -# As well as providing code overloading for controllers and helpers -# (see Engines::RailsExtensions::Dependencies), the engines plugin also allows -# developers to selectively override views and partials within their application. -# -# == An example -# -# This is achieved in much the same way as controller overriding. Our plugin contains -# a view to be rendered at the URL /test/hello, in -# our_plugin/app/views/test/hello.rhtml: -# -#
    Hi, <%= @dude.name %>, what's up?
    -# -# If in a particular application we're not happy with this message, we can override -# it by replacing the partial in our own application - -# RAILS_ROOT/app/views/test/hello.rhtml: -# -#
    Wassup <%= @dude.name %>. -# Waaaaassaaaaaaaaup
    -# -# This view will then be rendered in favour of that in the plugin. -# -module Engines::RailsExtensions::Templates - - # Override the finding of partials and views. This is achieved by wrapping - # the (private) method #full_template_path_with_engine_additions, that checks - # for the given template within plugins as well as the application. - module ActionView - def self.included(base) #:nodoc: - base.class_eval { alias_method_chain :full_template_path, :engine_additions } - end - - private - def full_template_path_with_engine_additions(template_path, extension) - path_in_app_directory = full_template_path_from_application(template_path, extension) - - # First check for this template in the application. If it exists, the user has - # overridden anything from the plugin, so use it (unless we're testing plugins; - # see full_template_path_from_application()) - return path_in_app_directory if path_in_app_directory && File.exist?(path_in_app_directory) - - # Otherwise, check in the plugins to see if the template can be found there. - # Load this in order so that more recently started plugins will take priority. - Rails.plugins.by_precedence do |plugin| - plugin_specific_path = File.join(plugin.root, 'app', 'views', - template_path.to_s + '.' + extension.to_s) - return plugin_specific_path if File.exist?(plugin_specific_path) - end - - # If it cannot be found anywhere, return the default path. - return full_template_path_without_engine_additions(template_path, extension) - end - - # Return a path to this template within our default app/views directory. - # In some circumstances, we may wish to prevent users from overloading views, - # such as when we are testing plugins with views. In this case, return "". - def full_template_path_from_application(template_path, extension) - if Engines.disable_application_view_loading - nil - else - full_template_path_without_engine_additions(template_path, extension) - end - end - end - - - # The Layout module overrides a single (private) method in ActionController::Layout::ClassMethods, - # called #layout_list. This method now returns an array of layouts, including those in plugins. - module Layout - def self.included(base) #:nodoc: - base.class_eval { alias_method_chain :layout_list, :engine_additions } - end - - private - # Return the list of layouts, including any in the app/views/layouts - # directories of loaded plugins. - def layout_list_with_engine_additions - plugin_layouts = Rails.plugins.by_precedence.map do |p| - File.join(p.root, "app", "views", "layouts") - end - layout_list_without_engine_additions + Dir["{#{plugin_layouts.join(",")}}/**/*"] - end - end - - - # The way ActionMailer is coded in terms of finding templates is very restrictive, to the point - # where all templates for rendering must exist under the single base path. This is difficult to - # work around without re-coding significant parts of the action mailer code. - # - # --- - # - # The MailTemplates module overrides two (private) methods from ActionMailer to enable mail - # templates within plugins: - # - # [+template_path+] which now produces the contents of #template_paths - # [+render+] which now find the first matching template and creates an ActionVew::Base - # instance with the correct @base_path for that template - module MailTemplates - def self.included(base) #:nodoc: - base.class_eval do - alias_method_chain :template_path, :engine_additions - alias_method_chain :render, :engine_additions - end - end - - private - # Returns all possible template paths for the current mailer, including those - # within the loaded plugins. - def template_paths - paths = Rails.plugins.by_precedence.map { |p| "#{p.root}/app/views/#{mailer_name}" } - paths.unshift(template_path_without_engine_additions) unless Engines.disable_application_view_loading - paths - end - - # Return something that Dir[] can glob against. This method is called in - # ActionMailer::Base#create! and used as part of an argument to Dir. We can - # take advantage of this by using some of the features of Dir.glob to search - # multiple paths for matching files. - def template_path_with_engine_additions - "{#{template_paths.join(",")}}" - end - - # We've broken this up so that we can dynamically alter the base_path that ActionView - # is rendering from so that templates can be located from plugins. - def render_with_engine_additions(opts) - template_path_for_method = Dir["#{template_path}/#{opts[:file]}*"].first - body = opts.delete(:body) - i = initialize_template_class(body) - i.base_path = File.dirname(template_path_for_method) - i.render(opts) - end - end -end - - -::ActionView::Base.send(:include, Engines::RailsExtensions::Templates::ActionView) -::ActionController::Layout::ClassMethods.send(:include, Engines::RailsExtensions::Templates::Layout) - -if Object.const_defined?(:ActionMailer) # We don't need to do this if ActionMailer hasn't been loaded. - ::ActionMailer::Base.send(:include, Engines::RailsExtensions::Templates::MailTemplates) -end \ No newline at end of file diff --git a/solr/client/ruby/flare/vendor/plugins/engines/lib/engines/testing.rb b/solr/client/ruby/flare/vendor/plugins/engines/lib/engines/testing.rb deleted file mode 100644 index 364f992ec66..00000000000 --- a/solr/client/ruby/flare/vendor/plugins/engines/lib/engines/testing.rb +++ /dev/null @@ -1,87 +0,0 @@ -# Contains the enhancements to assist in testing plugins. See Engines::Testing -# for more details. - -require 'test/unit' - -require 'tmpdir' -require 'fileutils' - -# In most cases, Rails' own plugin testing mechanisms are sufficient. However, there -# are cases where plugins can be given a helping hand in the testing arena. This module -# contains some methods to assist when testing plugins that contain fixtures. -# -# == Fixtures and plugins -# -# Since Rails' own fixtures method is fairly strict about where files can be loaded from, -# the simplest approach when running plugin tests with fixtures is to simply copy all -# fixtures into a single temporary location and inform the standard Rails mechanism to -# use this directory, rather than RAILS_ROOT/test/fixtures. -# -# The Engines::Testing#setup_plugin_fixtures method does this, copying all plugin fixtures -# into the temporary location before and tests are performed. This behaviour is invoked -# the the rake tasks provided by the Engines plugin, in the "test:plugins" namespace. If -# necessary, you can invoke the task manually. -# -# If you wish to take advantage of this, add a call to the Engines::Testing.set_fixture_path -# method somewhere before your tests (in a test_helper file, or above the TestCase itself). -# -# = Testing plugins -# -# Normally testing a plugin will require that Rails is loaded, unless you are including -# a skeleton Rails environment or set of mocks within your plugin tests. If you require -# the Rails environment to be started, you must ensure that this actually happens; while -# it's not obvious, your tests do not automatically run with Rails loaded. -# -# The simplest way to setup plugin tests is to include a test helper with the following -# contents: -# -# # Load the normal Rails helper. This ensures the environment is loaded -# require File.expand_path(File.dirname(__FILE__) + '/../../../../test/test_helper') -# # Ensure that we are using the temporary fixture path -# Engines::Testing.set_fixture_path -# -# Then run tests using the provided tasks (test:plugins, or the tasks that the engines -# plugin provides - test:plugins:units, etc.). -# -# Alternatively, you can explicitly load the environment by adpating the contents of the -# default test_helper: -# -# ENV["RAILS_ENV"] = "test" -# # Note that we are requiring config/environment from the root of the enclosing application. -# require File.expand_path(File.dirname(__FILE__) + "/../../../../config/environment") -# require 'test_help' -# -module Engines::Testing - mattr_accessor :temporary_fixtures_directory - self.temporary_fixtures_directory = FileUtils.mkdir_p(File.join(Dir.tmpdir, "rails_fixtures")) - - # Copies fixtures from plugins and the application into a temporary directory - # (Engines::Testing.temporary_fixtures_directory). - # - # If a set of plugins is not given, fixtures are copied from all plugins in order - # of precedence, meaning that plugins can 'overwrite' the fixtures of others if they are - # loaded later; the application's fixtures are copied last, allowing any custom fixtures - # to override those in the plugins. If no argument is given, plugins are loaded via - # PluginList#by_precedence. - # - # This method is called by the engines-supplied plugin testing rake tasks - def self.setup_plugin_fixtures(plugins=Rails.plugins.by_precedence) - - # Copy all plugin fixtures, and then the application fixtures, into this directory - plugins.each do |plugin| - plugin_fixtures_directory = File.join(plugin.root, "test", "fixtures") - if File.directory?(plugin_fixtures_directory) - Engines.mirror_files_from(plugin_fixtures_directory, self.temporary_fixtures_directory) - end - end - Engines.mirror_files_from(File.join(RAILS_ROOT, "test", "fixtures"), - self.temporary_fixtures_directory) - end - - # Sets the fixture path used by Test::Unit::TestCase to the temporary - # directory which contains all plugin fixtures. - def self.set_fixture_path - Test::Unit::TestCase.fixture_path = self.temporary_fixtures_directory - $LOAD_PATH.unshift self.temporary_fixtures_directory - end -end \ No newline at end of file diff --git a/solr/client/ruby/flare/vendor/plugins/engines/tasks/engines.rake b/solr/client/ruby/flare/vendor/plugins/engines/tasks/engines.rake deleted file mode 100644 index 1d644352e84..00000000000 --- a/solr/client/ruby/flare/vendor/plugins/engines/tasks/engines.rake +++ /dev/null @@ -1,149 +0,0 @@ -# This code lets us redefine existing Rake tasks, which is extremely -# handy for modifying existing Rails rake tasks. -# Credit for this snippet of code goes to Jeremy Kemper -# http://pastie.caboo.se/9620 -unless Rake::TaskManager.methods.include?(:redefine_task) - module Rake - module TaskManager - def redefine_task(task_class, args, &block) - task_name, deps = resolve_args(args) - task_name = task_class.scope_name(@scope, task_name) - deps = [deps] unless deps.respond_to?(:to_ary) - deps = deps.collect {|d| d.to_s } - task = @tasks[task_name.to_s] = task_class.new(task_name, self) - task.application = self - task.add_comment(@last_comment) - @last_comment = nil - task.enhance(deps, &block) - task - end - end - class Task - class << self - def redefine_task(args, &block) - Rake.application.redefine_task(self, args, &block) - end - end - end - end -end - - -namespace :db do - namespace :fixtures do - namespace :plugins do - - desc "Load plugin fixtures into the current environment's database." - task :load => :environment do - require 'active_record/fixtures' - ActiveRecord::Base.establish_connection(RAILS_ENV.to_sym) - Dir.glob(File.join(RAILS_ROOT, 'vendor', 'plugins', ENV['PLUGIN'] || '**', - 'test', 'fixtures', '*.yml')).each do |fixture_file| - Fixtures.create_fixtures(File.dirname(fixture_file), File.basename(fixture_file, '.*')) - end - end - - end - end -end - -# this is just a modification of the original task in railties/lib/tasks/documentation.rake, -# because the default task doesn't support subdirectories like /app or -# /component. These tasks now include every file under a plugin's code paths (see -# Plugin#code_paths). -namespace :doc do - - plugins = FileList['vendor/plugins/**'].collect { |plugin| File.basename(plugin) } - - namespace :plugins do - - # Define doc tasks for each plugin - plugins.each do |plugin| - desc "Create plugin documentation for '#{plugin}'" - Rake::Task.redefine_task(plugin => :environment) do - plugin_base = RAILS_ROOT + "/vendor/plugins/#{plugin}" - options = [] - files = Rake::FileList.new - options << "-o doc/plugins/#{plugin}" - options << "--title '#{plugin.titlecase} Plugin Documentation'" - options << '--line-numbers' << '--inline-source' - options << '-T html' - - # Include every file in the plugin's code_paths (see Plugin#code_paths) - if Rails.plugins[plugin] - files.include("#{plugin_base}/{#{Rails.plugins[plugin].code_paths.join(",")}}/**/*.rb") - end - if File.exists?("#{plugin_base}/README") - files.include("#{plugin_base}/README") - options << "--main '#{plugin_base}/README'" - end - files.include("#{plugin_base}/CHANGELOG") if File.exists?("#{plugin_base}/CHANGELOG") - - if files.empty? - puts "No source files found in #{plugin_base}. No documentation will be generated." - else - options << files.to_s - sh %(rdoc #{options * ' '}) - end - end - end - end -end - - - -namespace :test do - task :warn_about_multiple_plugin_testing_with_engines do - puts %{-~============== A Moste Polite Warninge ===========================~- - -You may experience issues testing multiple plugins at once when using -the code-mixing features that the engines plugin provides. If you do -experience any problems, please test plugins individually, i.e. - - $ rake test:plugins PLUGIN=my_plugin - -or use the per-type plugin test tasks: - - $ rake test:plugins:units - $ rake test:plugins:functionals - $ rake test:plugins:integration - $ rake test:plugins:all - -Report any issues on http://dev.rails-engines.org. Thanks! - --~===============( ... as you were ... )============================~-} - end - - namespace :plugins do - - desc "Run the plugin tests in vendor/plugins/**/test (or specify with PLUGIN=name)" - task :all => [:warn_about_multiple_plugin_testing_with_engines, - :units, :functionals, :integration] - - desc "Run all plugin unit tests" - Rake::TestTask.new(:units => :setup_plugin_fixtures) do |t| - t.pattern = "vendor/plugins/#{ENV['PLUGIN'] || "**"}/test/unit/**/*_test.rb" - t.verbose = true - end - - desc "Run all plugin functional tests" - Rake::TestTask.new(:functionals => :setup_plugin_fixtures) do |t| - t.pattern = "vendor/plugins/#{ENV['PLUGIN'] || "**"}/test/functional/**/*_test.rb" - t.verbose = true - end - - desc "Integration test engines" - Rake::TestTask.new(:integration => :setup_plugin_fixtures) do |t| - t.pattern = "vendor/plugins/#{ENV['PLUGIN'] || "**"}/test/integration/**/*_test.rb" - t.verbose = true - end - - desc "Mirrors plugin fixtures into a single location to help plugin tests" - task :setup_plugin_fixtures => :environment do - Engines::Testing.setup_plugin_fixtures - end - - # Patch the default plugin testing task to have setup_plugin_fixtures as a prerequisite - Rake::Task["test:plugins"].prerequisites << "test:plugins:setup_plugin_fixtures" - end -end \ No newline at end of file diff --git a/solr/client/ruby/flare/vendor/plugins/flare/README b/solr/client/ruby/flare/vendor/plugins/flare/README deleted file mode 100644 index 873a19b6017..00000000000 --- a/solr/client/ruby/flare/vendor/plugins/flare/README +++ /dev/null @@ -1,11 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. diff --git a/solr/client/ruby/flare/vendor/plugins/flare/Rakefile b/solr/client/ruby/flare/vendor/plugins/flare/Rakefile deleted file mode 100644 index 6b2788c6bd2..00000000000 --- a/solr/client/ruby/flare/vendor/plugins/flare/Rakefile +++ /dev/null @@ -1,34 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require 'rake' -require 'rake/testtask' -require 'rake/rdoctask' - -desc 'Default: run unit tests.' -task :default => :test - -desc 'Test the flare plugin.' -Rake::TestTask.new(:test) do |t| - t.libs << 'lib' - t.pattern = 'test/**/*_test.rb' - t.verbose = true -end - -desc 'Generate documentation for the flare plugin.' -Rake::RDocTask.new(:rdoc) do |rdoc| - rdoc.rdoc_dir = 'rdoc' - rdoc.title = 'Flare' - rdoc.options << '--line-numbers' << '--inline-source' - rdoc.rdoc_files.include('README') - rdoc.rdoc_files.include('lib/**/*.rb') -end diff --git a/solr/client/ruby/flare/vendor/plugins/flare/app/controllers/browse_controller.rb b/solr/client/ruby/flare/vendor/plugins/flare/app/controllers/browse_controller.rb deleted file mode 100644 index 173d798c0f5..00000000000 --- a/solr/client/ruby/flare/vendor/plugins/flare/app/controllers/browse_controller.rb +++ /dev/null @@ -1,15 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -class BrowseController < ApplicationController - flare -end diff --git a/solr/client/ruby/flare/vendor/plugins/flare/app/controllers/document_controller.rb b/solr/client/ruby/flare/vendor/plugins/flare/app/controllers/document_controller.rb deleted file mode 100755 index b11e345bfff..00000000000 --- a/solr/client/ruby/flare/vendor/plugins/flare/app/controllers/document_controller.rb +++ /dev/null @@ -1,16 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -class DocumentController < ApplicationController - # Currently not used, as partials are used for rendering documents in search results - # TODO: how best to allow pluggable document rendering? -end diff --git a/solr/client/ruby/flare/vendor/plugins/flare/app/controllers/simile_controller.rb b/solr/client/ruby/flare/vendor/plugins/flare/app/controllers/simile_controller.rb deleted file mode 100755 index d11791cd9e4..00000000000 --- a/solr/client/ruby/flare/vendor/plugins/flare/app/controllers/simile_controller.rb +++ /dev/null @@ -1,46 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -class SimileController < ApplicationController - before_filter :flare_before - - def exhibit - @data = @flare.search(0, 10) - - # Exhibit seems to require a label attribute to be happy - @data.each {|d| d['label'] = d['title_text']} - - respond_to do |format| - format.html # renders exhibit.rhtml - format.json { render :json => {'items' => @data}.to_json } # Exhibit seems to require data to be in a 'items' Hash - end - end - - def timeline - @data = @flare.search(0, 10) - - respond_to do |format| - format.html # renders timeline.rhtml - format.xml # renders timeline.rxml - end - end - - #TODO: this is duplicated from flare's - private - def flare_before - # TODO: allow source of context to be configurable. - session[:flare_context] ||= Flare::Context.new(SOLR_CONFIG) - - @flare = session[:flare_context] - end - -end diff --git a/solr/client/ruby/flare/vendor/plugins/flare/app/helpers/application_helper.rb b/solr/client/ruby/flare/vendor/plugins/flare/app/helpers/application_helper.rb deleted file mode 100755 index 2af0b89076b..00000000000 --- a/solr/client/ruby/flare/vendor/plugins/flare/app/helpers/application_helper.rb +++ /dev/null @@ -1,17 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -module ApplicationHelper - def facet_label(field) - field.match(/(.*)_.*/)[1].humanize.downcase - end -end diff --git a/solr/client/ruby/flare/vendor/plugins/flare/app/views/browse/_suggest.rhtml b/solr/client/ruby/flare/vendor/plugins/flare/app/views/browse/_suggest.rhtml deleted file mode 100755 index 6cb4b05e6fd..00000000000 --- a/solr/client/ruby/flare/vendor/plugins/flare/app/views/browse/_suggest.rhtml +++ /dev/null @@ -1,24 +0,0 @@ -<% -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -%> -
      -<% -@values.each do |value| - if value[1] > 0 --%> - -<% - end -end --%> -
    \ No newline at end of file diff --git a/solr/client/ruby/flare/vendor/plugins/flare/app/views/browse/facet.rhtml b/solr/client/ruby/flare/vendor/plugins/flare/app/views/browse/facet.rhtml deleted file mode 100755 index bf658cb5e39..00000000000 --- a/solr/client/ruby/flare/vendor/plugins/flare/app/views/browse/facet.rhtml +++ /dev/null @@ -1,55 +0,0 @@ -<% -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -%> -
    -
    - <%=link_to '[clear constraints]', :action => 'clear'%> -
    - -
    -Queries: -
    -<% @flare.queries.each_with_index do |q,i| %> -<%=link_to q[:negative] ? "-" : '+', :action => :invert_query, :index => i%> -<%=q[:query]%> -<%= in_place_editor "query_#{i}", :url=> url_for(:action=>"update_query", :index=>i) %> -<%=link_to image_tag("x-close.gif"), :action => :remove_query, :index => i %>
    -<% end %> -
    -
    - -
    -Filters: -
    -<% @flare.filters.each_with_index do |filter, i| %> - <%=link_to filter[:negative] ? "-" : "+", :action => :invert_filter, :index => i%> - <%=filter[:field]%>:<%=filter[:value]%> - <%=link_to image_tag("x-close.gif"), :action => :remove_filter, :index => i %> -<% end %> -
    -
    - -
    - <%=link_to '[clear constraints]', :action => 'clear'%> -
    - -
    - -

    <%=params[:field]%>

    -<% @facets.each do |f| %> - <% if f.name %> - <%= link_to f.name, :action => 'add_filter', :field => params[:field], :value => f.name %> (<%=f.value%>) - <% else %> - <%= link_to '---- NO VALUE ----', :action => 'add_filter', :field => params[:field], :value => "[* TO *]", :negative => true %> (<%=f.value%>) - <% end %> -<% end%> \ No newline at end of file diff --git a/solr/client/ruby/flare/vendor/plugins/flare/app/views/browse/index.rhtml b/solr/client/ruby/flare/vendor/plugins/flare/app/views/browse/index.rhtml deleted file mode 100755 index 858d10c3351..00000000000 --- a/solr/client/ruby/flare/vendor/plugins/flare/app/views/browse/index.rhtml +++ /dev/null @@ -1,121 +0,0 @@ -<% -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -%> - - -
    -
    - <%=link_to '[clear constraints]', :action => 'clear'%> -
    - -
    - Saved searches: -
    - <% @flare.applied_facet_queries.each_with_index do |q, i| %> - <%=link_to q[:negative] ? "-" : "+", :action => :invert_saved_constraint, :index => i%> - <%=q[:name]%> - <%=link_to image_tag("x-close.gif"), :action => :remove_saved_constraint, :index => i %>
    - <% end %> -
    -Queries: -
    -<% @flare.queries.each_with_index do |q,i| %> -<%=link_to q[:negative] ? "-" : '+', :action => :invert_query, :index => i%> -<%=q[:query]%> -<%= in_place_editor "query_#{i}", :url=> url_for(:action=>"update_query", :index=>i, :script=>true) %> -<%=link_to image_tag("x-close.gif"), :action => :remove_query, :index => i %>
    -<% end %> -
    -
    - -
    -Filters: -
    -<% @flare.filters.each_with_index do |filter, i| %> - <%=link_to filter[:negative] ? "-" : "+", :action => :invert_filter, :index => i%> - <%=filter[:field]%>:<%=filter[:value]%> - <%=link_to image_tag("x-close.gif"), :action => :remove_filter, :index => i %>
    -<% end %> -
    -
    - -
    - <%=link_to '[clear constraints]', :action => 'clear'%> -
    - -<% form_tag({:action=>'save'},{:id => 'savesearch', :style => "display:none;"}) do %> - <%= text_field_tag :name, "", {:size => 10, :id => "savesearch_name"} %> - <%= link_to_function "save", "document.forms['savesearch'].submit();" -%> - <%= link_to_function "cancel", "Element.toggle('savesearch'); Element.toggle('savesearch_link')" -%> -<% end %> -<%= link_to_function "[save these constraints]", "Element.toggle('savesearch'); Element.toggle('savesearch_link'); $('savesearch_name').focus()", {:id => "savesearch_link"} -%> - -
    - -<% if @flare.empty_constraints? %> - search or facet to see results -<% else %> - -
    Results <%=[@start + 1,@response.total_hits].min%>-<%=[@response.total_hits,@results_per_page + @start].min%> of <%=@response.total_hits%>
    - -
    - <% @response.each do |doc| %> - <%= render :partial => "document/document_#{SOLR_ENV}", :locals => {:doc => doc, :response => @response}%> - <% end %> -
    -
    - -
    <%=link_to_if @flare.page != 1, "<<", :page => @flare.page - 1%> Results <%=[@start + 1,@response.total_hits].min%>-<%=[@response.total_hits,@results_per_page + @start].min%> of <%=@response.total_hits%><%=link_to_if @flare.page < (@response.total_hits.to_f / @results_per_page).ceil, ">>", :page => @flare.page + 1%>
    - -<% end %> \ No newline at end of file diff --git a/solr/client/ruby/flare/vendor/plugins/flare/app/views/document/_document_development.rhtml b/solr/client/ruby/flare/vendor/plugins/flare/app/views/document/_document_development.rhtml deleted file mode 100755 index 1039e1e9818..00000000000 --- a/solr/client/ruby/flare/vendor/plugins/flare/app/views/document/_document_development.rhtml +++ /dev/null @@ -1,25 +0,0 @@ -<% -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -%> - - - - - - - <% doc.each do |k,v|; highlighting = response.highlighted(doc['id'], k) %> - - <% end %> -
    <%=doc['title_text']%>
    <%=k%>:<%= highlighting ? "...#{highlighting}..." : (v.respond_to?('join') ? v.join(',') : v.to_s)%>
    - - diff --git a/solr/client/ruby/flare/vendor/plugins/flare/app/views/layouts/browse.rhtml b/solr/client/ruby/flare/vendor/plugins/flare/app/views/layouts/browse.rhtml deleted file mode 100755 index 18a15f51977..00000000000 --- a/solr/client/ruby/flare/vendor/plugins/flare/app/views/layouts/browse.rhtml +++ /dev/null @@ -1,28 +0,0 @@ -<% -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -%> - - - Solr flare: <%=controller.action_name%> - <%= javascript_include_tag :defaults %> - <%= stylesheet_link_tag 'flare'%> - - -
    - - <%= yield %> -
    - - diff --git a/solr/client/ruby/flare/vendor/plugins/flare/app/views/simile/exhibit.rhtml b/solr/client/ruby/flare/vendor/plugins/flare/app/views/simile/exhibit.rhtml deleted file mode 100644 index acb919fe05c..00000000000 --- a/solr/client/ruby/flare/vendor/plugins/flare/app/views/simile/exhibit.rhtml +++ /dev/null @@ -1,37 +0,0 @@ -<% -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -%> - - - SIMILE Exhibit view - - - - - - -

    SIMILE Exhibit view

    - - - - - -
    -
    -
    -
    -
    ">
    -
    - - \ No newline at end of file diff --git a/solr/client/ruby/flare/vendor/plugins/flare/app/views/simile/timeline.rhtml b/solr/client/ruby/flare/vendor/plugins/flare/app/views/simile/timeline.rhtml deleted file mode 100755 index d04797b7b5e..00000000000 --- a/solr/client/ruby/flare/vendor/plugins/flare/app/views/simile/timeline.rhtml +++ /dev/null @@ -1,58 +0,0 @@ -<% -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -%> - - - - - - -
    - - diff --git a/solr/client/ruby/flare/vendor/plugins/flare/app/views/simile/timeline.rxml b/solr/client/ruby/flare/vendor/plugins/flare/app/views/simile/timeline.rxml deleted file mode 100755 index d3d2518e537..00000000000 --- a/solr/client/ruby/flare/vendor/plugins/flare/app/views/simile/timeline.rxml +++ /dev/null @@ -1,50 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -xml.data do - @data.each do |doc| - xml.event(doc['title_text'], - :start => doc[SOLR_CONFIG[:timeline_dates].to_s], - :end => doc[SOLR_CONFIG[:timeline_dates].to_s], - :title => doc['title_text'], - :image => SOLR_CONFIG[:image_proc] ? SOLR_CONFIG[:image_proc].call(doc) : nil) - end -end - -# Amazon images: http://www.betaversion.org/~stefano/linotype/news/66/ -# -# -# A few days to write some documentation for <a href="http://simile.mit.edu/timeline/">Timeline</a>. -# -# -# -# I'm not sure precisely when my friend's wedding is. -# -# -# -# Woohoo! -# -# \ No newline at end of file diff --git a/solr/client/ruby/flare/vendor/plugins/flare/init.rb b/solr/client/ruby/flare/vendor/plugins/flare/init.rb deleted file mode 100644 index 4f97bed495a..00000000000 --- a/solr/client/ruby/flare/vendor/plugins/flare/init.rb +++ /dev/null @@ -1,13 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require 'flare' \ No newline at end of file diff --git a/solr/client/ruby/flare/vendor/plugins/flare/lib/flare.rb b/solr/client/ruby/flare/vendor/plugins/flare/lib/flare.rb deleted file mode 100644 index f70a14c1ee8..00000000000 --- a/solr/client/ruby/flare/vendor/plugins/flare/lib/flare.rb +++ /dev/null @@ -1,15 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -module Flare; end -require 'flare/context' -require 'flare/controller_extensions' diff --git a/solr/client/ruby/flare/vendor/plugins/flare/lib/flare/context.rb b/solr/client/ruby/flare/vendor/plugins/flare/lib/flare/context.rb deleted file mode 100644 index 094807cb7a9..00000000000 --- a/solr/client/ruby/flare/vendor/plugins/flare/lib/flare/context.rb +++ /dev/null @@ -1,151 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require 'solr' - -class Flare::Context - attr_accessor :queries, :filters, :facet_queries, :applied_facet_queries, :page, :sort - attr_reader :facet_fields, :text_fields, :connection - - def initialize(solr_config={}) - @solr_config = solr_config - - @connection = Solr::Connection.new(@solr_config[:solr_url]) - - clear - @facet_queries = {} # name => {:queries => [], :filters => []} - - @index_info = index_info - - excluded = @solr_config[:facets_exclude] ? @solr_config[:facets_exclude].collect {|e| e.to_s} : [] - @facet_fields = @index_info.field_names.find_all {|v| v =~ /_facet$/} - excluded # TODO: is facets_excluded working? where are the tests?! :) - - @text_fields = @index_info.field_names.find_all {|v| v =~ /_text$/} - - @page = 1 - end - - def clear - #TODO unify initialize and clear - @queries = [] - @filters = [] - @applied_facet_queries = [] - @page = 1 - - # this is cleared for development purposes - allowing flare to stay running but different Solr datasets swapping - @index_info = index_info - excluded = @solr_config[:facets_exclude] ? @solr_config[:facets_exclude].collect {|e| e.to_s} : [] - @facet_fields = @index_info.field_names.find_all {|v| v =~ /_facet$/} - excluded - @text_fields = @index_info.field_names.find_all {|v| v =~ /_text$/} - - # facet_queries not cleared as their lifetime is different than constraints - end - - def empty_constraints? - @queries.empty? && @filters.empty? && @applied_facet_queries.empty? - end - - def search(start=0, max=25) - # TODO: Allow the search method to facilitate acts_as_solr somehow too - facet_queries = @facet_queries.collect do |k,v| - clauses = filter_queries(v[:filters]) - clauses << build_boolean_query(v[:queries]) - query = clauses.join(" AND ") - @facet_queries[k][:real_query] = query - query - end - - qa = applied_facet_queries.collect {|map| q = @facet_queries[map[:name]][:real_query]; map[:negative] ? "-(#{q})" : q} - qa << build_boolean_query(@queries) - - query_type = @solr_config[:solr_query_type] || :dismax - query_config = @solr_config["#{query_type.to_s}_query_params".to_sym] || {} - solr_params = query_config.merge(:query => qa.join(" AND "), - :filter_queries => filter_queries(@filters), - :start => start, - :rows => max, - :facets => { - :fields => @facet_fields, :limit => 20 , :mincount => 1, :sort => :count, - :queries => facet_queries - }, - :highlighting => {:field_list => @text_fields}, - :sort => @sort) -# if query_type == :dismax -# solr_params[:phrase_fields] ||= @text_fields -# if solr_params[:query] == "*:*" -# solr_params[:query] = "" -# end -# request = Solr::Request::Dismax.new(solr_params) # TODO rename to DisMax -# else - request = Solr::Request::Standard.new(solr_params) -# end - - #TODO: call response.field_facets(??) - maybe field_facets should be higher level? -# logger.info({:query => query, :filter_queries => filters}.inspect) - @connection.send(request) - end - - def document_by_id(id) - request = Solr::Request::Standard.new(:query => "id:\"#{id}\"") - @connection.send(request).hits[0] - end - - def retrieve_field_facets(field, limit=-1, prefix=nil) - req = Solr::Request::Standard.new(:query => build_boolean_query(@queries), - :filter_queries => filter_queries(@filters), - :facets => {:fields => [field], - :mincount => 1, :limit => limit, :prefix => prefix, :missing => true, :sort => :count - }, - :rows => 0 - ) - - results = @connection.send(req) - - results.field_facets(field) - end - - def to_s - <<-TO_S - ------ - Applied facet queries: #{applied_facet_queries.inspect} - Queries: #{queries.inspect} - Filters: #{filters.inspect} - Facet queries: #{facet_queries.inspect} - ------ - TO_S - end - - private - def build_boolean_query(queries) - if queries.nil? || queries.empty? - query = "*:*" - else - query = queries.collect{|q| "#{q[:negative] ? '-' : ''}(#{q[:query]})"}.join(' AND ') - end - - query - end - - def filter_queries(filters) - filters.collect do |filter| - value = filter[:value] - if value != "[* TO *]" - value = "\"#{value}\"" - end - "#{filter[:negative] ? '-' : ''}#{filter[:field]}:#{value}" - end - end - - def index_info - @connection.send(Solr::Request::IndexInfo.new) - end -end diff --git a/solr/client/ruby/flare/vendor/plugins/flare/lib/flare/controller_extensions.rb b/solr/client/ruby/flare/vendor/plugins/flare/lib/flare/controller_extensions.rb deleted file mode 100755 index f3b6ce97097..00000000000 --- a/solr/client/ruby/flare/vendor/plugins/flare/lib/flare/controller_extensions.rb +++ /dev/null @@ -1,171 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -module Flare - module ActionControllerExtensions - - def self.included(base) - base.extend(ClassMethods) - end - - module ClassMethods - def flare(options={}) - include Flare::ActionControllerExtensions::InstanceMethods - - cattr_accessor :suggest_field - self.suggest_field = options[:suggest_field] || 'text' - - before_filter :flare_before - end - end - - module InstanceMethods - def index - @results_per_page = 25 - - if params[:page] - @flare.page = params[:page].to_i - end - - @start = (@flare.page - 1) * @results_per_page - - @response = @flare.search(@start, @results_per_page) - end - - def facet - @facets = @flare.retrieve_field_facets(params[:field]) - end - - def auto_complete_for_search_query - @values = @flare.retrieve_field_facets(self.class.suggest_field, 5, params['search']['query'].downcase) - - render :partial => 'suggest' - end - - - def add_query - query = params[:search][:query].strip - if query.size > 0 - @flare.queries << {:query => query} - @flare.page = 1 - end - redirect_to :action => 'index' - end - - def update_query - logger.debug "update_query: #{params.inspect}" - @flare.queries[params[:index].to_i][:query] = params[:value] - @flare.page = 1 # TODO: let the context adjust this automatically when its state changes - render :update do |page| - page.redirect_to :action => 'index' - end - end - - def invert_query - q = @flare.queries[params[:index].to_i] - q[:negative] = !q[:negative] - @flare.page = 1 # TODO: let the context adjust this automatically when its state changes - redirect_to :action => 'index' - end - - def remove_query - @flare.queries.delete_at(params[:index].to_i) - @flare.page = 1 # TODO: let the context adjust this automatically when its state changes - redirect_to :action => 'index' - end - - def invert_filter - f = @flare.filters[params[:index].to_i] - f[:negative] = !f[:negative] - @flare.page = 1 # TODO: let the context adjust this automatically when its state changes - redirect_to :action => 'index' - end - - def remove_filter - @flare.filters.delete_at(params[:index].to_i) - @flare.page = 1 # TODO: let the context adjust this automatically when its state changes - redirect_to :action => 'index' - end - - def add_filter - @flare.filters << {:field => params[:field], :value => params[:value], :negative => (params[:negative] ? true : false)} - @flare.page = 1 # TODO: let the context adjust this automatically when its state changes - redirect_to :action => 'index' - end - - def add_saved_search - @flare.applied_facet_queries << {:name => params[:name], :negative => (params[:negative] ? true : false)} - redirect_to :action => 'index' - end - - def remove_saved_constraint - @flare.applied_facet_queries.delete_at(params[:index].to_i) - @flare.page = 1 # TODO: let the context adjust this automatically when its state changes - redirect_to :action => 'index' - end - - def clear - @flare.clear - redirect_to :action => 'index' - end - - def edit_saved_search - @flare.clear - saved = @flare.facet_queries[params[:name]] - @flare.filters = saved[:filters].clone - @flare.queries = saved[:queries].clone - redirect_to :action => 'index' - end - - def show_saved - query = @flare.facet_queries[params[:name]] - @flare.applied_facet_queries << {:name => params[:name], :negative => (params[:negative] ? true : false)} - index - render :action => 'index' - end - - def save - @flare.facet_queries[params[:name]] = {:filters => @flare.filters.clone, :queries => @flare.queries.clone} - redirect_to :action => 'index' - end - - def remove_saved_search - @flare.facet_queries.delete(params[:name]) - @flare.applied_facet_queries.delete_if {|f| params[:name] == f[:name]} - @flare.page = 1 # TODO: let the context adjust this automatically when its state changes - redirect_to :action => 'index' - end - - def invert_saved_constraint - f = @flare.applied_facet_queries[params[:index].to_i] - f[:negative] = !f[:negative] - @flare.page = 1 # TODO: let the context adjust this automatically when its state changes - redirect_to :action => 'index' - end - - private - def flare_before - # TODO: allow source of context to be configurable. - session[:flare_context] ||= Flare::Context.new(SOLR_CONFIG) - - @flare = session[:flare_context] - end - end - - end -end - -module ActionController - class Base - include Flare::ActionControllerExtensions - end -end \ No newline at end of file diff --git a/solr/client/ruby/flare/vendor/plugins/flare/routes.rb b/solr/client/ruby/flare/vendor/plugins/flare/routes.rb deleted file mode 100755 index a2753fc4098..00000000000 --- a/solr/client/ruby/flare/vendor/plugins/flare/routes.rb +++ /dev/null @@ -1,13 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -connect '', :controller => "browse" diff --git a/solr/client/ruby/flare/vendor/plugins/flare/test/flare_context_test.rb b/solr/client/ruby/flare/vendor/plugins/flare/test/flare_context_test.rb deleted file mode 100755 index 5e61beca162..00000000000 --- a/solr/client/ruby/flare/vendor/plugins/flare/test/flare_context_test.rb +++ /dev/null @@ -1,40 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require 'test/unit' -require 'flare' - -class Flare::Context - def index_info - Solr::Response::IndexInfo.new( -<{'status'=>0, 'QTime'=>7}, - 'fields'=>{'id'=>{'type'=>'string'}, 'text'=>{'type'=>'text'}}, - 'index'=>{'maxDoc'=>1337165, 'numDocs'=>1337159, 'version'=>'1174965134952'} - } -SOLR_RESPONSE -) - end -end - -class FlareContextTest < Test::Unit::TestCase - def setup - @flare_context = Flare::Context.new({:solr_url => 'http://server:8983/solr'}) - end - - def test_clear - @flare_context.page = 5 - @flare_context.clear - assert_equal @flare_context.page, 1 - end -end \ No newline at end of file diff --git a/solr/client/ruby/solr-ruby/CHANGES.yml b/solr/client/ruby/solr-ruby/CHANGES.yml deleted file mode 100644 index fa8a1613d90..00000000000 --- a/solr/client/ruby/solr-ruby/CHANGES.yml +++ /dev/null @@ -1,51 +0,0 @@ -v0.0.8: - release_date: TBD - changes: - - Updated Solr::Request::Standard to use modern style sort parameter - - Added FastVectorHighlighter capability - -v0.0.7: - release_date: 2009-03-06 - changes: - - Fixed string parameters with carriage returns in Solr::Request::Select (due to String.each pain) - - SOLR-1047 - added support for facet.method - -v0.0.6: - release_date: 2008-07-14 - changes: - - Added Solr::Request::Spellcheck - - Enabled Solr::Request::Select to work as a general pass through to any registered request handler - - Fixed modify_document_test.rb so as to not be brittle with Hash ordering - - Added support for alternate field highlighting to Solr::Request::Standard (and thus DisMax) - - Added facet.offset support to Solr::Request::Standard/Dismax - - Added shards parameter to Solr::Request::Standard/Dismax - -v0.0.5: - release_date: 2007-08-27 - changes: - - Added support for highlighter fragment size to Solr::Request::Standard - - Added support for MoreLikeThese to Solr::Request::Standard - - Added Solr::Request::ModifyDocument (requires SOLR-139 patch) - - Added Solr::Util.query_parser_escape() - -v0.0.4: - release_date: 2007-08-16 - changes: - - Solr::Indexer#solr added to gain access to the Solr::Connection instance - - Fixed issue with multi-line String field values when field set multiValued="false" - - Fixed tests to work without either Hpricot or libxml2 - -v0.0.3: - release_date: 2007-05-22 - changes: - - Adjusted HpricotMapper and XPathMapper, and tests, to load only if their dependencies are available. - -v0.0.2: - release_date: 2007-05-15 - changes: - - mappers, etc - -v0.0.1: - release_date: 2007-02-15 - changes: - - initial release diff --git a/solr/client/ruby/solr-ruby/LICENSE.txt b/solr/client/ruby/solr-ruby/LICENSE.txt deleted file mode 100644 index 261eeb9e9f8..00000000000 --- a/solr/client/ruby/solr-ruby/LICENSE.txt +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/solr/client/ruby/solr-ruby/README b/solr/client/ruby/solr-ruby/README deleted file mode 100644 index 9c492059e3b..00000000000 --- a/solr/client/ruby/solr-ruby/README +++ /dev/null @@ -1,56 +0,0 @@ -solr-ruby exposes the power of Solr as a Ruby DSL (domain specific language). - - Visit the solr-ruby wiki for more information: http://wiki.apache.org/solr/solr-ruby - -USAGE - -First launch Solr: - - cd solr - java -jar start.jar - -In a separate shell, launch {{{irb -Ilib}}}: - - require 'solr' # load the library - include Solr # Allow Solr:: to be omitted from class/module references - - # connect to the solr instance - conn = Connection.new('http://localhost:8983/solr', :autocommit => :on) - - # add a document to the index - conn.add(:id => 123, :title_text => 'Lucene in Action') - - # update the document - conn.update(:id => 123, :title_text => 'Solr in Action') - - # print out the first hit in a query for 'action' - response = conn.query('action') - print response.hits[0] - - # iterate through all the hits for 'action' - conn.query('action') do |hit| - puts hit.inspect - end - - # delete document by id - conn.delete(123) - -INSTALLATION - -First run the tests: - - rake - -then build the gem: - - rake package - -and install the versioned gem: - - gem install pkg/solr-x.x.x.gem - -LICENSE - -This package is licensed using the Apache Software License 2.0. - - diff --git a/solr/client/ruby/solr-ruby/Rakefile b/solr/client/ruby/solr-ruby/Rakefile deleted file mode 100644 index d14399c91c2..00000000000 --- a/solr/client/ruby/solr-ruby/Rakefile +++ /dev/null @@ -1,190 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -# the default task is to run both the unit and functional tests -# functional tests require that a solr test server is running -# but this Rakefil should take care of starting and stopping it -# for you -# -# if you just want to run unit tests: -# -# rake test_units -# -# and if you just want to run functional tests -# -# rake test_functionals -# -# if you would like to see solr startup messages on STDERR -# when starting solr test server during functional tests use: -# -# rake SOLR_CONSOLE=true - -SOLR_RUBY_VERSION = '0.0.8' - -require 'rubygems' -require 'rake' -require 'rake/testtask' -require 'rake/rdoctask' -require 'rake/packagetask' -require 'rake/gempackagetask' -require 'test/functional/test_solr_server' - -task :default => [:test_units] - -SOLR_PARAMS = { - :quiet => ENV['SOLR_CONSOLE'] ? false : true, - :jetty_home => ENV['SOLR_JETTY_HOME'] || File.expand_path('../../../example'), - :jetty_port => ENV['SOLR_JETTY_PORT'] || 8888, - :solr_home => ENV['SOLR_HOME'] || File.expand_path('test') -} - - -spec = Gem::Specification.new do |s| - s.name = 'solr-ruby' - s.version = SOLR_RUBY_VERSION - s.author = 'Apache Solr' - s.email = 'ruby-dev@lucene.apache.org' - s.homepage = 'http://wiki.apache.org/solr/solr-ruby' - s.platform = Gem::Platform::RUBY - s.summary = 'Ruby library for working with Apache Solr' - - # Omit functional tests from gem for now, as that requires a Solr instance - s.files = Dir.glob("lib/**/*").concat(Dir.glob("test/unit/**/*")) - s.require_path = 'lib' - s.autorequire = 'solr' - s.has_rdoc = true -end - -namespace :gem do - Rake::GemPackageTask.new(spec) do |pkg| - pkg.need_zip = true - pkg.need_tar = true - pkg.package_dir = "pkg/gem" - end -end - -namespace :rails do - desc "Creates rails plugin structure and distributable packages. init.rb is created and removed on the fly." - task :package => "init.rb" do - File.rm_f("init.rb") - end - Rake::PackageTask.new("solr-ruby-rails", SOLR_RUBY_VERSION) do |pkg| - pkg.need_zip = true - pkg.need_tar = true - pkg.package_dir = "pkg/rails" - pkg.package_files.include("lib/**/*.rb", "test/unit/**/*.rb", "init.rb", "LICENSE.txt", "README") - end - - file "init.rb" do - open("init.rb", "w") do |file| - file.puts LICENSE - file.puts "require 'solr.rb'" - end - end - - desc "Install the Rails plugin version into the vendor/plugins dir. Need to set PLUGINS_DIR environment variable." - task :install_solr_ruby => :package do - plugins_dir = ENV["PLUGINS_DIR"] or raise "You must set PLUGINS_DIR" - mkdir File.join(plugins_dir, "solr-ruby-rails-#{SOLR_RUBY_VERSION}/") rescue nil - File.cp_r(File.join("pkg","rails", "solr-ruby-rails-#{SOLR_RUBY_VERSION}/"), plugins_dir) - end -end - -task :package => ["rails:package", "gem:package"] -task :repackage => [:clobber_package, :package] -task :clobber_package => ["rails:clobber_package", "gem:clobber_package"] do rm_r "pkg" rescue nil end -task :clobber => [:clobber_package] - -desc "Generate rdoc documentation" -Rake::RDocTask.new('doc') do |rd| - rd.rdoc_files.include("lib/**/*.rb") - rd.rdoc_files.include('README', 'CHANGES.yml', 'LICENSE.txt') - rd.main = 'README' - rd.rdoc_dir = 'doc' -end - -desc "Run unit tests" -Rake::TestTask.new(:test_units) do |t| - t.pattern = 'test/unit/*_test.rb' - t.verbose = true - t.ruby_opts = ['-r solr', '-r test/unit', '-Itest/unit'] -end - -# NOTE: test_functionals does not work standalone currently. It needs the TestSolrServer wrapper in the :test task -Rake::TestTask.new(:test_functionals) do |t| - t.pattern = 'test/functional/*_test.rb' - t.verbose = true - t.ruby_opts = ['-r solr', '-r test/unit', '-Itest/functional'] -end - -desc "Run unit and functional tests" -task :test => [:test_units] do - rm_rf "test/data" # remove functional test temp data directory - - # wrap functional tests with a test-specific Solr server - got_error = TestSolrServer.wrap(SOLR_PARAMS) do - Rake::Task[:test_functionals].invoke - end - - raise "test failures" if got_error -end - -# TODO: consider replacing system() to rcov with the included -# Rake task: http://eigenclass.org/hiki.rb?cmd=view&p=rcov+FAQ&key=rake -namespace :test do - desc 'Measures test coverage' - # borrowed from here: http://clarkware.com/cgi/blosxom/2007/01/05#RcovRakeTask - task :coverage do - rm_rf "coverage" - rm_rf "coverage.data" - TestSolrServer.wrap(SOLR_PARAMS) do - system("rcov --aggregate coverage.data --text-summary -Ilib:test/functional test/functional/*_test.rb") - end - system("rcov --aggregate coverage.data --text-summary -Ilib:test/unit test/unit/*_test.rb") - system("open coverage/index.html") if PLATFORM['darwin'] - end -end - - -def egrep(pattern) - Dir['**/*.rb'].each do |fn| - count = 0 - open(fn) do |f| - while line = f.gets - count += 1 - if line =~ pattern - puts "#{fn}:#{count}:#{line}" - end - end - end - end -end - -desc "Report TODO/FIXME/TBD tags in the code" -task :todo do - egrep /#.*(FIXME|TODO|TBD)/ -end - -LICENSE = < Proc.new {|data| data[:upc].empty? ? data[:asin] : data[:upc]}, - :medium_facet => :medium, - :country_facet => :country, - :signed_facet => :signed, - :rating_facet => :netrating, - :language_facet => :language, - :genre_facet => Proc.new {|data| data[:genre].split('/').map {|s| s.strip}}, - :title_text => :title, - :full_title_text => :fullTitle, - :asin_display => :asin, - :notes_text => :notes, - :publisher_facet => :publisher, - :description_text => :description, - :author_text => :author, - :pages_text => :pages, - :published_year_facet => Proc.new {|data| data[:published].scan(/\d\d\d\d/)[0]} -} - -indexer = Solr::Indexer.new(source, mapping, :debug => debug) -indexer.index do |record, solr_document| - # can modify solr_document before it is indexed here -end - -indexer.solr.commit unless debug -indexer.solr.optimize unless debug \ No newline at end of file diff --git a/solr/client/ruby/solr-ruby/examples/delicious_library/sample_export.txt b/solr/client/ruby/solr-ruby/examples/delicious_library/sample_export.txt deleted file mode 100644 index b7edafbbbd2..00000000000 --- a/solr/client/ruby/solr-ruby/examples/delicious_library/sample_export.txt +++ /dev/null @@ -1,164 +0,0 @@ -medium associatedURL boxHeightInInches boxLengthInInches boxWeightInPounds boxWidthInInches scannednumber upc asin country title fullTitle series numberInSeries edition aspect mediacount genre price currentValue language netrating description owner publisher published rare purchaseDate rating used signed hasExperienced notes location paid condition notowned platform key developer esrbrating players author illustrator pages director stars features mpaarating theatricalDate minutes artist conductor tracks tracklisting -game 0711719721123 B00006Z7HU us ATV Offroad Fury 2 ATV Offroad Fury 2 Video Game/ CD-ROM Online/ Bike/ Video Games $19.99 $4.40 4 ATV Offroad Fury 2 provides expansive off-road racing gameplay packed with more courses, modes, tricks, and ATVs, plus online gameplay via the network adapter to heighten the racing experience. Players will choose from more than 20 licensed and team-sponsored ATVs from top-tier manufacturers and off-road sponsors. Every featured ATV will be true to spec, allowing for realistic handling and reactions in every situation. Sony Computer Entertainment 20-03-2003 07-02-2007 5 PlayStation2 Teen -book 9780966075007 0966075005 us Chinese Characters: A Genealogy and Dictionary Chinese Characters: A Genealogy and Dictionary Paperback Chinese/ Polyglot/ Dictionaries; Polyglot $19.95 $18.00 4.5 This dictionary is designed to help students understand, appreciate and remember Chinese characters. It has the following features: -Every character entry includes a brief traditional Chinese etymology. -Genealogical charts highlight the connections between characters, showing the creation of more than 4000 characters from less than 200 simple pictographs and ideographs. -Mandarin standards in China and Taiwan are distinguished. -Simplified forms for each character are given. -Character entries list all words which use the character in any position, allowing a word to be found even if the first character is unknown. -English definitions are referenced in an English-Chinese index. -A word pronunciation index allows students to directly search for an overheard word without having to guess the initial character. -A stroke count index lists every character by number of strokes. Zhongwen.Com 01-08-1998 07-02-2007 550 -book 9780195840971 0195840976 us Concise English-Chinese Chinese-English Dictionary Concise English-Chinese Chinese-English Dictionary Paperback English (All)/ Chinese/ Linguistics $12.95 $3.00 3.5 With nearly 20,000 entries in each, this bilingual dictionary is ideal for travelers and students of Chinese or English. Among the dictionary's many features are:/ *Simplified Chinese characters as well as Pinyin/ romanization / *Pronunciation using international phonetic symbols/ *Numerous examples of usage in both languages/ *Appendices including consonants and vowels of the/ Chinese phonetic alphabet, and names and / abbreviations of China's provinces, regions,/ and municipalities/ *Handy pocket-sized format Oxford University Press, USA 01-07-1994 11-02-2007 1114 -movie 0025192022425 0783226985 us Dragon: The Bruce Lee Story Dragon: The Bruce Lee Story DVD Biography/ Drama/ Action & Adventure/ Documentary $14.98 $5.62 4 This enjoyable and touching biography of martial-arts film star Bruce Lee stars Jason Scott Lee (no relation), an actor with a lively face and natural intensity, who makes every moment of this film compelling. Directed by Rob Cohen, Dragon traces Bruce Lee's slow rise over myriad obstacles--most of them race-based--to become an international superstar in films. Lee's origins are oddly set in San Francisco instead of his real home in Seattle, but then again there is plenty of artistic license going on as Cohen explores the actor's psyche through some powerful fantasy sequences. Lauren Holly is good as Lee's wife, Linda (whose book about her late husband inspired this movie). A scene involving Bruce's rescue of son Brandon (who died in a filmmaking accident in 1993) from a murderous spirit is plain spooky. The special-edition DVD release has a widescreen presentation, director interview, featurette, screen tests, closed captioning, optional French soundtrack, and optional Spanish subtitles. --Tom Keogh Universal Studios 01-07-1998 07-02-2007 Aki Aleong/ Eric Bruskotter/ John Cheung/ Chao Li Chi/ Sam Hau/ Lauren Holly/ Clyde Kusatsu/ Nancy Kwan/ Michael Learned/ Jason Scott Lee/ Kay Tong Lim/ Sterling Macer Jr./ Iain M. Parker/ Ong Soo Han/ Michelle Tennant/ Sven-Ole Thorsen/ Robert Wagner/ Luoyong Wang/ Ric Young Closed-captioned/ Color/ Letterboxed/ Widescreen/ NTSC/ 2.35:1 PG-13 07-05-1993 120 -movie 0018111924795 B0009IW92A us The Essential Sherlock Holmes The Essential Sherlock Holmes DVD 8 Mystery/ Drama/ Mystery & Suspense/ Sherlock Holmes $29.99 $8.95 3.5 Dressed to Kill Terror By Night The Woman in Green Sherlock Holmes And the Secret Weapon A Study in Scarlet Silver Blaze Sherlock Holmes TV Series Delta 07-06-2005 09-02-2007 Essential Sherlock Holmes Box set/ Color/ NTSC NR -book 0073999151893 1569221863 us Guitar Scale Guru: The Scale Book - Your Guide for Success! Guitar Scale Guru: The Scale Book - Your Guide for Success! Paperback Guitar/ Instruction & Study/ Techniques $14.95 $9.46 4.5 All of the essential diagrams, drawings and information concerning theory, scales, and their uses in one easy-to-use book! Covers the five essential scales for today's guitarists - major, major pentatonic, minor, minor pentatonic and blues - with a unique Linking System that makes it easy to understand scales like a pro! Creative Concepts 01-02-2000 11-02-2007 168 -music 0019028394855 B000CC2XP6 us Light Up Ahead Light Up Ahead Audio CD $11.95 4 Track Listing: 1.going too 2.comin' after you 3.on the beam 4.dont know what 5.hide 6.signs 7.lower voice 8.bad side 9.light up ahead TR Music 07-02-1995 07-02-2007 5 1 -music 0800314886006 B000B7PU66 us Parallel Universe Parallel Universe Audio CD 2 $15.26 Contains Parallel Universe CD plus bonus Invisible Pagan Underdogs 13 track CD. 23 total tracks. TR Music 07-02-2005 07-02-2007 5 1 -book 9781556152115 1556152116 us Programmers at Work: Interviews With 19 Programmers Who Shaped the Computer Industry (Tempus) Programmers at Work: Interviews With 19 Programmers Who Shaped the Computer Industry (Tempus) Paperback Careers/ Compilers $9.95 $19.92 5 Tempus Books 07-02-1989 07-02-2007 400 -book 9781904978367 1904978363 us Time Out Amsterdam (Time Out Amsterdam Guide) Time Out Amsterdam (Time Out Amsterdam Guide) Paperback Guidebooks/ Amsterdam/ Time Out Travel $19.95 $0.99 3.5 Europe's most infamous city remains one of its most popular, and not without good reason: between its world-class art museums, its eminent canals that are perfect for wandering, and its coffee shops that don't exactly specialize in coffee, its variety is glorious indeed. However, with one of Europe's more forward-thinking cultural scenes and striking new architectural developments in IJburg and the Bijlmermeer, there's much more here to enjoy than the clichés; written, researched and edited entirely by locals, the Time Out Amsterdam guide tells travelers all about it. Highlights include Amsterdam after dark - the best restaurants, bars, and nightclubs in the city; an unmatched section on the city's cultural scene including galleries, performance art, classical music, and theater; and trips beyond Amsterdam to the flower auction in Aalsmeer, the cheese market at Gouda, and the windmills of Alblasserdam. Time Out Publishing 10-07-2005 18-02-2007 320 -book 9780865470804 0865470804 us Taking the Path of Zen (Taking the Path of Zen Ppr) Taking the Path of Zen (Taking the Path of Zen Ppr) Paperback Zen $12.00 $4.40 4 There is a fine art to presenting complex ideas with simplicity and insight, in a manner that both guides and inspires. In Taking the Path of Zen Robert Aitken presents the practice, lifestyle, rationale, and ideology of Zen Buddhism with remarkable clarity. / / The foundation of Zen is the practice of zazen, or mediation, and Aitken Roshi insists that everything flows from the center. He discusses correct breathing, posture, routine, teacher-student relations, and koan study, as well as common problems and milestones encountered in the process. Throughout the book the author returns to zazen, offering further advice and more advanced techniques. The orientation extends to various religious attitudes and includes detailed discussions of the Three Treasures and the Ten Precepts of Zen Buddhism./ Taking the Path of Zen will serve as orientation and guide for anyone who is drawn to the ways of Zen, from the simply curious to the serious Zen student. / North Point Press 01-01-1982 06-02-2007 Robert Aitken 150 -book 9780963177513 0963177516 us Bubishi: Martial Art Spirit Bubishi: Martial Art Spirit Paperback Martial Arts $34.95 $61.18 5 Bubishi-Martial Art Spirit is the secret karate text of the Okinawan Masters. Guarded for centuries, this mystical book has finally been completely translated into English. The BUBISHI was cherished by Miyagi Chojun, the founder of Goju Ryu, Funakoshi Gichin, founder of Shotokan and Mabuni Kenwa, founder of Shito Ryu karate. It includes Dim Mak (The Death Touch), pressure points, knockout and killing techniques , 48 essential self defense applications, Chinese cures for Martial arts injuries and much more!!! Yamazato Pubns 12-02-1993 06-02-2007 George Alexander -book 9780142000281 0142000280 us Getting Things Done: The Art of Stress-Free Productivity Getting Things Done: The Art of Stress-Free Productivity Paperback Health & Stress/ Time Management/ Guides/ Labor & Industrial Relations/ Motivational/ Office Skills/ Creativity/ Self-Esteem/ Stress Management $15.00 $7.01 4.5 With first-chapter allusions to martial arts, "flow,""mind like water," and other concepts borrowed from the East (and usually mangled), you'd almost think this self-helper from David Allen should have been called Zen and the Art of Schedule Maintenance./ Not quite. Yes, Getting Things Done offers a complete system for downloading all those free-floating gotta-do's clogging your brain into a sophisticated framework of files and action lists--all purportedly to free your mind to focus on whatever you're working on. However, it still operates from the decidedly Western notion that if we could just get really, really organized, we could turn ourselves into 24//7 productivity machines. (To wit, Allen, whom the New Economy bible Fast Company has dubbed "the personal productivity guru," suggests that instead of meditating on crouching tigers and hidden dragons while you wait for a plane, you should unsheathe that high-tech saber known as the cell phone and attack that list of calls you need to return.)/ As whole-life-organizing systems go, Allen's is pretty good, even fun and therapeutic. It starts with the exhortation to take every unaccounted-for scrap of paper in your workstation that you can't junk, The next step is to write down every unaccounted-for gotta-do cramming your head onto its own scrap of paper. Finally, throw the whole stew into a giant "in-basket"/ That's where the processing and prioritizing begin; in Allen's system, it get a little convoluted at times, rife as it is with fancy terms, subterms, and sub-subterms for even the simplest concepts. Thank goodness the spine of his system is captured on a straightforward, one-page flowchart that you can pin over your desk and repeatedly consult without having to refer back to the book. That alone is worth the purchase price. Also of value is Allen's ingenious Two-Minute Rule: if there's anything you absolutely must do that you can do right now in two minutes or less, then do it now, thus freeing up your time and mind tenfold over the long term. It's commonsense advice so obvious that most of us completely overlook it, much to our detriment; Allen excels at dispensing such wisdom in this useful, if somewhat belabored, self-improver aimed at everyone from CEOs to soccer moms (who we all know are more organized than most CEOs to start with). --Timothy Murphy/ Penguin (Non-Classics) 31-12-2002 03-02-2007 David Allen 267 -book 0076092024163 0131422464 us Core J2EE Patterns: Best Practices and Design Strategies, Second Edition Core J2EE Patterns: Best Practices and Design Strategies, Second Edition Hardcover Qualifying Textbooks - Winter 2007 $54.99 $23.99 5 Prentice Hall Ptr 10-05-2003 07-02-2007 1 Deepak Alur/ Dan Malks/ John Crupi 650 -book 9780471202820 0471202827 us Agile Modeling: Effective Practices for Extreme Programming and the Unified Process Agile Modeling: Effective Practices for Extreme Programming and the Unified Process Paperback Object-Oriented Design/ Software Development/ Quality Control/ Computers & Internet/ Qualifying Textbooks - Winter 2007 $34.99 $24.39 3.5 The first book to cover Agile Modeling, a new modeling technique created specifically for XP projects eXtreme Programming (XP) has created a buzz in the software development community-much like Design Patterns did several years ago. Although XP presents a methodology for faster software development, many developers find that XP does not allow for modeling time, which is critical to ensure that a project meets its proposed requirements. They have also found that standard modeling techniques that use the Unified Modeling Language (UML) often do not work with this methodology. In this innovative book, Software Development columnist Scott Ambler presents Agile Modeling (AM)-a technique that he created for modeling XP projects using pieces of the UML and Rational's Unified Process (RUP). Ambler clearly explains AM, and shows readers how to incorporate AM, UML, and RUP into their development projects with the help of numerous case studies integrated throughout the book./ • AM was created by the author for modeling XP projects-an element lacking in the original XP design/ • The XP community and its creator have embraced AM, which should give this book strong market acceptance/ Companion Web site at www.agilemodeling.com features updates, links to XP and AM resources, and ongoing case studies about agile modeling./ John Wiley & Sons 01-02-2001 07-02-2007 Scott W. Ambler/ Ron Jeffries 224 -book 9780262012102 0262012103 us A Semantic Web Primer (Cooperative Information Systems) A Semantic Web Primer (Cooperative Information Systems) Hardcover Web Site Design/ Storage/ Internet $42.00 $25.98 4.5 The development of the Semantic Web, with machine-readable content, has the potential to revolutionize the World Wide Web and its use. A Semantic Web Primer provides an introduction and guide to this emerging field, describing its key ideas, languages, and technologies. Suitable for use as a textbook or for self-study by professionals, it concentrates on undergraduate-level fundamental concepts and techniques that will enable readers to proceed with building applications on their own. It includes exercises, project descriptions, and annotated references to relevant online materials. A Semantic Web Primer is the only available book on the Semantic Web to include a systematic treatment of the different languages (XML, RDF, OWL, and rules) and technologies (explicit metadata, ontologies, and logic and inference) that are central to Semantic Web development. The book also examines such crucial related topics as ontology engineering and application scenarios./ / After an introductory chapter, topics covered in succeeding chapters include XML and related technologies that support semantic interoperability; RDF and RDF Schema, the standard data model for machine-processable semantics; and OWL, the W3C-approved standard for a Web ontology language more extensive than RDF Schema; rules, both monotonic and nonmonotonic, in the framework of the Semantic Web; selected application domains and how the Semantic Web would benefit them; the development of ontology-based systems; and current debates on key issues and predictions for the future. The MIT Press 01-04-2004 07-02-2007 Grigoris Antoniou/ Frank van Harmelen 272 -book 0076092016335 0130674826 us A Practical Guide to eXtreme Programming A Practical Guide to eXtreme Programming Paperback Software Development/ Software Engineering $49.99 $4.38 4 Prentice Hall PTR 08-02-2002 08-02-2007 David Astels/ Granville Miller/ Miroslav Novak 384 -book 9780961454739 0961454733 us Art & Fear Art & Fear Paperback Study & Teaching/ Criticism $12.95 $7.25 4.5 "This is a book about making art. Ordinary art. Ordinary art means something like: all art not made by Mozart. After all, art is rarely made by Mozart-like people; essentially-statistically speaking-there aren't any people like that. Geniuses get made once-a-century or so, yet good art gets made all the time, so to equate the making of art with the workings of genius removes this intimately human activity to a strangely unreachable and unknowable place. For all practical purposes making art can be examined in great detail without ever getting entangled in the very remote problems of genius."
--from the Introduction/ Art & Fear explores the way art gets made, the reasons it often doesn't get made, and the nature of the difficulties that cause so many artists to give up along the way. The book's co-authors, David Bayles and Ted Orland, are themselves both working artists, grappling daily with the problems of making art in the real world. Their insights and observations, drawn from personal experience, provide an incisive view into the world of art as it is expeienced by artmakers themselves./ This is not your typical self-help book. This is a book written by artists, for artists -- it's about what it feels like when artists sit down at their easel or keyboard, in their studio or performance space, trying to do the work they need to do. First published in 1994, Art & Fear quickly became an underground classic. Word-of-mouth response alone-now enhanced by internet posting-has placed it among the best-selling books on artmaking and creativity nationally./ Art & Fear has attracted a remarkably diverse audience, ranging from beginning to accomplished artists in every medium, and including an exceptional concentration among students and teachers. The original Capra Press edition of Art & Fear sold 80,000 copies./ An excerpt:/ Today, more than it was however many years ago, art is hard because you have to keep after it so consistently. On so many different fronts. For so little external reward. Artists become veteran artists only by making peace not just with themselves, but with a huge range of issues. You have to find your work.../ Image Continuum Press 01-04-2001 03-02-2007 David Bayles/ Ted Orland 122 -book 0785342616415 0201616416 us Extreme Programming Explained: Embrace Change Extreme Programming Explained: Embrace Change Paperback Software Development/ Software Engineering $29.95 $2.98 4 Kent Beck's eXtreme Programming eXplained provides an intriguing high-level overview of the author's Extreme Programming (XP) software development methodology. Written for IS managers, project leaders, or programmers, this guide provides a glimpse at the principles behind XP and its potential advantages for small- to mid-size software development teams./ The book intends to describe what XP is, its guiding principles, and how it works. Simply written, the book avoids case studies and concrete details in demonstrating the efficacy of XP. Instead, it demonstrates how XP relies on simplicity, unit testing, programming in pairs, communal ownership of code, and customer input on software to motivate code improvement during the development process. As the author notes, these principles are not new, but when they're combined their synergy fosters a new and arguably better way to build and maintain software. Throughout the book, the author presents and explains these principles, such as "rapid feedback" and "play to win," which form the basis of XP./ Generally speaking, XP changes the way programmers work. The book is good at delineating new roles for programmers and managers who Beck calls "coaches." The most striking characteristic of XP is that programmers work in pairs, and that testing is an intrinsic part of the coding process. In a later section, the author even shows where XP works and where it doesn't and offers suggestions for migrating teams and organizations over to the XP process./ In the afterword, the author recounts the experiences that led him to develop and refine XP, an insightful section that should inspire any organization to adopt XP. This book serves as a useful introduction to the philosophy and practice of XP for the manager or programmer who wants a potentially better way to build software. --Richard Dragan/ Topics covered: Extreme Programming (XP) software methodology, principles, XP team roles, facilities design, testing, refactoring, the XP software lifecycle, and adopting XP./ Addison-Wesley Professional 05-10-1999 07-02-2007 Kent Beck 224 -book 0785342146530 0321146530 us Test Driven Development: By Example (Addison-Wesley Signature Series) Test Driven Development: By Example (Addison-Wesley Signature Series) Paperback Software Development/ Testing/ Software Engineering/ Qualifying Textbooks - Winter 2007 $44.99 $28.75 4 Addison-Wesley Professional 08-11-2002 07-02-2007 Kent Beck 240 -book 9780743245517 0743245512 us A Tooth from the Tiger's Mouth: How to Treat Your Injuries with Powerful Healing Secrets of the Great Chinese Warrior (Fireside Books (Fireside)) A Tooth from the Tiger's Mouth: How to Treat Your Injuries with Powerful Healing Secrets of the Great Chinese Warrior (Fireside Books (Fireside)) Paperback Healing/ Herbal Remedies/ Chinese Medicine $14.00 $8.25 5 A renowned expert in Chinese sports medicine and martial arts reveals ancient Eastern secrets for healing common injuries, including sprains, bruises, deep cuts, and much more./ For centuries, Chinese martial arts masters have kept their highly prized remedies as carefully guarded secrets, calling such precious and powerful knowledge "a tooth from the tiger's mouth." Now, for the first time, these deeply effective methods are revealed to Westerners who want alternative ways to treat the acute and chronic injuries experienced by any active person./ While many books outline the popular teachings of traditional Chinese medicine, only this one offers step-by-step instructions for treating injuries. Expert practitioner and martial artist Tom Bisio explains the complete range of healing strategies and provides a Chinese first-aid kit to help the reader fully recover from every mishap: cuts, sprains, breaks, dislocations, bruises, muscle tears, tendonitis, and much more./ He teaches readers how to:/ / • Examine and diagnose injuries/ • / • Prepare and apply herbal formulas/ • / • Assemble a portable kit for emergencies/ • / • Fully recuperate with strengthening exercises and healing dietary advice/ Comprehensive and easy to follow, with drawings to illustrate both the treatment strategies and the strengthening exercises, this unique guidebook will give readers complete access to the powerful healing secrets of the great Chinese warriors./ Fireside 05-10-2004 06-02-2007 Tom Bisio 384 -book 9781932394696 1932394699 us Ruby for Rails: Ruby Techniques for Rails Developers Ruby for Rails: Ruby Techniques for Rails Developers Paperback/ Illustrated Web Site Design/ Object-Oriented Design/ Transportation & Highway $44.95 $24.50 4 -The word is out: with Ruby on Rails you can build powerful Web applications easily and quickly! And just like the Rails framework itself, Rails applications are Ruby programs. That means you can't tap into the full power of Rails unless you master the Ruby language./ Ruby for Rails, written by Ruby expert David Black (with a forward by David Heinemeier Hansson), helps Rails developers achieve Ruby mastery. Each chapter deepens your Ruby knowledge and shows you how it connects to Rails. You'll gain confidence working with objects and classes and learn how to leverage Ruby's elegant, expressive syntax for Rails application power. And you'll become a better Rails developer through a deep understanding of the design of Rails itself and how to take advantage of it./ Newcomers to Ruby will find a Rails-oriented Ruby introduction that's easy to read and that includes dynamic programming techniques, an exploration of Ruby objects, classes, and data structures, and many neat examples of Ruby and Rails code in action. Ruby for Rails: the Ruby guide for Rails developers!/ What's Inside/ Classes, modules, and objects/ Collection handling and filtering/ String and regular expression manipulation/ Exploration of the Rails source code/ Ruby dynamics/ Many more programming concepts and techniques!/ Manning Publications 11-05-2006 07-02-2007 David Black 532 -book 0021898130853 0020130856 us The Elements of Technical Writing (Elements of Series) The Elements of Technical Writing (Elements of Series) Paperback Writing Skills/ General & Reference/ Technical $9.95 $4.49 3.5 Longman 19-12-2000 11-02-2007 Gary Blake/ Robert W. Bly 192 -book 0785342310054 0201310058 us Effective Java Programming Language Guide Effective Java Programming Language Guide Paperback Qualifying Textbooks - Winter 2007 $49.99 $29.95 5 Written for the working Java developer, Joshua Bloch's Effective Java Programming Language Guide provides a truly useful set of over 50 best practices and tips for writing better Java code. With plenty of advice from an indisputable expert in the field, this title is sure to be an indispensable resource for anyone who wants to get more out of their code./ As a veteran developer at Sun, the author shares his considerable insight into the design choices made over the years in Sun's own Java libraries (which the author acknowledges haven't always been perfect). Based on his experience working with Sun's best minds, the author provides a compilation of 57 tips for better Java code organized by category. Many of these ideas will let you write more robust classes that better cooperate with built-in Java APIs. Many of the tips make use of software patterns and demonstrate an up-to-the-minute sense of what works best in today's design. Each tip is clearly introduced and explained with code snippets used to demonstrate each programming principle./ Early sections on creating and destroying objects show you ways to make better use of resources, including how to avoid duplicate objects. Next comes an absolutely indispensable guide to implementing "required" methods for custom classes. This material will help you write new classes that cooperate with old ones (with advice on implementing essential requirements like the equals() and hashCode() methods)./ The author has a lot to say about class design, whether using inheritance or composition. Tips on designing methods show you how to create understandable, maintainable, and robust classes that can be easily reused by others on your team. Sections on mapping C code (like structures, unions, and enumerated types) onto Java will help C programmers bring their existing skills to Sun's new language. Later sections delve into some general programming tips, like using exceptions effectively. The book closes with advice on using threads and synchronization techniques, plus some worthwhile advice on object serialization./ Whatever your level of Java knowledge, this title can make you a more effective programmer. Wisely written, yet never pompous or doctrinaire, the author has succeeded in packaging some really valuable nuggets of advice into a concise and very accessible guidebook that arguably deserves a place on most any developer's bookshelf. --Richard Dragan/ Topics covered:/ • Best practices and tips for Java/ • Creating and destroying objects (static factory methods, singletons, avoiding duplicate objects and finalizers)/ • Required methods for custom classes (overriding equals(), hashCode(), toString(), clone(), and compareTo() properly)/ • Hints for class and interface design (minimizing class and member accessibility, immutability, composition versus inheritance, interfaces versus abstract classes, preventing subclassing, static versus nonstatic classes)/ • C constructs in Java (structures, unions, enumerated types, and function pointers in Java)/ • Tips for designing methods (parameter validation, defensive copies, method signatures, method overloading, zero-length arrays, hints for Javadoc comments)/ • General programming advice (local variable scope, using Java API libraries, avoiding float and double for exact comparisons, when to avoid strings, string concatenation, interfaces and reflection, avoid native methods, optimizing hints, naming conventions)/ • Programming with exceptions (checked versus run-time exceptions, standard exceptions, documenting exceptions, failure-capture information, failure atomicity)/ • Threading and multitasking (synchronization and scheduling hints, thread safety, avoiding thread groups)/ • Serialization (when to implement Serializable, the readObject(), and readResolve() methods)/ Prentice Hall PTR 05-06-2001 07-02-2007 Joshua Bloch 252 -book 9780596000523 0596000529 us Creating Applications with Mozilla Creating Applications with Mozilla Paperback/ Illustrated Web Browsers/ Web Programming $39.95 $3.97 2.5 Mozilla is not just a browser. Mozilla is also a framework that allows developers to create cross-platform applications. This framework is made up of JavaScript, CSS (Cascading Style Sheets), and Mozilla's XUL (XML-based User-interface Language) as well as the Gecko rendering engine, XBL (eXtensible Binding Language), XPCOM (Mozilla's component model), and several other components. Creating Applications with Mozilla explains how applications are created with Mozilla and provides step-by-step information about how you can create your own programs using Mozilla's powerful cross-platform development framework. This book also shows examples of many different types of existing applications to demonstrate some of the possibilities of Mozilla application development. One of Mozilla's biggest advantages for a developer is that Mozilla-based applications are cross-platform, meaning programs work the same on Windows as they do on Linux or the Mac OS. Working through the book, you are introduced to the Mozilla development environment and after installing Mozilla, you quickly learn to create simple applications. After the initial satisfaction of developing your own portable applications, the book branches into topics on modular development and packaging your application. In order to build more complex applications, coverage of XUL, JavaScript, and CSS allow you to discover how to customize and build out your application shell. The second half of the book explores more advanced topics including UI enhancement, localization, and remote distribution. Mozilla 1.0 was released on June 5th, 2002, after more than four years of development as an open source project. This book has been written so that all of the information and examples will work with this release and any of the 1.0.x maintenance releases. In addition to Netscape's Mozilla-based browsers (Netscape 6.x and 7.x), the Mozilla framework has been used to create other browsers such as Galeon and Chimera, and chat clients such as ChatZilla and JabberZilla. Developers have also used Mozilla to create games, development tools, browser enhancements, as well as all sorts of other types of applications. O'Reilly Media 09-02-2002 07-02-2007 David Boswell/ Brian King/ Ian Oeschger/ Pete Collins/ Eric Murphy 480 -book 0031869008357 1558538356 us Life's Little Instruction Book 511 Suggestions, Observations, And Reminders On How To Live A Happy And Rewarding Life Life's Little Instruction Book 511 Suggestions, Observations, And Reminders On How To Live A Happy And Rewarding Life Paperback Ethics & Morality/ New Age/ Gifts/ Collections & Readers/ Spiritual $6.99 $1.70 5 H. Jackson Brown, Jr. originally wrote Life's Little Instruction Book™ as a gift for his son who was leaving home to begin his freshman year in college. Brown says, "I read years ago that it was not the responsibility of parents to pave the road for their children but to provide a road map, and I wanted to provide him with what I had learned about living a happy and rewarding life."Life's Little Instruction Book™ is a guidebook that gently points the way to happiness and fulfillment. The observations are direct, simple, and as practical as an umbrella./ "But it's not just for young people," says Brown. "Most of us already know how to live a successful and purposeful life. We know we should be more understanding and thoughtful, more responsible, courageous and appreciative. It's just that we sometimes need reminding."Life's Little Instruction Book™ is that reminder, as well as the perfect gift for a relative or a friend who needs encouragement at any time of the year./ • Never give up on anybody. Miracles happen every day./ • Be brave. Even if you're not, pretend to be. No one can tell the difference./ • Think big thoughts, but relish small pleasures./ • Learn to listen. Opportunity sometimes knocks softly./ • Never deprive someone of hope; it might be all they have./ • Be kinder than necessary./ • Become the most positive and enthusiastic person you know./ • Commit yourself to constant self-improvement./ • Don't major in minor things./ • Never cut what can be untied./ Since its debut in 1991, Life's Little Instruction Book™ has revolutionized the publishing industry. This little plaid book, which has been embraced the world over, has sold more than nine million copies, spent more than two years atop the New York Times bestseller list, and has been translated into 33 languages. Though originally written as a gift from a father to a son, its simple message has been enjoyed by men and women of all ages around the world./ Rutledge Hill Press 29-09-2000 08-02-2007 H. Jackson Brown -book 0037038174434 1580174434 us The Qigong Year The Qigong Year Hardcover Meditation/ Mental & Spiritual Healing/ Chinese Medicine/ Energy Healing/ Tai Chi & Qi Gong $12.95 $0.98 3 Closely related to the popular Chinese martial art Tai Chi, Qigong (pronounced "chee gong") is an ancient self-healing art that combines movement and meditation in holistic workouts that simultaneously develop body and spirit, promoting overall health and vitality./ Practiced by millions of Chinese for thousands of years, Qigong is now gaining popularity throughout the world. The program of exercises, movements, breathing techniques, and visualizations in The Qigong Year is specially designed to mirror the flow of the seasons. The exercises are illustrated with instructive line drawings, and the book features elegant duotones and patterned art accented with gold metallic ink./ Combining vigorous and gentle movement, Qigong exercises help strengthen the body, improve posture, align the spine, and relax shoulder and neck muscles. Three variations of each exercise - seated, standing, and advanced - are described, enabling people of all ages and abilities to easily practice and enjoy the benefits of Qigong./ Qigong meditation can help stabilize moods - reducing anger, anxiety, and depression - and improve outlook and self-confidence, making it easier to cope with life's challenges. The powerful affirmation technique, based on repeating positive statements that relate to personal problems or desires, can be practiced anywhere - while driving to work, taking a shower, or doing housework. Includes examples of effective affirmations, as well as guidelines for generating personalized ones to target individual health, work, and relationship challenges./ / Storey Publishing, LLC 15-05-2002 06-02-2007 Michael Bruney 256 -book 9780385494717 0385494718 us The Hidden Connections: Integrating The Biological, Cognitive, And Social Dimensions Of Life Into A Science Of Sustainability The Hidden Connections: Integrating The Biological, Cognitive, And Social Dimensions Of Life Into A Science Of Sustainability Hardcover Modern/ History $24.95 $2.00 4.5 The author of the bestselling The Tao of Physics and The Web of Life explores the profound social implications of emerging scientific principles and provides an innovative framework for using them to understand and solve some of the most important issues of our time./ / For most of history, scientific investigation was based on linear thinking. But the 1980's brought a revolutionary change. With the advent of improved computer power, scientists could apply complexity theory--nonlinear thinking--to scientific processes far more easily than ever before. Physicist Fritjof Capra was at the forefront of the revolution, and in The Web of Life he extended its scope by showing the impact of complexity theory on living organisms. In The Hidden Connections he breaks through another frontier, this time applying the principles of complexity theory to an analysis of the broad sphere of all human interactions./ / Capra posits that in order to sustain life in the future, the principles underlying our social institutions must be consistent with the organization that nature has evolved to sustain the "web of life." In a lucid and convincing argument, Capra explains how the theoretical ideas of science can be applied to the practical concerns of our time. Covering every aspect of human nature and society, he discusses such vital matters as the management of human organizations, the challenges and dangers of economic globalization, and the nature and the problems of biotechnology. He concludes with an authoritative, often provocative plan for designing ecologically sustainable communities and technologies as alternatives to the current economic globalization./ / A brilliant, incisive examination of the relationship between science and our social systems, The Hidden Connections will spark enormous debate in the scientific community and inspire us to think about the future of humanity in a new way. Doubleday 20-08-2002 11-02-2007 Fritjof Capra 320 -book 9781570625190 1570625190 us The Tao of Physics The Tao of Physics Paperback Taoism $16.95 $7.95 4 First published in 1975, The Tao of Physics rode the wave of fascination in exotic East Asian philosophies. Decades later, it still stands up to scrutiny, explicating not only Eastern philosophies but also how modern physics forces us into conceptions that have remarkable parallels. Covering over 3,000 years of widely divergent traditions across Asia, Capra can't help but blur lines in his generalizations. But the big picture is enough to see the value in them of experiential knowledge, the limits of objectivity, the absence of foundational matter, the interrelation of all things and events, and the fact that process is primary, not things. Capra finds the same notions in modern physics. Those approaching Eastern thought from a background of Western science will find reliable introductions here to Hinduism, Buddhism, and Taoism and learn how commonalities among these systems of thought can offer a sort of philosophical underpinning for modern science. And those approaching modern physics from a background in Eastern mysticism will find precise yet comprehensible descriptions of a Western science that may reinvigorate a hope in the positive potential of scientific knowledge. Whatever your background, The Tao of Physics is a brilliant essay on the meeting of East and West, and on the invaluable possibilities that such a union promises. --Brian Bruya Shambhala 04-01-2000 11-02-2007 Fritjof Capra 366 -book 9780553346107 0553346105 us Uncommon Wisdom Uncommon Wisdom Paperback Modern $27.00 $0.20 5 Bantam 01-01-1989 11-02-2007 Fritjof Capra 334 -book 9780385476751 0385476752 us The Web of Life The Web of Life Hardcover Chaos & Systems/ Acoustics & Sound/ System Theory/ Ecology $23.95 $5.49 4 The vitality and accessibility of Fritjof Capra's ideas have made him perhaps the most eloquent spokesperson of the latest findings emerging at the frontiers of scientific, social, and philosophical thought. In his international bestsellers The Tao of Physics and The Turning Point, he juxtaposed physics and mysticism to define a new vision of reality. In The Web of Life, Capra takes yet another giant step, setting forth a new scientific language to describe interrelationships and interdependence of psychological, biological, physical, social, and cultural phenomena--the "web of life."/ / / / During the past twenty-five years, scientists have challenged conventional views of evolution and the organization of living systems and have developed new theories with revolutionary philosophical and social implications. Fritjof Capra has been at the forefront of this revolution. In The Web of Life, Capra offers a brilliant synthesis of such recent scientific breakthroughs as the theory of complexity, Gaia theory, chaos theory, and other explanations of the properties of organisms, social systems, and ecosystems. Capra's surprising findings stand in stark contrast to accepted paradigms of mechanism and Darwinism and provide an extraordinary new foundation for ecological policies that will allow us to build and sustain communities without diminishing the opportunities for future generations./ / / / Now available in paperback for the first time, The Web of Life is cutting-edge science writing in the tradition of James Gleick's Chaos, Gregory Bateson's Mind and Matter, and Ilya Prigogine's Order Out of Chaos./ / / From the Trade Paperback edition. DoubleDay 01-09-1996 11-02-2007 Fritjof Capra 368 -book 9780880222785 0880222786 us DBase III Plus Advanced Programming DBase III Plus Advanced Programming Paperback dBASE $22.95 $1.85 Que Corporation,U.S. 02-02-1987 07-02-2007 Joseph-David Carrabis 300 -book 9780810807303 0810807300 us Building library collections, Building library collections, Unknown Binding Library Management $0.99 Scarecrow Press 08-02-1974 08-02-2007 Mary Duncan Carter 415 -book 9780894070174 0894070177 us The Book of Internal Exercises The Book of Internal Exercises Hardcover $12.95 $0.01 4 Strawberry Hill Pr 12-02-1978 11-02-2007 Stephen Thomas Chang 138 -book 9781416915546 1416915540 us The I Chong: Meditations from the Joint The I Chong: Meditations from the Joint Hardcover Entertainers/ Criminals $23.95 $9.00 4.5 / Beloved stoner comedian TOMMY CHONG is now older, wiser, and officially an EX-CON./ / / On the morning of February 24, 2003, agents of the U.S. Drug Enforcement Administration launched a sting called Operation Pipe Dreams and forced themselves through the door of Tommy's California home, with automatic weapons drawn. As a result of the raid on his home; the simultaneous ransacking of his son's company, Chong Glass; and the Bush administration's determination to make an example out of the "Pope of Pot;" he was sentenced to nine months in prison because his company shipped bongs to a head shop in Pennsylvania that was a front for the DEA./ / / Well . . . now it's Tommy Chong's turn to fight back and tell his side of the story./ / / Beginning with Tommy's experiences growing up in Canada in the forties and fifties as a mixed-race kid and going on to become a comedy legend, The I Chong is at once a memoir, a spiritual exploration of his time in prison, and a political indictment of the eroding civil liberties in post-9//11 American society. He tells the unbelievable story of his trip down the rabbit hole of America's war on drugs and of his experiences in the federal prison system, and he offers up timely observations on combating the conservative political forces at work in this country. Introspective, inspiring, and incendiary, The I Chong is a unique chronicle of one man's life and how his humorous and spiritual point of view saved him during his wrongful incarceration at the hands of an administration without boundaries./ Simon Spotlight Entertainment 08-08-2006 10-02-2007 Tommy Chong 224 -book 9780974514031 0974514039 us Pragmatic Project Automation: How to Build, Deploy, and Monitor Java Apps Pragmatic Project Automation: How to Build, Deploy, and Monitor Java Apps Paperback/ Illustrated Software Development/ Software Project Management $29.95 $15.65 4.5 Forget wizards, you need a slave--someone to do your repetitive, tedious and boring tasks, without complaint and without pay, so you'll have more time to design and write exciting code. Indeed, that's what computers are for. You can enlist your own computer to automate all of your project's repetitive tasks, ranging from individual builds and running unit tests through to full product release, customer deployment, and monitoring the system. Many teams try to do these tasks by hand. That's usually a really bad idea: people just aren't as good at repetitive tasks as machines. You run the risk of doing it differently the one time it matters, on one machine but not another, or doing it just plain wrong. But the computer can do these tasks for you the same way, time after time, without bothering you. You can transform these labor-intensive, boring and potentially risky chores into automatic, background processes that just work. In this eagerly anticipated book, you'll find a variety of popular, open-source tools to help automate your project. With this book, you will learn:/ • How to make your build processes accurate, reliable, fast, and easy./ • How to build complex systems at the touch of a button./ • How to build, test, and release software automatically, with no human intervention./ • Technologies and tools available for automation: which to use and when./ • Tricks and tips from the masters (do you know how to have your cell phone tell you that your build just failed?)/ You'll find easy-to-implement recipes to automate your Java project, using the same popular style as the rest of our Jolt Productivity Award-winning Starter Kit books. Armed with plenty of examples and concrete, pragmatic advice, you'll find it's easy to get started and reap the benefits of modern software development. You can begin to enjoy pragmatic, automatic, unattended software production that's reliable and accurate every time. The Pragmatic Programmers 08-02-2004 07-02-2007 Mike Clark 176 -book 9780912381039 0912381035 us Traditional Acupuncture: The Law of the Five Elements Traditional Acupuncture: The Law of the Five Elements Paperback Acupuncture & Acupressure/ Massage/ Pharmacology/ Chinese Medicine $16.00 $11.29 4 Traditional Acupuncture Institute, Incorporat 10-02-1994 11-02-2007 Dianne M. Connelly 192 -book 9780262032933 0262032937 us Introduction to Algorithms, Second Edition Introduction to Algorithms, Second Edition Hardcover Beginner's Guides/ Information Systems/ Qualifying Textbooks - Winter 2007 $82.00 $56.99 4 Aimed at any serious programmer or computer science student, the new second edition of Introduction to Algorithms builds on the tradition of the original with a truly magisterial guide to the world of algorithms. Clearly presented, mathematically rigorous, and yet approachable even for the math-averse, this title sets a high standard for a textbook and reference to the best algorithms for solving a wide range of computing problems./ With sample problems and mathematical proofs demonstrating the correctness of each algorithm, this book is ideal as a textbook for classroom study, but its reach doesn't end there. The authors do a fine job of explaining each algorithm. (Reference sections on basic mathematical notation will help readers bridge the gap, but it will help to have some math background to appreciate the full achievement of this handsome hardcover volume.) Every algorithm is presented in pseudo-code, which can be implemented in any computer language, including C//C++ and Java. This ecumenical approach is one of the book's strengths. When it comes to sorting and common data structures, from basic linked lists to trees (including binary trees, red-black, and B-trees), this title really shines, with clear diagrams that show algorithms in operation. Even if you just glance over the mathematical notation here, you can definitely benefit from this text in other ways./ The book moves forward with more advanced algorithms that implement strategies for solving more complicated problems (including dynamic programming techniques, greedy algorithms, and amortized analysis). Algorithms for graphing problems (used in such real-world business problems as optimizing flight schedules or flow through pipelines) come next. In each case, the authors provide the best from current research in each topic, along with sample solutions./ This text closes with a grab bag of useful algorithms including matrix operations and linear programming, evaluating polynomials, and the well-known Fast Fourier Transformation (FFT) (useful in signal processing and engineering). Final sections on "NP-complete" problems, like the well-known traveling salesman problem, show off that while not all problems have a demonstrably final and best answer, algorithms that generate acceptable approximate solutions can still be used to generate useful, real-world answers./ Throughout this text, the authors anchor their discussion of algorithms with current examples drawn from molecular biology (like the Human Genome Project), business, and engineering. Each section ends with short discussions of related historical material, often discussing original research in each area of algorithms. On the whole, they argue successfully that algorithms are a "technology" just like hardware and software that can be used to write better software that does more, with better performance. Along with classic books on algorithms (like Donald Knuth's three-volume set, The Art of Computer Programming), this title sets a new standard for compiling the best research in algorithms. For any experienced developer, regardless of their chosen language, this text deserves a close look for extending the range and performance of real-world software. --Richard Dragan/ Topics covered: Overview of algorithms (including algorithms as a technology); designing and analyzing algorithms; asymptotic notation; recurrences and recursion; probabilistic analysis and randomized algorithms; heapsort algorithms; priority queues; quicksort algorithms; linear time sorting (including radix and bucket sort); medians and order statistics (including minimum and maximum); introduction to data structures (stacks, queues, linked lists, and rooted trees); hash tables (including hash functions); binary search trees; red-black trees; augmenting data structures for custom applications; dynamic programming explained (including assembly-line scheduling, matrix-chain multiplication, and optimal binary search trees); greedy algorithms (including Huffman codes and task-scheduling problems); amortized analysis (the accounting and potential methods); advanced data structures (including B-trees, binomial and Fibonacci heaps, representing disjoint sets in data structures); graph algorithms (representing graphs, minimum spanning trees, single-source shortest paths, all-pairs shortest paths, and maximum flow algorithms); sorting networks; matrix operations; linear programming (standard and slack forms); polynomials and the Fast Fourier Transformation (FFT); number theoretic algorithms (including greatest common divisor, modular arithmetic, the Chinese remainder theorem, RSA public-key encryption, primality testing, integer factorization); string matching; computational geometry (including finding the convex hull); NP-completeness (including sample real-world NP-complete problems and their insolvability); approximation algorithms for NP-complete problems (including the traveling salesman problem); reference sections for summations and other mathematical notation, sets, relations, functions, graphs and trees, as well as counting and probability backgrounder (plus geometric and binomial distributions)./ The MIT Press 01-09-2001 07-02-2007 Thomas H. Cormen/ Charles E. Leiserson/ Ronald L. Rivest/ Clifford Stein 1184 -book 9781932394610 1932394613 us Ajax in Action Ajax in Action Paperback/ Illustrated HTML - General/ Internet/ Qualifying Textbooks - Winter 2007 $44.95 $17.97 4 Val's Blog "A tremendously useful field guide specifically written for developers down in the trenches...waiting for the killer solution..."/ Web users are getting tired of the traditional web experience. They get frustrated losing their scroll position; they get annoyed waiting for refresh; they struggle to reorient themselves on every new page. And the list goes on. With asynchronous JavaScript and XML, known as "Ajax," you can give them a better experience. Once users have experienced an Ajax interface, they hate to go back. Ajax is new way of thinking that can result in a flowing and intuitive interaction with the user./ Ajax in Action helps you implement that thinking--it explains how to distribute the application between the client and the server (hint: use a "nested MVC" design) while retaining the integrity of the system. You will learn how to ensure your app is flexible and maintainable, and how good, structured design can help avoid problems like browser incompatibilities. Along the way it helps you unlearn many old coding habits. Above all, it opens your mind to the many advantages gained by placing much of the processing in the browser. If you are a web developer who has prior experience with web technologies, this book is for you./ Manning Publications 01-10-2005 07-02-2007 Dave Crane/ Eric Pascarello/ Darren James 650 -book 9780802065193 0802065198 us Design with Type Design with Type Paperback Typography/ Manufacturing/ General & Reference/ Qualifying Textbooks - Winter 2007 $23.95 $20.00 5 Design with Type takes the reader through a study of typography that starts with the individual letter and proceeds through the word, the line, and the mass of text. The contrasts possible with type are treated in detail, along with their applications to the typography ofbooks, advertising, magazines, and information data. The various contending schools oftypography are discussed, copiously illustrated with the author's selection of over 150 examples of imaginative typography from many parts ot the world./ Design with Type differs from all other books on typography in that it discusses type as a design material as well as a means of communication: the premise is that if type is understood in terms of design, the user of type will be better able to work with it to achieve maximum legibility and effectiveness, as well as aesthetic pleasure. Everyone who uses type, everyone who enjoys the appearance of the printed word, will find Design with Type informative and fascinating. It provides, too, an outstanding example of the effectiveness of imaginative and tasteful typographic design./ University of Toronto Press 14-06-2000 11-02-2007 Carl Dair 162 -book 0676251833904 0804833907 us Making Out in Chinese (Making Out (Tuttle)) Making Out in Chinese (Making Out (Tuttle)) Paperback Chinese/ Phrasebooks - General $7.95 $4.00 3.5 Tuttle Publishing 11-02-2003 11-02-2007 Ray Daniels 96 -book 9780062502230 0062502239 us 365 Tao: Daily Meditations 365 Tao: Daily Meditations Paperback Taoism/ New Age/ Prayerbooks/ Meditations $15.95 $2.99 5 Umbrella, light, landscape, sky— 
There is no language of the holy. 
The sacred lies in the ordinary./ This treasury of life-enhancing daily readings turns a wise Taoist light on every facet of life. Each daily entry with a one-word title and its Chinese character in elegant calligraphy./ A brief, poetic aphorism provides the theme, followed by a clear, insightful mediation on the day's Taoist principle./ HarperSanFrancisco 17-07-1992 08-02-2007 Ming-Dao Deng 400 -book 9780460874113 046087411X us A Discourse on Method (Everyman's Library (Paper)) A Discourse on Method (Everyman's Library (Paper)) Paperback Classics/ History, 17th & 18th Century/ Modern/ Methodology & Statistics/ Applied/ Geometry & Topology/ Meteorology/ Experiments, Instruments & Measurement $7.95 $3.95 4.5 By calling everything into doubt, Descartes laid the foundations of modern philosophy. He deduced that human beings consist of minds and bodies; that these are totally distinct "substances"; that God exists and that He ensures we can trust the evidence of our senses. Ushering in the "scientific revolution" of Galileo and Newton, Descartes' ideas swept aside ancient and medieval traditions of philosophical methods and investigation. Tuttle Publishing 11-02-2007 Rene Descartes 300 -book 9780140286786 0140286780 us Your Money or Your Life: Transforming Your Relationship with Money and Achieving Financial Independence Your Money or Your Life: Transforming Your Relationship with Money and Achieving Financial Independence Paperback Public Finance/ Financial Planning/ Money Management/ Contemporary $15.00 $5.00 4.5 There's a big difference between "making a living" and making a life. Do you spend more than you earn? Does making a living feel more like making a dying? Do you dislike your job but can't afford to leave it? Is money fragmenting your time, your relationships with family and friends? If so, Your Money or Your Life is for you./ From this inspiring book, learn how to/ • get out of debt and develop savings/ • reorder material priorities and live well for less/ • resolve inner conflicts between values and lifestyles/ • convert problems into opportunities to learn new skills/ • attain a wholeness of livelihood and lifestyle/ • save the planet while saving money/ • and much more/ Penguin (Non-Classics) 01-09-1999 11-02-2007 Joe Dominguez/ Vicki Robin 400 -book 9780262541480 0262541483 us The Scheme Programming Language, 3rd Edition The Scheme Programming Language, 3rd Edition Paperback Qualifying Textbooks - Winter 2007 $37.00 $22.98 5 This thoroughly updated edition of The Scheme Programming Language provides an introduction to Scheme and a definitive reference for standard Scheme, presented in a clear and concise manner. Written for professionals and students with some prior programming experience, it begins by leading the programmer gently through the basics of Scheme and continues with an introduction to some of the more advanced features of the language. Many exercises are presented to help reinforce the lessons learned, and answers to the exercises are given in a new appendix. Most of the remaining chapters are dedicated to the reference material, which describes in detail the standard features of Scheme included in the Revised Report on Scheme and the ANSI//IEEE standard for Scheme./ / Numerous examples are presented throughout the introductory and reference portions of the text, and a unique set of extended example programs and applications, with additional exercises, are presented in the final chapter. Reinforcing the book's utility as a reference text are appendixes that present the formal syntax of Scheme, a summary of standard forms and procedures, and a bibliography of Scheme resources. The Scheme Programming Language stands alone as an introduction to and essential reference for Scheme programmers. It is also useful as a supplementary text for any course that uses Scheme./ / The Scheme Programming Language is illustrated by artist Jean-Pierre Hebert, who writes Scheme programs to extend his ability to create sophisticated works of digital art. The MIT Press 01-10-2003 08-02-2007 R. Kent Dybvig 329 -book 9780874775136 0874775132 us Drawing on the right side of the Brain Drawing on the right side of the Brain Paperback Reference/ Study & Teaching/ Creativity/ Drawing $15.95 $1.08 4.5 Tarcher 01-05-1989 11-02-2007 Betty Edwards 254 -book 9780912111193 0912111194 us Grasping the Wind (Paradigm Title) Grasping the Wind (Paradigm Title) Paperback Acupuncture & Acupressure/ Reference/ Pharmacology $28.95 $19.75 4 Point names, the traditional means for identifying acupoints, have meanings that are, like the wind, hard to grasp. Yet enfolded in these often poetic words is a utility that involves the complex associations derived from the evolution of the Chinese language and the vast array of therapeutic nalogies found in traditional medical works./ In discussing the point names, the authors examine the meaning, context, and significance of each acupuncture point to promote understanding of the point's use in acupuncture practice. Guidelines for understanding the nature and structure of the Chinese language are offered, along with discussions of the Chinese rationale for naming points and point groupings. The reasoning for selecting the English names is offered so that readers may adapt the names for their own use. Each of the 363 points covered is listed according to the system currently used in China. Descriptions include the name in Chinese characters, in Pinyin, and in English. The classical location according to major Chinese texts, the associated point groupings, an explanation of point functions, and classical energetic associations are also noted. Further detail is provided by inclusion of channel relationships, five-phase relationships, and qi functions. Additional notes detail linguistic and practical considerations that have accrued to the point over time. Alternate names for the point are given, again in Chinese, Pinyin, and English. Indexes provide stroke order listings, point group names, and point lists for each character. A glossary of all the characters used in point names provides a definition for each Chinese character. This book provides much valuable theoretical and therapeutic information./ Paradigm Publications (MA) 06-02-1989 11-02-2007 Andrew Ellis/ Nigel Wiseman/ Ken Boss 462 -book 9780064539142 0064539148 us Anatomy Coloring Book Anatomy Coloring Book Paperback Anatomy/ Fundamentals & Skills $15.00 $0.01 4.5 This unique learning tool teaches anatomical concepts and illustrates all the structures and systems of the body through coloring exercises, an effective teaching device that also aids in the retention of the material. 163 detailed illustrations are organized according to body system and a color-key system links terminology to illustrations, reinforcing learning and impressing upon students the visual details of anatomy. Harpercollins Publisher 01-02-1997 06-02-2007 Lawrence Elson 142 -book 0076092021193 0321136497 us Servlets and JSP: The J2EE Web Tier Servlets and JSP: The J2EE Web Tier Paperback Web Site Design/ Internet/ Servlets/ Qualifying Textbooks - Winter 2007 $54.99 $11.99 3.5 Addison-Wesley Professional 29-08-2003 07-02-2007 Jayson Falkner/ Kevin R Jones 784 -book 9781932394443 1932394443 us IntelliJ IDEA in Action (In Action series) IntelliJ IDEA in Action (In Action series) Paperback/ Illustrated Software Development $44.95 $22.29 4.5 This book will help developers dig a little deeper into IDEA and embrace its streamlining features which allow for more time to be spent on project design rather than code management. Without some educational investment, however, IDEA can be just another editor. That then, is the purpose of this book. To not only get you up and running quickly, but to teach you how to use IDEA's powerful software development tools to their fullest advantage. Important product features, including the debugger, source code control, and the many code generation tools, are carefully explained and accompanied by tips and tricks that will leave even experienced IDEA users with "Eureka!" moments of informed programming. Coders just graduating from NOTEPAD and Java IDE veterans alike will profit from the powerful and timesaving expertise provided in this essential programmer's resource./ IDEA is a next-generation IDE for Java, an Integrated Development Environment. As the term IDE implies, IDEA integrates or combines all of the tools needed to develop Java software into a single application and interface. In other words, IDEA is a tool that helps develop Java applications more quickly, easily, and intelligently. IDEA can help with every phase of a project, from design and development to testing and deployment. This book is based on the IntelliJ IDEA Java development environment software from JetBrains, version 5.0./ Manning Publications 01-03-2006 07-02-2007 Duane K. Fields/ Stephen Saunders/ Eugene Belayev 450 -book 0636920924876 1565924878 us Java in a Nutshell : A Desktop Quick Reference (Java Series) Java in a Nutshell : A Desktop Quick Reference (Java Series) (3rd Edition) 3rd Paperback Reference/ Networking/ Object-Oriented Design/ Nutshell/ Java $29.95 $0.01 4 The 3rd edition of the well-known reference, Java in a Nutshell, covers the essential APIs of Java 1.2, including networking, security, input and output, and basic language and utility classes. Due to the size of the Java 1.2 API, graphics and graphical user interface classes are now examined in a volume called Java Foundation Classes in a Nutshell, and server-side and enterprise programming are detailed in Java Enterprise in a Nutshell./ Though primarily a reference, the book starts off with a thorough, fast-paced introduction to Java, exploring all the key topics, including syntax, object-oriented programming, security, beans, and tools. These discussions are brief and very information-dense, and if you are buying this book to learn the language, you will probably be overwhelmed by the speed of this initiation./ This book intends to document quite a bit of Java, and it easily succeeds with broad coverage of Java programming in Part I, and API cataloging broken down by package in Part II. For example, discussions in Part I explain Types, Reflection, and Dynamic Loading. The handling of these topics takes a little over a page, but the book gives a useful overview with code examples that clearly illustrate the points made. It is one of the clearest and most concise treatments of these three topics available./ The chapters in Part II include an introduction, diagrams, and sections for each class in the package. The sections for each class can be very informative, as in the discussion of the Socket class in the java.net chapter, which includes how to instantiate a Socket object, getting I//O streams from the object you instantiated, and how to alter the behavior of sockets. This discussion, like most in this book, is brief, clear, and to the point./ If you are looking for a Java reference, this is a solid volume that will provide lasting value. --John Keogh/ Topics covered: Part I, "Introducing Java," provides broad coverage of Java programming topics, including data types, syntax, classes, and objects; Java file structure; inner classes; interfaces; packages; creating and initializing objects; destroying and finalizing objects; input//output; cryptography; networking; security; threads; JavaBeans; JavaDoc; and tools that come with Java 1.2 SDK./ Part II, "The Java API Quick Reference," includes chapters on the following Java packages: java.beans, java.beans.beancontext, java.io, java.lang, java.lang.ref, java.lang.reflect, java.math, java.net, java.security, java.security.acl, java.security.cert, java.security.interfaces, java.security.spec, java.text, java.util, java.util.jar, java.util.zip, javax.crypto, javax.crypto.interfaces, javax.crypto.spec, and a final chapter, which provides an index for classes, methods, and fields./ O'Reilly 11-02-1999 07-02-2007 David Flanagan 666 -book 9780596000486 0596000480 us JavaScript: The Definitive Guide JavaScript: The Definitive Guide Paperback/ Illustrated Web Site Design/ JavaScript/ Object-Oriented Design/ HTML - General/ Utilities/ Web Programming/ Qualifying Textbooks - Winter 2007 $44.95 $7.98 4.5 Since the earliest days of Internet scripting, Web developers have considered JavaScript: The Definitive Guide an essential resource. David Flanagan's approach, which combines tutorials and examples with easy-to-use syntax guides and object references, suits the typical programmer's requirements nicely. The brand-new fourth edition of Flanagan's "Rhino Book" includes coverage of JavaScript 1.5, JScript 5.5, ECMAScript 3, and the Document Object Model (DOM) Level 2 standard from the World Wide Web Consortium (W3C). Interestingly, the author has shifted away from specifying--as he did in earlier editions--what browsers support each bit of the language. Rather than say Netscape 3.0 supports the Image object while Internet Explorer 3.0 does not, he specifies that JavaScript 1.1 and JScript 3.0 support Image. More usefully, he specifies the contents of independent standards like ECMAScript, which encourages scripters to write applications for these standards and browser vendors to support them. As Flanagan says, JavaScript and its related subjects are very complex in their pure forms. It's impossible to keep track of the differences among half a dozen vendors' generally similar implementations. Nonetheless, a lot of examples make reference to specific browsers' capabilities./ Though he does not cover server-side APIs, Flanagan has chosen to separate coverage of core JavaScript (all the keywords, general syntax, and utility objects like Array) from coverage of client-side JavaScript (which includes objects, like History and Event, that have to do with Web browsers and users' interactions with them. This approach makes this book useful to people using JavaScript for applications other than Web pages. By the way, the other classic JavaScript text--Danny Goodman's JavaScript Bible--isn't as current as this book, but it's still a fantastic (and perhaps somewhat more novice-friendly) guide to the JavaScript language and its capabilities. --David Wall/ Topics covered: The JavaScript language (version 1.0 through version 1.5) and its relatives, JScript and ECMAScript, as well as the W3C DOM standards they're often used to manipulate. Tutorial sections show how to program in JavaScript, while reference sections summarize syntax and options while providing copious code examples./ O'Reilly Media 15-12-2001 07-02-2007 David Flanagan 900 -book 9780596007386 0596007388 us Java 5.0 Tiger: A Developer's Notebook Java 5.0 Tiger: A Developer's Notebook Paperback/ Illustrated Perl/ Java $29.95 $3.97 4.5 Java 5.0, code-named "Tiger", promises to be the most significant new version of Java since the introduction of the language. With over a hundred substantial changes to the core language, as well as numerous library and API additions, developers have a variety of new features, facilities, and techniques available. But with so many changes, where do you start? You could read through the lengthy, often boring language specification; you could wait for the latest 500 page tome on concepts and theory; you could even play around with the new JDK, hoping you figure things out--or you can get straight to work with Java 5.0 Tiger: A Developer's Notebook. This no-nonsense, down-and-dirty guide by bestselling Java authors Brett McLaughlin and David Flanagan skips all the boring prose and lecture, and jumps right into Tiger. You'll have a handle on the important new features of the language by the end of the first chapter, and be neck-deep in code before you hit the halfway point. Using the task-oriented format of this new series, you'll get complete practical coverage of generics, learn how boxing and unboxing affects your type conversions, understand the power of varargs, learn how to write enumerated types and annotations, master Java's new formatting methods and the for//in loop, and even get a grip on concurrency in the JVM. Light on theory and long on practical application, Java 5.0 Tiger: A Developer's Notebook allows you to cut to the chase, getting straight to work with Tiger's new features. The new Developer's Notebooks series from O'Reilly covers important new tools for software developers. Emphasizing example over explanation and practice over theory, they focus on learning by doing--you'll get the goods straight from the masters, in an informal and code-intensive style that suits developers. If you've been curious about Tiger, but haven't known where to start, this no-fluff, lab-style guide is the solution. O'Reilly Media 25-06-2004 07-02-2007 David Flanagan/ Brett McLaughlin 177 -book 9780936185514 0936185511 us Imperial Secrets of Health and Longevity Imperial Secrets of Health and Longevity Paperback New Age/ History/ Tai Chi & Qi Gong $12.95 $8.50 3.5 The 14 secrets of longevity of the Qing Dynasty Emperor, Qian Long, cover all aspects of living a long and healthy life. This book offers Qian Long's sage advice on the role of diet, exercise, relaxation, emotions, sex, and environment in achieving long life and good health. This traditional Chinese medical theory includes self-massage, stretching, and qi gong exercise as well as how to use Chinese tonic herbs. Blue Poppy Press 03-02-1999 06-02-2007 Bob Flaws 113 -book 9780936185521 093618552X us Statements of Fact in Traditional Chinese Medicine Statements of Fact in Traditional Chinese Medicine Paperback Basic Science/ History $15.95 $33.04 4.5 At last, what every tcm student has been looking for, a linguistically accurate, succinct list of the key statements of fact in tcm which, as a style of Chinese medicine, is largely a word game. However, to play the game, one needs to know the words. Hopefully, this book will help Western students gain both clarity and proficiency in the process and practice of doing tcm. When supplemented by a teacher, introductory grammar, and a dictionary, this book can quickly and efficiently help teach English language students and practitioners how to read medical Chinese and thus gain access to the vast library of Chinese medical literature. Blue Poppy Press 01-01-1994 06-02-2007 Bob Flaws 107 -book 9780936185927 0936185929 us The Tao of Healthy Eating The Tao of Healthy Eating Paperback Healthy/ Chinese Medicine $15.95 $8.21 4 Chinese dietary therapy is one of the most important aspects of Chinese medicine. The Tao of Healthy Eating illuminates the theory and practice of Chinese dietary therapy with emphasis on the concerns and attitudes of Westerners. Commonsense metaphors explain basic Chinese medical theories and their application in preventive and remedial dietary therapy. It features a clear description of the Chinese medical understanding of digestion and all the practical implications if this for day-to-day diet. Issues of Western interest are discussed, such as raw versus cooked foods, high cholesterol, food allergies, and candidacies. It includes the Chinese medical descriptions of 200 Western food and similar information on vitamins, minerals, and amino acids. Blue Poppy Press 01-01-1998 06-02-2007 Bob Flaws 128 -book 9781932394184 1932394184 us Java Reflection in Action (In Action series) Java Reflection in Action (In Action series) Paperback/ Illustrated $44.95 $17.99 4.5 Explaining the Java Reflection API and providing techniques for using it effectively, this guide describes the capabilities that allow a program to examine and modify itself at runtime. The java.lang.reflect package and its uses are covered, including a detailed discussion of Java's dynamic proxy facility. Less obvious reflective capabilities, such as call stack introspection and the Java class loader, are addressed. In recognition of the limitations of Java Reflection, the various ways to use Reflection to generate code and surpass these limitations are detailed. A discussion of performance analysis techniques and a look ahead at what is new in JDK 1.5 is included./ Manning Publications 10-02-2004 07-02-2007 Ira R. Forman/ Nate Forman 300 -book 9780977616602 0977616606 us Rails Recipes (Pragmatic Programmers) Rails Recipes (Pragmatic Programmers) Paperback Object-Oriented Design/ Internet $32.95 $22.46 4.5 Rails is large, powerful, and new. How do you use it effectively? How do you harness the power? And, most important, how do you get high quality, real-world applications written?/ From the latest Ajax effects to time-saving automation tips for your development process, Rails Recipes will show you how the experts have already solved the problems you have./ • Use generators to automate repetitive coding tasks./ • Create sophisticated role-based authentication schemes./ • Add live search and live preview to your site./ • Run tests when anyone checks code in./ • How to create tagged data the right way./ • and many, many more.../ Owning Rails Recipes is like having the best Rails programmers sitting next to you while you code./ Pragmatic Bookshelf 01-06-2006 01-02-2007 3 Chad Fowler 332 -book 0785342485677 0201485672 us Refactoring: Improving the Design of Existing Code Refactoring: Improving the Design of Existing Code Hardcover Object-Oriented Design/ Design Tools & Techniques/ Qualifying Textbooks - Winter 2007 $59.99 $39.99 4.5 Your class library works, but could it be better? Refactoring: Improving the Design of Existing Code shows how refactoring can make object-oriented code simpler and easier to maintain. Today refactoring requires considerable design know-how, but once tools become available, all programmers should be able to improve their code using refactoring techniques./ Besides an introduction to refactoring, this handbook provides a catalog of dozens of tips for improving code. The best thing about Refactoring is its remarkably clear presentation, along with excellent nuts-and-bolts advice, from object expert Martin Fowler. The author is also an authority on software patterns and UML, and this experience helps make this a better book, one that should be immediately accessible to any intermediate or advanced object-oriented developer. (Just like patterns, each refactoring tip is presented with a simple name, a "motivation," and examples using Java and UML.)/ Early chapters stress the importance of testing in successful refactoring. (When you improve code, you have to test to verify that it still works.) After the discussion on how to detect the "smell" of bad code, readers get to the heart of the book, its catalog of over 70 "refactorings"--tips for better and simpler class design. Each tip is illustrated with "before" and "after" code, along with an explanation. Later chapters provide a quick look at refactoring research./ Like software patterns, refactoring may be an idea whose time has come. This groundbreaking title will surely help bring refactoring to the programming mainstream. With its clear advice on a hot new topic, Refactoring is sure to be essential reading for anyone who writes or maintains object-oriented software. --Richard Dragan/ Topics Covered: Refactoring, improving software code, redesign, design tips, patterns, unit testing, refactoring research, and tools./ Addison-Wesley Professional 28-06-1999 07-02-2007 Martin Fowler/ Kent Beck/ John Brant/ William Opdyke/ Don Roberts 464 -book 0785342657838 020165783X us UML Distilled: A Brief Guide to the Standard Object Modeling Language UML Distilled: A Brief Guide to the Standard Object Modeling Language (2nd Edition) 2nd Paperback Object-Oriented Design/ Software Development/ UML $34.99 $2.95 4 The second edition of Martin Fowler's bestselling UML Distilled provides updates to the Unified Modeling Language (UML) without changing its basic formula for success. It is still arguably the best resource for quick, no-nonsense explanations of using UML./ The major strength of UML Distilled is its short, concise presentation of the essentials of UML and where it fits within today's software development process. The book describes all the major UML diagram types, what they're for, and the basic notation involved in creating and deciphering them. These diagrams include use cases; class and interaction diagrams; collaborations; and state, activity, and physical diagrams. The examples are always clear, and the explanations cut to the fundamental design logic./ For the second edition, the material has been reworked for use cases and activity diagrams, plus there are numerous small tweaks throughout, including the latest UML v. 1.3 standard. An appendix even traces the evolution of UML versions./ Working developers often don't have time to keep up with new innovations in software engineering. This new edition lets you get acquainted with some of the best thinking about efficient object-oriented software design using UML in a convenient format that will be essential to anyone who designs software professionally. --Richard Dragan/ Topics covered: UML basics, analysis and design, outline development (software development process), inception, elaboration, managing risks, construction, transition, use case diagrams, class diagrams, interaction diagrams, collaborations, state diagrams, activity diagrams, physical diagrams, patterns, and refactoring basics./ Addison-Wesley Professional 25-08-1999 07-02-2007 Martin Fowler/ Kendall Scott 185 -book 0752063320839 0672320835 us The Ruby Way The Ruby Way Paperback Object-Oriented Design/ Qualifying Textbooks - Winter 2007 $39.99 $13.69 4.5 The Ruby Way assumes that the reader is already familiar with the subject matter. Using many code samples it focuses on "how-to use Ruby" for specific applications, either as a stand-alone language, or in conjunction with other languages./ Topics covered include:/ • Simple data tasks;/ • Manipulating structured data;/ • External data manipulation;/ • User interfaces;/ • Handling threads;/ • System programming;/ • Network and web programming;/ • Tools and utilities./ Note: The appendices offer instruction on migrating from Perl and Python to Ruby, and extending Ruby in C and C++./ Sams 17-12-2001 07-02-2007 Hal Fulton 600 -book 0785342633610 0201633612 us Design Patterns: Elements of Reusable Object-Oriented Software (Addison-Wesley Professional Computing Series) Design Patterns: Elements of Reusable Object-Oriented Software (Addison-Wesley Professional Computing Series) Hardcover Object-Oriented Design/ Software Development/ Software Reuse/ HTML - General/ Gangs/ Design Tools & Techniques/ Object-Oriented Software Design/ Qualifying Textbooks - Winter 2007 $54.99 $30.99 4.5 Design Patterns is a modern classic in the literature of object-oriented development, offering timeless and elegant solutions to common problems in software design. It describes patterns for managing object creation, composing objects into larger structures, and coordinating control flow between objects. The book provides numerous examples where using composition rather than inheritance can improve the reusability and flexibility of code. Note, though, that it's not a tutorial but a catalog that you can use to find an object-oriented design pattern that's appropriate for the needs of your particular application--a selection for virtuoso programmers who appreciate (or require) consistent, well-engineered object-oriented designs. Addison-Wesley Professional 15-01-1995 07-02-2007 Erich Gamma/ Richard Helm/ Ralph Johnson/ John Vlissides 395 -book B0006AXOU2 us Gravity: [classic and modern views] (Science study series) Gravity: [classic and modern views] (Science study series) Unknown Binding Astrophysics & Space Science $0.99 Anchor Books 08-02-1962 08-02-2007 George Gamow 157 -book 9781422103296 1422103293 us Changing Minds: The Art And Science of Changing Our Own And Other People's Minds (Leadership for the Common Good) Changing Minds: The Art And Science of Changing Our Own And Other People's Minds (Leadership for the Common Good) Paperback Leadership/ Management/ Motivational/ Applied Psychology/ Cognitive $14.95 $5.99 3 Think about the last time you tried to change someone’s mind about something important: a voter’s political beliefs; a customer’s favorite brand; a spouse’s decorating taste. Chances are you weren’t successful in shifting that person’s beliefs in any way. In his book, Changing Minds, Harvard psychologist Howard Gardner explains what happens during the course of changing a mind – and offers ways to influence that process./ Remember that we don’t change our minds overnight, it happens in gradual stages that can be powerfully influenced along the way.This book provides insights that can broaden our horizons and shape our lives./ Harvard Business School Press 30-09-2006 08-02-2007 Howard Gardner 244 -book 9780596007331 0596007337 us We the Media We the Media Hardcover Culture/ Government/ Internet Publishing/ Journalism/ Media Studies/ Weblogs/ Technology & Society $24.95 $3.49 4.5 Grassroots journalists are dismantling Big Media's monopoly on the news, transforming it from a lecture to a conversation. Not content to accept the news as reported, these readers-turned-reporters are publishing in real time to a worldwide audience via the Internet. The impact of their work is just beginning to be felt by professional journalists and the newsmakers they cover. In We the Media: Grassroots Journalism by the People, for the People, nationally known business and technology columnist Dan Gillmor tells the story of this emerging phenomenon, and sheds light on this deep shift in how we make and consume the news. We the Media is essential reading for all participants in the news cycle:/ • Consumers learn how they can become producers of the news. Gillmor lays out the tools of the grassroots journalist's trade, including personal Web journals (called weblogs or blogs), Internet chat groups, email, and cell phones. He also illustrates how, in this age of media consolidation and diminished reporting, to roll your own news, drawing from the array of sources available online and even over the phone./ • Newsmakers politicians, business executives, celebrities get a wake-up call. The control that newsmakers enjoyed in the top-down world of Big Media is seriously undermined in the Internet Age. Gillmor shows newsmakers how to successfully play by the new rules and shift from control to engagement./ • Journalists discover that the new grassroots journalism presents opportunity as well as challenge to their profession. One of the first mainstream journalists to have a blog, Gillmor says, "My readers know more than I do, and that's a good thing." In We the Media, he makes the case to his colleagues that, in the face of a plethora of Internet-fueled news vehicles, they must change or become irrelevant./ At its core, We the Media is a book about people. People like Glenn Reynolds, a law professor whose blog postings on the intersection of technology and liberty garnered him enough readers and influence that he became a source for professional journalists. Or Ben Chandler, whose upset Congressional victory was fueled by contributions that came in response to ads on a handful of political blogs. Or Iraqi blogger Zayed, whose Healing Irag blog (healingiraq.blogspot.com) scooped Big Media. Or acridrabbit, who inspired an online community to become investigative reporters and discover that the dying Kaycee Nichols sad tale was a hoax. Give the people tools to make the news, We the Media asserts, and they will. Journalism in the 21st century will be fundamentally different from the Big Media that prevails today. We the Media casts light on the future of journalism, and invites us all to be part of it. O'Reilly Media 08-02-2004 11-02-2007 Dan Gillmor 304 -book 9780894711350 0894711350 us Gray's Anatomy: The Unabridged Running Press Edition of the American Classic Gray's Anatomy: The Unabridged Running Press Edition of the American Classic Hardcover Bargain Books/ Reference/ Family Health/ Anatomy/ Surgery/ Bargain Books Outlet $18.98 $0.34 3.5 The leg bone's connected to the hip bone, and so on. For many of us, anatomy can seem intimidating and unrewarding, but the right teacher can clear such feelings away in a heartbeat. Our fascination with our bodies is a powerful force, and once we start looking, we find that beauty is much more than skin-deep./ It so happens that the right teacher can take the form of a book. Gray's Anatomy is one of those few titles that practically everybody has heard of, and with good reason--it is a scientific and artistic triumph. Not just a dry index of parts and names, Gray's lets the natural beauty and grace of the body's interconnected systems and structures shine forth from the page. Using sumptuous illustrations and clear, matter-of-fact descriptions, Dr. Gray unleashed a classic on the world more than 100 years ago. Its clarity and usefulness keep it in print today. Whether you want to understand yourself or others, knowledge of our physical parts and how they fit together is essential. Gray's Anatomy provides that information in a simple, timeless format that cleanly dissects a body of knowledge grown over centuries. This book will not only fill the needs of people in the medical profession, but will please artists and naturalists as well. --Rob Lightner/ Running Press Book Publishers 11-02-2007 Henry F. R. S. Gray/ T. Pickering Pick 1248 -book 9780976694076 0976694077 us Best of Ruby Quiz Volume One (Pragmatic Programmers) Best of Ruby Quiz Volume One (Pragmatic Programmers) Paperback/ Illustrated Object-Oriented Design/ Software Development $29.95 $13.71 4.5 Solve these twenty-five popular programming puzzles, and sharpen your programming skills as you craft solutions./ You'll find interesting and challenging programming puzzles including:/ • 800 Numbers/ • Crosswords/ • Cryptograms/ • Knight's Tour/ • Paper, Rock, Scissors/ • Tic-Tac-Toe/ • Texas Hold-Em/ • ...and more./ / Learning to program can be quite a challenge. Classes and books can get you so far, but at some point you have to sit down and start playing with some code. Only by reading and writing real code, with real problems, can you learn./ / The Ruby Quiz was built to fill exactly this need for Ruby programmers. Challenges, solutions, and discussions combine to make Ruby Quiz a powerful way to learn Ruby tricks. See how algorithms translate to Ruby code, get exposure to Ruby's libraries, and learn how other programmers use Ruby to solve problems quickly and efficiently./ Pragmatic Bookshelf 01-03-2006 08-02-2007 James Edward Gray 298 -book 9780312064945 0312064942 us The Alexander Technique: A Complete Course in How to Hold and Use Your Body for Maximum Energy The Alexander Technique: A Complete Course in How to Hold and Use Your Body for Maximum Energy Paperback Stress Management/ Psychology & Counseling/ Physical Therapy/ Pharmacology/ Exercise/ Alexander Technique/ Injuries & Rehabilitation $15.95 $5.00 3.5 The Alexander Technique is a proven process of mind and body reeducation that reduces stress and muscle tension, and revitalization those who practice it. Used by many actors, athletes, and dancers, the technique can help anyone increase his or her energy and achieve a more dynamic presence./ / Written by a veteran instructor of the Alexander Technique, this authentic and easy-to-follow guide allows everyone to learn the increasingly popular program, with clear instructions for each exercise, and dozens of helpful photographs that show correct and incorrect positions to use for the exercises and throughout the day./ St. Martin's Griffin 15-11-1991 11-02-2007 John Gray 176 -book 9781556432149 1556432143 us Planet Medicine: Modalities Planet Medicine: Modalities Paperback Holistic/ Holistic Medicine/ Pharmacology/ History/ Philosophy of Medicine $25.00 $7.43 Planet Medicine is a major work by an anthropologist who looks at medicine in a broad context. In this edition, additions to this classic text include a section on Reiki, a comparison of types of palpation used in healing, updates on craniosacral therapy, and a means of understanding how different alternative medicines actually work. Illustrated throughout, this is the standard on the history, philosophy, and anthropology of this subject. North Atlantic Books 11-02-1995 11-02-2007 Richard Grossinger/ Spain Rodriguez/ Alex Grey 602 -book 9781590590997 1590590996 us Logging in Java with the JDK 1.4 Logging API and Apache log4j Logging in Java with the JDK 1.4 Logging API and Apache log4j Hardcover Software Development $49.99 $2.91 3 Logging in Java with the JDK 1.4 Logging API and Apache log4j is the first book to discuss the two foremost logging APIs: JDK 1.4.0 logging API and Apache log4j 1.2.6 logging API for application developers. The internals of each API are examined, contrasted, and compared in exhaustive depth. Programmers will find a wealth of information simply not available elsewhere--not even on the Internet./ Each concept explained is accompanied by code example written in Java language. The book also provides guidelines for extending the existing logging frameworks to cater to application-specific needs. This is an essential handbook for logging-related information and techniques needed for developing applications in the Java language./ Apress 15-04-2003 07-02-2007 Samudra Gupta 336 -book 0785342753066 0201753065 us Component Development for the Java Platform Component Development for the Java Platform Paperback Software Design/ Qualifying Textbooks - Winter 2007 $39.99 $4.41 4.5 Addison-Wesley Professional 15-12-2001 07-02-2007 1 Stuart Dabbs Halloway 304 -book 0636920002925 0596002920 us XML in a Nutshell, 2nd Edition XML in a Nutshell, 2nd Edition Paperback HTML - General/ XML/ Nutshell $39.95 $0.46 4 Continuing in the tradition of the Nutshell series, XML in a Nutshell provides a dense tutorial on its subject, as well as a useful day-to-day reference. While the reader isn't expected to have prior expertise in XML, this book is most effective as an add-on to a more introductory tutorial because of its relatively fast pace./ The authors set out to systematically--and rapidly--cover the basics of XML first, namely the history of the markup language and the various languages and technologies that compose the standard. In this first section, they discuss the basics of XML markup, Document Type Definitions (DTDs), namespaces, and Unicode. From there, the authors move into "narrative-centric documents" in a section that appropriately focuses on the application of XML to books, articles, Web pages and other readable content./ This book definitely presupposes in the reader an aptitude for picking up concepts quickly and for rapidly building cumulative knowledge. Code examples are used--only to illustrate the particular point in question--but not in excess. The book gets into "data-centric" XML, exploring the difference between the object-driven Document Object Model (DOM) and the event-driven Simple API for XML (SAX). However, these areas are a little underpowered and offer a bit less detail about this key area than the reader will expect./ At the core of any Nutshell book is the reference section, and the installment found inside this text is no exception. Here, the XML 1.0 standard, XPath, XSLT, DOM, SAX, and character sets are covered. Some material that is covered earlier in the book--such as Cascading Style Sheets (CSS)--is not re-articulated, however. XML in a Nutshell is not the only book on XML you should have, but it is definitely one that no XML coder should be without. --Stephen W. Plain/ Topics covered:/ • XML history/ • Document Type Definitions (DTDs)/ • Namespaces/ • Internationalization/ • XML-based data formats/ • XHTML/ • XSL/ • XPath/ • XLink/ • XPointer/ • Cascading Style Sheets (CSS)/ • XSL-FO/ • Document Object Model (DOM)/ • Simple API for XML (SAX)/ O'Reilly 15-06-2002 07-02-2007 Elliotte Rusty Harold/ W. Scott Means 640 -book 9781932394283 1932394281 us Lucene in Action (In Action series) Lucene in Action (In Action series) Paperback/ Illustrated $44.95 $31.14 4.5 Lucene is a gem in the open-source world‹-a highly scalable, fast search engine. It delivers performance and is disarmingly easy to use. Lucene in Action is the authoritative guide to Lucene. It describes how to index your data, including types you definitely need to know such as MS Word, PDF, HTML, and XML. It introduces you to searching, sorting, filtering, and highlighting search results./ / Lucene powers search in surprising places‹-in discussion groups at Fortune 100 companies, in commercial issue trackers, in email search from Microsoft, in the Nutch web search engine (that scales to billions of pages). It is used by diverse companies including Akamai, Overture, Technorati, HotJobs, Epiphany, FedEx, Mayo Clinic, MIT, New Scientist Magazine, and many others. Adding search to your application can be easy. With many reusable examples and good advice on best practices, Lucene in Action shows you how./ / What's Inside/ - How to integrate Lucene into your applications/ - Ready-to-use framework for rich document handling/ - Case studies including Nutch, TheServerSide, jGuru, etc./ - Lucene ports to Perl, Python, C#//.Net, and C++/ - Sorting, filtering, term vectors, multiple, and remote index searching/ - The new SpanQuery family, extending query parser, hit collecting/ - Performance testing and tuning/ - Lucene add-ons (hit highlighting, synonym lookup, and others)/ Manning Publications 28-12-2004 07-02-2007 Erik Hatcher/ Otis Gospodnetic 456 -book 9781930110588 1930110588 us Java Development with Ant Java Development with Ant Paperback/ Illustrated $44.95 $24.67 4.5 Encompassing Java-centric software project best practices for designing and automating build, test, and deployment processes using ANT, this book is written for developers using Java in large software projects and those who have reached the limits of classic IDE development systems. Benefiting developers who apply extreme programming methodology to Java projects, this resource provides detailed coverage of ANT and explains how to use it in large projects and extend it when needed. In addition to using ANT for Java applications, it includes discussions of servlets and J2EE applications, which cover the majority of Java development projects./ Manning Publications 08-02-2002 07-02-2007 Erik Hatcher/ Steve Loughran 672 -book 9781930110977 1930110979 us Code Generation in Action Code Generation in Action Paperback Software Design/ Software Development/ Systems Analysis & Design/ Coding Theory $44.95 $9.95 4.5 Developers using code generation are producing higher quality code faster than their hand-coding counterparts. And, they enjoy other advantages like maintainability, consistency and abstraction. Using the new CG methods they can make a change in one place, avoiding multiple synchronized changes you must make by hand./ Code Generation in Action shows you the techniques of building and using programs to write other programs. It shows how to avoid repetition and error to produce consistent, high quality code, and how to maintain it more easily. It demonstrates code generators for user interfaces, database access, remote procedure access, and much more./ Code Generation in Action is an A-to-Z guide covering building, buying, deploying and using code generators. If you are a software engineer-whether beginner or advanced-eager to become the "ideas person," the mover-and-shaker on your development team, you should learn CG techniques. This book will help you master them./ What's Inside:/ • Code generation basics/ • CG techniques and best practices/ • Patterns of CG design/ • How to deploy generators/ • Many example generators/ Includes generators for:/ • Database access/ • RPC/ • Unit tests/ • Documentation/ • Business logic/ • Data translation/ Over his twenty years of development experience, Jack Herrington has shipped many software applications helped by code generation techniques. He runs the Code Generation Network. Manning Publications 01-07-2003 07-02-2007 Jack Herrington 368 -book 9780140951448 014095144X us Tao of Pooh and Te of Piglet Boxed Set Tao of Pooh and Te of Piglet Boxed Set Paperback/ Box set History of Books/ 20th Century/ Taoism/ Entertainment/ Literature & Fiction/ Nonfiction/ Religion & Spirituality $27.00 $9.89 4 Is there such thing as a Western Taoist? Benjamin Hoff says there is, and this Taoist's favorite food is honey. Through brilliant and witty dialogue with the beloved Pooh-bear and his companions, the author of this smash bestseller explains with ease and aplomb that rather than being a distant and mysterious concept, Taoism is as near and practical to us as our morning breakfast bowl. Romp through the enchanting world of Winnie-the-Pooh while soaking up invaluable lessons on simplicity and natural living. Penguin (Non-Classics) 01-11-1994 11-02-2007 Benjamin Hoff -book 9780140230161 0140230165 us The Te of Piglet The Te of Piglet Paperback History of Books/ British/ Taoism/ Mysticism/ 20th Century $14.00 $1.05 3 In The Te of Piglet, a good deal of Taoist wisdom is revealed through the character and actions of A. A. Milne's Piglet. Piglet herein demonstrates a very important principle of Taoism: The Te-a Chinese word meaning Virtue-of the Small. Penguin (Non-Classics) 01-11-1993 11-02-2007 Benjamin Hoff 272 -book 9780553345841 0553345842 us The Mind's I: Fantasies and Reflections on Self and Soul The Mind's I: Fantasies and Reflections on Self and Soul Paperback Consciousness & Thought/ Cognitive Psychology/ Cognitive Science $18.95 $1.43 4.5 Brilliant, shattering, mind-jolting, The  Mind's I is a searching, probing nook--a  cosmic journey of the mind--that goes deeply into  the problem of self and self-consciousness as  anything written in our time. From verbalizing  chimpanzees to scientific speculations involving  machines with souls, from the mesmerizing, maze-like  fiction of Borges to the tantalizing, dreamlike  fiction of Lem and Princess Ineffable, her circuits  glowing read and gold, The Mind's I   opens the mind to the Black Box of fantasy, to the  windfalls of reflection, to new dimensions of  exciting possibilities. Bantam 01-04-1985 08-02-2007 Douglas Hofstadter/ Daniel C. Dennett 512 -book 9780880225724 0880225726 us Unix Shell Commands Quick Reference (Que Quick Reference Series) Unix Shell Commands Quick Reference (Que Quick Reference Series) Paperback MacOS/ Shell/ Macintosh/ Macs $8.95 $0.77 4 Que Pub 10-02-1990 07-02-2007 William Holliker 154 -book 9780131855861 0131855867 us Spring Into HTML and CSS (Spring Into... Series) Spring Into HTML and CSS (Spring Into... Series) Paperback HTML - General/ Internet/ XHTML/ Qualifying Textbooks - Winter 2007 $29.99 $6.00 4 Addison-Wesley Professional 22-04-2005 07-02-2007 1 Molly E. Holzschlag 336 -book 9789629962166 9629962160 us Business Chinese Business Chinese Paperback English (All)/ Chinese/ Study & Teaching/ Qualifying Textbooks - Winter 2007 $33.00 $24.98 This book will help readers develop their competence in advanced Chinese in a business context. Rather than teaching language in isolation from substantive content, Business Chinese presents readers with both content and context. Exercises and tasks in the book require readers to integrate their language skills with their content knowledge. To meet learners'practical communication needs, the book focuses on both oral and written language skills./ In order to keep readers abreast of the real business world, all texts and exercises are drawn from authentic materials from mainland China, Taiwan and Hong Kong. Business Chinese is the perfect, practical guide for those who want to master Chinese language and the Chinese business world./ Chinese University Press 20-07-2005 09-02-2007 Jiaying Howard/ Tsengtseng Chang 311 -book 0785342616224 020161622X us The Pragmatic Programmer: From Journeyman to Master The Pragmatic Programmer: From Journeyman to Master Paperback Qualifying Textbooks - Winter 2007 $45.99 $21.84 4.5 Programmers are craftspeople trained to use a certain set of tools (editors, object managers, version trackers) to generate a certain kind of product (programs) that will operate in some environment (operating systems on hardware assemblies). Like any other craft, computer programming has spawned a body of wisdom, most of which isn't taught at universities or in certification classes. Most programmers arrive at the so-called tricks of the trade over time, through independent experimentation. In The Pragmatic Programmer, Andrew Hunt and David Thomas codify many of the truths they've discovered during their respective careers as designers of software and writers of code./ Some of the authors' nuggets of pragmatism are concrete, and the path to their implementation is clear. They advise readers to learn one text editor, for example, and use it for everything. They also recommend the use of version-tracking software for even the smallest projects, and promote the merits of learning regular expression syntax and a text-manipulation language. Other (perhaps more valuable) advice is more light-hearted. In the debugging section, it is noted that, "if you see hoof prints think horses, not zebras." That is, suspect everything, but start looking for problems in the most obvious places. There are recommendations for making estimates of time and expense, and for integrating testing into the development process. You'll want a copy of The Pragmatic Programmer for two reasons: it displays your own accumulated wisdom more cleanly than you ever bothered to state it, and it introduces you to methods of work that you may not yet have considered. Working programmers will enjoy this book. --David Wall/ Topics covered: A useful approach to software design and construction that allows for efficient, profitable development of high-quality products. Elements of the approach include specification development, customer relations, team management, design practices, development tools, and testing procedures. This approach is presented with the help of anecdotes and technical problems./ Addison-Wesley Professional 20-10-1999 07-02-2007 1 Andrew Hunt/ David Thomas 352 -book 9780974514017 0974514012 us Pragmatic Unit Testing in Java with JUnit Pragmatic Unit Testing in Java with JUnit Paperback/ Illustrated Software Development/ Testing/ Information Systems/ Information Theory $29.95 $16.46 4.5 Learn how to improve your Java coding skills using unit testing. Despite it's name, unit testing is really a coding technique, not a testing technique. Unit testing is done by programmers, for programmers. It's primarily for our benefit: we get improved confidence in our code, better ability to make deadlines, less time spent in the debugger, and less time beating on the code to make it work correctly. This book shows how to write tests, but more importantly, it goes where other books fear to tread and gives you concrete advice and examples of what to test--the common things that go wrong in all of our programs. Discover the tricky hiding places where bugs breed, and how to catch them using the freely available JUnit framework. It's easy to learn how to think of all the things in your code that are likely to break. We'll show you how with helpful mnemonics, summarized in a handy tip sheet (also available from our www.pragmaticprogrammer.com website) to help you remember all this stuff. With this book you will:/ • Write better code, and take less time to write it/ • Discover the tricky places where bugs breed/ • Learn how to think of all the things that could go wrong/ • Test individual pieces of code without having to include the whole project/ • Test effectively with the whole team/ We'll also cover how to use Mock Objects for testing, how to write high quality test code, and how to use unit testing to improve your design skills. We'll show you frequent "gotchas"--along with the fixes--to save you time when problems come up. We'll show you how with helpful mnemonics, summarized in a handy tip sheet (also available from our www.pragmaticprogrammer.com website). But the best part is that you don't need a sweeping mandate to change your whole team or your whole company. You don't need to adopt Extreme Programming or Test-Driven Development, or change your development process in order to reap the proven benefits of unit testing. You can start unit testing, the pragmatic way, right away. The Pragmatic Programmers 09-02-2003 07-02-2007 Andrew Hunt/ David Thomas 159 -book 9780596000400 0596000405 us Java Servlet Programming, 2nd Edition Java Servlet Programming, 2nd Edition Paperback/ Illustrated Web Site Design/ Java/ Web Programming/ Servlets $44.95 $7.90 4 Aimed at Web developers with some previous Java experience, Java Servlet Programming, Second Edition, offers a solid introduction to the world of Java development with Servlets and related technologies. Thoroughly revised and newly updated with over a half-dozen new chapters, this title brings an already useful text up to speed with some leading-edge material. It excels particularly in explaining how to program dynamic Web content using Java Servlets, with a fine introduction to all the APIs, programming techniques, and tips you will need to be successful with this standard./ Besides a useful guide to APIs, the book looks at a variety of techniques for saving session state, as well as showing how Servlets can work together to power Web sites. You will learn performance tips and ways to get Servlets to work together (like forwarding and redirection), plus the basics of database programming with JDBC, to build content with "live" data. A later chapter examines what's next for Servlets with the emerging Servlet 2.3 API standard. Importantly, the authors go over deploying and configuring Web applications by editing XML files, a must-have for successfully running Servlets in real applications./ Since the first edition of this title, the choices for Java Web developers have grown much richer. Many of the new chapters in this edition look at options beyond Servlets. Short sections on application frameworks such as Tea, WebMacro, the Element Construction Set (ECS), XMLC, and JavaServer Pages (JSP) let you explore what's out there for Java developers today with a survey of some current tools that can speed up creating new Web applications./ The text closes with reference sections on Servlet APIs (and other material) that will be useful for any working developer. Although Servlets are not the only game in town, they are still important tools for successful Web development. This updated edition shows you just how to do it with plenty of basic and advanced tips for taking full advantage of this powerful Java standard. --Richard Dragan/ Topics covered:/ • Overview and history of Java Servlets/ • Fundamentals of HTTP/ • Web applications (including deployment and configuration using XML files)/ • The Servlet lifecycle (initializing, processing requests, cleanup, and caching)/ • Multimedia content (images and compressed content)/ • WAP and WML for wireless content/ • Servlet session tracking techniques (hidden form fields, cookies, and URL rewriting)/ • Security issues with Servlets (including certificates and SSL)/ • Tutorial for JDBC and Java database programming/ • Using applets and Servlets together/ • Servlet collaboration/ • Quick introduction to Java 2 Enterprise Edition (J2EE)/ • Internationalization issues/ • Survey of third-party Servlet application frameworks and tools: Tea, WebMacro, the Element Contruction Set (ECS), XMLC, and JavaServer Pages (JSP)/ • Miscellaneous tips for Servlets (including sending e-mail and using regular expressions)/ • Description of the new Servlet 2.3 API spec/ • Servlet API quick reference/ O'Reilly Media 15-01-2001 07-02-2007 Jason Hunter 753 -book 9781930110991 1930110995 us JUnit in Action JUnit in Action Paperback/ Illustrated Object-Oriented Design/ Software Design/ Testing/ Systems Analysis & Design $39.95 $21.83 4.5 A guide to unit testing Java applications (including J2EE applications) using the JUnit framework and its extensions, this book provides techniques for solving real-world problems such as unit testing legacy applications, writing real tests for real objects, automating tests, testing in isolation, and unit testing J2EE and database applications. Using a sample-driven approach, various unit testing strategies are covered, such as how to unit test EJBs, database applications, JSPs, and Taglibs. Also addressed are testing strategies using freely available open source frameworks and tools, and how to unit test in isolation with Mock Objects. Testing J2EE applications by running tests from inside the container for performing integration unit tests is discussed, as is how to automate unit testing in automated builds (such as Ant and Maven) for performing continuous integration./ Manning Publications 28-10-2003 07-02-2007 Ted Husted/ Vincent Massol 384 -book 9781932394498 1932394494 us RSS and Atom in Action: Web 2.0 Building Blocks RSS and Atom in Action: Web 2.0 Building Blocks Paperback/ Illustrated Web Site Design/ Internet $39.95 $19.98 4.5 RSS and Atom in Action is organized into two parts. The first part introduces the blog technologies of news feed formats and publishing protocols-the building blocks. The second part shows how to put to those blocks together to assemble interesting and useful blog applications. In keeping with the behind Manning's "In Action" series, this book shows the reader, through numerous examples in Java and C#, how to parse Atom and RSS format newsfeeds, how to generate valid newsfeeds and serve them efficiently, and how to automate blogging via web services based on the new Atom protocol and the older MetaWeblog API. The book also shows how to develop a complete blog client library that readers can use in their own applications. The second half of the book is devoted to a dozen blog apps-small but immediately useful example applications such as a community aggregator, a file distribution newsfeed, a blog cross-poster, an email-to-blog gateway, Ant tasks for blogging softwarebuilds, and more./ Manning Publications 31-07-2006 07-02-2007 Dave Johnson 300 -book 9780684868769 0684868768 us Emergence: The Connected Lives of Ants, Brains, Cities, and Software Emergence: The Connected Lives of Ants, Brains, Cities, and Software Paperback Urban/ Chaos & Systems/ History of Science/ Acoustics & Sound/ System Theory/ General & Reference/ Systems Analysis & Design/ Information Theory $15.00 $4.40 3.5 An individual ant, like an individual neuron, is just about as dumb as can be. Connect enough of them together properly, though, and you get spontaneous intelligence. Web pundit Steven Johnson explains what we know about this phenomenon with a rare lucidity in Emergence: The Connected Lives of Ants, Brains, Cities, and Software. Starting with the weird behavior of the semi-colonial organisms we call slime molds, Johnson details the development of increasingly complex and familiar behavior among simple components: cells, insects, and software developers all find their place in greater schemes./ / Most game players, alas, live on something close to day-trader time, at least when they're in the middle of a game--thinking more about their next move than their next meal, and usually blissfully oblivious to the ten- or twenty-year trajectory of software development. No one wants to play with a toy that's going to be fun after a few decades of tinkering--the toys have to be engaging now, or kids will find other toys./ Johnson has a knack for explaining complicated and counterintuitive ideas cleverly without stealing the scene. Though we're far from fully understanding how complex behavior manifests from simple units and rules, our awareness that such emergence is possible is guiding research across disciplines. Readers unfamiliar with the sciences of complexity will find Emergence an excellent starting point, while those who were chaotic before it was cool will appreciate its updates and wider scope. --Rob Lightner/ Scribner 27-08-2002 11-02-2007 Steven Johnson 288 -book 9780743241663 0743241665 us Mind Wide Open: Your Brain and the Neuroscience of Everyday Life Mind Wide Open: Your Brain and the Neuroscience of Everyday Life Paperback Consciousness & Thought/ Applied Psychology/ Neuropsychology/ Personality/ Physiology/ Neuroscience $15.00 $4.96 4 Given the opportunity to watch the inner workings of his own brain, Steven Johnson jumps at the chance. He reveals the results in Mind Wide Open, an engaging and personal account of his foray into edgy brain science. In the 21st century, Johnson observes, we have become used to ideas such as "adrenaline rushes" and "serotonin levels," without really recognizing that complex neurobiology has become a commonplace thing to talk about. He sees recent laboratory revelations about the brain as crucial for understanding ourselves and our psyches in new, post-Freudian ways. Readers shy about slapping electrodes on their own temples can get a vicarious scientific thrill as Johnson tries out empathy tests, neurofeedback, and fMRI scans. The results paint a distinct picture of the author, and uncover general brain secrets at the same time. Memory, fear, love, alertness--all the multitude of states housed in our brains are shown to be the results of chemical and electrical interactions constantly fed and changed by input from our senses. Mind Wide Open both satisfies curiosity and provokes more questions, leaving readers wondering about their own gray matter. --Therese Littleton Scribner 03-05-2005 11-02-2007 Steven Johnson 288 -book 9780139376818 013937681X us The UNIX Programming Environment The UNIX Programming Environment Paperback History/ Unix/ History of Ideas $49.99 $14.04 4.5 Prentice Hall 03-02-1984 07-02-2007 Brian W. Kernighan/ Rob Pike 357 -book 9780312421434 0312421435 us No Logo: No Space, No Choice, No Jobs No Logo: No Space, No Choice, No Jobs Paperback Company Histories/ Labor Policy/ International/ Labor & Industrial Relations/ Production & Operations/ Advertising/ Global/ Ethics/ Anthropology/ Consumer Guides/ Media Studies/ Culture $15.00 $6.38 4 We live in an era where image is nearly everything, where the proliferation of brand-name culture has created, to take one hyperbolic example from Naomi Klein's No Logo, "walking, talking, life-sized Tommy [Hilfiger] dolls, mummified in fully branded Tommy worlds." Brand identities are even flourishing online, she notes--and for some retailers, perhaps best of all online: "Liberated from the real-world burdens of stores and product manufacturing, these brands are free to soar, less as the disseminators of goods or services than as collective hallucinations."/ In No Logo, Klein patiently demonstrates, step by step, how brands have become ubiquitous, not just in media and on the street but increasingly in the schools as well. (The controversy over advertiser-sponsored Channel One may be old hat, but many readers will be surprised to learn about ads in school lavatories and exclusive concessions in school cafeterias.) The global companies claim to support diversity, but their version of "corporate multiculturalism" is merely intended to create more buying options for consumers. When Klein talks about how easy it is for retailers like Wal-Mart and Blockbuster to "censor" the contents of videotapes and albums, she also considers the role corporate conglomeration plays in the process. How much would one expect Paramount Pictures, for example, to protest against Blockbuster's policies, given that they're both divisions of Viacom?/ Klein also looks at the workers who keep these companies running, most of whom never share in any of the great rewards. The president of Borders, when asked whether the bookstore chain could pay its clerks a "living wage," wrote that "while the concept is romantically appealing, it ignores the practicalities and realities of our business environment." Those clerks should probably just be grateful they're not stuck in an Asian sweatshop, making pennies an hour to produce Nike sneakers or other must-have fashion items. Klein also discusses at some length the tactic of hiring "permatemps" who can do most of the work and receive few, if any, benefits like health care, paid vacations, or stock options. While many workers are glad to be part of the "Free Agent Nation," observers note that, particularly in the high-tech industry, such policies make it increasingly difficult to organize workers and advocate for change./ But resistance is growing, and the backlash against the brands has set in. Street-level education programs have taught kids in the inner cities, for example, not only about Nike's abusive labor practices but about the astronomical markup in their prices. Boycotts have commenced: as one urban teen put it, "Nike, we made you. We can break you." But there's more to the revolution, as Klein optimistically recounts: "Ethical shareholders, culture jammers, street reclaimers, McUnion organizers, human-rights hacktivists, school-logo fighters and Internet corporate watchdogs are at the early stages of demanding a citizen-centered alternative to the international rule of the brands ... as global, and as capable of coordinated action, as the multinational corporations it seeks to subvert."No Logo is a comprehensive account of what the global economy has wrought and the actions taking place to thwart it. --Ron Hogan/ Picador 06-04-2002 11-02-2007 Naomi Klein 528 -book 0029236723101 0789723107 us Don't Make Me Think: A Common Sense Approach to Web Usability Don't Make Me Think: A Common Sense Approach to Web Usability Paperback Web Site Design/ Internet Publishing/ Interface Design $35.00 $14.98 5 Usability design is one of the most important--yet often least attractive--tasks for a Web developer. In Don't Make Me Think, author Steve Krug lightens up the subject with good humor and excellent, to-the-point examples./ The title of the book is its chief personal design premise. All of the tips, techniques, and examples presented revolve around users being able to surf merrily through a well-designed site with minimal cognitive strain. Readers will quickly come to agree with many of the book's assumptions, such as "We don't read pages--we scan them" and "We don't figure out how things work--we muddle through." Coming to grips with such hard facts sets the stage for Web design that then produces topnotch sites./ Using an attractive mix of full-color screen shots, cute cartoons and diagrams, and informative sidebars, the book keeps your attention and drives home some crucial points. Much of the content is devoted to proper use of conventions and content layout, and the "before and after" examples are superb. Topics such as the wise use of rollovers and usability testing are covered using a consistently practical approach./ This is the type of book you can blow through in a couple of evenings. But despite its conciseness, it will give you an expert's ability to judge Web design. You'll never form a first impression of a site in the same way again. --Stephen W. Plain/ Topics covered:/ • User patterns/ • Designing for scanning/ • Wise use of copy/ • Navigation design/ • Home page layout/ • Usability testing/ New Riders Press 13-10-2000 07-02-2007 Steve Krug 195 -book 9781585730407 1585730408 us Pocket Menu Reader China (Pocket Dictionaries) (Langenscheidt's Pocket Menu Reader) Pocket Menu Reader China (Pocket Dictionaries) (Langenscheidt's Pocket Menu Reader) Paperback Chinese/ Dictionaries; Polyglot/ Phrasebooks - General/ Dining $7.95 $4.98 1 Each Pocket Menu Reader is an indispensable gastronomic dictionary, phrasebook, and guidebook. It includes more than 1,500 words with translations and pronunciations, comprehensive treatment of the country's cuisine, an alphabetical list of dishes and culinary terms, plus a gourmet's selection of recipes. Langenscheidt Publishers 15-11-2000 11-02-2007 Langenscheidt 189 -book 9780897500487 0897500482 us Tao of Jeet Kune Do Tao of Jeet Kune Do Paperback Contemporary/ New Age $16.95 $7.00 4.5 To watch Bruce Lee on film is an amazing experience. Those who have read Tao of Jeet Kune Do, however, know that Lee's prose can also be exhilarating. This praiseworthy and enduring bestseller (mainly written over six months when Lee was bedridden with back problems) compiles philisophical aphorisms, explanations on technique, and sketches by the master himself. Ohara Publications 07-02-1993 06-02-2007 Bruce Lee 208 -book 9780974175706 0974175706 us Getting Around in Chinese Getting Around in Chinese Paperback Study & Teaching $25.00 $13.25 3 Marco Liang & Co. 02-02-2003 11-02-2007 Marco Liang 669 -book 9780201570090 0201570092 us China: Empire of Living Symbols China: Empire of Living Symbols Hardcover Photo Essays/ Chinese/ Linguistics $39.90 $1,203.99 4.5 Perseus Books 11-02-1991 11-02-2007 Cecilia Lindqvist 423 -book 9781556432767 1556432763 us Ba Gua: Hidden Knowledge in the Taoist Internal Martial Art Ba Gua: Hidden Knowledge in the Taoist Internal Martial Art Paperback Reference $16.95 $6.49 4 North Atlantic Books 12-02-1998 11-02-2007 Hsing-Han Liu/ John Bracy 138 -book 9780738204314 0738204315 us The Cluetrain Manifesto: The End of Business as Usual The Cluetrain Manifesto: The End of Business as Usual Paperback Strategy & Competition/ Theory/ Customer Service/ Systems & Planning/ Consumerism/ Web Marketing/ Social Theory/ Peripherals $14.00 $1.79 4 How would you classify a book that begins with the salutation, "People of Earth..."? While the captains of industry might dismiss it as mere science fiction, The Cluetrain Manifesto is definitely of this day and age. Aiming squarely at the solar plexus of corporate America, authors Christopher Locke, Rick Levine, Doc Searls, and David Weinberger show how the Internet is turning business upside down. They proclaim that, thanks to conversations taking place on Web sites and message boards, and in e-mail and chat rooms, employees and customers alike have found voices that undermine the traditional command-and-control hierarchy that organizes most corporate marketing groups. "Markets are conversations," the authors write, and those conversations are "getting smarter faster than most companies." In their view, the lowly customer service rep wields far more power and influence in today's marketplace than the well-oiled front office PR machine./ The Cluetrain Manifesto began as a Web site (www.cluetrain.com) in 1999 when the authors, who have worked variously at IBM, Sun Microsystems, the Linux Journal, and NPR, posted 95 theses that pronounced what they felt was the new reality of the networked marketplace. For example, thesis no. 2: "Markets consist of human beings, not demographic sectors"; thesis no. 20: "Companies need to realize their markets are often laughing. At them"; thesis no. 62: "Markets do not want to talk to flacks and hucksters. They want to participate in the conversations going on behind the corporate firewall"; thesis no. 74: "We are immune to advertising. Just forget it." The book enlarges on these themes through seven essays filled with dozens of stories and observations about how business gets done in America and how the Internet will change it all. While Cluetrain will strike many as loud and over the top, the message itself remains quite relevant and unique. This book is for anyone interested in the Internet and e-commerce, and is especially important for those businesses struggling to navigate the topography of the wired marketplace. All aboard! --Harry C. Edwards/ Perseus Books Group 09-01-2001 11-02-2007 Christopher Locke/ Rick Levine/ Doc Searls/ David Weinberger 190 -book 9780806906164 0806906162 us Chinese System Of Natural Cures Chinese System Of Natural Cures Paperback Herbal Remedies/ Basic Science/ History/ Chinese Medicine $11.95 $1.98 3 Discover traditional Chinese herbal healing formulas--and how to use the Four Energies, the Five Flavors, and the Four Movements to prescribe various herbal treatments, as well as acupuncture and other methods of pain relief. Detailed sections of specific treatments of patients' complaints, and recommended herbal treatments for diagnosed diseases, including high cholesterol, diabetes, heart and coronary problems, arthritis, allergies, and more./ Sterling 31-12-1994 11-02-2007 Henry C. Lu 160 -book 9780156799805 0156799804 us The Secret of the Golden Flower: A Chinese Book of Life The Secret of the Golden Flower: A Chinese Book of Life Paperback Taoism/ New Age/ Behavioral Psychology $12.00 $1.24 4 1955. The point of view established in this volume is that the spirit must lean on science as its guide in the world of reality, and that science must turn to the spirit for the meaning of life. This book lends us a new approach to the East, and it also strengthens the point of view evolving in the West with respect to the psyche. Wilhelm provides the reader with the text and explanation, while another section contains commentary by Jung. Harvest//HBJ Book 08-02-1962 08-02-2007 Tung-Pin Lu 149 -book 9780394717272 0394717279 us Acupuncture: The Ancient Chinese Art of Healing and How it Works Scientifically Acupuncture: The Ancient Chinese Art of Healing and How it Works Scientifically Paperback Acupuncture & Acupressure/ Healing/ China/ Pharmacology $11.00 $0.01 Dr. Felix Mann, President of the Medical Acupuncture Society, is one of the outstanding Western practitioners of the ancient Chinese art, which he has been using for some years in London. In this complete revision of his 1962 book -- over half of which is entirely new material -- he describes in detail for the first time how acupuncture works from a scientific point of view, explaining the neurophysiological mechanism involved as well as the basic principles and laws according to the theories of traditional Chinese medicine. Written for both the layman and the medical profession, the book illustrates its points with case histories drawn from Dr. Mann's own patients in England. Vintage 12-01-1973 06-02-2007 Felix Mann 256 -book 9780135974445 0135974445 us Agile Software Development, Principles, Patterns, and Practices Agile Software Development, Principles, Patterns, and Practices Hardcover C & C++ Windows Programming/ Object-Oriented Design/ Software Development/ Qualifying Textbooks - Winter 2007 $68.20 $38.50 4.5 Prentice Hall 15-10-2002 03-02-2007 Robert C. Martin 552 -book 9780974514062 0974514063 us Pragmatic Version Control Using Subversion Pragmatic Version Control Using Subversion Paperback/ Illustrated Software Design/ Software Development/ Software Engineering $29.95 $23.94 4.5 This book covers the theory behind version control and how it can help developers become more efficient, work better as a team, and keep on top of software complexity. All projects need version control: it's the lifeblood of any project's infrastructure, yet half of all project teams in the U.S. don't use any version control at all. Many others don't use it well and end up experiencing time-consuming problems. Version control, done well, is your "undo" button for the project: nothing is final, and mistakes are easily rolled back. This book describes Subversion, the latest and hottest open source version control system, using a recipe-based approach that will get you up and running quickly--and correctly. Learn how to use Subversion the right way--the pragmatic way. With this book, you can:/ • Keep all project assets safe--not just source code--and never run the risk of losing a great idea/ • Know how to undo bad decisions--even directories and symlinks are versioned/ • Learn how to share code safely, and work in parallel for maximum efficiency/ • Install Subversion and organize, administer and backup your repository/ • Share code over a network with Apache, svnserve, or ssh/ • Create and manage releases, code branches, merges and bug fixes/ • Manage 3rd party code safely/ Now there's no excuse not to use professional-grade version control. Pragmatic Bookshelf 08-02-2005 07-02-2007 Mike Mason 207 -book 9780804836340 0804836345 us Chinese Character Fast Finder Chinese Character Fast Finder Paperback English (All)/ Chinese $19.95 $13.48 5 Chinese Character Fast Finder allows users to find Chinese characters based on their appearance alone, without knowing their pronunciation, radical or stroke count. This reference book has been designed for serious learners of Chinese as well as readers with an interest in written Chinese./ Convenient features include printed thumb-index marks for rapid access to any character; all the characters prescribed for the Chinese government's official HSK (Hanyu Shuiping Koshi) Language Proficiency Test, and simplified characters and their pinyin pronunciation. Tuttle Publishing 15-03-2005 07-02-2007 Laurence Matthews 256 -book 9780596009281 0596009283 us Firefox Hacks: Tips & Tools for Next-Generation Web Browsing (Hacks) Firefox Hacks: Tips & Tools for Next-Generation Web Browsing (Hacks) Paperback/ Illustrated Privacy/ Network Security/ Software Development/ Web Browsers/ Web Programming/ Internet Security/ Qualifying Textbooks - Winter 2007 $24.95 $12.74 4.5 Firefox Hacks is ideal for power users who want to take full advantage of Firefox from Mozilla, the next-generation web browser that is rapidly subverting Internet Explorer's once-dominant audience. It's also the first book that specifically dedicates itself to this technology. Firefox is winning such widespread approval for a number of reasons, including the fact that it lets users browse faster and more efficiently. Perhaps its most appealing strength, though, is its increased security something that is covered in great detail in Firefox Hacks. Clearly the web browser of the future, Firefox includes most of the features that browser users are familiar with, along with several new features, such as a bookmarks toolbar and tabbed pages that allow users to quickly switch among several web sites. Firefox Hacks offers all the valuable tips and tools you need to maximize the effectiveness of this hot web application. It's all covered, including how to customize its deployment, appearance, features, and functionality. You'll even learn how to install, use, and alter extensions and plug-ins. Aimed at clever people who may or may not be capable of basic programming tasks, this convenient resource describes 100 techniques for 100 strategies that effectively exploit Firefox. Or, put another way, readers of every stripe will find all the user-friendly tips, tools, and tricks they need to make a productive switch to Firefox. With Firefox Hacks, a superior and safer browsing experience is truly only pages away. The latest in O'Reilly's celebrated Hacks series, Firefox Hacks smartly complements other web-application titles such as Google Hacks and PayPal Hacks. O'Reilly Media 14-03-2005 07-02-2007 Nigel McFarlane 377 -book 9780321356703 0321356705 us Software Security: Building Security In (Addison-Wesley Software Security Series) Software Security: Building Security In (Addison-Wesley Software Security Series) Paperback Privacy/ Network Security/ Software Development $49.99 $6.40 5 Addison-Wesley Professional 23-01-2006 07-02-2007 1 Gary McGraw 448 -book 9780124848306 0124848303 us Programming for the Newton Using Windows Programming for the Newton Using Windows Paperback Object-Oriented Design/ Software Development/ Windows - General/ PCs $34.95 $9.46 5 Morgan Kaufmann Pub 09-02-1996 07-02-2007 Julie McKeehan/ Neil Rhodes 440 -book 0676251832068 0804832064 us Reading and Writing Chinese: A Guide to the Chinese Writing System Reading and Writing Chinese: A Guide to the Chinese Writing System Paperback Chinese/ Phrasebooks - General/ Southeast Asian/ Reading Skills/ Study & Teaching/ Writing Skills $24.95 $12.50 4 Reading and Writing Chinese has been the standard text for foreign students and teachers of the Chinese Writing System since Tuttle first published it over 20 years ago. This new, completely revised edition offers students a more convenient, efficient, and up-to-date introduction to the writing system./ Charles E. Tuttle Co. 09-02-1999 11-02-2007 William McNaughton/ Li Ying 368 -book 9780877736769 0877736766 us WAY OF CHAUNG TZU (Shambhala Pocket Classics) WAY OF CHAUNG TZU (Shambhala Pocket Classics) Paperback Taoism/ Eastern Philosophy/ Comparative Religion/ Paperback $6.00 $5.80 5 Working from existing translations, Thomas Merton composed a series of personal versions from his favorites among the classic sayings of Chuang Tzu, the most spiritual of the Chinese philosophers. Chuang Tzu, who wrote in the fourth and third centuries B.C., is the chief authentic historical spokesman for Taoism and its founder Lao Tzu (a legendary character known largely through Chuang Tzu's writings). Indeed it was because of Chuang Tzu and the other Taoist sages that Indian Buddhism was transformed, in China, into the unique vehicle we now call by its Japanese name — Zen. The Chinese sage abounds in wit, paradox, satire, and shattering insight into the true ground of being. Father Merton, no stranger to Asian thought, brings a vivid, modern idiom to the timeless wisdom of Tao. Illustrated with early Chinese drawings. Shambhala 30-06-1992 11-02-2007 Thomas Merton 240 -book 0636920926221 1565926226 us Cascading Style Sheets: The Definitive Guide Cascading Style Sheets: The Definitive Guide Paperback Web Site Design/ Internet Publishing/ Database Design/ Structured Design/ HTML - General/ Web Programming/ Web Authoring & Design $34.95 $1.70 4 Cascading Style Sheets can put a great deal of control and flexibility into the hands of a Web designer--in theory. In reality, however, varying browser support for CSS1 and lack of CSS2 implementation makes CSS a very tricky topic. Cascading Style Sheets: The Definitive Guide is a comprehensive text that shows how to take advantage of the benefits of CSS while keeping compatibility issues in mind./ The book is very upfront about the spotty early browser support for CSS1 and the sluggish adoption of CSS2. However, enthusiasm for the technology spills out of the pages, making a strong case for even the most skeptical reader to give CSS a whirl and count on its future. The text covers CSS1 in impressive depth--not only the syntactical conventions but also more general concepts such as specificity and inheritance. Frequent warnings and tips alert the reader to browser-compatibility pitfalls./ Entire chapters are devoted to topics like units and values, visual formatting and positioning, and the usual text, fonts, and colors. This attention to both detail and architecture helps readers build a well-rounded knowledge of CSS and equips readers for a future of real-world debugging. Cascading Style Sheets honestly explains the reasons for avoiding an in-depth discussion of the still immature CSS2, but covers the general changes over CSS1 in a brief chapter near the end of the book./ When successfully implemented, Cascading Style Sheets result in much more elegant HTML that separates form from function. This fine guide delivers on its promise as an indispensable tool for CSS coders. --Stephen W. Plain/ Topics covered:/ • HTML with CSS/ • Selectors and structure/ • Units/ • Text manipulation/ • Colors and backgrounds/ • Boxes and borders/ • Visual formatting principles/ • Positioning/ • CSS2 preview/ • CSS case studies/ O'Reilly 15-05-2000 07-02-2007 Eric Meyer 470 -book 0636920001201 0596001207 us CSS Pocket Reference CSS Pocket Reference Paperback Web Graphics/ Web Site Design/ Internet Publishing/ HTML - General/ Pocket/ Web Programming/ Web Authoring & Design $9.95 $2.11 4 CSS (Cascading Style Sheets) is the W3C-approved method for enriching the visual presentation of web pages. CSS allows web pages to become more structural, and at the same time promises that they can have a more sophisticated look than ever before. With good implementations in Internet Explorer 5.0 and Opera 3.6, and 100% CSS1 support expected in Netscapes's Mozilla browser, signs are that CSS is rapidly becoming a useful, reliable, and powerful tool for web authors./ The CSS Pocket Reference briefly introduces CSS and then lists all CSS1 properties, plus the CSS1 pseudo-elements and pseudo-classes. Since browser incompatibility is the biggest obstacle to CSS adoption, we've also included a comprehensive guide to how the browsers have implemented support for CSS1. For anyone who wants to correctly implement CSS, this is a handy condensed reference to all the details in the larger volume, Cascading Style Sheets: The Definitive Guide./ O'Reilly 16-05-2001 07-02-2007 Eric A. Meyer 96 -book 0752064712459 073571245X us Eric Meyer on CSS: Mastering the Language of Web Design Eric Meyer on CSS: Mastering the Language of Web Design Paperback Web Site Design/ Internet Publishing/ HTML - General/ jp-unknown1/ Qualifying Textbooks - Winter 2007 $45.00 $9.99 4.5 There are several other books on the market that serve as in-depth technical guides or reference books for CSS. None, however, take a more hands-on approach and use practical examples to teach readers how to solve the problems they face in designing with CSS - until now. Eric Meyer provides a variety of carefully crafted projects that teach how to use CSS and why particular methods were chosen. The web site includes all of the files needed to complete the tutorials in the book. In addition, bonus information is be posted. New Riders Press 28-06-2002 03-02-2007 Eric A. Meyer 352 -book 9780865681743 0865681740 us Xing Yi Nei Gong: Xing Yi Health Maintenance and Internal Strength Development Xing Yi Nei Gong: Xing Yi Health Maintenance and Internal Strength Development Paperback $21.95 $14.05 4.5 This is the most complete book on the art of xing yi (hsing Yi) available. It includes the complete xing yi history and lineage going back eight generations; manuscripts handed down from famous practitioners Dai Long Bang and Li Neng Ran; 16 health maintenance and power development exercises; qigong (chi kung) exerices; xing yi long spear power training exercises; and more. Unique Publications 10-02-1998 03-02-2007 Dan Miller/ Tim Cartmell 200 -book 9781883175009 1883175003 us Liang Zhen Pu Eight Diagram Palm Liang Zhen Pu Eight Diagram Palm Paperback Taichi/ jp-unknown3 $17.95 $14.99 5 High View Pubns 04-02-1993 11-02-2007 Li Zi Ming 168 -book 9780609810347 0609810340 us Bhagavad Gita: A New Translation Bhagavad Gita: A New Translation Paperback Eastern/ Bhagavad Gita $13.95 $7.45 3.5 On the list of the greatest spiritual books of all time, the Bhagavad Gita resides permanently in the top echelon. This poem of patently Indian genius sprouted an immense tree of devotional, artistic, and philosophical elaboration in the subcontinent. The scene is a battlefield with the prince Arjuna pitted against his own family, but no sooner does the poem begin than the action reverts inward. Krishna, Arjuna's avatar and spiritual guide, points the way to the supreme wisdom and perfect freedom that lie within everyone's reach. Worship and be faithful, meditate and know reality--these make up the secret of life and lead eventually to the realization that the self is the root of the world. In this titular translation, Stephen Mitchell's rhythms are faultless, making music of this ancient "Song of the Blessed One." Savor his rendition, but nibble around the edges of his introduction. In a bizarre mixture of praise and condescension, Mitchell disregards two millennia of Indian commentary, seeking illumination on the text from Daoism and Zen, with the Gita coming up just shy of full spiritual merit. Perhaps we should take it from Gandhi, who used the Gita as a handbook for life, that it nourishes on many levels. --Brian Bruya Three Rivers Press 27-08-2002 11-02-2007 Stephen Mitchell 224 -book 9780060923211 0060923210 us The Gospel According to Jesus The Gospel According to Jesus Paperback Classics/ New Testament/ Study/ Inspirational/ Christology $14.00 $2.62 3.5 A dazzling presentation of the life and teachings of Jesus by the eminent scholar and translator Stephen Mitchell. Harper Perennial 31-03-1993 08-02-2007 Stephen Mitchell 320 -book 9780690012903 069001290X us Flower, Moon, Snow: A Book of Haiku Flower, Moon, Snow: A Book of Haiku Library Binding 20th Century/ Japanese & Haiku/ United States $12.89 $4.40 Crowell 04-02-1977 03-02-2007 Kazue Mizumura 48 -book 9780060922245 0060922249 us Care of the Soul : A Guide for Cultivating Depth and Sacredness in Everyday Life Care of the Soul : A Guide for Cultivating Depth and Sacredness in Everyday Life Paperback Personal Transformation/ New Age/ Spiritual/ Pastoral Theology $14.00 $0.01 4 Care of the Soul is considered to be one of the best primers for soul work ever written. Thomas Moore, an internationally renowned theologian and former Catholic monk, offers a philosophy for living that involves accepting our humanity rather than struggling to transcend it. By nurturing the soul in everyday life, Moore shows how to cultivate dignity, peace, and depth of character. For example, in addressing the importance of daily rituals he writes, "Ritual maintains the world's holiness. As in a dream a small object may assume significance, so in a life that is animated by ritual there are no insignificant things." This is the eloquence that helped reintroduce the sacred into everyday language and contemporary values. Harper Paperbacks 26-01-1994 03-02-2007 Thomas Moore 336 -book 9780416543506 0416543502 us Pooh's Workout Book Pooh's Workout Book Hardcover Parodies/ British $13.44 5 Methuen young books 24-10-1985 11-02-2007 Ethan Mordden 176 -book 9780596007652 0596007655 us Ambient Findability Ambient Findability Paperback/ Illustrated Web Site Design/ Database Design/ Internet/ Web Programming/ Web Authoring & Design/ Qualifying Textbooks - Winter 2007 $29.95 $14.94 4 How do you find your way in an age of information overload? How can you filter streams of complex information to pull out only what you want? Why does it matter how information is structured when Google seems to magically bring up the right answer to your questions? What does it mean to be "findable" in this day and age? This eye-opening new book examines the convergence of information and connectivity. Written by Peter Morville, author of the groundbreaking Information Architecture for the World Wide Web, the book defines our current age as a state of unlimited findability. In other words, anyone can find anything at any time. Complete navigability./ Morville discusses the Internet, GIS, and other network technologies that are coming together to make unlimited findability possible. He explores how the melding of these innovations impacts society, since Web access is now a standard requirement for successful people and businesses. But before he does that, Morville looks back at the history of wayfinding and human evolution, suggesting that our fear of being lost has driven us to create maps, charts, and now, the mobile Internet./ The book's central thesis is that information literacy, information architecture, and usability are all critical components of this new world order. Hand in hand with that is the contention that only by planning and designing the best possible software, devices, and Internet, will we be able to maintain this connectivity in the future. Morville's book is highlighted with full color illustrations and rich examples that bring his prose to life./ Ambient Findability doesn't preach or pretend to know all the answers. Instead, it presents research, stories, and examples in support of its novel ideas. Are we truly at a critical point in our evolution where the quality of our digital networks will dictate how we behave as a species? Is findability indeed the primary key to a successful global marketplace in the 21st century and beyond. Peter Morville takes you on a thought-provoking tour of these memes and more -- ideas that will not only fascinate but will stir your creativity in practical ways that you can apply to your work immediately./ "A lively, enjoyable and informative tour of a topic that's only going to become more important."
--David Weinberger, Author, Small Pieces Loosely Joined and The Cluetrain Manifesto/ "I envy the young scholar who finds this inventive book, by whatever strange means are necessary. The future isn't just unwritten--it's unsearched."
--Bruce Sterling, Writer, Futurist, and Co-Founder, The Electronic Frontier Foundation/ "Search engine marketing is the hottest thing in Internet business, and deservedly so. Ambient Findability puts SEM into a broader context and provides deeper insights into human behavior. This book will help you grow your online business in a world where being found is not at all certain."
--Jakob Nielsen, Ph.D., Author, Designing Web Usability: The Practice of Simplicity/ "Information that's hard to find will remain information that's hardly found--from one of the fathers of the discipline of information architecture, and one of its most experienced practitioners, come penetrating observations on why findability is elusive and how the act of seeking changes us."
--Steve Papa, Founder and Chairman, Endeca/ "Whether it's a fact or a figure, a person or a place, Peter Morville knows how to make it findable. Morville explores the possibilities of a world where everything can always be found--and the challenges in getting there--in this wide-ranging, thought-provoking book."
--Jesse James Garrett, Author, The Elements of User Experience/ "It is easy to assume that current searching of the World Wide Web is the last word in finding and using information. Peter Morville shows us that search engines are just the beginning. Skillfully weaving together information science research with his own extensive experience, he develops for the reader a feeling for the near future when information is truly findable all around us. There are immense implications, and Morville's lively and humorous writing brings them home."
--Marcia J. Bates, Ph.D., University of California Los Angeles/ "I've always known that Peter Morville was smart. After reading Ambient Findability, I now know he's (as we say in Boston) wicked smart. This is a timely book that will have lasting effects on how we create our future.
--Jared Spool, Founding Principal, User Interface Engineering/ "In Ambient Findability, Peter Morville has put his mind and keyboard on the pulse of the electronic noosphere. With tangible examples and lively writing, he lays out the challenges and wonders of finding our way in cyberspace, and explains the mutually dependent evolution of our changing world and selves. This is a must read for everyone and a practical guide for designers."
--Gary Marchionini, Ph.D., University of North Carolina/ "Find this book! Anyone interested in making information easier to find, or understanding how finding and being found is changing, will find this thoroughly researched, engagingly written, literate, insightful and very, very cool book well worth their time. Myriad examples from rich and varied domains and a valuable idea on nearly every page. Fun to read, too!
--Joseph Janes, Ph.D., Founder, Internet Public Library/ O'Reilly Media 01-10-2005 07-02-2007 Peter Morville 188 -book 0636920924180 1565924185 us Java Threads, Second Edition Java Threads, Second Edition Paperback Parallel Computing/ Java $34.95 $0.47 3.5 Building sophisticated Java applets means learning about threading--if you need to read data from a network, for example, you can't afford to let a delay in its delivery lock up your entire applet. Java Threads introduces the Java threading API and uses non-computing analogies--such as scenarios involving bank tellers--to explain the need for synchronization and the dangers of deadlock. Scott Oaks and Henry Wong follow up their high-level examples with more detailed discussions on building a thread scheduler in Java, dealing with advanced synchronization issues, and handling exceptions. O'Reilly 20-01-1999 07-02-2007 Scott Oaks/ Henry Wong 336 -book 9780312275631 0312275633 us Awareness: The Key to Living in Balance Awareness: The Key to Living in Balance Paperback Meditation/ Mysticism/ Self-Help/ Spiritualism/ Osho/ Personal Transformation $11.95 $7.61 4.5 Underlying all meditation techniques, including martial arts-and in fact underlying all great athletic performances-is a quality of being awake and present to the moment, a quality that Osho calls awareness. Once we can identify and understand what this quality of awareness is, we have the key to self-mastery in virtually every area of our lives.According to great masters like Lao Tzu or Buddha, most of us move through our lives like sleepwalkers. Never really present in what we are doing, never fully alert to our environment, and not even aware of what motivates us to do and say the things we do.At the same time, all of us have experienced moments of awareness-or awakening, to use another-in extraordinary circumstances. On the road, in a sudden and unexpected accident, time seems to stop and one is suddenly aware of every movement, every sound, every thought. Or in moments that touch us deeply-welcoming a new baby into the world for the first time, or being with someone at the moment of death.Awareness, says Osho, is the key to being self-directed, centered, and free in every aspect of our lives. In this book, Osho teaches how to live life more attentively, mindfully, and meditatively, with love, caring and consciousness.OSHO challenges readers to examine and break free of the conditioned belief systems and prejudices that limit their capacity to life in all its richness. He has been described by the Sunday Times of London as one of the "1000 Makers of the 20th Century" and by Sunday Mid-Day (India) as one of the ten people-along with Gandhi, Nehru, and Buddha-who have changed the destiny of India. More than a decade after his death in 1990, the influence of his teachings continues to expand, reaching seekers of all ages in virtually every country of the world. St. Martin's Griffin 10-12-2001 03-02-2007 Osho 192 -book 9781580632256 1580632254 us Tao: The Pathless Path Tao: The Pathless Path Paperback Taoism/ Osho $12.95 $7.61 5 In his commentaries on five parables from the Leih Tzu, Osho brings a fresh and contemporary interpretation to the ancient wisdom of Tao. Leih Tzu was a well-known Taoist master in the fourth century B.C., and his sly critiques of a Confucius provide abundant opportunities for the reader to explore the contrasts between the rational and irrational, the male and female, the structured and the spontaneous."Who Is Really Happy" uses the discovery of a human skull on the roadside to probe into the question of immortality and how misery arises out of the existence of the ego."A Man Who Knows How to Console Himself" looks beneath the apparent cheerfulness of a wandering monk and asks if there is really a happiness that endures through life's ups and downs."No Regrets" is a parable about the difference between the knowledge that is gathered from the outside and the "knowing" that arises from within."No Rest for the Living" uses a dialogue between a despondent seeker and his master to reveal the limits of philosophy and the crippling consequences of living for the sake of some future goal. "Best Be Still, Best Be Empty" discusses the difference between the path of the will, the via affirmitiva of Christianity, Judaism, and Islam, versus the path of the mystic, the via negativa of Buddha and Lao Tzu.A Q&A section addresses how Taoist understanding applies to everyday life in concrete, practical terms. Renaissance Books 23-02-2002 11-02-2007 Osho 192 -book 9780865681729 0865681724 us Fundamentals of Pa Kua Chan, Vol. 1 Fundamentals of Pa Kua Chan, Vol. 1 Paperback $19.95 $9.00 4.5 Unique Publications 01-02-1999 11-02-2007 Bok Nam Park/ Dan Miller 204 -book B000AMLXHM us THE EMPEROR'S NEW MIND: CONCERNING COMPUTERS, MINDS, AND THE LAWS OF PHYSICS..."Ranks among the most innovative and exciting science books to be published in the last forty years." THE EMPEROR'S NEW MIND: CONCERNING COMPUTERS, MINDS, AND THE LAWS OF PHYSICS..."Ranks among the most innovative and exciting science books to be published in the last forty years." Paperback $1.89 PENGUIN BOOKS 08-02-1990 08-02-2007 ROGER PENROSE -book 9780936085241 093608524X us The Fine Art of Technical Writing The Fine Art of Technical Writing Paperback Technical $9.95 $0.95 4.5 This slender volume for the beginning technical writer doesn't delve very deeply into its subject, but The Fine Art of Technical Writing does make some nice points. Most appealing and useful is the book's premise: though its subject matter can be dry, "technical writing is a creative act." Author Carol Rosenblum Perry likens the technical writer to a ceramist, recommending that he or she get as much down on paper (or computer) as possible for the first draft, then think of that "rough text as a big, shapeless lump of clay" to be sculpted. Next is a more oblique analogy to figurative drawing. Perry urges the technical writer to consider the writing's "skeleton" (order), "body mass" (conciseness), and "muscle tone" (vigor). Finally, technical writing is compared to making music: "Writing, like music, depends on its dynamics ... varying degrees of 'loudness' and 'softness.'" Blue Heron Publishing 11-02-1991 11-02-2007 Carol Rosenblum Perry 111 -book 9780596004484 0596004486 us Version Control with Subversion Version Control with Subversion Paperback/ Illustrated Software Development $34.95 $18.69 4.5 One of the greatest frustrations in most software projects is version control: the art of managing changes to information. Today's increasingly fast pace of software development--as programmers make small changes to software one day only to undo them the next--has only heightened the problem; consecutive work on code or single-programmer software is a rare sight these days. Without careful attention to version control, concurrent and collaborative work can create more headaches than it solves. This is where Subversion comes into play. Written by members of the Subversion open source development team, Version Control with Subversion introduces the powerful new versioning tool designed to be the successor to the Concurrent Version System or CVS. CVS users will find the "look and feel" Subversion comfortably familiar, but under the surface it's far more flexible, robust, and usable, and more importantly, it improves on CVS's more notable flaws. The book begins with a general introduction to Subversion, the basic concepts behind version control, and a guided tour of Subversion's capabilities and structure. With thorough attention to detail, the authors cover every aspect of installing and configuring Subversion for managing a programming project, documentation, or any other team-based endeavor. Later chapters cover the more complex topics of branching, repository administration, and other advanced features such as properties, externals, and access control. The book ends with reference material and appendices covering a number of useful topics such as a Subversion complete reference and troubleshooting guide. Version Control with Subversion aims to be useful to readers of widely different backgrounds, from those with no previous experience in version control to experienced sysadmins. If you've never used version control, you'll find everything you need to get started in this book. And if you're a seasoned CVS pro, this book will help you make a painless leap into Subversion. O'Reilly Media 22-06-2004 07-02-2007 C. Michael Pilato/ Ben Collins-Sussman/ Brian W. Fitzpatrick 304 -book 9780060958404 0060958405 us Words and Rules: The Ingredients of Language Words and Rules: The Ingredients of Language Paperback Logic & Language/ Grammar/ Linguistics/ Neuroscience/ Cognitive $15.00 $3.50 4 Human languages are capable of expressing a literally endless number of different ideas. How do we manage it--so effortlessly that we scarcely ever stop to think about it? In Words and Rules: The Ingredients of Language, a look at the simple concepts that we use to devise works as complex as love sonnets and tax laws, renowned neuroscientist and linguist Steven Pinker shows us how. The latest linguistic research suggests that each of us stores a limited (though large) number of words and word-parts in memory and manipulates them with a much smaller number of rules to produce every writing and utterance, and Pinker explains every step of the way with engaging good humor./ Pinker's enthusiasm for the subject infects the reader, particularly as he emphasizes the relation between how we communicate and how we think. What does it mean that a small child who has never heard the word wug can tell a researcher that when one wug meets another, there are two wugs? Some rule must be telling the child that English plurals end in -s, which also explains mistakes like mouses. Is our communication linked inextricably with our thinking? Pinker says yes, and it's hard to disagree. Words and Rules is an excellent introduction to and overview of current thinking about language, and will greatly reward the careful reader with new ways of thinking about how we think, talk, and write. --Rob Lightner/ Harper Perennial 15-01-2000 03-02-2007 Steven Pinker 368 -book 9781556434303 1556434308 us Healing With Whole Foods: Asian Traditions and Modern Nutrition Healing With Whole Foods: Asian Traditions and Modern Nutrition (3rd Edition) 3rd Paperback Healthy/ Macrobiotics/ Healing/ Naturopathy/ Family Health/ Diet Therapy/ Whole Foods/ Chinese Medicine/ Healthy Living $35.00 $22.00 5 Used as a reference by students of acupuncture, this is a hefty, truly comprehensive guide to the theory and healing power of Chinese medicine. It's also a primer on nutrition--including facts about green foods, such as spirulina and blue-green algae, and the "regeneration diets" used by cancer patients and arthritics--along with an inspiring cookbook with more than 300 mostly vegetarian, nutrient-packed recipes./ The information on Chinese medicine is useful for helping to diagnose health imbalances, especially nascent illnesses. It's smartly paired with the whole-foods program because the Chinese have attributed various health-balancing properties to foods, so you can tailor your diet to help alleviate symptoms of illness. For example, Chinese medicine dictates that someone with low energy and a pale complexion (a yin deficiency) would benefit from avoiding bitter foods and increasing "sweet" foods such as soy, black sesame seeds, parsnips, rice, and oats. (Note that the Chinese definition of sweet foods is much different from the American one!)/ Pitchford says in his dedication that he hopes the reader finds "healing, awareness, and peace" from following his program. The diet is certainly acetic by American standards (no alcohol, caffeine, white flour, fried foods, or sugar, and a minimum of eggs and dairy) but the reasons he gives for avoiding these "negative energy" foods are compelling. From the adrenal damage imparted by coffee to immune dysfunction brought on by excess refined sugar, Pitchford spurs you to rethink every dietary choice and its ultimate influence on your health. Without being alarmist, he adds dietary tips for protecting yourself against the dangers of modern life, including neutralizing damage from water fluoridation (thyroid and immune-system problems may result; fluoride is a carcinogen). There's further reading on food combining, female health, heart disease, pregnancy, fasting, and weight loss. Overall, this is a wonderful book for anyone who's serious about strengthening his or her body from the inside out. --Erica Jorgensen/ North Atlantic Books 12-02-2002 11-02-2007 Paul Pitchford 750 -book 9780596002633 0596002637 us Practical RDF Practical RDF Paperback/ Illustrated XML/ Web Programming/ Qualifying Textbooks - Winter 2007 $39.95 $25.99 3.5 The Resource Description Framework (RDF) is a structure for describing and interchanging metadata on the Web--anything from library catalogs and worldwide directories to bioinformatics, Mozilla internal data structures, and knowledge bases for artificial intelligence projects. RDF provides a consistent framework and syntax for describing and querying data, making it possible to share website descriptions more easily. RDF's capabilities, however, have long been shrouded by its reputation for complexity and a difficult family of specifications. Practical RDF breaks through this reputation with immediate and solvable problems to help you understand, master, and implement RDF solutions. Practical RDF explains RDF from the ground up, providing real-world examples and descriptions of how the technology is being used in applications like Mozilla, FOAF, and Chandler, as well as infrastructure you can use to build your own applications. This book cuts to the heart of the W3C's often obscure specifications, giving you tools to apply RDF successfully in your own projects. The first part of the book focuses on the RDF specifications. After an introduction to RDF, the book covers the RDF specification documents themselves, including RDF Semantics and Concepts and Abstract Model specifications, RDF constructs, and the RDF Schema. The second section focuses on programming language support, and the tools and utilities that allow developers to review, edit, parse, store, and manipulate RDF//XML. Subsequent sections focus on RDF's data roots, programming and framework support, and practical implementation and use of RDF and RDF//XML. If you want to know how to apply RDF to information processing, Practical RDF is for you. Whether your interests lie in large-scale information aggregation and analysis or in smaller-scale projects like weblog syndication, this book will provide you with a solid foundation for working with RDF. O'Reilly Media 07-02-2003 07-02-2007 Shelley Powers 331 -book 9781556433023 1556433026 us Cheng Hsin: The Principles of Effortless Power Cheng Hsin: The Principles of Effortless Power Paperback New Age $16.95 $11.44 4.5 The basic text of one of the geniuses of martial arts in America. North Atlantic Books 01-02-1999 06-02-2007 Peter Ralston 184 -book 9781583941591 1583941592 us Zen Body-Being: An Enlightened Approach to Physical Skill, Grace, and Power Zen Body-Being: An Enlightened Approach to Physical Skill, Grace, and Power Paperback Meditation/ Personal Transformation/ Zen/ Zen Philosophy/ Physical Education $16.95 $10.51 5 In this inspiring guide, Peter Ralston presents a program of "physical education" for anyone interested in body improvement. Using simple, clear language to demystify the Zen mindset, he draws on more than three decades of experience teaching students and apprentices worldwide who have applied his body-being approach. More of a transformative guide than a specific list of exercises devoted to any particular physical approach, Zen Body-Being explains how to create a state of mental control, enhanced feeling-awareness, correct structural alignment, increased spatial acuity, and even a greater interactive presence. Exercises are simple, often involving feeling-imagery or a kind of meditative awareness that has a profound and sometimes instant effect. Where similar guides teach readers what to do, this challenging book by the man whose insights Dan Millman has said “speak to us all,” teaches readers how to be./ North Atlantic Books, Frog Ltd. 27-07-2006 18-02-2007 Peter Ralston/ Laura Ralston 200 -book 0639785334866 0071377646 us Schaum's Outline of Chinese Grammar Schaum's Outline of Chinese Grammar Paperback Chinese/ Grammar/ Vocabulary/ Study Guides/ Reference/ Schaum's Outlines $17.95 $10.15 4.5 Schaum's Outline of Chinese Grammar is designed to assist beginning and intermediate students of Mandarin Chinese develop and enhance their knowledge of Chinese grammar. Chinese morphology can be intimidating to students. By simplifying the learning process, this practical book enriches the student's understanding of the Chinese language./ The accessible summary of the major features of Chinese grammar complete with clear explanations of terms and usage is especially helpful to students. The book features 200 sets of practice exercises as well as Chinese-English and English-Chinese glossaries. It serves as a much-needed supplement to textbooks and class materials currently being used in first-and second-year college-level courses./ McGraw-Hill 13-02-2004 11-02-2007 Claudia Ross 304 -book 9780439784542 0439784549 us Harry Potter and the Half-Blood Prince Harry Potter and the Half-Blood Prince (Book 6) 6 Hardcover/ Unabridged Humorous/ Science Fiction, Fantasy, & Magic/ Contemporary/ Hardcover/ School $29.99 $3.45 4.5 The long-awaited, eagerly anticipated, arguably over-hyped Harry Potter and the Half-Blood Prince has arrived, and the question on the minds of kids, adults, fans, and skeptics alike is, "Is it worth the hype?" The answer, luckily, is simple: yep. A magnificent spectacle more than worth the price of admission, Harry Potter and the Half-Blood Prince will blow you away. However, given that so much has gone into protecting the secrets of the book (including armored trucks and injunctions), don't expect any spoilers in this review. It's much more fun not knowing what's coming--and in the case of Rowling's delicious sixth book, you don't want to know. Just sit tight, despite the earth-shattering revelations that will have your head in your hands as you hope the words will rearrange themselves into a different story. But take one warning to heart: do not open Harry Potter and the Half-Blood Prince until you have first found a secluded spot, safe from curious eyes, where you can tuck in for a good long read. Because once you start, you won't stop until you reach the very last page./ A darker book than any in the series thus far with a level of sophistication belying its genre, Harry Potter and the Half-Blood Prince moves the series into murkier waters and marks the arrival of Rowling onto the adult literary scene. While she has long been praised for her cleverness and wit, the strength of Book 6 lies in her subtle development of key characters, as well as her carefully nuanced depiction of a community at war. In Harry Potter and the Half-Blood Prince, no one and nothing is safe, including preconceived notions of good and evil and of right and wrong. With each book in her increasingly remarkable series, fans have nervously watched J.K. Rowling raise the stakes; gone are the simple delights of butterbeer and enchanted candy, and days when the worst ailment could be cured by a bite of chocolate. A series that began as a colorful lark full of magic and discovery has become a dark and deadly war zone. But this should not come as a shock to loyal readers. Rowling readied fans with Harry Potter and the Goblet of Fire and Harry Potter and the Order of the Phoenix by killing off popular characters and engaging the young students in battle. Still, there is an unexpected bleakness from the start of Book 6 that casts a mean shadow over Quidditch games, silly flirtations, and mountains of homework. Ready or not, the tremendous ending of Harry Potter and the Half-Blood Prince will leave stunned fans wondering what great and terrible events await in Book 7 if this sinister darkness is meant to light the way. --Daphne Durham/ Visit the Harry Potter Store/ / Our Harry Potter Store features all things Harry, including books (box sets and collector's editions), audio CDs and cassettes, DVDs, soundtracks, games, and more. 

Begin at the Beginning/ Harry Potter and the Sorcerer's Stone/ / Hardcover / Paperback/ Harry Potter and the Chamber of Secrets/ / Hardcover/ Paperback/ Harry Potter and the Prisoner of Azkaban/ / Hardcover/ Paperback/ Harry Potter and the Goblet of Fire/ / Hardcover/ Paperback/ Harry Potter and the Order of the Phoenix/ / Hardcover/ Paperback/ 
Why We Love Harry
Favorite Moments from the Series
There are plenty of reasons to love Rowling's wildly popular series--no doubt you have several dozen of your own. Our list features favorite moments, characters, and artifacts from the first five books. Keep in mind that this list is by no means exhaustive (what we love about Harry could fill ten books!) and does not include any of the spectacular revelatory moments that would spoil the books for those (few) who have not read them. Enjoy./ Harry Potter and the Sorcerer's Stone/ / * Harry's first trip to the zoo with the Dursleys, when a boa constrictor winks at him. / * When the Dursleys' house is suddenly besieged by letters for Harry from Hogwarts. Readers learn how much the Dursleys have been keeping from Harry. Rowling does a wonderful job in displaying the lengths to which Uncle Vernon will go to deny that magic exists. / * Harry's first visit to Diagon Alley with Hagrid. Full of curiosities and rich with magic and marvel, Harry's first trip includes a trip to Gringotts and Ollivanders, where Harry gets his wand (holly and phoenix feather) and discovers yet another connection to He-Who-Must-No-Be-Named. This moment is the reader's first full introduction to Rowling's world of witchcraft and wizards./ * Harry's experience with the Sorting Hat./ Harry Potter and the Chamber of Secrets/ / * The de-gnoming of the Weasleys' garden. Harry discovers that even wizards have chores--gnomes must be grabbed (ignoring angry protests "Gerroff me! Gerroff me!"), swung about (to make them too dizzy to come back), and tossed out of the garden--this delightful scene highlights Rowling's clever and witty genius. / * Harry's first experience with a Howler, sent to Ron by his mother. / * The Dueling Club battle between Harry and Malfoy. Gilderoy Lockhart starts the Dueling Club to help students practice spells on each other, but he is not prepared for the intensity of the animosity between Harry and Draco. Since they are still young, their minibattle is innocent enough, including tickling and dancing charms./ Harry Potter and the Prisoner of Azkaban/ / * Ron's attempt to use a telephone to call Harry at the Dursleys'. / * Harry's first encounter with a Dementor on the train (and just about any other encounter with Dementors). Harry's brush with the Dementors is terrifying and prepares Potter fans for a darker, scarier book. / * Harry, Ron, and Hermione's behavior in Professor Trelawney's Divination class. Some of the best moments in Rowling's books occur when she reminds us that the wizards-in-training at Hogwarts are, after all, just children. Clearly, even at a school of witchcraft and wizardry, classes can be boring and seem pointless to children. / * The Boggart lesson in Professor Lupin's classroom. / * Harry, Ron, and Hermione's knock-down confrontation with Snape./ Harry Potter and the Goblet of Fire/ / * Hermione's disgust at the reception for the veela (Bulgarian National Team Mascots) at the Quidditch World Cup. Rowling's fourth book addresses issues about growing up--the dynamic between the boys and girls at Hogwarts starts to change. Nowhere is this more plain than the hilarious scene in which magical cheerleaders nearly convince Harry and Ron to jump from the stands to impress them. / * Viktor Krum's crush on Hermione--and Ron's objection to it. / * Malfoy's "Potter Stinks" badge. / * Hermione's creation of S.P.E.W., the intolerant bigotry of the Death Eaters, and the danger of the Triwizard Tournament. Add in the changing dynamics between girls and boys at Hogwarts, and suddenly Rowling's fourth book has a weight and seriousness not as present in early books in the series. Candy and tickle spells are left behind as the students tackle darker, more serious issues and take on larger responsibilities, including the knowledge of illegal curses./ Harry Potter and the Order of the Phoenix/ / / * Harry's outburst to his friends at No. 12 Grimmauld Place. A combination of frustration over being kept in the dark and fear that he will be expelled fuels much of Harry's anger, and it all comes out at once, directly aimed at Ron and Hermione. Rowling perfectly portrays Harry's frustration at being too old to shirk responsibility, but too young to be accepted as part of the fight that he knows is coming. / * Harry's detention with Professor Umbridge. Rowling shows her darker side, leading readers to believe that Hogwarts is no longer a safe haven for young wizards. Dolores represents a bureaucratic tyrant capable of real evil, and Harry is forced to endure their private battle of wills alone. / * Harry and Cho's painfully awkward interactions. Rowling clearly remembers what it was like to be a teenager. / * Harry's Occlumency lessons with Snape. / * Dumbledore's confession to Harry./ / Magic, Mystery, and Mayhem: A Conversation with J.K. Rowling
/ / "I am an extraordinarily lucky person, doing what I love best in the world. I'm sure that I will always be a writer. It was wonderful enough just to be published. The greatest reward is the enthusiasm of the readers."--J.K. Rowling/ Find out more about Harry's creator in our exclusive interview with J.K. Rowling./ 

Did You Know?/ / The Little White Horse was J.K. Rowling's favorite book as a child./ / Jane Austen is Rowling's favorite author./ / Roddy Doyle is Rowling's favorite living writer./ A Few Words from Mary GrandPré
/ / "When I illustrate a cover or a book, I draw upon what the author tells me; that's how I see my responsibility as an illustrator. J.K. Rowling is very descriptive in her writing--she gives an illustrator a lot to work with. Each story is packed full of rich visual descriptions of the atmosphere, the mood, the setting, and all the different creatures and people. She makes it easy for me. The images just develop as I sketch and retrace until it feels right and matches her vision." Check out more Harry Potter art from illustrator Mary GrandPré. 
/ Scholastic, Inc. 16-07-2005 18-02-2007 J. K. Rowling 672 -book 9780767900027 0767900022 us The Illuminated Rumi The Illuminated Rumi Hardcover Middle Eastern/ Inspirational & Religious/ Eastern European/ Mysticism/ Folk Art/ Ancient, Classical & Medieval $30.00 $13.99 4.5 Rise up nimbly and go on your strange journey to the ocean of meanings.../ / In the mid-thirteenth century, in a dusty marketplace in Konya, Turkey, a city where Muslim, Christian, Hindu, and Buddhist travelers mingled, Jelaluddin Rumi, a popular philosopher and scholar, met Shams of Tabriz, a wandering dervish.  Their meeting forever altered the course of Rumi's life and influenced the mystical evolution of the planet.  The bond they formed was everlasting--a powerful transcendent friendship that would flow through Rumi as some of the world's best-loved ecstatic poetry./ / Rumi's passionate, playful poems find and celebrate sacred life in everyday existence.  They speak across all traditions, to all peoples, and today his relevance and popularity continue to grow.  In The Illuminated Rumi, Coleman Barks, widely regarded as the world's premier translator of Rumi's writings, presents some of his most brilliant work, including many new translations.  To complement Rumi's universal vision, Michael Green has worked the ancient art of illumination into a new, visually stunning form that joins typography, original art, old masters, photographs, and prints with sacred images from around the world./ / The Illuminated Rumi is a truly groundbreaking collaboration that interweaves word and image: a magnificent meeting of ancient tradition and modern interpretation that uniquely captures the spiritual wealth of Rumi's teachings.  Coleman Barks's wise and witty commentary, together with Michael Green's art, makes this a classic guide to the life of the soul for a whole new generation of seekers. Broadway 13-10-1997 11-02-2007 Jalal Al-Din Rumi 128 -book 9780140195682 0140195688 us Sitting: A Guide to Buddhist Meditation Sitting: A Guide to Buddhist Meditation Paperback Rituals & Practice $12.00 $2.90 4.5 Penguin (Non-Classics) 01-05-1998 03-02-2007 Diana St. Ruth 96 -book 9780060970796 0060970790 us The Man Who Mistook His Wife for a Hat: And Other Clinical Tales The Man Who Mistook His Wife for a Hat: And Other Clinical Tales Paperback Doctors & Medicine/ Self-Help & Psychology/ Clinical Psychology/ Neuropsychology/ Mental Illness $13.00 $0.95 4.5 In his most extraordinary book, "one of the great clinical writers of the 20th century"(The New York Times) recounts the case histories of patients lost in the bizarre, apparently inescapable world of neurological disorders. Oliver Sacks's The Man Who Mistook His Wife for a Hat tells the stories of individuals afflicted with fantastic perceptual and intellectual aberrations: patients who have lost their memories and with them the greater part of their pasts; who are no longer able to recognize people and common objects; who are stricken with violent tics and grimaces or who shout involuntary obscenities; whose limbs have become alien; who have been dismissed as retarded yet are gifted with uncanny artistic or mathematical talents./ If inconceivably strange, these brilliant tales remain, in Dr. Sacks's splendid and sympathetic telling, deeply human. They are studies of life struggling against incredible adversity, and they enable us to enter the world of the neurologically impaired, to imagine with our hearts what it must be to live and feel as they do. A great healer, Sacks never loses sight of medicine's ultimate responsibility: "the suffering, afflicted, fighting human subject."/ / Harpercollins 01-02-1987 11-02-2007 Oliver W. Sacks 256 -book 9781590591253 1590591259 us Enterprise Java Development on a Budget: Leveraging Java Open Source Technologies Enterprise Java Development on a Budget: Leveraging Java Open Source Technologies Paperback Software Development/ Logic $49.99 $7.43 4.5 Open source has had a profound effect on the Java community. Many Java open source projects have even become de-facto standards. The principal purpose of Enterprise Java Development on a Budget is to guide you through the development of a real enterprise Java application using nothing but open source Java tools, projects, and frameworks./ This book is organized by activities and by particular open source projects that can help you take on the challenges of building the different tiers of your applications. The authors also present a realistic example application that covers most areas of enterprise application development. You'll find information on how to use and configure JBoss, Ant, XDoclet, Struts, ArgoUML, OJB, Hibernate, JUnit, SWT//JFace, and others. Not only will you learn how to use each individual tool, but you'll also understand how to use them in synergy to create robust enterprise Java applications within your budget./ Enterprise Java Development on a Budget combines coverage of best practices with information on the right open source Java tools and technologies, all of which will help support your Java development budget and goals./ Apress 10-11-2003 08-02-2007 5 1 Brian Sam-Bodden/ Christopher M. Judd 656 -book 9780976694069 0976694069 us Enterprise Integration with Ruby Enterprise Integration with Ruby Paperback/ Illustrated Assembly Language Programming/ Object-Oriented Design $32.95 $15.50 4.5 Typical enterprises use dozens, hundreds, and sometimes even thousands of applications, components, services, and databases. Many of them are custom built in-house or by third parties, some are bought, others are based on open source projects, and the origin of a few--usually the most critical ones--is completely unknown./ A lot of applications are very old, some are fairly new, and seemingly no two of them were written using the same tools. They run on heterogeneous operating systems and hardware, use databases and messaging systems from various vendors, and were written in different programming languages./ See how to glue these disparate applications together using popular technologies such as:/ • LDAP, Oracle, and MySQL/ • XML Documents and DTDs/ • Sockets, HTTP, and REST/ • XML//RPC, SOAP, and others/ • ...and more./ If you're on the hook to integrate enterprise-class systems together, the tips and techniques in this book will help./ Pragmatic Bookshelf 01-04-2006 08-02-2007 Maik Schmidt 330 -book 0639785413059 0071419837 us Teach Yourself Beginner's Chinese Script Teach Yourself Beginner's Chinese Script Paperback Chinese/ Phrasebooks - General/ Alphabet/ Reading Skills/ Writing Skills $10.95 $4.50 3 Now learning non-Roman-alphabet languages is as easy as A-B-C!/ Readers wanting to learn the basics of reading and writing a new language that employs script will find all they need in the Teach Yourself Beginner's Script series. Each book includes a step-by-step introduction to reading and writing in a new language as well as tips and practice exercises to build learners' skills. Thanks to the experts at Teach Yourself, script will no longer be all "Greek" to language learners--unless of course, it is Greek script! Teach Yourself Beginner's Script series books feature:/ • Origins of the language/ • A systematic approach to mastering the script/ • Lots of "hands-on" exercises and activities/ • Practical examples from real-life situations/ McGraw-Hill 06-06-2003 11-02-2007 Elizabeth Scurfield/ Song Lianyi 192 -book 9781590302835 1590302834 us Zen Training: Methods and Philosophy (Shambhala Classics) Zen Training: Methods and Philosophy (Shambhala Classics) Paperback Zen/ Meditation/ Buddha $16.95 $9.95 5 Zen Training is a comprehensive handbook for zazen, seated meditation practice, and an authoritative presentation of the Zen path. The book marked a turning point in Zen literature in its critical reevaluation of the enlightenment experience, which the author believes has often been emphasized at the expense of other important aspects of Zen training. In addition, Zen Training goes beyond the first flashes of enlightenment to explore how one lives as well as trains in Zen. The author also draws many significant parallels between Zen and Western philosophy and psychology, comparing traditional Zen concepts with the theories of being and cognition of such thinkers as Heidegger and Husserl. Shambhala 13-09-2005 06-02-2007 Katsuki Sekida 264 -book 9781583941454 1583941452 us Combat Techniques of Taiji, Xingyi, and Bagua: Principles and Practices of Internal Martial Arts Combat Techniques of Taiji, Xingyi, and Bagua: Principles and Practices of Internal Martial Arts Paperback Taichi $22.95 $13.20 3.5 The combat techniques of Tai Ji, Ba Gua, and Xing Yi were forbidden during China's Cultural Revolution, but the teachings of grandmaster Wang Pei Shing have survived. This comprehensive guide, written by one of his students, selects core movements from each practice and gives the student powerful tools to recognize the unique strategies and skills, and to develop a deeper understanding, of each style. It contains complete instructions for a 16-posture form to gain mastery of combat techniques. The book helps practitioners achieve a new level of practice, where deeply ingrained skills are brought forth in a more fluid, intuitive, and fast-paced fashion. Blue Snake Books//Frog, Ltd. 09-02-2006 11-02-2007 Lu Shengli 400 -book 0752063324547 0672324547 us HTTP Developer's Handbook HTTP Developer's Handbook Paperback HTML - General $39.99 $24.97 4.5 HTTP is the protocol that powers the Web. As Web applications become more sophisticated, and as emerging technologies continue to rely heavily on HTTP, understanding this protocol is becoming more and more essential for professional Web developers. By learning HTTP protocol, Web developers gain a deeper understanding of the Web's architecture and can create even better Web applications that are more reliable, faster, and more secure./ The HTTP Developer's Handbook is written specifically for Web developers. It begins by introducing the protocol and explaining it in a straightforward manner. It then illustrates how to leverage this information to improve applications. Extensive information and examples are given covering a wide variety of issues, such as state and session management, caching, SSL, software architecture, and application security./ Sams 19-03-2003 07-02-2007 Chris Shiflett 312 -book 9780517887943 0517887940 us Feng Shui Step by Step : Arranging Your Home for Health and Happiness--with Personalized Astrological Charts Feng Shui Step by Step : Arranging Your Home for Health and Happiness--with Personalized Astrological Charts Paperback Household Hints/ Psychology & Counseling/ Parapsychology/ Feng Shui $20.00 $0.01 4 Simons, a feng shui master and astrologer, teaches readers how to feng shui their homes in a clear, step-by-step fashion and gives personalized advice based on readers' dates of birth. Simons presents not only the popular eight-point method but also divining techniques and other authentic Chinese methods that make analysis more complete. Illustrations. Three Rivers Press 12-11-1996 07-02-2007 T. Raphael Simons 256 -book 9780380788620 0380788624 us Cryptonomicon Cryptonomicon Paperback United States/ Contemporary/ Literary/ Historical/ Spy Stories & Tales of Intrigue/ Technothrillers/ High Tech/ Paperback/ Action & Adventure $16.00 $1.95 4 Neal Stephenson enjoys cult status among science fiction fans and techie types thanks to Snow Crash, which so completely redefined conventional notions of the high-tech future that it became a self-fulfilling prophecy. But if his cyberpunk classic was big, Cryptonomicon is huge... gargantuan... massive, not just in size (a hefty 918 pages including appendices) but in scope and appeal. It's the hip, readable heir to Gravity's Rainbow and the Illuminatus trilogy. And it's only the first of a proposed series--for more information, read our interview with Stephenson./ Cryptonomicon zooms all over the world, careening conspiratorially back and forth between two time periods--World War II and the present. Our 1940s heroes are the brilliant mathematician Lawrence Waterhouse, cryptanalyst extraordinaire, and gung ho, morphine-addicted marine Bobby Shaftoe. They're part of Detachment 2702, an Allied group trying to break Axis communication codes while simultaneously preventing the enemy from figuring out that their codes have been broken. Their job boils down to layer upon layer of deception. Dr. Alan Turing is also a member of 2702, and he explains the unit's strange workings to Waterhouse. "When we want to sink a convoy, we send out an observation plane first.... Of course, to observe is not its real duty--we already know exactly where the convoy is. Its real duty is to be observed.... Then, when we come round and sink them, the Germans will not find it suspicious."/ All of this secrecy resonates in the present-day story line, in which the grandchildren of the WWII heroes--inimitable programming geek Randy Waterhouse and the lovely and powerful Amy Shaftoe--team up to help create an offshore data haven in Southeast Asia and maybe uncover some gold once destined for Nazi coffers. To top off the paranoiac tone of the book, the mysterious Enoch Root, key member of Detachment 2702 and the Societas Eruditorum, pops up with an unbreakable encryption scheme left over from WWII to befuddle the 1990s protagonists with conspiratorial ties./ Cryptonomicon is vintage Stephenson from start to finish: short on plot, but long on detail so precise it's exhausting. Every page has a math problem, a quotable in-joke, an amazing idea, or a bit of sharp prose. Cryptonomicon is also packed with truly weird characters, funky tech, and crypto--all the crypto you'll ever need, in fact, not to mention all the computer jargon of the moment. A word to the wise: if you read this book in one sitting, you may die of information overload (and starvation). --Therese Littleton/ Harper Perennial 02-05-2000 07-02-2007 Neal Stephenson 928 -book 9780887100260 0887100260 us Fifty-Five T'ang Poems: A Text in the Reading and Understanding of T'Ang Poetry (Far Eastern Publications Series) Fifty-Five T'ang Poems: A Text in the Reading and Understanding of T'Ang Poetry (Far Eastern Publications Series) Paperback Movements & Periods/ Anthologies/ Chinese $26.00 $24.95 3 Four masters of the shi form of Chinese poetry, who are generally considered to be giants in the entire history of Chinese literature, are represented in this book: three from the eighth century, and one from the ninth. A few works by other well-known poets are also included. The author provides a general background sketch, instruction to the student, a description of the phonological system and the spelling used, as well as an outline of the grammar of T'ang shi, insofar as it is known. Yale University Press 15-08-2006 11-02-2007 Hugh M. Stimson 256 -book 9780865681859 0865681856 us Xing Yi Quan Xue: The Study of Form-Mind Boxing Xing Yi Quan Xue: The Study of Form-Mind Boxing Paperback $21.95 $15.22 4.5 This is the first English language edition of Sun Lu Tang's 1915 classic on xing yi (hsing yi). In addition to the original text and photographs by Sun Lu Tang, a complete biography and additional photos of Master Sun have been added. Unique Publications 06-02-2000 06-02-2007 Sun Lu Tang 312 -book 9780596003425 0596003420 us Learning Unix for Mac OS X Learning Unix for Mac OS X Paperback MacOS/ Macintosh/ Macs/ Linux/ X Windows & Motif $19.95 $0.01 3 The success of Apple's operating system, Mac OS X, and its Unix roots has brought many new potential Unix users searching for information. The Terminal application and that empty command line can be daunting at first, but users understand it can bring them power and flexibility. Learning Unix for Mac OS X is a concise introduction to just what a reader needs to know to get a started with Unix on Mac OS X. Many Mac users are familiar and comfortable with the easy-to-use elegance of the GUI. With Mac OS X, they now have the ability to not only continue to use their preferred platform, but to explore the powerful capabilities of Unix. Learning Unix for Mac OS X gives the reader information on how to use the Terminal application, become functional with the command interface, explore many Unix applications, and learn how to take advantage of the strengths of both interfaces./ The reader will find all the common commands simply explained with accompanying examples, exercises, and opportunities for experimentation. The book even includes problem checklists along the way to help the reader if they get stuck. The books begins with a introduction to the Unix environment to encourage the reader to get comfortable with the command line. The coverage then expands to launching and configuring the Terminal application--the heart of the Unix interface for the Mac OS X user. The text also introduces how to manage, create, edit, and transfer files. Most everyone using a computer today knows the importance of the internet. And Learning Unix for Mac OS X provides instruction on how to use function such as mail, chat, and web browsing from the command line. A unique challenge for Mac OS X users is printing from the command line. The book contains an entire chapter on how to configure and utilize the various print functions./ The book has been reviewed by Apple for technological accuracy and brandishes the Apple Development Connection (ADC) logo./ O'Reilly 05-02-2002 07-02-2007 Dave Taylor/ Jerry Peek 156 -book 9780974514055 0974514055 us Programming Ruby: The Pragmatic Programmers' Guide, Second Edition Programming Ruby: The Pragmatic Programmers' Guide, Second Edition Paperback/ Illustrated Object-Oriented Design/ Qualifying Textbooks - Winter 2007 $44.95 $20.53 4.5 Ruby is an increasingly popular, fully object-oriented dynamic programming language, hailed by many practitioners as the finest and most useful language available today. When Ruby first burst onto the scene in the Western world, the Pragmatic Programmers were there with the definitive reference manual, Programming Ruby: The Pragmatic Programmer's Guide. Now in its second edition, author Dave Thomas has expanded the famous Pickaxe book with over 200 pages of new content, covering all the new and improved language features of Ruby 1.8 and standard library modules. The Pickaxe contains four major sections:/ • An acclaimed tutorial on using Ruby./ • The definitive reference to the language./ • Complete documentation on all built-in classes, modules, and methods/ • Complete descriptions of all 98 standard libraries./ If you enjoyed the First Edition, you'll appreciate the new and expanded content, including: enhanced coverage of installation, packaging, documenting Ruby source code, threading and synchronization, and enhancing Ruby's capabilities using C-language extensions. Programming for the world-wide web is easy in Ruby, with new chapters on XML//RPC, SOAP, distributed Ruby, templating systems and other web services. There's even a new chapter on unit testing. This is the definitive reference manual for Ruby, including a description of all the standard library modules, a complete reference to all built-in classes and modules (including more than 250 significant changes since the First Edition). Coverage of other features has grown tremendously, including details on how to harness the sophisticated capabilities of irb, so you can dynamically examine and experiment with your running code. "Ruby is a wonderfully powerful and useful language, and whenever I'm working with it this book is at my side" --Martin Fowler, Chief Scientist, ThoughtWorks Pragmatic Bookshelf 01-10-2004 07-02-2007 Dave Thomas/ Chad Fowler/ Andy Hunt 828 -book 9780974514000 0974514004 us Pragmatic Version Control Using CVS Pragmatic Version Control Using CVS Paperback/ Illustrated Software Development/ Information Systems/ Information Theory $29.95 $14.35 4 This book is a recipe-based approach to using the CVS Version Control system that will get you up and running quickly--and correctly. All projects need version control: it's a foundational piece of any project's infrastructure. Yet half of all project teams in the U.S. don't use any version control at all. Many others don't use it well, and end up experiencing time-consuming problems. Version Control, done well, is your "undo" button for the project: nothing is final, and mistakes are easily rolled back. With version control, you'll never again lose a good idea because someone overwrote your file edits. You can always find out easily who made what changes to the source code--and why. Version control is a project-wide time machine. Dial in a date and see exactly what the entire project looked like yesterday, last Tuesday, or even last year. This book describes a practical, easy-to-follow way of using CVS, the most commonly used version control system in the world (and it's available for free). Instead of presenting the grand Theory of Version Control and describing every possible option (whether you'd ever use it or not), this book focuses on the practical application of CVS. It builds a set of examples of use that parallel the life of typical projects, showing you how to adopt and then enhance your pragmatic use of CVS. With this book, you can:/ • Keep project all assets (not just source code) safe, and never run the risk of losing a great idea/ • Know how to undo bad decisions--no matter when they were made/ • Learn how to share code safely, and work in parallel for maximum efficiency/ • See how to avoid costly code freezes/ • Manage 3rd party code/ Now there's no excuse not to use professional-grade version control. The Pragmatic Programmers 09-02-2003 07-02-2007 David Thomas/ Andrew Hunt 161 -book 7805961006053 0596100604 us Astronomy Hacks Astronomy Hacks Paperback/ Illustrated Astronomy/ Star-Gazing $24.95 $13.93 5 Why use the traditional approach to study the stars when you can turn computers, handheld devices, and telescopes into out-of-this-world stargazing tools? Whether you're a first timer or an advanced hobbyist, you'll find Astronomy Hacks both useful and fun. From upgrading your optical finder to photographing stars, this book is the perfect cosmic companion. This handy field guide covers the basics of observing, and what you need to know about tweaking, tuning, adjusting, and tricking out a 'scope. Expect priceless tips and tools for using a Dobsonian Telescope, the large-aperture telescope you can inexpensively build in your garage. Get advice on protocols involved with using electronics including in dark places without ruining the party. Astronomy Hacks begins the space exploration by getting you set up with the right equipment for observing and admiring the stars in an urban setting. Along for the trip are first rate tips for making most of observations. The hacks show you how to:/ • Dark-Adapt Your Notebook Computer/ • Choose the Best Binocular/ • Clean Your Eyepieces and Lenses Safely/ • Upgrade Your Optical Finder/ • Photograph the Stars with Basic Equipment/ The O'Reilly Hacks series has reclaimed the term "hacking" to mean innovating, unearthing, and creating shortcuts, gizmos, and gears. With these hacks, you don't dream it-you do it--and Astronomy Hacks brings space dreams to life. The book is essential for anyone who wants to get the most out of an evening under the stars and have memorable celestial adventures. O'Reilly Media 17-06-2005 08-02-2007 Robert Bruce Thompson/ Barbara Fritchman Thompson 388 -book 9780877736752 0877736758 us The Tibetan Book of the Dead (Shambala Pocket Classics) The Tibetan Book of the Dead (Shambala Pocket Classics) Paperback Motivational/ Book of the Dead (Tibetan)/ Mysticism/ Eastern Philosophy/ Death/ Rituals & Practice $7.00 $2.56 4.5 In this classic scripture of Tibetan Buddhism—traditionally read aloud to the dying to help them attain liberation—death and rebirth are seen as a process that provides an opportunity to recognize the true nature of mind. This unabridged translation of The Tibetan Book of the Dead emphasizes the practical advice that the book offers to the living. The insightful commentary by Chögyam Trungpa, written in clear, concise language, explains what the text teaches us about human psychology. This book will be of interest to people concerned with death and dying, as well as those who seek greater spiritual understanding in everyday life. Shambhala 13-10-1992 11-02-2007 Chogyam Trungpa 236 -book 9781592400874 1592400876 us Eats, Shoots & Leaves: The Zero Tolerance Approach to Punctuation Eats, Shoots & Leaves: The Zero Tolerance Approach to Punctuation Hardcover Essays/ Grammar/ Reference/ Writing Skills $19.95 $1.84 4 A bona fide publishing phenomenon, Lynne Truss's now classic #1 New York Times bestseller Eats, Shoots & Leaves makes its paperback debut after selling over 3 million copies worldwide in hardcover./ We all know the basics of punctuation. Or do we? A look at most neighborhood signage tells a different story. Through sloppy usage and low standards on the Internet, in e-mail, and now text messages, we have made proper punctuation an endangered species./ In Eats, Shoots & Leaves, former editor Truss dares to say, in her delightfully urbane, witty, and very English way, that it is time to look at our commas and semicolons and see them as the wonderful and necessary things they are. This is a book for people who love punctuation and get upset when it is mishandled. From the invention of the question mark in the time of Charlemagne to George Orwell shunning the semicolon, this lively history makes a powerful case for the preservation of a system of printing conventions that is much too subtle to be mucked about with. BACKCOVER: Praise for Lynne Truss and Eats, Shoots & Leaves:

Eats, Shoots & Leaves“makes correct usage so cool that you have to admire Ms. Truss.”
—Janet Maslin, The New York Times

“Witty, smart, passionate.”
—Los Angeles Times Book Review, Best Books Of 2004: Nonfiction 

“Who knew grammar could be so much fun?”
—Newsweek

“Witty and instructive. . . . Truss is an entertaining, well-read scold in a culture that could use more scolding.”
—USA Today“Truss is William Safire crossed with John Cleese's Basil Fawlty.”
—Entertainment Weekly

“Lynne Truss has done the English-speaking world a huge service.”
—The Christian Science Monitor

“This book changed my life in small, perfect ways like learning how to make better coffee or fold an omelet. It's the perfect gift for anyone who cares about grammar and a gentle introduction for those who don't care enough.”
—The Boston Sunday Globe

“Lynne Truss makes [punctuation] a joy to contemplate.”
—Elle

“If Lynne Truss were Roman Catholic I'd nominate her for sainthood.” —Frank McCourt, author of Angela's Ashes

“Truss's scholarship is impressive and never dry.”
—Edmund Morris, The New York Times Book Review/ Gotham 12-04-2004 03-02-2007 Lynne Truss 209 -book 9780679724346 0679724346 us Tao Te Ching [Text Only] Tao Te Ching [Text Only] Paperback Taoism/ Tao Te Ching/ Chinese/ Bible & Other Sacred Texts $9.95 $2.88 4.5 Available for the first time in a handy, easy-to-use size, here is the most accessible and authoritative modern English translation of the ancient Chinese classic. This new Vintage edition includes an introduction and notes by the well-known writer and scholar of philosophy and comparative religion, Jacob Needleman. Vintage 28-08-1989 11-02-2007 Lao Tsu/ Jane English/ Jacob Needleman 144 -book 9780844285269 0844285269 us Easy Chinese Phrasebook & Dictionary Easy Chinese Phrasebook & Dictionary Paperback English (All)/ English (British)/ Chinese/ Conversation/ Phrasebooks - General/ Southeast Asian/ Linguistics $12.95 $3.00 4.5 Two books in one—a practical phrasebook of essential Chinese vocabulary and expressions, plus a 3,500 English//Chinese dictionary. McGraw-Hill 07-12-1990 11-02-2007 Yeou-Koung Tung 272 -book 9780877738510 0877738513 us Art of Peace (Shambhala Pocket Classics) Art of Peace (Shambhala Pocket Classics) Paperback New Age/ Eastern Philosophy/ Aikido/ Martial Arts $6.95 $2.59 4.5 These inspirational teachings show that the real way of the warrior is based on compassion, wisdom, fearlessness, and love of nature. Drawn from the talks and writings of Morihei Ueshiba, founder of the popular Japanese martial art known as Aikido, The Art of Peace, presented here in a pocket-sized edition, offers a nonviolent way to victory and a convincing counterpoint to such classics as Musashi's Book of Five Rings and Sun Tzu's Art of War. Shambhala 10-11-1992 11-02-2007 Morihei Ueshiba/ John Stevens 126 -book 9780912111476 091211147X us Learn to Read Chinese: An Introduction to the Language and Concepts of Current Zhongyi Literature (Learn to Read Chinese) Learn to Read Chinese: An Introduction to the Language and Concepts of Current Zhongyi Literature (Learn to Read Chinese) Paperback Acupuncture & Acupressure/ Chinese/ Southeast Asian/ Linguistics/ Chinese Medicine $30.00 $17.50 These two volumes teach the language of contemporary Chinese technical literature. The subject matter is Chinese medicine, making these texts ideal for those who wish to learn Chinese from real-world sources. All 128 of the texts chosen are excerpted from the introduction to Chinese medicine written by Qin Bowei, one of the founders of TCM and a medical writer known for his clear, precise and detailed clinical expression. The work is thus a superb supplement for students of Chinese and an effective course of study for clinicians or scholars who wish to read Chinese technical periodicals, papers and texts./ The first volume teaches vocabulary. Each text is an exercise; readers transliterate, then translate a passage based on the simplified character vocabulary provided with each passage and its preceding passages. A completed transliteration in Pinyin and a finished English translation accompany the Chinese. The subject matter provides an exposure to authentic contemporary discussions of the fundamental principles of Chinese medicine./ The second volume teaches analysis of Chinese texts through the principles of Natural Language development. By showing how to identify the basic statement in a sentence and the adjunct statements that complete its meaning, just as children learn to read their native language, the reader is given access to Chinese texts as quickly as is possible. When the course is completed, users are working with typical modern Chinese medical sources./ Paradigm Publications (MA) 09-02-1994 11-02-2007 Paul U. Unschuld 2 -book 9780521777681 0521777682 us The Elements of Java Style The Elements of Java Style Paperback Object-Oriented Design/ Software Development/ Computers & Internet $14.99 $2.98 4 The Elements of Java Style, written by renowned author Scott Ambler, Alan Vermeulen, and a team of programmers from Rogue Wave Software, is directed at anyone who writes Java code. Many books explain the syntax and basic use of Java; however, this essential guide explains not only what you can do with the syntax, but what you ought to do. Just as Strunk and White's The Elements of Style provides rules of usage for the English language, this text furnishes a set of rules for Java practitioners. While illustrating these rules with parallel examples of correct and incorrect usage, the authors offer a collection of standards, conventions, and guidelines for writing solid Java code that will be easy to understand, maintain, and enhance. Java developers and programmers who read this book will write better Java code, and become more productive as well. Indeed, anyone who writes Java code or plans to learn how to write Java code should have this book next to his//her computer. Cambridge University Press 01-02-2000 07-02-2007 Allan Vermeulen/ Scott W. Ambler/ Greg Bumgardner/ Eldon Metz/ Trevor Misfeldt/ Jim Shur/ Alan Vermeulen/ Patrick Thompson 125 -book 0723812607006 0471463620 us Java Open Source Programming: with XDoclet, JUnit, WebWork, Hibernate Java Open Source Programming: with XDoclet, JUnit, WebWork, Hibernate Paperback Software Development/ Computers & Internet $45.00 $1.65 4 The Java language itself is not strictly open-source (Sun has held onto control, albeit with lots of public input). There is, however, a large open-source development community around this highly capable language. Java Open Source Programming describes and provides tutorials on some of the most interesting public Java projects, and is designed to enable a Java programmer (who's worked through the basic language's initial learning curve) to take on more ambitious assignments. The authors generally treat the covered open-source packages as resources to be used, rather than projects to be contributed to, and so it's fair to think of this volume as the "missing manual" for downloaded code. In that spirit, the authors devote many sections to "how to" subjects (addressing, for example, a good way to retrieve stored objects from a database and the procedure for calling an action in XWork)./ Java Open Source Programming takes a bit of a risk by devoting a lot of space to the development of a complex application (an online pet shop), as such a didactic strategy can be hard to follow. The authors pull it off, though, and manage to show that their covered technologies can be used to create a feature-rich and robust application that uses the versatile model-view-controller (MVC) pattern. This book will suit you well if you're planning an MVC Java project and want to take advantage of open-source packages. --David Wall/ Topics covered: The most popular open-source Java packages, particularly those concerned with Web applications and the model-view-controller (MVC) pattern. Specific packages covered include JUnit and Mocks (code testing), Hibernate (persistent storage of objects in databases), WebWork (MVC), SiteMesh (Web page layout), Lucene (site searching), and WebDoclet (configuration file generation)./ Wiley 28-11-2003 07-02-2007 Joseph Walnes/ Ara Abrahamian/ Mike Cannon-Brookes/ Patrick A. Lightbody 480 -book 9780201082593 0201082594 us Artificial Intelligence Edition (Addison-Wesley series in computer science) Artificial Intelligence Edition (Addison-Wesley series in computer science) Paperback Questions & Answers/ Information Systems $32.61 $0.01 3.5 This book is one of the oldest and most popular introductions to artificial intelligence. An accomplished artificial intelligence (AI) scientist, Winston heads MIT's Artificial Intelligence Laboratory, and his hands-on AI research experience lends authority to what he writes. Winston provides detailed pseudo-code for most of the algorithms discussed, so you will be able to implement and test the algorithms immediately. The book contains exercises to test your knowledge of the subject and helpful introductions and summaries to guide you through the material. Addison-wesley 04-02-1984 08-02-2007 Patrick Henry Winston 527 -book 9781558605701 1558605703 us Managing Gigabytes: Compressing and Indexing Documents and Images (The Morgan Kaufmann Series in Multimedia and Information Systems) Managing Gigabytes: Compressing and Indexing Documents and Images (The Morgan Kaufmann Series in Multimedia and Information Systems) Hardcover Storage/ Compression/ Software Development/ Software Project Management/ Electronic Documents/ General & Reference/ Engineering/ Peripherals/ Digital Image Processing/ Qualifying Textbooks - Winter 2007 $74.95 $49.98 4.5 Of all the tasks programmers are asked to perform, storing, compressing, and retrieving information are some of the most challenging--and critical to many applications. Managing Gigabytes: Compressing and Indexing Documents and Images is a treasure trove of theory, practical illustration, and general discussion in this fascinating technical subject./ Ian Witten, Alistair Moffat, and Timothy Bell have updated their original work with this even more impressive second edition. This version adds recent techniques such as block-sorting, new indexing techniques, new lossless compression strategies, and many other elements to the mix. In short, this work is a comprehensive summary of text and image compression, indexing, and querying techniques. The history of relevant algorithm development is woven well with a practical discussion of challenges, pitfalls, and specific solutions./ This title is a textbook-style exposition on the topic, with its information organized very clearly into topics such as compression, indexing, and so forth. In addition to diagrams and example text transformations, the authors use "pseudo-code" to present algorithms in a language-independent manner wherever possible. They also supplement the reading with mg--their own implementation of the techniques. The mg C language source code is freely available on the Web./ Alone, this book is an impressive collection of information. Nevertheless, the authors list numerous titles for further reading in selected topics. Whether you're in the midst of application development and need solutions fast or are merely curious about how top-notch information management is done, this hardcover is an excellent investment. --Stephen W. Plain/ Topics covered: Text compression models, including Huffman, LZW, and their variants; trends in information management; index creation and compression; image compression; performance issues; and overall system implementation./ Morgan Kaufmann 15-05-1999 07-02-2007 Ian H. Witten/ Alistair Moffat/ Timothy C. Bell 519 -book 9780596101190 0596101198 us Open Source for the Enterprise: Managing Risks Reaping Rewards Open Source for the Enterprise: Managing Risks Reaping Rewards Paperback/ Illustrated Technical Support/ Programming/ Risks/ Linux $22.95 $12.50 5 Open source software is changing the world of Information Technology. But making it work for your company is far more complicated than simply installing a copy of Linux. If you are serious about using open source to cut costs, accelerate development, and reduce vendor lock-in, you must institutionalize skills and create new ways of working. You must understand how open source is different from commercial software and what responsibilities and risks it brings. Open Source for the Enterprise is a sober guide to putting open source to work in the modern IT department./ Open source software is software whose code is freely available to anyone who wants to change and redistribute it. New commercial support services, smaller licensing fees, increased collaboration, and a friendlier platform to sell products and services are just a few of the reasons open source is so attractive to IT departments. Some of the open source projects that are in current, widespread use in businesses large and small include Linux, FreeBSD, Apache, MySQL, PostgreSQL, JBOSS, and Perl. These have been used to such great effect by Google, Amazon, Yahoo!, and major commercial and financial firms, that a wave of publicity has resulted in recent years, bordering on hype. Large vendors such as IBM, Novell, and Hewlett Packard have made open source a lynchpin of their offerings. Open source has entered a new area where it is being used as a marketing device, a collaborative software development methodology, and a business model./ This book provides something far more valuable than either the cheerleading or the fear-mongering one hears about open source. The authors are Dan Woods, former CTO of TheStreet.com and a consultant and author of several books about IT, and Gautam Guliani, Director of Software Architecture at Kaplan Test Prep & Admissions. Each has used open source software for some 15 years at IT departments large and small. They have collected the wisdom of a host of experts from IT departments, open source communities, and software companies./ Open Source for the Enterprise provides a top to bottom view not only of the technology, but of the skills required to manage it and the organizational issues that must be addressed. Here are the sorts of questions answered in the book:/ • Why is there a "productization gap" in most open source projects?/ • How can the maturity of open source be evaluated?/ • How can the ROI of open source be calculated?/ • What skills are needed to use open source?/ • What sorts of open source projects are appropriate for IT departments at the beginner, intermediate, advanced, and expert levels?/ • What questions need to be answered by an open source strategy?/ • What policies for governance can be instituted to control the adoption of open source?/ • What new commercial services can help manage the risks of open source?/ • Do differences in open source licenses matter?/ • How will using open source transform an IT department?/ Praise for Open Source for the Enterprise: "Open Source has become a strategic business issue; decisions on how and where to choose to use Open Source now have a major impact on the overall direction of IT abilities to support the business both with capabilities and by controlling costs. This is a new game and one generally not covered in existing books on Open Source which continue to assume that the readers are 'deep dive' technologists, Open Source for the Enterprise provides everyone from business managers to technologists with the balanced view that has been missing. Well worth the time to read, and also worth encouraging others in your enterprise to read as well." ----Andy Mulholland - Global CTO Capgemini/ "Open Source for the Enterprise is required reading for anyone working with or looking to adopt open source technologies in a corporate environment. Its practical, no-BS approach will make sure you're armed with the information you need to deploy applications successfully (as well as helping you know when to say "no"). If you're trying to sell open source to management, this book will give you the ammunition you need. If you're a manager trying to drive down cost using open source, this book will tell you what questions to ask your staff. In short, it's a clear, concise explanation of how to successfully leverage open source without making the big mistakes that can get you fired." ----Kevin Bedell - founding editor of LinuxWorld Magazine/ O'Reilly Media 27-07-2005 08-02-2007 Dan Woods/ Gautam Guliani 217 -movie 0786936259223 B00030590I us Hero Hero DVD China/ Leung Chiu Wai, Tony/ Jet Li $19.99 $5.49 4 Master filmmaker Quentin Tarantino presents HERO -- starring martial arts legend Jet Li in a visually stunning martial arts epic where a fearless warrior rises up to defy an empire and unite a nation! With supernatural skill ... and no fear ... a nameless soldier (Jet Li) embarks on a mission of revenge against the fearsome army that massacred his people. Now, to achieve the justice he seeks, he must take on the empire's most ruthless assassins and reach the enemy he has sworn to defeat! Acclaimed by critics and honored with numerous awards, HERO was nominated for both an Oscar® (2002 Best Foreign Language Film)and Golden Globe! Miramax 30-11-2004 07-02-2007 5 Yimou Zhang Jet Li/ Tony Leung Chiu Wai/ Maggie Cheung/ Ziyi Zhang/ Daoming Chen/ Donnie Yen/ Liu Zhong Yuan/ Zheng Tia Yong/ Yan Qin/ Chang Xiao Yang/ Zhang Ya Kun/ Ma Wen Hua/ Jin Ming/ Xu Kuang Hua/ Wang Shou Xin/ Hei Zi/ Cao Hua/ Li Lei/ Xia Bin/ Peng Qiang/ Zhang Yimou Closed-captioned/ Color/ Dolby/ Dubbed/ Subtitled/ Widescreen/ NTSC/ 2.35:1 PG-13 27-08-2004 99 -book 0752064712350 0735712352 us Cocoon: Building XML Applications Cocoon: Building XML Applications Paperback Software Development/ HTML - General/ XML/ Combinatorics/ jp-unknown1 $39.99 $2.30 4 Cocoon: Building XML Applications is the guide to the Apache Cocoon project. The book contains the much needed documentation on the Cocoon project, but it does not limit itself to just being a developer's handbook. The book motivates the use of XML and XML software (in particular open source software). It contains everything a beginner needs to get going with Cocoon as well as the detailed information a developer needs to develop new and exciting components to extend the XML publishing framework. Although each chapter builds upon the previous ones, the book is designed so that the chapters can also be read as individual guides to the topics they discuss. Varied "hands-on" examples are used to make the underlying concepts and technologies absolutely clear to anyone starting out with Cocoon. Chapters that detail the author's experience in building Internet applications are used to embed Cocoon into the "real world" and complete the picture. [md]Matthew Langham and Carsten Ziegeler Sams 24-07-2002 07-02-2007 Carsten Ziegeler/ Matthew Langham 504 \ No newline at end of file diff --git a/solr/client/ruby/solr-ruby/examples/marc/marc_importer.rb b/solr/client/ruby/solr-ruby/examples/marc/marc_importer.rb deleted file mode 100755 index f4f7376d6f8..00000000000 --- a/solr/client/ruby/solr-ruby/examples/marc/marc_importer.rb +++ /dev/null @@ -1,106 +0,0 @@ -#!/usr/bin/env ruby -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require 'marc' -require 'solr' - -solr_url = ENV["SOLR_URL"] || "http://localhost:8983/solr" -marc_filename = ARGV[0] -file_number = marc_filename.scan(/\d\d/) -debug = ARGV[1] == "-debug" - -$KCODE = 'UTF8' - -mapping = { - # :solr_field_name => String - # :solr_field_name => Array of Strings - # :solr_field_name => Proc [Proc operates on record] - # String = 3 digit control field number or 3 digit data field number + subfield letter - - :id => '001', - :subject_genre_facet => ['600v', '610v', '611v', '650v', '651v', '655a'], - :subject_era_facet => ['650d', '650y', '651y', '655y'], - :subject_topic_facet => ['650a', '650b', '650x'], - :subject_geographic_facet => ['650c', '650z', '651a', '651x', '651z', '655z'], - :year_facet => Proc.new do |r| - extract_record_data(r,'260c').collect {|f| f.scan(/\d\d\d\d/)}.flatten - end, - :title_text => '245a', - :author_text => '100a', - :call_number_text => '050a', - :isbn_text => '010a', - :filename_facet => Proc.new {|r| file_number}, -} - -connection = Solr::Connection.new(solr_url) - -if marc_filename =~ /.gz$/ - puts "Unzipping data file..." - temp_filename = "/tmp/marc_data_#{file_number}.mrc" - system("cp #{marc_filename} #{temp_filename}.gz") - system("gunzip #{temp_filename}") - marc_filename = temp_filename -end - -reader = MARC::Reader.new(marc_filename) -count = 0 - -def extract_record_data(record, fields) - extracted_data = [] - - fields.each do |field| - tag = field[0,3] - - extracted_fields = record.find_all {|f| f.tag === tag} - - extracted_fields.each do |field_instance| - if tag < '010' # control field - extracted_data << field_instance.value rescue nil - else # data field - subfield = field[3].chr - extracted_data << field_instance[subfield] rescue nil - end - end - end - - extracted_data.compact.uniq -end - -puts "Indexing #{marc_filename}..." -for record in reader - doc = {} - mapping.each do |key,value| - data = nil - case value - when Proc - data = value.call(record) - - when String, Array - data = extract_record_data(record, value) - data = nil if data.empty? - end - - doc[key] = data if data - end - - puts doc.inspect,"------" if debug - - connection.send(Solr::Request::AddDocument.new(doc)) unless debug - - count += 1 - - puts count if count % 100 == 0 -end - -connection.send(Solr::Request::Commit.new) unless debug -puts "Done" diff --git a/solr/client/ruby/solr-ruby/examples/tang/tang_importer.rb b/solr/client/ruby/solr-ruby/examples/tang/tang_importer.rb deleted file mode 100755 index eb22d5b0232..00000000000 --- a/solr/client/ruby/solr-ruby/examples/tang/tang_importer.rb +++ /dev/null @@ -1,58 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require 'hpricot' -require 'solr' - -solr_url = ENV["SOLR_URL"] || "http://localhost:8983/solr" -debug = ARGV[1] == "-debug" - -solr = Solr::Connection.new(solr_url) - -html = Hpricot(open(ARGV[0])) -max = 320 - -def next_blockquote(elem) - elem = elem.next_sibling - until elem.name == "blockquote" do - elem = elem.next_sibling - end - - elem -end - -for current_index in (1..max) do - section_start = html.at("//blockquote[text()='#{format('%03d',current_index)}']") - type_zh = next_blockquote(section_start) - author_zh = next_blockquote(type_zh) - title_zh = next_blockquote(author_zh) - body_zh = next_blockquote(title_zh) - - type_en = next_blockquote(body_zh) - author_en = next_blockquote(type_en) - title_en = next_blockquote(author_en) - body_en = next_blockquote(title_en) - doc = {:type_zh_facet => type_zh, :author_zh_facet => author_zh, :title_zh_text => title_zh, :body_zh_text => body_zh, - :type_en_facet => type_en, :author_en_facet => author_en, :title_en_text => title_en, :body_en_text => body_en - } - doc.each {|k,v| doc[k] = v.inner_text} - doc[:id] = current_index # TODO: namespace the id, something like "etext_tang:#{current_index}" - doc[:source_facet] = 'etext_tang' - doc[:language_facet] = ['chi','eng'] - - puts "----",doc[:id],doc[:title_en_text],doc[:author_en_facet],doc[:type_en_facet] -# puts doc.inspect if debug - solr.add doc unless debug -end - -solr.commit unless debug -#solr.optimize unless debug \ No newline at end of file diff --git a/solr/client/ruby/solr-ruby/lib/solr.rb b/solr/client/ruby/solr-ruby/lib/solr.rb deleted file mode 100755 index aea686fffea..00000000000 --- a/solr/client/ruby/solr-ruby/lib/solr.rb +++ /dev/null @@ -1,21 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -module Solr; end -require 'solr/exception' -require 'solr/request' -require 'solr/connection' -require 'solr/response' -require 'solr/util' -require 'solr/xml' -require 'solr/importer' -require 'solr/indexer' diff --git a/solr/client/ruby/solr-ruby/lib/solr/connection.rb b/solr/client/ruby/solr-ruby/lib/solr/connection.rb deleted file mode 100755 index 6e1aadcd1ea..00000000000 --- a/solr/client/ruby/solr-ruby/lib/solr/connection.rb +++ /dev/null @@ -1,179 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require 'net/http' - -# TODO: add a convenience method to POST a Solr .xml file, like Solr's example post.sh - -class Solr::Connection - attr_reader :url, :autocommit, :connection - - # create a connection to a solr instance using the url for the solr - # application context: - # - # conn = Solr::Connection.new("http://example.com:8080/solr") - # - # if you would prefer to have all adds/updates autocommitted, - # use :autocommit => :on - # - # conn = Solr::Connection.new('http://example.com:8080/solr', - # :autocommit => :on) - - def initialize(url="http://localhost:8983/solr", opts={}) - @url = URI.parse(url) - unless @url.kind_of? URI::HTTP - raise "invalid http url: #{url}" - end - - # TODO: Autocommit seems nice at one level, but it currently is confusing because - # only calls to Connection#add/#update/#delete, though a Connection#send(AddDocument.new(...)) - # does not autocommit. Maybe #send should check for the request types that require a commit and - # commit in #send instead of the individual methods? - @autocommit = opts[:autocommit] == :on - - # Not actually opening the connection yet, just setting up the persistent connection. - @connection = Net::HTTP.new(@url.host, @url.port) - - @connection.read_timeout = opts[:timeout] if opts[:timeout] - end - - # add a document to the index. you can pass in either a hash - # - # conn.add(:id => 123, :title => 'Tlon, Uqbar, Orbis Tertius') - # - # or a Solr::Document - # - # conn.add(Solr::Document.new(:id => 123, :title = 'On Writing') - # - # true/false will be returned to designate success/failure - - def add(doc) - request = Solr::Request::AddDocument.new(doc) - response = send(request) - commit if @autocommit - return response.ok? - end - - # update a document in the index (really just an alias to add) - - def update(doc) - return add(doc) - end - - # performs a standard query and returns a Solr::Response::Standard - # - # response = conn.query('borges') - # - # alternative you can pass in a block and iterate over hits - # - # conn.query('borges') do |hit| - # puts hit - # end - # - # options include: - # - # :sort, :default_field, :rows, :filter_queries, :debug_query, - # :explain_other, :facets, :highlighting, :mlt, - # :operator => :or / :and - # :start => defaults to 0 - # :field_list => array, defaults to ["*", "score"] - - def query(query, options={}, &action) - # TODO: Shouldn't this return an exception if the Solr status is not ok? (rather than true/false). - create_and_send_query(Solr::Request::Standard, options.update(:query => query), &action) - end - - # performs a dismax search and returns a Solr::Response::Standard - # - # response = conn.search('borges') - # - # options are same as query, but also include: - # - # :tie_breaker, :query_fields, :minimum_match, :phrase_fields, - # :phrase_slop, :boost_query, :boost_functions - - def search(query, options={}, &action) - create_and_send_query(Solr::Request::Dismax, options.update(:query => query), &action) - end - - # sends a commit message to the server - def commit(options={}) - response = send(Solr::Request::Commit.new(options)) - return response.ok? - end - - # sends an optimize message to the server - def optimize - response = send(Solr::Request::Optimize.new) - return response.ok? - end - - # pings the connection and returns true/false if it is alive or not - def ping - begin - response = send(Solr::Request::Ping.new) - return response.ok? - rescue - return false - end - end - - # delete a document from the index using the document id - def delete(document_id) - response = send(Solr::Request::Delete.new(:id => document_id)) - commit if @autocommit - response.ok? - end - - # delete using a query - def delete_by_query(query) - response = send(Solr::Request::Delete.new(:query => query)) - commit if @autocommit - response.ok? - end - - def info - send(Solr::Request::IndexInfo.new) - end - - # send a given Solr::Request and return a RubyResponse or XmlResponse - # depending on the type of request - def send(request) - data = post(request) - Solr::Response::Base.make_response(request, data) - end - - # send the http post request to solr; for convenience there are shortcuts - # to some requests: add(), query(), commit(), delete() or send() - def post(request) - response = @connection.post(@url.path + "/" + request.handler, - request.to_s, - { "Content-Type" => request.content_type }) - - case response - when Net::HTTPSuccess then response.body - else - response.error! - end - - end - -private - - def create_and_send_query(klass, options = {}, &action) - request = klass.new(options) - response = send(request) - return response unless action - response.each {|hit| action.call(hit)} - end - -end diff --git a/solr/client/ruby/solr-ruby/lib/solr/document.rb b/solr/client/ruby/solr-ruby/lib/solr/document.rb deleted file mode 100644 index ba03efd6b0d..00000000000 --- a/solr/client/ruby/solr-ruby/lib/solr/document.rb +++ /dev/null @@ -1,73 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require 'solr/xml' -require 'solr/field' - -class Solr::Document - include Enumerable - attr_accessor :boost - - # Create a new Solr::Document, optionally passing in a hash of - # key/value pairs for the fields - # - # doc = Solr::Document.new(:creator => 'Jorge Luis Borges') - def initialize(hash={}) - @fields = [] - self << hash - end - - # Append a Solr::Field - # - # doc << Solr::Field.new(:creator => 'Jorge Luis Borges') - # - # If you are truly lazy you can simply pass in a hash: - # - # doc << {:creator => 'Jorge Luis Borges'} - def <<(fields) - case fields - when Hash - fields.each_pair do |name,value| - if value.respond_to?(:each) && !value.is_a?(String) - value.each {|v| @fields << Solr::Field.new(name => v)} - else - @fields << Solr::Field.new(name => value) - end - end - when Solr::Field - @fields << fields - else - raise "must pass in Solr::Field or Hash" - end - end - - # shorthand to allow hash lookups - # doc['name'] - def [](name) - field = @fields.find {|f| f.name == name.to_s} - return field.value if field - return nil - end - - # shorthand to assign as a hash - def []=(name,value) - @fields << Solr::Field.new(name => value) - end - - # convert the Document to a REXML::Element - def to_xml - e = Solr::XML::Element.new 'doc' - e.attributes['boost'] = @boost.to_s if @boost - @fields.each {|f| e.add_element(f.to_xml)} - return e - end -end diff --git a/solr/client/ruby/solr-ruby/lib/solr/exception.rb b/solr/client/ruby/solr-ruby/lib/solr/exception.rb deleted file mode 100644 index a439e6728a5..00000000000 --- a/solr/client/ruby/solr-ruby/lib/solr/exception.rb +++ /dev/null @@ -1,13 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -class Solr::Exception < Exception; end diff --git a/solr/client/ruby/solr-ruby/lib/solr/field.rb b/solr/client/ruby/solr-ruby/lib/solr/field.rb deleted file mode 100644 index 0731d0e0afd..00000000000 --- a/solr/client/ruby/solr-ruby/lib/solr/field.rb +++ /dev/null @@ -1,39 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require 'solr/xml' -require 'time' - -class Solr::Field - VALID_PARAMS = [:boost] - attr_accessor :name - attr_accessor :value - attr_accessor :boost - - # Accepts an optional :boost parameter, used to boost the relevance of a particular field. - def initialize(params) - @boost = params[:boost] - name_key = (params.keys - VALID_PARAMS).first - @name, @value = name_key.to_s, params[name_key] - # Convert any Time values into UTC/XML schema format (which Solr requires). - @value = @value.respond_to?(:utc) ? @value.utc.xmlschema : @value.to_s - end - - def to_xml - e = Solr::XML::Element.new 'field' - e.attributes['name'] = @name - e.attributes['boost'] = @boost.to_s if @boost - e.text = @value - return e - end - -end diff --git a/solr/client/ruby/solr-ruby/lib/solr/importer.rb b/solr/client/ruby/solr-ruby/lib/solr/importer.rb deleted file mode 100755 index d607b2c39c3..00000000000 --- a/solr/client/ruby/solr-ruby/lib/solr/importer.rb +++ /dev/null @@ -1,19 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -module Solr; module Importer; end; end -require 'solr/importer/mapper' -require 'solr/importer/array_mapper' -require 'solr/importer/delimited_file_source' -require 'solr/importer/hpricot_mapper' -require 'solr/importer/xpath_mapper' -require 'solr/importer/solr_source' \ No newline at end of file diff --git a/solr/client/ruby/solr-ruby/lib/solr/importer/array_mapper.rb b/solr/client/ruby/solr-ruby/lib/solr/importer/array_mapper.rb deleted file mode 100755 index abef9075545..00000000000 --- a/solr/client/ruby/solr-ruby/lib/solr/importer/array_mapper.rb +++ /dev/null @@ -1,26 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - - -class Solr::Importer::ArrayMapper < Solr::Importer::Mapper - # TODO document that initializer takes an array of Mappers [mapper1, mapper2, ... mapperN] - - # TODO: make merge conflict handling configurable. as is, the last map fields win. - def map(orig_data_array) - mapped_data = {} - orig_data_array.each_with_index do |data,i| - mapped_data.merge!(@mapping[i].map(data)) - end - mapped_data - end -end \ No newline at end of file diff --git a/solr/client/ruby/solr-ruby/lib/solr/importer/delimited_file_source.rb b/solr/client/ruby/solr-ruby/lib/solr/importer/delimited_file_source.rb deleted file mode 100755 index 70f226a2eb0..00000000000 --- a/solr/client/ruby/solr-ruby/lib/solr/importer/delimited_file_source.rb +++ /dev/null @@ -1,38 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# For files with the first line containing field names -# Currently not designed for enormous files, as all lines are -# read into an array -class Solr::Importer::DelimitedFileSource - include Enumerable - - def initialize(filename, splitter=/\t/) - @filename = filename - @splitter = splitter - end - - def each - lines = IO.readlines(@filename) - headers = lines[0].split(@splitter).collect{|h| h.chomp} - - lines[1..-1].each do |line| - data = headers.zip(line.split(@splitter).collect{|s| s.chomp}) - def data.[](key) - self.assoc(key.to_s)[1] - end - - yield(data) - end - end - -end diff --git a/solr/client/ruby/solr-ruby/lib/solr/importer/hpricot_mapper.rb b/solr/client/ruby/solr-ruby/lib/solr/importer/hpricot_mapper.rb deleted file mode 100644 index 53a48e4314d..00000000000 --- a/solr/client/ruby/solr-ruby/lib/solr/importer/hpricot_mapper.rb +++ /dev/null @@ -1,27 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -begin - require 'hpricot' - - class Solr::Importer::HpricotMapper < Solr::Importer::Mapper - def field_data(doc, path) - doc.search(path.to_s).collect { |e| e.inner_html } - end - end -rescue LoadError => e # If we can't load hpricot - class Solr::Importer::HpricotMapper - def initialize(mapping, options={}) - raise "Hpricot not installed." - end - end -end \ No newline at end of file diff --git a/solr/client/ruby/solr-ruby/lib/solr/importer/mapper.rb b/solr/client/ruby/solr-ruby/lib/solr/importer/mapper.rb deleted file mode 100755 index 55b199f8e11..00000000000 --- a/solr/client/ruby/solr-ruby/lib/solr/importer/mapper.rb +++ /dev/null @@ -1,51 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -class Solr::Importer::Mapper - def initialize(mapping, options={}) - @mapping = mapping - @options = options - end - - def field_data(orig_data, field_name) - orig_data[field_name] - end - - def mapped_field_value(orig_data, field_mapping) - case field_mapping - when String - field_mapping - when Proc - field_mapping.call(orig_data) # TODO pass in more context, like self or a function for field_data, etc - when Symbol - field_data(orig_data, @options[:stringify_symbols] ? field_mapping.to_s : field_mapping) - when Enumerable - field_mapping.collect {|orig_field_name| mapped_field_value(orig_data, orig_field_name)}.flatten - else - raise "Unknown mapping for #{field_mapping}" - end - end - - def map(orig_data) - mapped_data = {} - @mapping.each do |solr_name, field_mapping| - value = mapped_field_value(orig_data, field_mapping) - mapped_data[solr_name] = value if value - end - - mapped_data - end - - - - -end diff --git a/solr/client/ruby/solr-ruby/lib/solr/importer/solr_source.rb b/solr/client/ruby/solr-ruby/lib/solr/importer/solr_source.rb deleted file mode 100755 index fe2f4f66e0a..00000000000 --- a/solr/client/ruby/solr-ruby/lib/solr/importer/solr_source.rb +++ /dev/null @@ -1,43 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require 'solr' - -class Solr::Importer::SolrSource - def initialize(solr_url, query, filter_queries=nil, options={}) - @connection = Solr::Connection.new(solr_url) - @query = query - @filter_queries = filter_queries - - @page_size = options[:page_size] || 1000 - @field_list = options[:field_list] || ["*"] - end - - def each - done = false - start = 0 - until done do - # request N documents from a starting point - request = Solr::Request::Standard.new(:query => @query, - :rows => @page_size, - :start => start, - :field_list => @field_list, - :filter_queries => @filter_queries) - response = @connection.send(request) - response.each do |doc| - yield doc # TODO: perhaps convert to HashWithIndifferentAccess.new(doc), so stringify_keys isn't necessary - end - done = start + @page_size >= response.total_hits - start = start + @page_size - end - end -end diff --git a/solr/client/ruby/solr-ruby/lib/solr/importer/xpath_mapper.rb b/solr/client/ruby/solr-ruby/lib/solr/importer/xpath_mapper.rb deleted file mode 100755 index 772e1c3c1f0..00000000000 --- a/solr/client/ruby/solr-ruby/lib/solr/importer/xpath_mapper.rb +++ /dev/null @@ -1,35 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -begin - require 'xml/libxml' - - # For files with the first line containing field names - class Solr::Importer::XPathMapper < Solr::Importer::Mapper - def field_data(doc, xpath) - doc.find(xpath.to_s).collect do |node| - case node - when XML::Attr - node.value - when XML::Node - node.content - end - end - end - end -rescue LoadError => e # If we can't load libxml - class Solr::Importer::XPathMapper - def initialize(mapping, options={}) - raise "libxml not installed" - end - end -end diff --git a/solr/client/ruby/solr-ruby/lib/solr/indexer.rb b/solr/client/ruby/solr-ruby/lib/solr/indexer.rb deleted file mode 100755 index 863510c8bc1..00000000000 --- a/solr/client/ruby/solr-ruby/lib/solr/indexer.rb +++ /dev/null @@ -1,52 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -class Solr::Indexer - attr_reader :solr - - # TODO: document options! - def initialize(data_source, mapper_or_mapping, options={}) - solr_url = options[:solr_url] || ENV["SOLR_URL"] || "http://localhost:8983/solr" - @solr = Solr::Connection.new(solr_url, options) #TODO - these options contain the solr_url and debug keys also, so tidy up what gets passed - - @data_source = data_source - @mapper = mapper_or_mapping.is_a?(Hash) ? Solr::Importer::Mapper.new(mapper_or_mapping) : mapper_or_mapping - - @buffer_docs = options[:buffer_docs] - @debug = options[:debug] - end - - def index - buffer = [] - @data_source.each do |record| - document = @mapper.map(record) - - # TODO: check arrity of block, if 3, pass counter as 3rd argument - yield(record, document) if block_given? # TODO check return of block, if not true then don't index, or perhaps if document.empty? - - buffer << document - - if !@buffer_docs || buffer.size == @buffer_docs - add_docs(buffer) - buffer.clear - end - end - add_docs(buffer) if !buffer.empty? - - @solr.commit unless @debug # TODO: provide option to not commit - end - - def add_docs(documents) - @solr.add(documents) unless @debug - puts documents.inspect if @debug - end -end diff --git a/solr/client/ruby/solr-ruby/lib/solr/request.rb b/solr/client/ruby/solr-ruby/lib/solr/request.rb deleted file mode 100755 index a3ce7da3396..00000000000 --- a/solr/client/ruby/solr-ruby/lib/solr/request.rb +++ /dev/null @@ -1,26 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -module Solr; module Request; end; end -require 'solr/request/add_document' -require 'solr/request/modify_document' -require 'solr/request/base' -require 'solr/request/commit' -require 'solr/request/delete' -require 'solr/request/ping' -require 'solr/request/select' -require 'solr/request/standard' -require 'solr/request/spellcheck' -require 'solr/request/dismax' -require 'solr/request/update' -require 'solr/request/index_info' -require 'solr/request/optimize' diff --git a/solr/client/ruby/solr-ruby/lib/solr/request/add_document.rb b/solr/client/ruby/solr-ruby/lib/solr/request/add_document.rb deleted file mode 100644 index bb3d018f526..00000000000 --- a/solr/client/ruby/solr-ruby/lib/solr/request/add_document.rb +++ /dev/null @@ -1,63 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require 'solr/xml' -require 'solr/request/base' -require 'solr/document' -require 'solr/request/update' - -class Solr::Request::AddDocument < Solr::Request::Update - - # create the request, optionally passing in a Solr::Document - # - # request = Solr::Request::AddDocument.new doc - # - # as a short cut you can pass in a Hash instead: - # - # request = Solr::Request::AddDocument.new :creator => 'Jorge Luis Borges' - # - # or an array, to add multiple documents at the same time: - # - # request = Solr::Request::AddDocument.new([doc1, doc2, doc3]) - - def initialize(doc={}) - @docs = [] - if doc.is_a?(Array) - doc.each { |d| add_doc(d) } - else - add_doc(doc) - end - end - - # returns the request as a string suitable for posting - - def to_s - e = Solr::XML::Element.new 'add' - for doc in @docs - e.add_element doc.to_xml - end - return e.to_s - end - - private - def add_doc(doc) - case doc - when Hash - @docs << Solr::Document.new(doc) - when Solr::Document - @docs << doc - else - raise "must pass in Solr::Document or Hash" - end - end - -end diff --git a/solr/client/ruby/solr-ruby/lib/solr/request/base.rb b/solr/client/ruby/solr-ruby/lib/solr/request/base.rb deleted file mode 100644 index 4b65b1f9484..00000000000 --- a/solr/client/ruby/solr-ruby/lib/solr/request/base.rb +++ /dev/null @@ -1,36 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -class Solr::Request::Base - - - #TODO : Add base support for the debugQuery flag, and such that the response provides debug output easily - - # returns either :xml or :ruby depending on what the - # response type is for a given request - - def response_format - raise "unknown request type: #{self.class}" - end - - def content_type - 'text/xml; charset=utf-8' - end - - # returns the solr handler or url fragment that can - # respond to this type of request - - def handler - raise "unknown request type: #{self.class}" - end - -end diff --git a/solr/client/ruby/solr-ruby/lib/solr/request/commit.rb b/solr/client/ruby/solr-ruby/lib/solr/request/commit.rb deleted file mode 100644 index bcf1308d8b1..00000000000 --- a/solr/client/ruby/solr-ruby/lib/solr/request/commit.rb +++ /dev/null @@ -1,31 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require 'solr/xml' - -class Solr::Request::Commit < Solr::Request::Update - - def initialize(options={}) - @wait_searcher = options[:wait_searcher] || true - @wait_flush = options[:wait_flush] || true - end - - - def to_s - e = Solr::XML::Element.new('commit') - e.attributes['waitSearcher'] = @wait_searcher ? 'true' : 'false' - e.attributes['waitFlush'] = @wait_flush ? 'true' : 'false' - - e.to_s - end - -end diff --git a/solr/client/ruby/solr-ruby/lib/solr/request/delete.rb b/solr/client/ruby/solr-ruby/lib/solr/request/delete.rb deleted file mode 100644 index 916b44ad70a..00000000000 --- a/solr/client/ruby/solr-ruby/lib/solr/request/delete.rb +++ /dev/null @@ -1,50 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require 'solr/xml' - -class Solr::Request::Delete < Solr::Request::Update - - # A delete request can be for a specific document id - # - # request = Solr::Request::Delete.new(:id => 1234) - # - # or by query: - # - # request = Solr::Request::Delete.new(:query => - # - def initialize(options) - unless options.kind_of?(Hash) and (options[:id] or options[:query]) - raise Solr::Exception.new("must pass in :id or :query") - end - if options[:id] and options[:query] - raise Solr::Exception.new("can't pass in both :id and :query") - end - @document_id = options[:id] - @query = options[:query] - end - - def to_s - delete_element = Solr::XML::Element.new('delete') - if @document_id - id_element = Solr::XML::Element.new('id') - id_element.text = @document_id - delete_element.add_element(id_element) - elsif @query - query = Solr::XML::Element.new('query') - query.text = @query - delete_element.add_element(query) - end - delete_element.to_s - end -end - diff --git a/solr/client/ruby/solr-ruby/lib/solr/request/dismax.rb b/solr/client/ruby/solr-ruby/lib/solr/request/dismax.rb deleted file mode 100644 index 13d19771ec9..00000000000 --- a/solr/client/ruby/solr-ruby/lib/solr/request/dismax.rb +++ /dev/null @@ -1,46 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -class Solr::Request::Dismax < Solr::Request::Standard - - VALID_PARAMS.replace(VALID_PARAMS + [:tie_breaker, :query_fields, :minimum_match, :phrase_fields, :phrase_slop, - :boost_query, :boost_functions]) - - def initialize(params) - @alternate_query = params.delete(:alternate_query) - @sort_values = params.delete(:sort) - - super - - @query_type = "dismax" - end - - def to_hash - hash = super - hash[:tie] = @params[:tie_breaker] - hash[:mm] = @params[:minimum_match] - hash[:qf] = @params[:query_fields] - hash[:pf] = @params[:phrase_fields] - hash[:ps] = @params[:phrase_slop] - hash[:bq] = @params[:boost_query] - hash[:bf] = @params[:boost_functions] - hash["q.alt"] = @alternate_query - # FIXME: 2007-02-13 -- This code is duplicated in - # Solr::Request::Standard. It should be refactored into a single location. - hash[:sort] = @sort_values.collect do |sort| - key = sort.keys[0] - "#{key.to_s} #{sort[key] == :descending ? 'desc' : 'asc'}" - end.join(',') if @sort_values - return hash - end - -end \ No newline at end of file diff --git a/solr/client/ruby/solr-ruby/lib/solr/request/index_info.rb b/solr/client/ruby/solr-ruby/lib/solr/request/index_info.rb deleted file mode 100755 index d4eeea54d67..00000000000 --- a/solr/client/ruby/solr-ruby/lib/solr/request/index_info.rb +++ /dev/null @@ -1,22 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -class Solr::Request::IndexInfo < Solr::Request::Select - - def handler - 'admin/luke' - end - - def to_hash - {:numTerms => 0}.merge(super.to_hash) - end -end diff --git a/solr/client/ruby/solr-ruby/lib/solr/request/modify_document.rb b/solr/client/ruby/solr-ruby/lib/solr/request/modify_document.rb deleted file mode 100755 index 6276d979c1e..00000000000 --- a/solr/client/ruby/solr-ruby/lib/solr/request/modify_document.rb +++ /dev/null @@ -1,51 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require 'solr/xml' -require 'solr/request/base' -require 'solr/document' -require 'solr/request/update' - -class Solr::Request::ModifyDocument < Solr::Request::Update - - # Example: ModifyDocument.new(:id => 10, :overwrite => {:field_name => "new value"}) - def initialize(update_data) - modes = [] - @doc = {} - [:overwrite, :append, :distinct, :increment, :delete].each do |mode| - field_data = update_data[mode] - if field_data - field_data.each do |field_name, field_value| - modes << "#{field_name}:#{mode.to_s.upcase}" - @doc[field_name] = field_value if field_value # if value is nil, omit so it can be removed - end - update_data.delete mode - end - end - @mode = modes.join(",") - - # only one key should be left over, the id - @doc[update_data.keys[0].to_s] = update_data.values[0] - end - - # returns the request as a string suitable for posting - def to_s - e = Solr::XML::Element.new 'add' - e.add_element(Solr::Document.new(@doc).to_xml) - return e.to_s - end - - def handler - "update?mode=#{@mode}" - end - -end diff --git a/solr/client/ruby/solr-ruby/lib/solr/request/optimize.rb b/solr/client/ruby/solr-ruby/lib/solr/request/optimize.rb deleted file mode 100755 index 3bd1fc4e494..00000000000 --- a/solr/client/ruby/solr-ruby/lib/solr/request/optimize.rb +++ /dev/null @@ -1,21 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require 'solr/xml' - -class Solr::Request::Optimize < Solr::Request::Update - - def to_s - Solr::XML::Element.new('optimize').to_s - end - -end \ No newline at end of file diff --git a/solr/client/ruby/solr-ruby/lib/solr/request/ping.rb b/solr/client/ruby/solr-ruby/lib/solr/request/ping.rb deleted file mode 100644 index 6b420bee062..00000000000 --- a/solr/client/ruby/solr-ruby/lib/solr/request/ping.rb +++ /dev/null @@ -1,36 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# TODO: Consider something lazy like this? -# Solr::Request::Ping = Solr::Request.simple_request :format=>:xml, :handler=>'admin/ping' -# class Solr::Request -# def self.simple_request(options) -# Class.new do -# def response_format -# options[:format] -# end -# def handler -# options[:handler] -# end -# end -# end -# end - -class Solr::Request::Ping < Solr::Request::Base - def response_format - :xml - end - - def handler - 'admin/ping' - end -end diff --git a/solr/client/ruby/solr-ruby/lib/solr/request/select.rb b/solr/client/ruby/solr-ruby/lib/solr/request/select.rb deleted file mode 100644 index 95267436935..00000000000 --- a/solr/client/ruby/solr-ruby/lib/solr/request/select.rb +++ /dev/null @@ -1,56 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require 'erb' - -# "Abstract" base class, only useful with subclasses that add parameters -class Solr::Request::Select < Solr::Request::Base - - attr_reader :query_type - - def initialize(qt=nil, params={}) - @query_type = qt - @select_params = params - end - - def response_format - :ruby - end - - def handler - 'select' - end - - def content_type - 'application/x-www-form-urlencoded; charset=utf-8' - end - - def to_hash - return {:qt => query_type, :wt => 'ruby'}.merge(@select_params) - end - - def to_s - raw_params = self.to_hash - - http_params = [] - raw_params.each do |key,value| - if value.respond_to?(:each) && !value.is_a?(String) - value.each { |v| http_params << "#{key}=#{ERB::Util::url_encode(v)}" unless v.nil?} - else - http_params << "#{key}=#{ERB::Util::url_encode(value)}" unless value.nil? - end - end - - http_params.join("&") - end - -end diff --git a/solr/client/ruby/solr-ruby/lib/solr/request/spellcheck.rb b/solr/client/ruby/solr-ruby/lib/solr/request/spellcheck.rb deleted file mode 100644 index eab24eb9a9a..00000000000 --- a/solr/client/ruby/solr-ruby/lib/solr/request/spellcheck.rb +++ /dev/null @@ -1,30 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -class Solr::Request::Spellcheck < Solr::Request::Select - - def initialize(params) - super('spellchecker') - @params = params - end - - def to_hash - hash = super - hash[:q] = @params[:query] - hash[:suggestionCount] = @params[:suggestion_count] - hash[:accuracy] = @params[:accuracy] - hash[:onlyMorePopular] = @params[:only_more_popular] - hash[:cmd] = @params[:command] - return hash - end - -end \ No newline at end of file diff --git a/solr/client/ruby/solr-ruby/lib/solr/request/standard.rb b/solr/client/ruby/solr-ruby/lib/solr/request/standard.rb deleted file mode 100755 index a5dd61e8352..00000000000 --- a/solr/client/ruby/solr-ruby/lib/solr/request/standard.rb +++ /dev/null @@ -1,376 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -class Solr::Request::Standard < Solr::Request::Select - - VALID_PARAMS = [:query, :sort, :default_field, :operator, :start, :rows, :shards, - :filter_queries, :field_list, :debug_query, :explain_other, :facets, :highlighting, :mlt] - - def initialize(params) - super('standard') - - raise "Invalid parameters: #{(params.keys - VALID_PARAMS).join(',')}" unless - (params.keys - VALID_PARAMS).empty? - - raise ":query parameter required" unless params[:query] - - @params = params.dup - - # Validate operator - if params[:operator] - raise "Only :and/:or operators allowed" unless - [:and, :or].include?(params[:operator]) - - @params[:operator] = params[:operator].to_s.upcase - end - - # Validate start, rows can be transformed to ints - @params[:start] = params[:start].to_i if params[:start] - @params[:rows] = params[:rows].to_i if params[:rows] - - @params[:field_list] ||= ["*","score"] - - @params[:shards] ||= [] - end - - def to_hash - hash = {} - - # standard request param processing - hash[:sort] = @params[:sort].collect do |sort| - key = sort.keys[0] - "#{key.to_s} #{sort[key] == :descending ? 'desc' : 'asc'}" - end.join(',') if @params[:sort] - hash[:q] = @params[:query] - hash["q.op"] = @params[:operator] - hash[:df] = @params[:default_field] - - # common parameter processing - hash[:start] = @params[:start] - hash[:rows] = @params[:rows] - hash[:fq] = @params[:filter_queries] - hash[:fl] = @params[:field_list].join(',') - hash[:debugQuery] = @params[:debug_query] - hash[:explainOther] = @params[:explain_other] - hash[:shards] = @params[:shards].join(',') unless @params[:shards].empty? - - # facet parameter processing - if @params[:facets] - # TODO need validation of all that is under the :facets Hash too - hash[:facet] = true - hash["facet.field"] = [] - hash["facet.query"] = @params[:facets][:queries] - hash["facet.sort"] = (@params[:facets][:sort] == :count) if @params[:facets][:sort] - hash["facet.limit"] = @params[:facets][:limit] - hash["facet.missing"] = @params[:facets][:missing] - hash["facet.mincount"] = @params[:facets][:mincount] - hash["facet.prefix"] = @params[:facets][:prefix] - hash["facet.offset"] = @params[:facets][:offset] - hash["facet.method"] = @params[:facets][:method] if @params[:facets][:method] - if @params[:facets][:fields] # facet fields are optional (could be facet.query only) - @params[:facets][:fields].each do |f| - if f.kind_of? Hash - key = f.keys[0] - value = f[key] - hash["facet.field"] << key - hash["f.#{key}.facet.sort"] = (value[:sort] == :count) if value[:sort] - hash["f.#{key}.facet.limit"] = value[:limit] - hash["f.#{key}.facet.missing"] = value[:missing] - hash["f.#{key}.facet.mincount"] = value[:mincount] - hash["f.#{key}.facet.prefix"] = value[:prefix] - hash["f.#{key}.facet.offset"] = value[:offset] - else - hash["facet.field"] << f - end - end - end - end - - # highlighting parameter processing - http://wiki.apache.org/solr/HighlightingParameters - if @params[:highlighting] - hash[:hl] = true - hash["hl.fl"] = @params[:highlighting][:field_list].join(',') if @params[:highlighting][:field_list] - - snippets = @params[:highlighting][:max_snippets] - if snippets - if snippets.kind_of? Hash - if snippets[:default] - hash["hl.snippets"] = snippets[:default] - end - if snippets[:fields] - snippets[:fields].each do |k,v| - hash["f.#{k}.hl.snippets"] = v - end - end - else - hash["hl.snippets"] = snippets - end - end - - fragsize = @params[:highlighting][:fragment_size] - if fragsize - if fragsize.kind_of? Hash - if fragsize[:default] - hash["hl.fragsize"] = fragsize[:default] - end - if fragsize[:fields] - fragsize[:fields].each do |k,v| - hash["f.#{k}.hl.fragsize"] = v - end - end - else - hash["hl.fragsize"] = fragsize - end - end - - rfm = @params[:highlighting][:require_field_match] - if nil != rfm - if rfm.kind_of? Hash - if nil != rfm[:default] - hash["hl.requireFieldMatch"] = rfm[:default] - end - if rfm[:fields] - rfm[:fields].each do |k,v| - hash["f.#{k}.hl.requireFieldMatch"] = v - end - end - else - hash["hl.requireFieldMatch"] = rfm - end - end - - mac = @params[:highlighting][:max_analyzed_chars] - if mac - if mac.kind_of? Hash - if mac[:default] - hash["hl.maxAnalyzedChars"] = mac[:default] - end - if mac[:fields] - mac[:fields].each do |k,v| - hash["f.#{k}.hl.maxAnalyzedChars"] = v - end - end - else - hash["hl.maxAnalyzedChars"] = mac - end - end - - prefix = @params[:highlighting][:prefix] - if prefix - if prefix.kind_of? Hash - if prefix[:default] - hash["hl.simple.pre"] = prefix[:default] - end - if prefix[:fields] - prefix[:fields].each do |k,v| - hash["f.#{k}.hl.simple.pre"] = v - end - end - else - hash["hl.simple.pre"] = prefix - end - end - - suffix = @params[:highlighting][:suffix] - if suffix - if suffix.kind_of? Hash - if suffix[:default] - hash["hl.simple.post"] = suffix[:default] - end - if suffix[:fields] - suffix[:fields].each do |k,v| - hash["f.#{k}.hl.simple.post"] = v - end - end - else - hash["hl.simple.post"] = suffix - end - end - - formatter = @params[:highlighting][:formatter] - if formatter - if formatter.kind_of? Hash - if formatter[:default] - hash["hl.formatter"] = formatter[:default] - end - if formatter[:fields] - formatter[:fields].each do |k,v| - hash["f.#{k}.hl.formatter"] = v - end - end - else - hash["hl.formatter"] = formatter - end - end - - fragmenter = @params[:highlighting][:fragmenter] - if fragmenter - if fragmenter.kind_of? Hash - if fragmenter[:default] - hash["hl.fragmenter"] = fragmenter[:default] - end - if fragmenter[:fields] - fragmenter[:fields].each do |k,v| - hash["f.#{k}.hl.fragmenter"] = v - end - end - else - hash["hl.fragmenter"] = fragmenter - end - end - - merge_contiguous = @params[:highlighting][:merge_contiguous] - if nil != merge_contiguous - if merge_contiguous.kind_of? Hash - if nil != merge_contiguous[:default] - hash["hl.mergeContiguous"] = merge_contiguous[:default] - end - if merge_contiguous[:fields] - merge_contiguous[:fields].each do |k,v| - hash["f.#{k}.hl.mergeContiguous"] = v - end - end - else - hash["hl.mergeContiguous"] = merge_contiguous - end - end - - increment = @params[:highlighting][:increment] - if increment - if increment.kind_of? Hash - if increment[:default] - hash["hl.increment"] = increment[:default] - end - if increment[:fields] - increment[:fields].each do |k,v| - hash["f.#{k}.hl.increment"] = v - end - end - else - hash["hl.increment"] = increment - end - end - - # support "old style" - alternate_fields = @params[:highlighting][:alternate_fields] - if alternate_fields - alternate_fields.each do |f,v| - hash["f.#{f}.hl.alternateField"] = v - end - end - - alternate_field = @params[:highlighting][:alternate_field] - if alternate_field - if alternate_field.kind_of? Hash - if alternate_field[:default] - hash["hl.alternateField"] = alternate_field[:default] - end - if alternate_field[:fields] - alternate_field[:fields].each do |k,v| - hash["f.#{k}.hl.alternateField"] = v - end - end - else - hash["hl.alternateField"] = alternate_field - end - end - - mafl = @params[:highlighting][:max_alternate_field_length] - if mafl - if mafl.kind_of? Hash - if mafl[:default] - hash["hl.maxAlternateFieldLength"] = mafl[:default] - end - if mafl[:fields] - mafl[:fields].each do |k,v| - hash["f.#{k}.hl.maxAlternateFieldLength"] = v - end - else - # support "old style" - mafl.each do |k,v| - hash["f.#{k}.hl.maxAlternateFieldLength"] = v - end - end - else - hash["hl.maxAlternateFieldLength"] = mafl - end - end - - hash["hl.usePhraseHighlighter"] = @params[:highlighting][:use_phrase_highlighter] - - hash["hl.useFastVectorHighlighter"] = @params[:highlighting][:use_fast_vector_highlighter] - - regex = @params[:highlighting][:regex] - if regex - if regex[:slop] - if regex[:slop].kind_of? Hash - if regex[:slop][:default] - hash["hl.regex.slop"] = regex[:slop][:default] - end - if regex[:slop][:fields] - regex[:slop][:fields].each do |k,v| - hash["f.#{k}.hl.regex.slop"] = v - end - end - else - hash["hl.regex.slop"] = regex[:slop] - end - end - if regex[:pattern] - if regex[:pattern].kind_of? Hash - if regex[:pattern][:default] - hash["hl.regex.pattern"] = regex[:pattern][:default] - end - if regex[:pattern][:fields] - regex[:pattern][:fields].each do |k,v| - hash["f.#{k}.hl.regex.pattern"] = v - end - end - else - hash["hl.regex.pattern"] = regex[:pattern] - end - end - if regex[:max_analyzed_chars] - if regex[:max_analyzed_chars].kind_of? Hash - if regex[:max_analyzed_chars][:default] - hash["hl.regex.maxAnalyzedChars"] = regex[:max_analyzed_chars][:default] - end - if regex[:max_analyzed_chars][:fields] - regex[:max_analyzed_chars][:fields].each do |k,v| - hash["f.#{k}.hl.regex.maxAnalyzedChars"] = v - end - end - else - hash["hl.regex.maxAnalyzedChars"] = regex[:max_analyzed_chars] - end - end - end - - end - - if @params[:mlt] - hash[:mlt] = true - hash["mlt.count"] = @params[:mlt][:count] - hash["mlt.fl"] = @params[:mlt][:field_list].join(',') - hash["mlt.mintf"] = @params[:mlt][:min_term_freq] - hash["mlt.mindf"] = @params[:mlt][:min_doc_freq] - hash["mlt.minwl"] = @params[:mlt][:min_word_length] - hash["mlt.maxwl"] = @params[:mlt][:max_word_length] - hash["mlt.maxqt"] = @params[:mlt][:max_query_terms] - hash["mlt.maxntp"] = @params[:mlt][:max_tokens_parsed] - hash["mlt.boost"] = @params[:mlt][:boost] - end - - hash.merge(super.to_hash) - end - -end diff --git a/solr/client/ruby/solr-ruby/lib/solr/request/update.rb b/solr/client/ruby/solr-ruby/lib/solr/request/update.rb deleted file mode 100644 index 8bd84488645..00000000000 --- a/solr/client/ruby/solr-ruby/lib/solr/request/update.rb +++ /dev/null @@ -1,23 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# a parent class for all requests that go through the solr update handler -# TODO: Use new xml update handler for better error responses -class Solr::Request::Update < Solr::Request::Base - def response_format - :xml - end - - def handler - 'update' - end -end diff --git a/solr/client/ruby/solr-ruby/lib/solr/response.rb b/solr/client/ruby/solr-ruby/lib/solr/response.rb deleted file mode 100755 index 72c55fe664c..00000000000 --- a/solr/client/ruby/solr-ruby/lib/solr/response.rb +++ /dev/null @@ -1,27 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -module Solr; module Response; end; end -require 'solr/response/base' -require 'solr/response/xml' -require 'solr/response/ruby' -require 'solr/response/ping' -require 'solr/response/add_document' -require 'solr/response/modify_document' -require 'solr/response/standard' -require 'solr/response/spellcheck' -require 'solr/response/dismax' -require 'solr/response/commit' -require 'solr/response/delete' -require 'solr/response/index_info' -require 'solr/response/optimize' -require 'solr/response/select' \ No newline at end of file diff --git a/solr/client/ruby/solr-ruby/lib/solr/response/add_document.rb b/solr/client/ruby/solr-ruby/lib/solr/response/add_document.rb deleted file mode 100644 index d1e192301db..00000000000 --- a/solr/client/ruby/solr-ruby/lib/solr/response/add_document.rb +++ /dev/null @@ -1,17 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -class Solr::Response::AddDocument < Solr::Response::Xml - def initialize(xml) - super - end -end diff --git a/solr/client/ruby/solr-ruby/lib/solr/response/base.rb b/solr/client/ruby/solr-ruby/lib/solr/response/base.rb deleted file mode 100644 index a66d2a4d4f9..00000000000 --- a/solr/client/ruby/solr-ruby/lib/solr/response/base.rb +++ /dev/null @@ -1,42 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -class Solr::Response::Base - attr_reader :raw_response - - def initialize(raw_response) - @raw_response = raw_response - end - - # factory method for creating a Solr::Response::* from - # a request and the raw response content - def self.make_response(request, raw) - - # make sure response format seems sane - unless [:xml, :ruby].include?(request.response_format) - raise Solr::Exception.new("unknown response format: #{request.response_format}" ) - end - - # TODO: Factor out this case... perhaps the request object should provide the response class instead? Or dynamically align by class name? - # Maybe the request itself could have the response handling features that get mixed in with a single general purpose response object? - - begin - klass = eval(request.class.name.sub(/Request/,'Response')) - rescue NameError - raise Solr::Exception.new("unknown request type: #{request.class}") - else - klass.new(raw) - end - - end - -end diff --git a/solr/client/ruby/solr-ruby/lib/solr/response/commit.rb b/solr/client/ruby/solr-ruby/lib/solr/response/commit.rb deleted file mode 100644 index ff937a36ac3..00000000000 --- a/solr/client/ruby/solr-ruby/lib/solr/response/commit.rb +++ /dev/null @@ -1,17 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require 'rexml/xpath' - -class Solr::Response::Commit < Solr::Response::Xml -end - diff --git a/solr/client/ruby/solr-ruby/lib/solr/response/delete.rb b/solr/client/ruby/solr-ruby/lib/solr/response/delete.rb deleted file mode 100644 index 0836128094c..00000000000 --- a/solr/client/ruby/solr-ruby/lib/solr/response/delete.rb +++ /dev/null @@ -1,13 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -class Solr::Response::Delete < Solr::Response::Xml; end diff --git a/solr/client/ruby/solr-ruby/lib/solr/response/dismax.rb b/solr/client/ruby/solr-ruby/lib/solr/response/dismax.rb deleted file mode 100644 index e3ff8c08c64..00000000000 --- a/solr/client/ruby/solr-ruby/lib/solr/response/dismax.rb +++ /dev/null @@ -1,20 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -class Solr::Response::Dismax < Solr::Response::Standard - # no need for special processing - - # FIXME: 2007-02-07 -- The existence of this class indicates that - # the Request/Response pair architecture is a little hinky. Perhaps we could refactor - # out some of the most common functionality -- Common Query Parameters, Highlighting Parameters, - # Simple Facet Parameters, etc. -- into modules? -end \ No newline at end of file diff --git a/solr/client/ruby/solr-ruby/lib/solr/response/index_info.rb b/solr/client/ruby/solr-ruby/lib/solr/response/index_info.rb deleted file mode 100755 index b8e215ff268..00000000000 --- a/solr/client/ruby/solr-ruby/lib/solr/response/index_info.rb +++ /dev/null @@ -1,26 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -class Solr::Response::IndexInfo < Solr::Response::Ruby - def initialize(ruby_code) - super - end - - def num_docs - return @data['index']['numDocs'] - end - - def field_names - return @data['fields'].keys - end - -end diff --git a/solr/client/ruby/solr-ruby/lib/solr/response/modify_document.rb b/solr/client/ruby/solr-ruby/lib/solr/response/modify_document.rb deleted file mode 100755 index 44c4f5b0cb6..00000000000 --- a/solr/client/ruby/solr-ruby/lib/solr/response/modify_document.rb +++ /dev/null @@ -1,17 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -class Solr::Response::ModifyDocument < Solr::Response::Xml - def initialize(xml) - super - end -end diff --git a/solr/client/ruby/solr-ruby/lib/solr/response/optimize.rb b/solr/client/ruby/solr-ruby/lib/solr/response/optimize.rb deleted file mode 100755 index 4594d90d065..00000000000 --- a/solr/client/ruby/solr-ruby/lib/solr/response/optimize.rb +++ /dev/null @@ -1,14 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -class Solr::Response::Optimize < Solr::Response::Commit -end \ No newline at end of file diff --git a/solr/client/ruby/solr-ruby/lib/solr/response/ping.rb b/solr/client/ruby/solr-ruby/lib/solr/response/ping.rb deleted file mode 100644 index 1c405885e26..00000000000 --- a/solr/client/ruby/solr-ruby/lib/solr/response/ping.rb +++ /dev/null @@ -1,28 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require 'rexml/xpath' - -class Solr::Response::Ping < Solr::Response::Xml - - def initialize(xml) - super - @ok = REXML::XPath.first(@doc, './solr/ping') ? true : false - end - - # returns true or false depending on whether the ping - # was successful or not - def ok? - @ok - end - -end diff --git a/solr/client/ruby/solr-ruby/lib/solr/response/ruby.rb b/solr/client/ruby/solr-ruby/lib/solr/response/ruby.rb deleted file mode 100644 index 05424c13d83..00000000000 --- a/solr/client/ruby/solr-ruby/lib/solr/response/ruby.rb +++ /dev/null @@ -1,42 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -class Solr::Response::Ruby < Solr::Response::Base - attr_reader :data, :header - - def initialize(ruby_code) - super - begin - #TODO: what about pulling up data/header/response to ResponseBase, - # or maybe a new middle class like SelectResponseBase since - # all Select queries return this same sort of stuff?? - # XML (&wt=xml) and Ruby (&wt=ruby) responses contain exactly the same structure. - # a goal of solrb is to make it irrelevant which gets used under the hood, - # but favor Ruby responses. - @data = eval(ruby_code) - @header = @data['responseHeader'] - raise "response should be a hash" unless @data.kind_of? Hash - raise "response header missing" unless @header.kind_of? Hash - rescue SyntaxError => e - raise Solr::Exception.new("invalid ruby code: #{e}") - end - end - - def ok? - @header['status'] == 0 - end - - def query_time - @header['QTime'] - end - -end diff --git a/solr/client/ruby/solr-ruby/lib/solr/response/select.rb b/solr/client/ruby/solr-ruby/lib/solr/response/select.rb deleted file mode 100755 index 8e2185d67de..00000000000 --- a/solr/client/ruby/solr-ruby/lib/solr/response/select.rb +++ /dev/null @@ -1,17 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -class Solr::Response::Select < Solr::Response::Ruby - def initialize(ruby_code) - super - end -end diff --git a/solr/client/ruby/solr-ruby/lib/solr/response/spellcheck.rb b/solr/client/ruby/solr-ruby/lib/solr/response/spellcheck.rb deleted file mode 100644 index a4842c58424..00000000000 --- a/solr/client/ruby/solr-ruby/lib/solr/response/spellcheck.rb +++ /dev/null @@ -1,20 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -class Solr::Response::Spellcheck < Solr::Response::Ruby - attr_reader :suggestions - - def initialize(ruby_code) - super - @suggestions = @data['suggestions'] - end -end diff --git a/solr/client/ruby/solr-ruby/lib/solr/response/standard.rb b/solr/client/ruby/solr-ruby/lib/solr/response/standard.rb deleted file mode 100644 index 2e59fe9b068..00000000000 --- a/solr/client/ruby/solr-ruby/lib/solr/response/standard.rb +++ /dev/null @@ -1,60 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -class Solr::Response::Standard < Solr::Response::Ruby - FacetValue = Struct.new(:name, :value) - include Enumerable - - def initialize(ruby_code) - super - @response = @data['response'] - raise "response section missing" unless @response.kind_of? Hash - end - - def total_hits - @response['numFound'] - end - - def start - @response['start'] - end - - def hits - @response['docs'] - end - - def max_score - @response['maxScore'] - end - - # TODO: consider the use of json.nl parameter - def field_facets(field) - facets = [] - values = @data['facet_counts']['facet_fields'][field] - Solr::Util.paired_array_each(values) do |key, value| - facets << FacetValue.new(key, value) - end - - facets - end - - def highlighted(id, field) - @data['highlighting'][id.to_s][field.to_s] rescue nil - end - - # supports enumeration of hits - # TODO revisit - should this iterate through *all* hits by re-requesting more? - def each - @response['docs'].each {|hit| yield hit} - end - -end diff --git a/solr/client/ruby/solr-ruby/lib/solr/response/xml.rb b/solr/client/ruby/solr-ruby/lib/solr/response/xml.rb deleted file mode 100644 index f48de5d047e..00000000000 --- a/solr/client/ruby/solr-ruby/lib/solr/response/xml.rb +++ /dev/null @@ -1,42 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require 'rexml/document' -require 'solr/exception' - -class Solr::Response::Xml < Solr::Response::Base - attr_reader :doc, :status_code, :status_message - - def initialize(xml) - super - # parse the xml - @doc = REXML::Document.new(xml) - - # look for the result code and string - # - # - # 02 - # - result = REXML::XPath.first(@doc, './response/lst[@name="responseHeader"]/int[@name="status"]') - if result - @status_code = result.text - @status_message = result.text # TODO: any need for a message? - end - rescue REXML::ParseException => e - raise Solr::Exception.new("invalid response xml: #{e}") - end - - def ok? - return @status_code == '0' - end - -end diff --git a/solr/client/ruby/solr-ruby/lib/solr/solrtasks.rb b/solr/client/ruby/solr-ruby/lib/solr/solrtasks.rb deleted file mode 100755 index 3a1f76a54d5..00000000000 --- a/solr/client/ruby/solr-ruby/lib/solr/solrtasks.rb +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env ruby -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# TODO: fill out Solr tasks: start, stop, ping, optimize, etc. - -require 'rake' -require 'rake/tasklib' - -module Solr - namespace :solr do - desc "Start Solr" - task :start do - # TODO: actually start it up! - puts "Starting..." - end - end -end diff --git a/solr/client/ruby/solr-ruby/lib/solr/util.rb b/solr/client/ruby/solr-ruby/lib/solr/util.rb deleted file mode 100755 index bb134eeeefa..00000000000 --- a/solr/client/ruby/solr-ruby/lib/solr/util.rb +++ /dev/null @@ -1,32 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -class Solr::Util - # paired_array_each([key1,value1,key2,value2]) yields twice: - # |key1,value1| and |key2,value2| - def self.paired_array_each(a, &block) - 0.upto(a.size / 2 - 1) do |i| - n = i * 2 - yield(a[n], a[n+1]) - end - end - - # paired_array_to_hash([key1,value1,key2,value2]) => {key1 => value1, key2, value2} - def self.paired_array_to_hash(a) - Hash[*a] - end - - def self.query_parser_escape(string) - # backslash prefix everything that isn't a word character - string.gsub(/(\W)/,'\\\\\1') - end -end diff --git a/solr/client/ruby/solr-ruby/lib/solr/xml.rb b/solr/client/ruby/solr-ruby/lib/solr/xml.rb deleted file mode 100644 index 626ecd295f3..00000000000 --- a/solr/client/ruby/solr-ruby/lib/solr/xml.rb +++ /dev/null @@ -1,47 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -module Solr::XML -end - -begin - - # If we can load rubygems and libxml-ruby... - require 'rubygems' - require 'xml/libxml' - - # then make a few modifications to XML::Node so it can stand in for REXML::Element - class XML::Node - # element.add_element(another_element) should work - alias_method :add_element, :<< - - # element.attributes['blah'] should work - def attributes - self - end - - # element.text = "blah" should work - def text=(x) - self << x.to_s - end - end - - # And use XML::Node for our XML generation - Solr::XML::Element = XML::Node - -rescue LoadError => e # If we can't load either rubygems or libxml-ruby - - # Just use REXML. - require 'rexml/document' - Solr::XML::Element = REXML::Element - -end \ No newline at end of file diff --git a/solr/client/ruby/solr-ruby/script/setup.rb b/solr/client/ruby/solr-ruby/script/setup.rb deleted file mode 100755 index b7256c92c1b..00000000000 --- a/solr/client/ruby/solr-ruby/script/setup.rb +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env ruby -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -include Solr diff --git a/solr/client/ruby/solr-ruby/script/solrshell b/solr/client/ruby/solr-ruby/script/solrshell deleted file mode 100755 index 46938fa0924..00000000000 --- a/solr/client/ruby/solr-ruby/script/solrshell +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env ruby -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -solr_lib = File.dirname(__FILE__) + '/../lib/solr' -setup = File.dirname(__FILE__) + '/setup' -irb_name = RUBY_PLATFORM =~ /mswin32/ ? 'irb.bat' : 'irb' - -exec "#{irb_name} -r #{solr_lib} -r #{setup} --simple-prompt" diff --git a/solr/client/ruby/solr-ruby/solr/conf/admin-extra.html b/solr/client/ruby/solr-ruby/solr/conf/admin-extra.html deleted file mode 100644 index aa739da862c..00000000000 --- a/solr/client/ruby/solr-ruby/solr/conf/admin-extra.html +++ /dev/null @@ -1,31 +0,0 @@ - - - diff --git a/solr/client/ruby/solr-ruby/solr/conf/protwords.txt b/solr/client/ruby/solr-ruby/solr/conf/protwords.txt deleted file mode 100644 index 1dfc0abecbf..00000000000 --- a/solr/client/ruby/solr-ruby/solr/conf/protwords.txt +++ /dev/null @@ -1,21 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -#----------------------------------------------------------------------- -# Use a protected word file to protect against the stemmer reducing two -# unrelated words to the same base word. - -# Some non-words that normally won't be encountered, -# just to test that they won't be stemmed. -dontstems -zwhacky - diff --git a/solr/client/ruby/solr-ruby/solr/conf/schema.xml b/solr/client/ruby/solr-ruby/solr/conf/schema.xml deleted file mode 100755 index daac616b121..00000000000 --- a/solr/client/ruby/solr-ruby/solr/conf/schema.xml +++ /dev/null @@ -1,222 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id - - - text - - - - - - - - - - - - diff --git a/solr/client/ruby/solr-ruby/solr/conf/scripts.conf b/solr/client/ruby/solr-ruby/solr/conf/scripts.conf deleted file mode 100644 index f58b262ae0c..00000000000 --- a/solr/client/ruby/solr-ruby/solr/conf/scripts.conf +++ /dev/null @@ -1,24 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -user= -solr_hostname=localhost -solr_port=8983 -rsyncd_port=18983 -data_dir= -webapp_name=solr -master_host= -master_data_dir= -master_status_dir= diff --git a/solr/client/ruby/solr-ruby/solr/conf/solrconfig.xml b/solr/client/ruby/solr-ruby/solr/conf/solrconfig.xml deleted file mode 100755 index 0262200ea48..00000000000 --- a/solr/client/ruby/solr-ruby/solr/conf/solrconfig.xml +++ /dev/null @@ -1,385 +0,0 @@ - - - - - - - ${solr.data.dir:} - - - - false - 32 - 10 - 2147483647 - 10000 - 1000 - - - - - false - 32 - 10 - 2147483647 - 10000 - - - false - - - - - - - - - - - - - - - - - - - 1024 - - - - - - - - - - - - - false - - - - - - - - 10 - - - - - - - - - - - - - - - - - - false - - - 4 - - - - - - - - - - - - - - - explicit - - - - - - - - - - explicit - text^1.0 title_text^2.0 description_text^1.5 id^10.0 - 2<-1 5<-2 6<90% - *:* - - - - - - - on - 1 - genre_facet - medium_facet - rating_facet - publisher_facet - - - - - - - - - 1 - 0.5 - - - - - - - - spell - - - - - word - - - - - - - - - - - - - - - - explicit - true - - - - - - - - 5 - - - - - solr - - - - diff --git a/solr/client/ruby/solr-ruby/solr/conf/stopwords.txt b/solr/client/ruby/solr-ruby/solr/conf/stopwords.txt deleted file mode 100644 index b5824da3263..00000000000 --- a/solr/client/ruby/solr-ruby/solr/conf/stopwords.txt +++ /dev/null @@ -1,58 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -#----------------------------------------------------------------------- -# a couple of test stopwords to test that the words are really being -# configured from this file: -stopworda -stopwordb - -#Standard english stop words taken from Lucene's StopAnalyzer -a -an -and -are -as -at -be -but -by -for -if -in -into -is -it -no -not -of -on -or -s -such -t -that -the -their -then -there -these -they -this -to -was -will -with - diff --git a/solr/client/ruby/solr-ruby/solr/conf/synonyms.txt b/solr/client/ruby/solr-ruby/solr/conf/synonyms.txt deleted file mode 100644 index b0e31cb7ec8..00000000000 --- a/solr/client/ruby/solr-ruby/solr/conf/synonyms.txt +++ /dev/null @@ -1,31 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -#----------------------------------------------------------------------- -#some test synonym mappings unlikely to appear in real input text -aaa => aaaa -bbb => bbbb1 bbbb2 -ccc => cccc1,cccc2 -a\=>a => b\=>b -a\,a => b\,b -fooaaa,baraaa,bazaaa - -# Some synonym groups specific to this example -GB,gib,gigabyte,gigabytes -MB,mib,megabyte,megabytes -Television, Televisions, TV, TVs -#notice we use "gib" instead of "GiB" so any WordDelimiterFilter coming -#after us won't split it into two words. - -# Synonym mappings can be used for spelling correction too -pixima => pixma - diff --git a/solr/client/ruby/solr-ruby/solr/conf/xslt/example.xsl b/solr/client/ruby/solr-ruby/solr/conf/xslt/example.xsl deleted file mode 100644 index 75178f29d27..00000000000 --- a/solr/client/ruby/solr-ruby/solr/conf/xslt/example.xsl +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - - - - - - - - - - <xsl:value-of select="$title"/> - - - -

    -
    - This has been formatted by the sample "example.xsl" transform - - use your own XSLT to get a nicer page -
    - - - -
    - - - -
    - - - - -
    -
    -
    - - - - - - - - - - - - - - javascript:toggle("");? -
    - - exp - - - - - -
    - - -
    - - - - - - - -
      - -
    • -
      -
    - - -
    - - - - - - - - - - - - - - - - - - - - -
    diff --git a/solr/client/ruby/solr-ruby/test/conf/admin-extra.html b/solr/client/ruby/solr-ruby/test/conf/admin-extra.html deleted file mode 100644 index aa739da862c..00000000000 --- a/solr/client/ruby/solr-ruby/test/conf/admin-extra.html +++ /dev/null @@ -1,31 +0,0 @@ - - - diff --git a/solr/client/ruby/solr-ruby/test/conf/protwords.txt b/solr/client/ruby/solr-ruby/test/conf/protwords.txt deleted file mode 100644 index 1dfc0abecbf..00000000000 --- a/solr/client/ruby/solr-ruby/test/conf/protwords.txt +++ /dev/null @@ -1,21 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -#----------------------------------------------------------------------- -# Use a protected word file to protect against the stemmer reducing two -# unrelated words to the same base word. - -# Some non-words that normally won't be encountered, -# just to test that they won't be stemmed. -dontstems -zwhacky - diff --git a/solr/client/ruby/solr-ruby/test/conf/schema.xml b/solr/client/ruby/solr-ruby/test/conf/schema.xml deleted file mode 100755 index a284b29ddce..00000000000 --- a/solr/client/ruby/solr-ruby/test/conf/schema.xml +++ /dev/null @@ -1,240 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id - - - text - - - - - - - - - - - diff --git a/solr/client/ruby/solr-ruby/test/conf/scripts.conf b/solr/client/ruby/solr-ruby/test/conf/scripts.conf deleted file mode 100644 index f58b262ae0c..00000000000 --- a/solr/client/ruby/solr-ruby/test/conf/scripts.conf +++ /dev/null @@ -1,24 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -user= -solr_hostname=localhost -solr_port=8983 -rsyncd_port=18983 -data_dir= -webapp_name=solr -master_host= -master_data_dir= -master_status_dir= diff --git a/solr/client/ruby/solr-ruby/test/conf/solrconfig.xml b/solr/client/ruby/solr-ruby/test/conf/solrconfig.xml deleted file mode 100755 index 07d8da984e6..00000000000 --- a/solr/client/ruby/solr-ruby/test/conf/solrconfig.xml +++ /dev/null @@ -1,367 +0,0 @@ - - - - - - - - - - - false - 32 - 10 - 2147483647 - 10000 - 1000 - - - - - false - 32 - 10 - 2147483647 - 10000 - - - false - - - - - - - - - - - - - - - - - - - 1024 - - - - - - - - - - - - - false - - - - - - - - 10 - - - - - - - - - - - - - - - - - - false - - - 4 - - - - - - - - - - - - - - - explicit - - - - - - - - explicit - 0.01 - - text^0.5 - - - - - - - - - id,test - - - 2<-1 5<-2 6<90% - - 100 - *:* - - - - - - - - - - 1 - 0.5 - - - - - - - - spell - - - - - word - - - - - - - - - - - - - - - - explicit - true - - - - - - - - 5 - - - - - solr - - - - diff --git a/solr/client/ruby/solr-ruby/test/conf/stopwords.txt b/solr/client/ruby/solr-ruby/test/conf/stopwords.txt deleted file mode 100644 index b5824da3263..00000000000 --- a/solr/client/ruby/solr-ruby/test/conf/stopwords.txt +++ /dev/null @@ -1,58 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -#----------------------------------------------------------------------- -# a couple of test stopwords to test that the words are really being -# configured from this file: -stopworda -stopwordb - -#Standard english stop words taken from Lucene's StopAnalyzer -a -an -and -are -as -at -be -but -by -for -if -in -into -is -it -no -not -of -on -or -s -such -t -that -the -their -then -there -these -they -this -to -was -will -with - diff --git a/solr/client/ruby/solr-ruby/test/conf/synonyms.txt b/solr/client/ruby/solr-ruby/test/conf/synonyms.txt deleted file mode 100644 index b0e31cb7ec8..00000000000 --- a/solr/client/ruby/solr-ruby/test/conf/synonyms.txt +++ /dev/null @@ -1,31 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -#----------------------------------------------------------------------- -#some test synonym mappings unlikely to appear in real input text -aaa => aaaa -bbb => bbbb1 bbbb2 -ccc => cccc1,cccc2 -a\=>a => b\=>b -a\,a => b\,b -fooaaa,baraaa,bazaaa - -# Some synonym groups specific to this example -GB,gib,gigabyte,gigabytes -MB,mib,megabyte,megabytes -Television, Televisions, TV, TVs -#notice we use "gib" instead of "GiB" so any WordDelimiterFilter coming -#after us won't split it into two words. - -# Synonym mappings can be used for spelling correction too -pixima => pixma - diff --git a/solr/client/ruby/solr-ruby/test/functional/server_test.rb b/solr/client/ruby/solr-ruby/test/functional/server_test.rb deleted file mode 100644 index c94a7dd40f7..00000000000 --- a/solr/client/ruby/solr-ruby/test/functional/server_test.rb +++ /dev/null @@ -1,218 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require 'test/unit' -require 'solr' - -class BadRequest < Solr::Request::Standard - def response_format - :invalid - end -end - -class ServerTest < Test::Unit::TestCase - include Solr - - def setup - @connection = Connection.new("http://localhost:8888/solr", :autocommit => :on) - clean - end - - def test_full_lifecycle - # make sure autocommit is on - assert @connection.autocommit - - # make sure this doc isn't there to begin with - @connection.delete(123456) - - # add it - @connection.add(:id => 123456, :text => 'Borges') # add :some_date => 'NOW/HOUR' to test richer data type handling - # now = DateTime.now - - # look for it - response = @connection.query('Borges') - assert_equal 1, response.total_hits - hit = response.hits[0] - assert_equal '123456', hit['id'] - # assert_equal now.year, hit['whatever_date'].year - - # look for it via dismax - response = @connection.search('Borges') - assert_equal 1, response.total_hits - assert_equal '123456', response.hits[0]['id'] - - # delete it - @connection.delete(123456) - - # make sure it's gone - response = @connection.query('Borges') - assert_equal 0, response.total_hits - end - - def test_i18n_full_lifecycle - # make sure autocommit is on - assert @connection.autocommit - - # make sure this doc isn't there to begin with - @connection.delete(123456) - - # add it - @connection.add(:id => 123456, :text => 'Åäöêâîôû') - - # look for it - response = @connection.query('Åäöêâîôû') - assert_equal 1, response.total_hits - assert_equal '123456', response.hits[0]['id'] - - # delete it - @connection.delete(123456) - - # make sure it's gone - response = @connection.query('Åäöêâîôû Öëäïöü') - assert_equal 0, response.total_hits - end - - def test_sorting - @connection.add(:id => 1, :text => 'aaa woot') - @connection.add(:id => 2, :text => 'bbb woot') - @connection.add(:id => 3, :text => 'ccc woot') - @connection.commit - - results = @connection.query('woot', :sort => [:id => :descending], :rows => 2) - assert_equal([3, 2], results.hits.map { |h| h['id'].to_i }) - - results = @connection.search('woot', :sort => [:id => :descending], :rows => 2) - assert_equal([3, 2], results.hits.map { |h| h['id'].to_i }) - - @connection.delete_by_query("id:1 OR id:2 OR id:3") - end - - def test_bad_connection - conn = Solr::Connection.new 'http://127.0.0.1:9999/invalid' - begin - conn.send(Solr::Request::Ping.new) - flunk "Expected exception not raised" - rescue ::Exception - # expected - assert true - end - end - - def test_bad_url - conn = Solr::Connection.new 'http://localhost:8888/invalid' - assert_raise(Net::HTTPServerException) do - conn.send(Solr::Request::Ping.new) - end - end - - def test_commit - response = @connection.send(Solr::Request::Commit.new) - assert response.ok? - end - - def test_optimize - response = @connection.send(Solr::Request::Optimize.new) - assert response.ok? - end - -# TODO: add test_ping back... something seems to have changed with the response, so adjustments are needed. -# non-critical - if Solr is broken we'll know from other tests! -# def test_ping -# assert_equal true, @connection.ping -# end - - def test_delete_with_query - assert_equal true, @connection.delete_by_query('[* TO *]') - end - - def test_ping_with_bad_server - conn = Solr::Connection.new 'http://localhost:8888/invalid' - assert_equal false, conn.ping - end - - def test_invalid_response_format - request = BadRequest.new(:query => "solr") - assert_raise(Solr::Exception) do - @connection.send(request) - end - end - - def test_escaping - doc = Solr::Document.new :id => 47, :ruby_text => 'puts "ouch!"' - @connection.add(doc) - @connection.commit - - request = Solr::Request::Standard.new :query => 'ouch' - result = @connection.send(request) - - assert_match /puts/, result.raw_response - end - - def test_add_document - doc = {:id => 999, :text => 'hi there!'} - request = Solr::Request::AddDocument.new(doc) - response = @connection.send(request) - assert response.status_code == '0' - end - - def test_update - @connection.update(:id => 999, :text => 'update test') - end - - def test_no_such_field - doc = {:id => 999, :bogus => 'foo'} - request = Solr::Request::AddDocument.new(doc) - assert_raise(Net::HTTPServerException) do - response = @connection.send(request) - end - # assert_equal false, response.ok? - # assert_match "ERROR:unknown field 'bogus'", response.status_message - end - - def test_index_info - doc = {:id => 999, :test_index_facet => 'value'} - @connection.add(doc) - ii = Solr::Request::IndexInfo.new - info = @connection.send(Solr::Request::IndexInfo.new) - assert info.field_names.include?("id") && info.field_names.include?("test_index_facet") - assert_equal 1, info.num_docs - end - - def test_highlighting - @connection.add(:id => 1, :title_text => "Apache Solr") - - request = Solr::Request::Standard.new(:query => 'solr', - :highlighting => { - :field_list => ['title_text'], - :max_snippets => 3, - :prefix => ">>", - :suffix => "<<" - } - ) - - response = @connection.send(request) - assert_equal ["Apache >>Solr<<"], response.highlighted(1, :title_text) - end - - def test_entities - @connection.add(:id => 1, :title_text => " ") - response = @connection.query('nbsp') - assert_equal 1, response.total_hits - assert_equal '1', response.hits[0]['id'] - end - - # wipe the index clean - def clean - @connection.delete_by_query('*:*') - end - -end diff --git a/solr/client/ruby/solr-ruby/test/functional/test_solr_server.rb b/solr/client/ruby/solr-ruby/test/functional/test_solr_server.rb deleted file mode 100644 index fa01072e66c..00000000000 --- a/solr/client/ruby/solr-ruby/test/functional/test_solr_server.rb +++ /dev/null @@ -1,104 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# A singleton class for starting/stopping a Solr server for testing purposes -# The behavior of TestSolrServer can be modified prior to start() by changing -# port, solr_home, and quiet properties. - -class TestSolrServer - require 'singleton' - include Singleton - attr_accessor :port, :jetty_home, :solr_home, :quiet - - # configure the singleton with some defaults - def initialize - @pid = nil - end - - def self.wrap(params = {}) - error = false - solr_server = self.instance - solr_server.quiet = params[:quiet] || true - solr_server.jetty_home = params[:jetty_home] - solr_server.solr_home = params[:solr_home] - solr_server.port = params[:jetty_port] || 8888 - begin - puts "starting solr server on #{RUBY_PLATFORM}" - solr_server.start - sleep params[:startup_wait] || 5 - yield - rescue - error = true - ensure - puts "stopping solr server" - solr_server.stop - end - - return error - end - - def jetty_command - "java -Djetty.port=#{@port} -Dsolr.solr.home=#{@solr_home} -jar start.jar" - end - - def start - puts "jetty_home: #{@jetty_home}" - puts "solr_home: #{@solr_home}" - puts "jetty_command: #{jetty_command}" - platform_specific_start - end - - def stop - platform_specific_stop - end - - if RUBY_PLATFORM =~ /mswin32/ - require 'win32/process' - - # start the solr server - def platform_specific_start - Dir.chdir(@jetty_home) do - @pid = Process.create( - :app_name => jetty_command, - :creation_flags => Process::DETACHED_PROCESS, - :process_inherit => false, - :thread_inherit => true, - :cwd => "#{@jetty_home}" - ).process_id - end - end - - # stop a running solr server - def platform_specific_stop - Process.kill(1, @pid) - Process.wait - end - else # Not Windows - # start the solr server - def platform_specific_start - puts self.inspect - Dir.chdir(@jetty_home) do - @pid = fork do - STDERR.close if @quiet - exec jetty_command - end - end - end - - # stop a running solr server - def platform_specific_stop - Process.kill('TERM', @pid) - Process.wait - end - end - -end diff --git a/solr/client/ruby/solr-ruby/test/unit/add_document_test.rb b/solr/client/ruby/solr-ruby/test/unit/add_document_test.rb deleted file mode 100644 index 414cbfc47cf..00000000000 --- a/solr/client/ruby/solr-ruby/test/unit/add_document_test.rb +++ /dev/null @@ -1,40 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require 'solr_mock_base' - -class AddDocumentTest < SolrMockBaseTestCase - - def test_add_document_response - conn = Solr::Connection.new('http://localhost:9999/solr') - set_post_return('02') - doc = {:id => '123', :text => 'Tlon, Uqbar, Orbis Tertius'} - response = conn.send(Solr::Request::AddDocument.new(doc)) - assert_equal true, response.ok? - end - - def test_bad_add_document_response - conn = Solr::Connection.new('http://localhost:9999/solr') - set_post_return('12') - doc = {:id => '123', :text => 'Tlon, Uqbar, Orbis Tertius'} - response = conn.send(Solr::Request::AddDocument.new(doc)) - assert_equal false, response.ok? - end - - def test_shorthand - conn = Solr::Connection.new('http://localhost:9999/solr') - set_post_return('02') - doc = {:id => '123', :text => 'Tlon, Uqbar, Orbis Tertius'} - assert_equal true, conn.add(:id => '123', :text => 'Tlon, Uqbar, Orbis Tetius') - end - -end diff --git a/solr/client/ruby/solr-ruby/test/unit/array_mapper_test.rb b/solr/client/ruby/solr-ruby/test/unit/array_mapper_test.rb deleted file mode 100755 index 55ba3e61ef9..00000000000 --- a/solr/client/ruby/solr-ruby/test/unit/array_mapper_test.rb +++ /dev/null @@ -1,37 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require 'solr' -require 'test/unit' - -include Solr::Importer - -class ArrayMapperTest < Test::Unit::TestCase - def test_simple - mapping1 = {:one => "uno"} - mapping2 = {:two => "dos"} - - mapper = Solr::Importer::ArrayMapper.new([Mapper.new(mapping1),Mapper.new(mapping2)]) - mapped_data = mapper.map([{},{}]) - assert_equal "uno", mapped_data[:one] - assert_equal "dos", mapped_data[:two] - end - - def test_field_conflict_goes_to_last - mapping1 = {:same => "uno"} - mapping2 = {:same => "dos"} - - mapper = Solr::Importer::ArrayMapper.new([Mapper.new(mapping1),Mapper.new(mapping2)]) - mapped_data = mapper.map([{},{}]) - assert_equal "dos", mapped_data[:same] - end -end \ No newline at end of file diff --git a/solr/client/ruby/solr-ruby/test/unit/changes_yaml_test.rb b/solr/client/ruby/solr-ruby/test/unit/changes_yaml_test.rb deleted file mode 100755 index 69f8c14d2c3..00000000000 --- a/solr/client/ruby/solr-ruby/test/unit/changes_yaml_test.rb +++ /dev/null @@ -1,21 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require 'test/unit' - -class ChangesYamlTest < Test::Unit::TestCase - def test_parse - change_log = YAML.load_file(File.expand_path(File.dirname(__FILE__)) + "/../../CHANGES.yml") - assert_equal Date.parse("2007-02-15"), change_log["v0.0.1"]["release_date"] - assert_equal ["initial release"], change_log["v0.0.1"]["changes"] - end -end diff --git a/solr/client/ruby/solr-ruby/test/unit/commit_test.rb b/solr/client/ruby/solr-ruby/test/unit/commit_test.rb deleted file mode 100644 index 908ae5e576c..00000000000 --- a/solr/client/ruby/solr-ruby/test/unit/commit_test.rb +++ /dev/null @@ -1,41 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require 'solr_mock_base' - -class CommitTest < SolrMockBaseTestCase - - def test_commit - xml = '02' - conn = Solr::Connection.new('http://localhost:9999/solr') - set_post_return(xml) - response = conn.send(Solr::Request::Commit.new) - assert_kind_of Solr::Response::Commit, response - assert_equal true, response.ok? - - # test shorthand - assert_equal true, conn.commit - end - - # def test_invalid_commit - # xml = '12' - # conn = Solr::Connection.new('http://localhost:9999/solr') - # set_post_return(xml) - # response = conn.send(Solr::Request::Commit.new) - # assert_kind_of Solr::Response::Commit, response - # assert_equal false, response.ok? - # - # # test shorthand - # assert_equal false, conn.commit - # end - -end diff --git a/solr/client/ruby/solr-ruby/test/unit/connection_test.rb b/solr/client/ruby/solr-ruby/test/unit/connection_test.rb deleted file mode 100755 index cba4f169b17..00000000000 --- a/solr/client/ruby/solr-ruby/test/unit/connection_test.rb +++ /dev/null @@ -1,55 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require 'test/unit' -require 'solr' -require 'solr_mock_base' - -class ConnectionTest < SolrMockBaseTestCase - def test_mock - connection = Connection.new("http://localhost:9999") - set_post_return("foo") - assert_equal "foo", connection.post(Solr::Request::AddDocument.new) - end - - def test_bad_url - assert_raise(RuntimeError) do - Connection.new("ftp://localhost:9999") - end - end - - def test_connection_initialize - connection = Solr::Connection.new("http://localhost:8983/solr") - assert_equal 'localhost', connection.url.host - assert_equal 8983, connection.url.port - assert_equal '/solr', connection.url.path - end - - def test_non_standard_context - connection = Solr::Connection.new("http://localhost:8983/index") - assert_equal '/index', connection.url.path - end - - def test_xml_response - connection = Connection.new("http://localhost:9999") - set_post_return "" - response = connection.send(Solr::Request::Ping.new) - assert_equal "", response.raw_response - end - - def test_ruby_response - connection = Connection.new("http://localhost:9999") - set_post_return "{'responseHeader' => {}, 'response' => {}}" - response = connection.send(Solr::Request::Standard.new(:query => 'foo')) - assert_equal({'responseHeader' => {}, 'response' => {}}, response.data) - end -end diff --git a/solr/client/ruby/solr-ruby/test/unit/data_mapper_test.rb b/solr/client/ruby/solr-ruby/test/unit/data_mapper_test.rb deleted file mode 100755 index ca9ab78cb6c..00000000000 --- a/solr/client/ruby/solr-ruby/test/unit/data_mapper_test.rb +++ /dev/null @@ -1,75 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require 'solr' -require 'test/unit' - -class DataMapperTest < Test::Unit::TestCase - - def test_static_mapping - mapping = {:static => "value", - :static_array => ["value1", "value2"]} - - mapper = Solr::Importer::Mapper.new(mapping) - mapped_data = mapper.map({}) - - assert_equal "value", mapped_data[:static] - assert_equal ["value1", "value2"], mapped_data[:static_array] - end - - def test_simple_mapping - orig_data = {:orig_field => "value", - :multi1 => "val1", :multi2 => "val2"} - mapping = {:solr_field => :orig_field, - :mapped_array => [:multi1, :multi2], } - - mapper = Solr::Importer::Mapper.new(mapping) - mapped_data = mapper.map(orig_data) - - assert_equal "value", mapped_data[:solr_field] - assert_equal ["val1", "val2"], mapped_data[:mapped_array] - end - - def test_proc - orig_data = {:orig_field => "value"} - mapping = {:solr_field => Proc.new {|record| ">#{record[:orig_field]}<"}} - - mapper = Solr::Importer::Mapper.new(mapping) - mapped_data = mapper.map(orig_data) - - assert_equal ">value<", mapped_data[:solr_field] - end - - def test_overridden_field - mapping = {:solr_field => [:orig_field1, :orig_field2]} - orig_data = {:orig_field1 => "value1", :orig_field2 => "value2", } - - mapper = Solr::Importer::Mapper.new(mapping) - def mapper.field_data(orig_data, field_name) - ["~#{super(orig_data, field_name)}~"] # array tests that the value is flattened - end - mapped_data = mapper.map(orig_data) - - assert_equal ["~value1~", "~value2~"], mapped_data[:solr_field] - end - - def test_unknown_mapping - mapping = {:solr_field => /foo/} # regexp currently not a valid mapping type - - mapper = Solr::Importer::Mapper.new(mapping) - - assert_raise(RuntimeError) do - mapped_data = mapper.map({}) - end - end - -end diff --git a/solr/client/ruby/solr-ruby/test/unit/delete_test.rb b/solr/client/ruby/solr-ruby/test/unit/delete_test.rb deleted file mode 100644 index bd00c7c4611..00000000000 --- a/solr/client/ruby/solr-ruby/test/unit/delete_test.rb +++ /dev/null @@ -1,56 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require 'solr_mock_base' - -class DeleteTest < SolrMockBaseTestCase - - def test_delete_request - request = Solr::Request::Delete.new(:id => '123') - assert_match(/[\s]*123<\/id>[\s]*<\/delete>/m, request.to_s) - end - - def test_delete_by_query_request - request = Solr::Request::Delete.new(:query => 'name:summers') - assert_match(/[\s]*name:summers<\/query>[\s]*<\/delete>/m, request.to_s) - end - - def test_delete_response - conn = Solr::Connection.new 'http://localhost:9999/solr' - set_post_return('02') - response = conn.send(Solr::Request::Delete.new(:id => 123)) - assert_equal true, response.ok? - end - - def test_bad_delete_request - assert_raise(Solr::Exception) do - Solr::Request::Delete.new(:bogus => :param) - end - - assert_raise(Solr::Exception) do - Solr::Request::Delete.new(:id => 529, :query => "id:529") - end - end - - def test_bad_delete_response - conn = Solr::Connection.new 'http://localhost:9999/solr' - set_post_return('uhoh') - response = conn.send(Solr::Request::Delete.new(:id => 123)) - assert_equal false, response.ok? - end - - def test_delete_by_i18n_query_request - request = Solr::Request::Delete.new(:query => 'ëäïöü') - assert_match(/[\s]*ëäïöü<\/query>[\s]*<\/delete>/m, request.to_s) - end - -end diff --git a/solr/client/ruby/solr-ruby/test/unit/delimited_file_source_test.rb b/solr/client/ruby/solr-ruby/test/unit/delimited_file_source_test.rb deleted file mode 100755 index bb52fcc11ab..00000000000 --- a/solr/client/ruby/solr-ruby/test/unit/delimited_file_source_test.rb +++ /dev/null @@ -1,29 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require 'solr' -require 'test/unit' - -class DelimitedFileSourceTest < Test::Unit::TestCase - - def test_load - filename = File.expand_path(File.dirname(__FILE__)) + "/tab_delimited.txt" - - source = Solr::Importer::DelimitedFileSource.new(filename,/\t/) - assert_equal source.to_a.size, 1 - - source.each do |data| - assert_equal data[:asin], '0865681740' - end - end - -end diff --git a/solr/client/ruby/solr-ruby/test/unit/dismax_request_test.rb b/solr/client/ruby/solr-ruby/test/unit/dismax_request_test.rb deleted file mode 100644 index 7141334720d..00000000000 --- a/solr/client/ruby/solr-ruby/test/unit/dismax_request_test.rb +++ /dev/null @@ -1,26 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require 'test/unit' -require 'solr' - -class DismaxRequestTest < Test::Unit::TestCase - - def test_basic_query - request = Solr::Request::Dismax.new(:query => 'query', :phrase_slop => '1000', :sort => [{:deedle => :descending}]) - assert_match(/q=query/, request.to_s) - assert_match(/qt=dismax/, request.to_s) - assert_match(/ps=1000/, request.to_s) - assert_match(/sort=deedle%20desc/, request.to_s) - end - -end \ No newline at end of file diff --git a/solr/client/ruby/solr-ruby/test/unit/document_test.rb b/solr/client/ruby/solr-ruby/test/unit/document_test.rb deleted file mode 100644 index 6bb6e14a026..00000000000 --- a/solr/client/ruby/solr-ruby/test/unit/document_test.rb +++ /dev/null @@ -1,69 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require 'test/unit' -require 'solr' - -class DocumentTest < Test::Unit::TestCase - - def test_xml - doc = Solr::Document.new - doc << Solr::Field.new(:creator => 'Erik Hatcher') - assert_kind_of Solr::XML::Element, doc.to_xml - assert_match(/[\s]*Erik Hatcher<\/field>[\s]*<\/doc>/m, doc.to_xml.to_s) - end - - def test_repeatable - doc = Solr::Document.new - doc << Solr::Field.new(:creator => 'Erik Hatcher') - doc << Solr::Field.new(:creator => 'Otis Gospodnetic') - assert_kind_of Solr::XML::Element, doc.to_xml - assert_match(/[\s]*Erik Hatcher<\/field>[\s]*Otis Gospodnetic<\/field>[\s]*<\/doc>/m, doc.to_xml.to_s) - end - - def test_repeatable_in_hash - doc = Solr::Document.new({:creator => ['Erik Hatcher', 'Otis Gospodnetic']}) - assert_match(/[\s]*Erik Hatcher<\/field>[\s]*Otis Gospodnetic<\/field>[\s]*<\/doc>/m, doc.to_xml.to_s) - end - - def test_bad_doc - doc = Solr::Document.new - assert_raise(RuntimeError) do - doc << "invalid" - end - end - - def test_hash_shorthand - doc = Solr::Document.new :creator => 'Erik Hatcher', :title => 'Lucene in Action' - assert_equal 'Erik Hatcher', doc[:creator] - assert_equal 'Lucene in Action', doc[:title] - assert_equal nil, doc[:foo] - - doc = Solr::Document.new - doc << {:creator => 'Erik Hatcher', :title => 'Lucene in Action'} - doc[:subject] = 'Search' - assert_equal 'Erik Hatcher', doc[:creator] - assert_equal 'Lucene in Action', doc[:title] - assert_equal 'Search', doc[:subject] - end - - def test_boost - doc = Solr::Document.new :name => "McGrump" - doc.boost = 300.28 - assert_match(/[\s]*McGrump<\/field>[\s]*<\/doc>/, doc.to_xml.to_s) - end - - def test_string_values - doc = Solr::Document.new :name => "multi\nline" - assert_match(/[\s]*multi\nline<\/field>[\s]*<\/doc>/, doc.to_xml.to_s) - end -end diff --git a/solr/client/ruby/solr-ruby/test/unit/field_test.rb b/solr/client/ruby/solr-ruby/test/unit/field_test.rb deleted file mode 100644 index 44e6d5c4c27..00000000000 --- a/solr/client/ruby/solr-ruby/test/unit/field_test.rb +++ /dev/null @@ -1,48 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require 'test/unit' -require 'solr' - -class FieldTest < Test::Unit::TestCase - - def test_xml - field = Solr::Field.new :creator => 'Erik Hatcher' - assert_kind_of Solr::XML::Element, field.to_xml - assert_match(/Erik Hatcher<\/field>/, field.to_xml.to_s) - end - - def test_escaped_xml - field = Solr::Field.new :creator => 'Erik Hatcher & His Amazing Leaping Ability' - assert_kind_of Solr::XML::Element, field.to_xml - assert_match(/Erik Hatcher & His Amazing Leaping Ability<\/field>/, field.to_xml.to_s) - end - - def test_xml_date - field = Solr::Field.new :time => Time.now - assert_kind_of Solr::XML::Element, field.to_xml - assert_match(/[\d]{4}-[\d]{2}-[\d]{2}T[\d]{2}:[\d]{2}:[\d]{2}Z<\/field>/, field.to_xml.to_s) - end - - def test_i18n_xml - field = Solr::Field.new :i18nstring => 'Äêâîôû Öëäïöü' - assert_kind_of Solr::XML::Element, field.to_xml - assert_match(/Äêâîôû Öëäïöü<\/field>/m, field.to_xml.to_s) - end - - def test_boost_values - field = Solr::Field.new(:blah => "squee", :boost => 3.0) - assert_kind_of Solr::XML::Element, field.to_xml - assert_match(/squee<\/field>/, field.to_xml.to_s) - end - -end diff --git a/solr/client/ruby/solr-ruby/test/unit/hpricot_mapper_test.rb b/solr/client/ruby/solr-ruby/test/unit/hpricot_mapper_test.rb deleted file mode 100644 index 075064e4581..00000000000 --- a/solr/client/ruby/solr-ruby/test/unit/hpricot_mapper_test.rb +++ /dev/null @@ -1,44 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -begin - require 'solr' - require 'test/unit' - require 'hpricot' - - class HpricotMapperTest < Test::Unit::TestCase - - def setup - @doc = open(File.expand_path(File.dirname(__FILE__)) + "/hpricot_test_file.xml"){|f| Hpricot.XML(f)} - end - - def test_simple_hpricot_path - mapping = {:field1 => :'child[@attribute="attribute1"]', - :field2 => :'child[@attribute="attribute2"]', - :field3 => :'child[@attribute="attribute3"]', - :field4 => :'child[@attribute="attribute3"] grandchild', - :field5 => :'child'} - - mapper = Solr::Importer::HpricotMapper.new(mapping) - mapped_data = mapper.map(@doc) - - assert_equal ['text1'], mapped_data[:field1] - assert_equal ['text2'], mapped_data[:field2] - assert_equal ['text3grandchild 3 text'], mapped_data[:field3] - assert_equal ['grandchild 3 text'], mapped_data[:field4] - assert_equal ['text1', 'text2', 'text3grandchild 3 text'], mapped_data[:field5] - end - - end -rescue LoadError => e - puts "HpricotMapperTest not run because #{e}" -end \ No newline at end of file diff --git a/solr/client/ruby/solr-ruby/test/unit/hpricot_test_file.xml b/solr/client/ruby/solr-ruby/test/unit/hpricot_test_file.xml deleted file mode 100644 index 3f3c7214484..00000000000 --- a/solr/client/ruby/solr-ruby/test/unit/hpricot_test_file.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - text1 - text2 - text3grandchild 3 text - - \ No newline at end of file diff --git a/solr/client/ruby/solr-ruby/test/unit/indexer_test.rb b/solr/client/ruby/solr-ruby/test/unit/indexer_test.rb deleted file mode 100755 index 58d1a8defd8..00000000000 --- a/solr/client/ruby/solr-ruby/test/unit/indexer_test.rb +++ /dev/null @@ -1,57 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require 'test/unit' -require 'solr' - -class Solr::Indexer - attr_reader :added - def add_docs(doc) - @added ||= [] - @added << doc - end -end - -class IndexerTest < Test::Unit::TestCase - def test_mapping_or_mapping - mapping = {:field => "foo"} - indexer = Solr::Indexer.new([1,2,3], mapping, :debug => true) - indexer.index - assert_equal 3, indexer.added.size - - indexer = Solr::Indexer.new([1,2,3,4], Solr::Importer::Mapper.new(mapping), :debug => true) - indexer.index - assert_equal 4, indexer.added.size - end - - def test_batch - mapping = {:field => "foo"} - indexer = Solr::Indexer.new([1,2,3], mapping, :debug => true, :buffer_docs => 2) - indexer.index - assert_equal 2, indexer.added.size - end - -end - - -# source = DataSource.new -# -# mapping = { -# :id => :isbn, -# :name => :author, -# :source => "BOOKS", -# :year => Proc.new {|record| record.date[0,4] }, -# } -# -# Solr::Indexer.index(source, mapper) do |orig_data, solr_document| -# solr_document[:timestamp] = Time.now -# end \ No newline at end of file diff --git a/solr/client/ruby/solr-ruby/test/unit/modify_document_test.rb b/solr/client/ruby/solr-ruby/test/unit/modify_document_test.rb deleted file mode 100755 index 9291dd16623..00000000000 --- a/solr/client/ruby/solr-ruby/test/unit/modify_document_test.rb +++ /dev/null @@ -1,24 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require 'test/unit' -require 'solr' - -class ModifyDocumentTest < Test::Unit::TestCase - - def test_update_formatting - request = Solr::Request::ModifyDocument.new(:id => 10, :overwrite => {:name => ['val1', 'val2'], :copyfield => nil}) - assert_equal :xml, request.response_format - assert_match /copyfield\:OVERWRITE/, request.handler - assert_match /name\:OVERWRITE/, request.handler - end -end diff --git a/solr/client/ruby/solr-ruby/test/unit/ping_test.rb b/solr/client/ruby/solr-ruby/test/unit/ping_test.rb deleted file mode 100644 index 7d4dd3001d7..00000000000 --- a/solr/client/ruby/solr-ruby/test/unit/ping_test.rb +++ /dev/null @@ -1,51 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require 'solr_mock_base' - -class PingTest < SolrMockBaseTestCase - - def test_ping_response - xml = -< - - - - - - -PING_RESPONSE - conn = Solr::Connection.new('http://localhost:9999') - set_post_return(xml) - response = conn.send(Solr::Request::Ping.new) - assert_kind_of Solr::Response::Ping, response - assert_equal true, response.ok? - - # test shorthand - assert true, conn.ping - end - - def test_bad_ping_response - xml = "bar" - conn = Solr::Connection.new('http://localhost:9999') - set_post_return(xml) - response = conn.send(Solr::Request::Ping.new) - assert_kind_of Solr::Response::Ping, response - assert_equal false, response.ok? - - # test shorthand - assert_equal false, conn.ping - end - -end diff --git a/solr/client/ruby/solr-ruby/test/unit/request_test.rb b/solr/client/ruby/solr-ruby/test/unit/request_test.rb deleted file mode 100755 index ca2e5897a16..00000000000 --- a/solr/client/ruby/solr-ruby/test/unit/request_test.rb +++ /dev/null @@ -1,61 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require 'test/unit' -require 'solr' - -class BadRequest < Solr::Request::Base -end - -class RequestTest < Test::Unit::TestCase - - def test_commit_request - request = Solr::Request::Commit.new - assert_equal :xml, request.response_format - assert_equal 'update', request.handler - assert_match(//, request.to_s) - end - - def test_add_doc_request - request = Solr::Request::AddDocument.new(:title => "title") - assert_match(/[\s]*[\s]*title<\/field>[\s]*<\/doc>[\s]*<\/add>/m, request.to_s) - assert_equal :xml, request.response_format - assert_equal 'update', request.handler - - assert_raise(RuntimeError) do - Solr::Request::AddDocument.new("invalid") - end - end - - def test_add_multidoc_request - request = Solr::Request::AddDocument.new([{:title => "title1"}, {:title => "title2"}]) - assert_match(/[\s]*[\s]*title1<\/field>[\s]*<\/doc>[\s]*[\s]*title2<\/field>[\s]*<\/doc>[\s]*<\/add>/m, request.to_s) - assert_equal :xml, request.response_format - assert_equal 'update', request.handler - end - - def test_ping_request - request = Solr::Request::Ping.new - assert_equal :xml, request.response_format - end - - def test_bad_request_class - assert_raise(RuntimeError) do - BadRequest.new.response_format - end - - assert_raise(RuntimeError) do - BadRequest.new.handler - end - end - -end diff --git a/solr/client/ruby/solr-ruby/test/unit/response_test.rb b/solr/client/ruby/solr-ruby/test/unit/response_test.rb deleted file mode 100644 index 1496262beed..00000000000 --- a/solr/client/ruby/solr-ruby/test/unit/response_test.rb +++ /dev/null @@ -1,43 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require 'test/unit' -require 'solr' -require 'solr_mock_base' - - -class ResponseTest < SolrMockBaseTestCase - - def test_response_xml_error - begin - Solr::Response::Xml.new("invalid xml&") - flunk("failed to get Solr::Exception as expected") - rescue Exception => exception - assert_kind_of Solr::Exception, exception - assert_match 'invalid response xml', exception.to_s - end - end - - def test_invalid_ruby - assert_raise(Solr::Exception) do - Solr::Response::Ruby.new(' {...') - end - end - - # This is now an acceptable use of Select, for the default request handler with no parameters (other than &wt=ruby) - # def test_bogus_request_handling - # assert_raise(Solr::Exception) do - # Solr::Response::Base.make_response(Solr::Request::Select.new, "response data") - # end - # end - -end diff --git a/solr/client/ruby/solr-ruby/test/unit/select_test.rb b/solr/client/ruby/solr-ruby/test/unit/select_test.rb deleted file mode 100755 index ae1a40bb719..00000000000 --- a/solr/client/ruby/solr-ruby/test/unit/select_test.rb +++ /dev/null @@ -1,25 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require 'test/unit' -require 'solr' - -class SelectTest < Test::Unit::TestCase - - def test_basic_query - request = Solr::Request::Select.new('custom', :q => 'query') - assert_equal :ruby, request.response_format - assert_equal 'select', request.handler - assert_equal 'query', request.to_hash[:q] - end - -end diff --git a/solr/client/ruby/solr-ruby/test/unit/solr_mock_base.rb b/solr/client/ruby/solr-ruby/test/unit/solr_mock_base.rb deleted file mode 100755 index 86e676a0e05..00000000000 --- a/solr/client/ruby/solr-ruby/test/unit/solr_mock_base.rb +++ /dev/null @@ -1,40 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require 'test/unit' -require 'solr' - -# TODO: Maybe replace this with flexmock -class SolrMockBaseTestCase < Test::Unit::TestCase - include Solr - - def setup - Connection.send(:alias_method, :orig_post, :post) - end - - def teardown - Connection.send(:alias_method, :post, :orig_post) - end - - def set_post_return(value) - Connection.class_eval %{ - def post(request) - %q{#{value}} - end - } - end - - def test_dummy - # So Test::Unit is happy running this class - end - -end diff --git a/solr/client/ruby/solr-ruby/test/unit/spellcheck_response_test.rb b/solr/client/ruby/solr-ruby/test/unit/spellcheck_response_test.rb deleted file mode 100644 index 0d9217425f0..00000000000 --- a/solr/client/ruby/solr-ruby/test/unit/spellcheck_response_test.rb +++ /dev/null @@ -1,26 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require 'solr_mock_base' - -class SpellcheckResponseTest < SolrMockBaseTestCase - def test_basic - ruby_code = "{'responseHeader'=>{'status'=>0,'QTime'=>5},'suggestions'=>['whately','whatcha','whatever']}" - conn = Solr::Connection.new 'http://localhost:9999' - set_post_return(ruby_code) - response = conn.send(Solr::Request::Spellcheck.new(:query => 'whateva')) - assert_equal true, response.ok? - assert_equal 3, response.suggestions.size - assert_equal ['whately','whatcha','whatever'], response.suggestions - end -end - diff --git a/solr/client/ruby/solr-ruby/test/unit/spellchecker_request_test.rb b/solr/client/ruby/solr-ruby/test/unit/spellchecker_request_test.rb deleted file mode 100644 index 9a603443e29..00000000000 --- a/solr/client/ruby/solr-ruby/test/unit/spellchecker_request_test.rb +++ /dev/null @@ -1,27 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require 'test/unit' -require 'solr' - -class SpellcheckRequestTest < Test::Unit::TestCase - def test_spellcheck_request - request = Solr::Request::Spellcheck.new(:query => 'whateva', :suggestion_count => 5, :accuracy => 0.7, :only_more_popular => true) - assert_equal :ruby, request.response_format - assert_equal 'select', request.handler - hash = request.to_hash - assert_equal 'whateva', hash[:q] - assert_equal 5, hash[:suggestionCount] - assert_equal 0.7, hash[:accuracy] - assert_equal true, hash[:onlyMorePopular] - end -end diff --git a/solr/client/ruby/solr-ruby/test/unit/standard_request_test.rb b/solr/client/ruby/solr-ruby/test/unit/standard_request_test.rb deleted file mode 100755 index 5cacfc1d435..00000000000 --- a/solr/client/ruby/solr-ruby/test/unit/standard_request_test.rb +++ /dev/null @@ -1,324 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require 'test/unit' -require 'solr' - -class StandardRequestTest < Test::Unit::TestCase - - def test_basic_query - request = Solr::Request::Standard.new(:query => 'query') - assert_equal :ruby, request.response_format - assert_equal 'select', request.handler - assert_equal 'query', request.to_hash[:q] - assert_match /q=query/, request.to_s - end - - def test_bad_params - assert_raise(RuntimeError) do - Solr::Request::Standard.new(:foo => "invalid") - end - - assert_raise(RuntimeError) do - Solr::Request::Standard.new(:query => "valid", :foo => "invalid") - end - - assert_raise(RuntimeError) do - Solr::Request::Standard.new(:query => "valid", :operator => :bogus) - end - end - - def test_common_params - request = Solr::Request::Standard.new(:query => 'query', :start => 10, :rows => 50, - :filter_queries => ['fq1', 'fq2'], :field_list => ['id','title','score'], :operator => :and) - assert_equal 10, request.to_hash[:start] - assert_equal 50, request.to_hash[:rows] - assert_equal ['fq1','fq2'], request.to_hash[:fq] - assert_equal "id,title,score", request.to_hash[:fl] - assert_equal "AND", request.to_hash["q.op"] - end - - def test_missing_params - request = Solr::Request::Standard.new(:query => 'query', :debug_query => false, :facets => {:fields =>[:category_facet]}) - assert_nil request.to_hash[:rows] - assert_no_match /rows/, request.to_s - assert_no_match /facet\.sort/, request.to_s - assert_match /debugQuery/, request.to_s - end - - def test_only_facet_query - request = Solr::Request::Standard.new(:query => 'query', - :facets => { - :queries => ["q1", "q2"], - } - ) - - hash = request.to_hash - assert_equal ["q1", "q2"], hash["facet.query"] - end - - def test_facet_params_all - request = Solr::Request::Standard.new(:query => 'query', - :facets => { - :fields => [:genre, - # field that overrides the global facet parameters - {:year => {:limit => 50, :mincount => 0, :missing => false, :sort => :term, :prefix=>"199", :offset => 7}}], - :queries => ["q1", "q2"], - :prefix => "cat", - :offset => 3, :limit => 5, :zeros => true, :mincount => 20, :sort => :count # global facet parameters - } - ) - - hash = request.to_hash - assert_equal true, hash[:facet] - assert_equal [:genre, :year], hash["facet.field"] - assert_equal ["q1", "q2"], hash["facet.query"] - assert_equal 5, hash["facet.limit"] - assert_equal 20, hash["facet.mincount"] - assert_equal true, hash["facet.sort"] - assert_equal "cat", hash["facet.prefix"] - assert_equal 50, hash["f.year.facet.limit"] - assert_equal 0, hash["f.year.facet.mincount"] - assert_equal false, hash["f.year.facet.sort"] - assert_equal "199", hash["f.year.facet.prefix"] - assert_equal 3, hash["facet.offset"] - assert_equal 7, hash["f.year.facet.offset"] - end - - def test_basic_sort - request = Solr::Request::Standard.new(:query => 'query', :sort => [{:title => :descending}, {:date => :ascending}]) - assert_equal 'query', request.to_hash[:q] - assert_equal 'title desc,date asc', request.to_hash[:sort] - end - - def test_highlighting - request = Solr::Request::Standard.new(:query => 'query', - :highlighting => { - :field_list => ['title', 'author'], - :merge_contiguous => true, - :increment => 100, - :max_snippets => 3, - :require_field_match => true, - :prefix => "", - :suffix => "", - :fragment_size => 300, - :max_analyzed_chars => 102400, - :formatter => 'myFormatter', - :fragmenter => 'myFragmenter', - :use_phrase_highlighter => true - } - ) - - hash = request.to_hash - assert_equal true, hash[:hl] - assert_equal "title,author", hash["hl.fl"] - assert_equal true, hash["hl.mergeContiguous"] - assert_equal 100, hash["hl.increment"] - assert_equal 3, hash["hl.snippets"] - assert_equal true, hash["hl.requireFieldMatch"] - assert_equal "", hash["hl.simple.pre"] - assert_equal "", hash["hl.simple.post"] - assert_equal 300, hash["hl.fragsize"] - assert_equal 102400, hash["hl.maxAnalyzedChars"] - assert_equal "myFormatter", hash["hl.formatter"] - assert_equal "myFragmenter", hash["hl.fragmenter"] - assert_equal true, hash["hl.usePhraseHighlighter"] - end - - def test_highlighting2 - request = Solr::Request::Standard.new(:query => 'query', - :highlighting => { - :field_list => ['title', 'author'], - :merge_contiguous => { - :default=>false, :fields=>{'author'=>true} - }, - :increment => { - :default=>100, :fields=>{'author'=>200} - }, - :max_snippets => { - :default=>2,:fields=>{'author'=>3} - }, - :prefix => { - :default=>"", :fields=>{'author'=>""}, - }, - :suffix => { - :default=>"", :fields=>{'author'=>""}, - }, - :fragment_size => { - :default=>300,:fields=>{'author'=>200} - }, - :max_analyzed_chars => { - :default=>102400,:fields=>{'author'=>51200} - }, - :require_field_match => { - :default=>false, :fields=>{'author'=>true} - }, - :formatter => { - :default=>'defaultFormatter', :fields=>{'title'=>'titleFormatter'} - }, - :fragmenter => { - :default=>'defaultFragmenter',:fields=>{'title'=>'titleFragmenter'} - }, - } - ) - - hash = request.to_hash - assert_equal true, hash[:hl] - assert_equal "title,author", hash["hl.fl"] - assert_equal false, hash["hl.mergeContiguous"] - assert_equal true, hash["f.author.hl.mergeContiguous"] - assert_equal 100, hash["hl.increment"] - assert_equal 200, hash["f.author.hl.increment"] - assert_equal 2, hash["hl.snippets"] - assert_equal 3, hash["f.author.hl.snippets"] - assert_equal "", hash["hl.simple.pre"] - assert_equal "", hash["f.author.hl.simple.pre"] - assert_equal "", hash["hl.simple.post"] - assert_equal "", hash["f.author.hl.simple.post"] - assert_equal 300, hash["hl.fragsize"] - assert_equal 200, hash["f.author.hl.fragsize"] - assert_equal 102400, hash["hl.maxAnalyzedChars"] - assert_equal 51200, hash["f.author.hl.maxAnalyzedChars"] - assert_equal false, hash["hl.requireFieldMatch"] - assert_equal true, hash["f.author.hl.requireFieldMatch"] - assert_equal 'defaultFormatter', hash["hl.formatter"] - assert_equal 'titleFormatter', hash["f.title.hl.formatter"] - assert_equal 'defaultFragmenter', hash["hl.fragmenter"] - assert_equal 'titleFragmenter', hash["f.title.hl.fragmenter"] - end - - def test_highlighting_regex - request = Solr::Request::Standard.new(:query => 'query', - :highlighting => { - :field_list => ['title', 'author'], - :regex => { - :slop => 0.8, - :pattern => '\w', - :max_analyzed_chars => 10000 - } - } - ) - - hash = request.to_hash - assert_equal true, hash[:hl] - assert_equal "title,author", hash["hl.fl"] - assert_equal 0.8, hash["hl.regex.slop"] - assert_equal '\w', hash["hl.regex.pattern"] - assert_equal 10000, hash["hl.regex.maxAnalyzedChars"] - end - - def test_highlighting_regex2 - request = Solr::Request::Standard.new(:query => 'query', - :highlighting => { - :field_list => ['title', 'author'], - :regex => { - :slop => { :default=>0.5, :fields=>{'author'=>0.8} }, - :pattern => { :default=>'\w', :fields=>{'author'=>'\n'} }, - :max_analyzed_chars => { :default=>10000, :fields=>{'author'=>20000} } - } - } - ) - - hash = request.to_hash - assert_equal true, hash[:hl] - assert_equal "title,author", hash["hl.fl"] - assert_equal 0.5, hash["hl.regex.slop"] - assert_equal 0.8, hash["f.author.hl.regex.slop"] - assert_equal '\w', hash["hl.regex.pattern"] - assert_equal '\n', hash["f.author.hl.regex.pattern"] - assert_equal 10000, hash["hl.regex.maxAnalyzedChars"] - assert_equal 20000, hash["f.author.hl.regex.maxAnalyzedChars"] - end - - def test_highlighting_alternate_field - request = Solr::Request::Standard.new(:query => 'query', - :highlighting => { - :field_list => ['title', 'author'], - :alternate_field => 'title', - :max_alternate_field_length => 30 - } - ) - - hash = request.to_hash - assert_equal true, hash[:hl] - assert_equal "title,author", hash["hl.fl"] - assert_equal "title", hash["hl.alternateField"] - assert_equal 30, hash["hl.maxAlternateFieldLength"] - end - - def test_highlighting_alternate_field2 - request = Solr::Request::Standard.new(:query => 'query', - :highlighting => { - :field_list => ['title', 'author'], - :alternate_field => { - :default=>'default', :fields=>{'title'=>'title', 'author'=>'author'} - }, - :max_alternate_field_length => { - :default=>10, :fields=>{'title'=>30, 'author'=>20} - } - } - ) - - hash = request.to_hash - assert_equal true, hash[:hl] - assert_equal "title,author", hash["hl.fl"] - assert_equal "default", hash["hl.alternateField"] - assert_equal "title", hash["f.title.hl.alternateField"] - assert_equal "author", hash["f.author.hl.alternateField"] - assert_equal 10, hash["hl.maxAlternateFieldLength"] - assert_equal 30, hash["f.title.hl.maxAlternateFieldLength"] - assert_equal 20, hash["f.author.hl.maxAlternateFieldLength"] - end - - def test_highlighting_alternate_field_old_style - request = Solr::Request::Standard.new(:query => 'query', - :highlighting => { - :field_list => ['title', 'author'], - :alternate_fields => {'title'=>'title', 'author'=>'author'}, - :max_alternate_field_length => {'title'=>30, 'author'=>20} - } - ) - - hash = request.to_hash - assert_equal true, hash[:hl] - assert_equal "title,author", hash["hl.fl"] - assert_equal "title", hash["f.title.hl.alternateField"] - assert_equal "author", hash["f.author.hl.alternateField"] - assert_equal 30, hash["f.title.hl.maxAlternateFieldLength"] - assert_equal 20, hash["f.author.hl.maxAlternateFieldLength"] - end - - def test_mlt - request = Solr::Request::Standard.new(:query => 'query', - :mlt => { - :count => 5, :field_list => ['field1', 'field2'], - :min_term_freq => 3, :min_doc_freq => 10, - :min_word_length => 4, :max_word_length => 17, - :max_query_terms => 20, :max_tokens_parsed => 100, - :boost => true - } - ) - - hash = request.to_hash - assert_equal true, hash[:mlt] - assert_equal 5, hash["mlt.count"] - assert_equal 'field1,field2', hash["mlt.fl"] - assert_equal 3, hash["mlt.mintf"] - assert_equal 10, hash["mlt.mindf"] - assert_equal 4, hash["mlt.minwl"] - assert_equal 17, hash["mlt.maxwl"] - assert_equal 20, hash["mlt.maxqt"] - assert_equal 100, hash["mlt.maxntp"] - assert_equal true, hash["mlt.boost"] - end - -end diff --git a/solr/client/ruby/solr-ruby/test/unit/standard_response_test.rb b/solr/client/ruby/solr-ruby/test/unit/standard_response_test.rb deleted file mode 100644 index 81175d9fdf8..00000000000 --- a/solr/client/ruby/solr-ruby/test/unit/standard_response_test.rb +++ /dev/null @@ -1,174 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require 'solr_mock_base' - -class StandardResponseTest < SolrMockBaseTestCase - - def test_basic - ruby_code = -<{ - 'status'=>0, - 'QTime'=>1, - 'params'=>{ - 'wt'=>'ruby', - 'rows'=>'10', - 'explainOther'=>'', - 'start'=>'0', - 'hl.fl'=>'', - 'indent'=>'on', - 'q'=>'guido', - 'fl'=>'*,score', - 'qt'=>'standard', - 'version'=>'2.2'}}, - 'response'=>{'numFound'=>1,'start'=>0,'maxScore'=>0.67833745,'docs'=>[ - { - 'name'=>'guido von rossum', - 'id'=>'123', - 'timestamp'=>'2007-01-16T09:55:30.589Z', - 'score'=>0.67833745}] - }} -RUBY_CODE - conn = Solr::Connection.new 'http://localhost:9999' - set_post_return(ruby_code) - response = conn.send(Solr::Request::Standard.new(:query => 'foo')) - assert_equal true, response.ok? - assert response.query_time - assert_equal 1, response.total_hits - assert_equal 0, response.start - assert_equal 0.67833745, response.max_score - assert_equal 1, response.hits.length - end - - def test_iteration - ruby_code = -<{ - 'status'=>0, - 'QTime'=>0, - 'params'=>{ - 'wt'=>'ruby', - 'rows'=>'10', - 'explainOther'=>'', - 'start'=>'0', - 'hl.fl'=>'', - 'indent'=>'on', - 'q'=>'guido', - 'fl'=>'*,score', - 'qt'=>'standard', - 'version'=>'2.2'}}, - 'response'=>{'numFound'=>22,'start'=>0,'maxScore'=>0.53799295,'docs'=>[ - { - 'name'=>'guido von rossum the 0', - 'id'=>'0', - 'score'=>0.53799295}, - { - 'name'=>'guido von rossum the 1', - 'id'=>'1', - 'score'=>0.53799295}, - { - 'name'=>'guido von rossum the 2', - 'id'=>'2', - 'score'=>0.53799295}, - { - 'name'=>'guido von rossum the 3', - 'id'=>'3', - 'score'=>0.53799295}, - { - 'name'=>'guido von rossum the 4', - 'id'=>'4', - 'score'=>0.53799295}, - { - 'name'=>'guido von rossum the 5', - 'id'=>'5', - 'score'=>0.53799295}, - { - 'name'=>'guido von rossum the 6', - 'id'=>'6', - 'score'=>0.53799295}, - { - 'name'=>'guido von rossum the 7', - 'id'=>'7', - 'score'=>0.53799295}, - { - 'name'=>'guido von rossum the 8', - 'id'=>'8', - 'score'=>0.53799295}, - { - 'name'=>'guido von rossum the 9', - 'id'=>'9', - 'score'=>0.53799295}] - }} -RUBY_CODE - conn = Solr::Connection.new 'http://localhost:9999' - set_post_return(ruby_code) - - count = 0 - conn.query('foo') do |hit| - assert_equal "guido von rossum the #{count}", hit['name'] - count += 1 - end - - assert_equal 10, count - end - - def test_facets - ruby_code = - <{ - 'status'=>0, - 'QTime'=>1897, - 'params'=>{ - 'facet.limit'=>'20', - 'wt'=>'ruby', - 'rows'=>'0', - 'facet'=>'true', - 'facet.mincount'=>'1', - 'facet.field'=>[ - 'subject_genre_facet', - 'subject_geographic_facet', - 'subject_format_facet', - 'subject_era_facet', - 'subject_topic_facet'], - 'indent'=>'true', - 'fl'=>'*,score', - 'q'=>'[* TO *]', - 'qt'=>'standard', - 'facet.sort'=>'true'}}, - 'response'=>{'numFound'=>49999,'start'=>0,'maxScore'=>1.0,'docs'=>[] - }, - 'facet_counts'=>{ - 'facet_queries'=>{}, - 'facet_fields'=>{ - 'subject_genre_facet'=>[ - 'Biography.',2605, - 'Congresses.',1837, - 'Bibliography.',672, - 'Exhibitions.',642, - 'Periodicals.',615, - 'Sources.',485]}} - } -RUBY_CODE - set_post_return(ruby_code) - conn = Solr::Connection.new "http://localhost:9999" - response = conn.query('foo') - facets = response.field_facets('subject_genre_facet') - assert_equal 2605, facets[0].value - assert_equal 485, facets[5].value - end - -end - diff --git a/solr/client/ruby/solr-ruby/test/unit/suite.rb b/solr/client/ruby/solr-ruby/test/unit/suite.rb deleted file mode 100755 index d33e4afb74a..00000000000 --- a/solr/client/ruby/solr-ruby/test/unit/suite.rb +++ /dev/null @@ -1,16 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# dynamically require all tests files -Dir.glob("*_test.rb").each do | file | - require file -end diff --git a/solr/client/ruby/solr-ruby/test/unit/tab_delimited.txt b/solr/client/ruby/solr-ruby/test/unit/tab_delimited.txt deleted file mode 100755 index 386b5700ea9..00000000000 --- a/solr/client/ruby/solr-ruby/test/unit/tab_delimited.txt +++ /dev/null @@ -1,2 +0,0 @@ -medium associatedURL boxHeightInInches boxLengthInInches boxWeightInPounds boxWidthInInches scannednumber upc asin country title fullTitle series numberInSeries edition aspect mediacount genre price currentValue language netrating description owner publisher published rare purchaseDate rating used signed hasExperienced notes location paid condition notowned author illustrator pages -book 9780865681743 0865681740 us Xing Yi Nei Gong: Xing Yi Health Maintenance and Internal Strength Development Xing Yi Nei Gong: Xing Yi Health Maintenance and Internal Strength Development Paperback $21.95 $14.05 4.5 This is the most complete book on the art of xing yi (hsing Yi) available. It includes the complete xing yi history and lineage going back eight generations; manuscripts handed down from famous practitioners Dai Long Bang and Li Neng Ran; 16 health maintenance and power development exercises; qigong (chi kung) exerices; xing yi long spear power training exercises; and more. Unique Publications 1998-02-10 12:00:00 +0000 2007-02-03 02:22:25 -0500 Dan Miller/ Tim Cartmell 200 diff --git a/solr/client/ruby/solr-ruby/test/unit/util_test.rb b/solr/client/ruby/solr-ruby/test/unit/util_test.rb deleted file mode 100755 index b45462a590f..00000000000 --- a/solr/client/ruby/solr-ruby/test/unit/util_test.rb +++ /dev/null @@ -1,24 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require 'solr' -require 'test/unit' - -class UtilTest < Test::Unit::TestCase - def test_paired_array_to_hash - assert_equal({:key1 => :value1, :key2 => :value2}, Solr::Util.paired_array_to_hash([:key1, :value1, :key2, :value2])) - end - - def test_query_parser_escape - assert_equal %q(http\:\/\/lucene\.apache\.org\/solr), Solr::Util.query_parser_escape("http://lucene.apache.org/solr") - end -end diff --git a/solr/client/ruby/solr-ruby/test/unit/xpath_mapper_test.rb b/solr/client/ruby/solr-ruby/test/unit/xpath_mapper_test.rb deleted file mode 100755 index 6d364c9e92e..00000000000 --- a/solr/client/ruby/solr-ruby/test/unit/xpath_mapper_test.rb +++ /dev/null @@ -1,38 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -begin - require 'solr' - require 'test/unit' - require 'xml/libxml' - - class XPathMapperTest < Test::Unit::TestCase - - def setup - @doc = XML::Document.file(File.expand_path(File.dirname(__FILE__)) + "/xpath_test_file.xml") - end - - def test_simple_xpath - mapping = {:solr_field1 => :'/root/parent/child', - :solr_field2 => :'/root/parent/child/@attribute'} - - mapper = Solr::Importer::XPathMapper.new(mapping) - mapped_data = mapper.map(@doc) - - assert_equal ['text1', 'text2'], mapped_data[:solr_field1] - assert_equal ['attribute1', 'attribute2'], mapped_data[:solr_field2] - end - - end -rescue LoadError => e - puts "XPathMapperTest not run because #{e}" -end \ No newline at end of file diff --git a/solr/client/ruby/solr-ruby/test/unit/xpath_test_file.xml b/solr/client/ruby/solr-ruby/test/unit/xpath_test_file.xml deleted file mode 100644 index 545734f81c2..00000000000 --- a/solr/client/ruby/solr-ruby/test/unit/xpath_test_file.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - text1 - text2 - - \ No newline at end of file