erichummel-sunspot 1.2.1g → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +12 -0
- data/Gemfile +3 -9
- data/Rakefile +11 -5
- data/lib/sunspot/dsl/field_query.rb +13 -0
- data/lib/sunspot/dsl/functional.rb +3 -0
- data/lib/sunspot/search/abstract_search.rb +9 -12
- data/lib/sunspot/search/paginated_collection.rb +55 -0
- data/lib/sunspot/server.rb +3 -7
- data/lib/sunspot/version.rb +1 -1
- data/script/console +10 -0
- data/solr-1.3/etc/jetty.xml +212 -0
- data/solr-1.3/etc/webdefault.xml +379 -0
- data/solr-1.3/lib/jetty-6.1.3.jar +0 -0
- data/solr-1.3/lib/jetty-util-6.1.3.jar +0 -0
- data/solr-1.3/lib/jsp-2.1/ant-1.6.5.jar +0 -0
- data/solr-1.3/lib/jsp-2.1/core-3.1.1.jar +0 -0
- data/solr-1.3/lib/jsp-2.1/jsp-2.1.jar +0 -0
- data/solr-1.3/lib/jsp-2.1/jsp-api-2.1.jar +0 -0
- data/solr-1.3/lib/servlet-api-2.5-6.1.3.jar +0 -0
- data/solr-1.3/solr/conf/elevate.xml +36 -0
- data/solr-1.3/solr/conf/protwords.txt +21 -0
- data/solr-1.3/solr/conf/schema.xml +64 -0
- data/solr-1.3/solr/conf/solrconfig.xml +725 -0
- data/solr-1.3/solr/conf/stopwords.txt +57 -0
- data/solr-1.3/solr/conf/synonyms.txt +31 -0
- data/solr-1.3/solr/lib/geoapi-nogenerics-2.1-M2.jar +0 -0
- data/solr-1.3/solr/lib/gt2-referencing-2.3.1.jar +0 -0
- data/solr-1.3/solr/lib/jsr108-0.01.jar +0 -0
- data/solr-1.3/solr/lib/locallucene.jar +0 -0
- data/solr-1.3/solr/lib/localsolr.jar +0 -0
- data/solr-1.3/start.jar +0 -0
- data/solr-1.3/webapps/solr.war +0 -0
- data/solr/README.txt +42 -0
- data/solr/etc/jetty.xml +4 -0
- data/solr/solr/.gitignore +1 -0
- data/solr/solr/README.txt +54 -0
- data/solr/solr/conf/xslt/example.xsl +132 -0
- data/solr/solr/conf/xslt/example_atom.xsl +67 -0
- data/solr/solr/conf/xslt/example_rss.xsl +66 -0
- data/solr/solr/conf/xslt/luke.xsl +337 -0
- data/spec/api/adapters_spec.rb +1 -1
- data/spec/api/binding_spec.rb +1 -1
- data/spec/api/indexer/attributes_spec.rb +1 -1
- data/spec/api/indexer/batch_spec.rb +1 -1
- data/spec/api/indexer/dynamic_fields_spec.rb +1 -1
- data/spec/api/indexer/fixed_fields_spec.rb +1 -1
- data/spec/api/indexer/fulltext_spec.rb +1 -1
- data/spec/api/indexer/removal_spec.rb +1 -1
- data/spec/api/indexer/spec_helper.rb +1 -1
- data/spec/api/indexer_spec.rb +1 -1
- data/spec/api/query/advanced_manipulation_examples.rb +1 -1
- data/spec/api/query/dsl_spec.rb +1 -1
- data/spec/api/query/faceting_examples.rb +0 -2
- data/spec/api/query/fulltext_examples.rb +0 -2
- data/spec/api/query/function_spec.rb +1 -1
- data/spec/api/query/geo_examples.rb +0 -1
- data/spec/api/query/highlighting_examples.rb +0 -2
- data/spec/api/query/more_like_this_spec.rb +1 -1
- data/spec/api/query/ordering_pagination_examples.rb +0 -2
- data/spec/api/query/spec_helper.rb +1 -1
- data/spec/api/query/standard_spec.rb +1 -1
- data/spec/api/search/dynamic_fields_spec.rb +1 -1
- data/spec/api/search/faceting_spec.rb +1 -1
- data/spec/api/search/highlighting_spec.rb +1 -1
- data/spec/api/search/hits_spec.rb +12 -32
- data/spec/api/search/paginated_collection_spec.rb +26 -0
- data/spec/api/search/results_spec.rb +6 -19
- data/spec/api/search/search_spec.rb +1 -1
- data/spec/api/search/spec_helper.rb +1 -1
- data/spec/api/server_spec.rb +1 -1
- data/spec/api/session_proxy/class_sharding_session_proxy_spec.rb +1 -1
- data/spec/api/session_proxy/id_sharding_session_proxy_spec.rb +1 -1
- data/spec/api/session_proxy/master_slave_session_proxy_spec.rb +1 -1
- data/spec/api/session_proxy/sharding_session_proxy_spec.rb +1 -1
- data/spec/api/session_proxy/silent_fail_session_proxy_spec.rb +1 -1
- data/spec/api/session_proxy/spec_helper.rb +1 -1
- data/spec/api/session_proxy/thread_local_session_proxy_spec.rb +1 -1
- data/spec/api/session_spec.rb +1 -1
- data/spec/api/spec_helper.rb +1 -1
- data/spec/api/sunspot_spec.rb +1 -1
- data/spec/integration/faceting_spec.rb +1 -1
- data/spec/integration/indexing_spec.rb +1 -1
- data/spec/integration/keyword_search_spec.rb +1 -1
- data/spec/integration/local_search_spec.rb +1 -1
- data/spec/integration/more_like_this_spec.rb +1 -1
- data/spec/integration/scoped_search_spec.rb +1 -1
- data/spec/integration/spec_helper.rb +1 -1
- data/spec/integration/test_pagination.rb +1 -1
- data/spec/mocks/connection.rb +1 -1
- data/spec/spec_helper.rb +4 -16
- metadata +118 -37
- data/Gemfile.lock +0 -32
data/.gitignore
ADDED
data/Gemfile
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
source
|
|
1
|
+
source "http://rubygems.org"
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
gem 'sunspot', Sunspot::VERSION, :path => File.expand_path('..', __FILE__)
|
|
6
|
-
|
|
7
|
-
group :test do
|
|
8
|
-
gem 'rspec', '~> 1.3'
|
|
9
|
-
gem 'ruby-debug'
|
|
10
|
-
end
|
|
3
|
+
# Specify your gem's dependencies in carrierwave_backgrounder.gemspec
|
|
4
|
+
gemspec
|
data/Rakefile
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
ENV['RUBYOPT'] = '-W1'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
# encoding: UTF-8
|
|
4
|
+
require 'bundler'
|
|
5
|
+
Bundler::GemHelper.install_tasks
|
|
6
6
|
|
|
7
|
-
require
|
|
7
|
+
require 'spec/rake/spectask'
|
|
8
8
|
|
|
9
9
|
Dir['tasks/**/*.rake'].each { |t| load t }
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
desc "Run all examples"
|
|
12
|
+
Spec::Rake::SpecTask.new(:spec) do |t|
|
|
13
|
+
t.spec_files = Dir.glob('spec/**/*_spec.rb')
|
|
14
|
+
t.spec_opts << '--format specdoc'
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
task :default => 'spec'
|
|
@@ -84,6 +84,19 @@ module Sunspot
|
|
|
84
84
|
# with a category_id of 2, the category_id facet will operate as if a
|
|
85
85
|
# category had not been selected, allowing the user to select additional
|
|
86
86
|
# categories (which will presumably be ORed together).
|
|
87
|
+
#
|
|
88
|
+
# It possible to exclude multiple filters by passing an array:
|
|
89
|
+
#
|
|
90
|
+
# Sunspot.search(Post) do
|
|
91
|
+
# with(:blog_id, 1)
|
|
92
|
+
# category_filter = with(:category_id, 2)
|
|
93
|
+
# author_filter = with(:author_id, 3)
|
|
94
|
+
# facet(:category_id,
|
|
95
|
+
# :exclude => [category_filter, author_filter].compact)
|
|
96
|
+
# end
|
|
97
|
+
#
|
|
98
|
+
# You should consider using +.compact+ to ensure that the array does not
|
|
99
|
+
# contain any nil values.
|
|
87
100
|
#
|
|
88
101
|
# <strong>As far as I can tell, Solr only supports multi-select with
|
|
89
102
|
# field facets; if +:exclude+ is passed to a query facet, this method will
|
|
@@ -14,6 +14,9 @@ module Sunspot
|
|
|
14
14
|
# function { :average_rating }
|
|
15
15
|
# function { sum(:average_rating, 10) }
|
|
16
16
|
#
|
|
17
|
+
# See http://wiki.apache.org/solr/FunctionQuery for a list of all
|
|
18
|
+
# applicable functions
|
|
19
|
+
#
|
|
17
20
|
def function(&block)
|
|
18
21
|
expression = Sunspot::Util.instance_eval_or_call(
|
|
19
22
|
Function.new(self),
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
require 'sunspot/search/paginated_collection'
|
|
2
|
+
|
|
1
3
|
module Sunspot
|
|
2
4
|
module Search #:nodoc:
|
|
5
|
+
|
|
3
6
|
#
|
|
4
7
|
# This class encapsulates the results of a Solr search. It provides access
|
|
5
8
|
# to search results, total result count, facets, and pagination information.
|
|
@@ -32,7 +35,7 @@ module Sunspot
|
|
|
32
35
|
def execute
|
|
33
36
|
reset
|
|
34
37
|
params = @query.to_params
|
|
35
|
-
@solr_result = @connection.request("/#{request_handler}", params)
|
|
38
|
+
@solr_result = @connection.request("/#{request_handler}", params, {:header => {'Content-Type' => 'application/x-www-form-urlencoded'}})
|
|
36
39
|
self
|
|
37
40
|
end
|
|
38
41
|
|
|
@@ -53,7 +56,7 @@ module Sunspot
|
|
|
53
56
|
# WillPaginate::Collection or Array:: Instantiated result objects
|
|
54
57
|
#
|
|
55
58
|
def results
|
|
56
|
-
@results ||=
|
|
59
|
+
@results ||= paginate_collection(verified_hits.map { |hit| hit.instance })
|
|
57
60
|
end
|
|
58
61
|
|
|
59
62
|
#
|
|
@@ -84,7 +87,7 @@ module Sunspot
|
|
|
84
87
|
Hit.new(doc, highlights_for(doc), self)
|
|
85
88
|
end
|
|
86
89
|
end
|
|
87
|
-
|
|
90
|
+
paginate_collection(hits || [])
|
|
88
91
|
end
|
|
89
92
|
end
|
|
90
93
|
end
|
|
@@ -269,17 +272,11 @@ module Sunspot
|
|
|
269
272
|
end
|
|
270
273
|
|
|
271
274
|
def verified_hits
|
|
272
|
-
@verified_hits ||=
|
|
275
|
+
@verified_hits ||= paginate_collection(hits.select { |hit| hit.instance })
|
|
273
276
|
end
|
|
274
277
|
|
|
275
|
-
def
|
|
276
|
-
|
|
277
|
-
WillPaginate::Collection.create(@query.page, @query.per_page, total) do |pager|
|
|
278
|
-
pager.replace(collection)
|
|
279
|
-
end
|
|
280
|
-
else
|
|
281
|
-
collection
|
|
282
|
-
end
|
|
278
|
+
def paginate_collection(collection)
|
|
279
|
+
PaginatedCollection.new(collection, @query.page, @query.per_page, total)
|
|
283
280
|
end
|
|
284
281
|
|
|
285
282
|
def add_facet(name, facet)
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
module Sunspot
|
|
2
|
+
module Search
|
|
3
|
+
|
|
4
|
+
class PaginatedCollection
|
|
5
|
+
instance_methods.each { |m| undef_method m unless m =~ /^__|instance_eval|object_id/ }
|
|
6
|
+
|
|
7
|
+
attr_reader :total_count, :current_page, :per_page
|
|
8
|
+
alias :total_entries :total_count
|
|
9
|
+
alias :limit_value :per_page
|
|
10
|
+
|
|
11
|
+
def initialize(collection, page, per_page, total)
|
|
12
|
+
@collection = collection
|
|
13
|
+
@current_page = page
|
|
14
|
+
@per_page = per_page
|
|
15
|
+
@total_count = total
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def total_pages
|
|
19
|
+
(total_count.to_f / per_page).ceil
|
|
20
|
+
end
|
|
21
|
+
alias :num_pages :total_pages
|
|
22
|
+
|
|
23
|
+
def first_page?
|
|
24
|
+
current_page == 1
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def last_page?
|
|
28
|
+
current_page >= total_pages
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def previous_page
|
|
32
|
+
current_page > 1 ? (current_page - 1) : nil
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def next_page
|
|
36
|
+
current_page < total_pages ? (current_page + 1) : nil
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def out_of_bounds?
|
|
40
|
+
current_page > total_pages
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def offset
|
|
44
|
+
(current_page - 1) * per_page
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
private
|
|
48
|
+
|
|
49
|
+
def method_missing(method, *args, &block)
|
|
50
|
+
@collection.send(method, *args, &block)
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
data/lib/sunspot/server.rb
CHANGED
|
@@ -16,7 +16,7 @@ module Sunspot
|
|
|
16
16
|
|
|
17
17
|
LOG_LEVELS = Set['SEVERE', 'WARNING', 'INFO', 'CONFIG', 'FINE', 'FINER', 'FINEST']
|
|
18
18
|
|
|
19
|
-
attr_accessor :min_memory, :max_memory, :port, :solr_data_dir, :solr_home, :log_file
|
|
19
|
+
attr_accessor :min_memory, :max_memory, :port, :solr_data_dir, :solr_home, :log_file
|
|
20
20
|
attr_writer :pid_dir, :pid_file, :log_level, :solr_data_dir, :solr_home, :solr_jar
|
|
21
21
|
|
|
22
22
|
#
|
|
@@ -66,7 +66,7 @@ module Sunspot
|
|
|
66
66
|
command << "-Xms#{min_memory}" if min_memory
|
|
67
67
|
command << "-Xmx#{max_memory}" if max_memory
|
|
68
68
|
command << "-Djetty.port=#{port}" if port
|
|
69
|
-
command << "-Dsolr.data.dir=#{solr_data_dir}" if solr_data_dir
|
|
69
|
+
command << "-Dsolr.data.dir=#{solr_data_dir}" if solr_data_dir
|
|
70
70
|
command << "-Dsolr.solr.home=#{solr_home}" if solr_home
|
|
71
71
|
command << "-Djava.util.logging.config.file=#{logging_config_path}" if logging_config_path
|
|
72
72
|
command << '-jar' << File.basename(solr_jar)
|
|
@@ -131,11 +131,7 @@ module Sunspot
|
|
|
131
131
|
def solr_jar
|
|
132
132
|
@solr_jar || SOLR_START_JAR
|
|
133
133
|
end
|
|
134
|
-
|
|
135
|
-
def multicore
|
|
136
|
-
@multicore || false
|
|
137
|
-
end
|
|
138
|
-
|
|
134
|
+
|
|
139
135
|
private
|
|
140
136
|
|
|
141
137
|
def logging_config_path
|
data/lib/sunspot/version.rb
CHANGED
data/script/console
ADDED
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
<?xml version="1.0"?>
|
|
2
|
+
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
|
|
3
|
+
|
|
4
|
+
<!-- =============================================================== -->
|
|
5
|
+
<!-- Configure the Jetty Server -->
|
|
6
|
+
<!-- -->
|
|
7
|
+
<!-- Documentation of this file format can be found at: -->
|
|
8
|
+
<!-- http://docs.codehaus.org/display/JETTY/jetty.xml -->
|
|
9
|
+
<!-- -->
|
|
10
|
+
<!-- =============================================================== -->
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
<Configure id="Server" class="org.mortbay.jetty.Server">
|
|
14
|
+
|
|
15
|
+
<!-- Increase the maximum POST size to 1 MB to be able to handle large shard requests -->
|
|
16
|
+
<Call class="java.lang.System" name="setProperty">
|
|
17
|
+
<Arg>org.mortbay.jetty.Request.maxFormContentSize</Arg>
|
|
18
|
+
<Arg>1000000</Arg>
|
|
19
|
+
</Call>
|
|
20
|
+
|
|
21
|
+
<!-- =========================================================== -->
|
|
22
|
+
<!-- Server Thread Pool -->
|
|
23
|
+
<!-- =========================================================== -->
|
|
24
|
+
<Set name="ThreadPool">
|
|
25
|
+
<!-- Default bounded blocking threadpool
|
|
26
|
+
-->
|
|
27
|
+
<New class="org.mortbay.thread.BoundedThreadPool">
|
|
28
|
+
<Set name="minThreads">10</Set>
|
|
29
|
+
<Set name="lowThreads">50</Set>
|
|
30
|
+
<Set name="maxThreads">10000</Set>
|
|
31
|
+
</New>
|
|
32
|
+
|
|
33
|
+
<!-- Optional Java 5 bounded threadpool with job queue
|
|
34
|
+
<New class="org.mortbay.thread.concurrent.ThreadPool">
|
|
35
|
+
<Arg type="int">0</Arg>
|
|
36
|
+
<Set name="corePoolSize">10</Set>
|
|
37
|
+
<Set name="maximumPoolSize">250</Set>
|
|
38
|
+
</New>
|
|
39
|
+
-->
|
|
40
|
+
</Set>
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
<!-- =========================================================== -->
|
|
45
|
+
<!-- Set connectors -->
|
|
46
|
+
<!-- =========================================================== -->
|
|
47
|
+
<!-- One of each type! -->
|
|
48
|
+
<!-- =========================================================== -->
|
|
49
|
+
|
|
50
|
+
<!-- Use this connector for many frequently idle connections
|
|
51
|
+
and for threadless continuations.
|
|
52
|
+
<Call name="addConnector">
|
|
53
|
+
<Arg>
|
|
54
|
+
<New class="org.mortbay.jetty.nio.SelectChannelConnector">
|
|
55
|
+
<Set name="port"><SystemProperty name="jetty.port" default="8983"/></Set>
|
|
56
|
+
<Set name="maxIdleTime">30000</Set>
|
|
57
|
+
<Set name="Acceptors">2</Set>
|
|
58
|
+
<Set name="confidentialPort">8443</Set>
|
|
59
|
+
</New>
|
|
60
|
+
</Arg>
|
|
61
|
+
</Call>
|
|
62
|
+
-->
|
|
63
|
+
|
|
64
|
+
<!-- Use this connector if NIO is not available. -->
|
|
65
|
+
<!-- This connector is currently being used for Solr because the
|
|
66
|
+
nio.SelectChannelConnector showed poor performance under WindowsXP
|
|
67
|
+
from a single client with non-persistent connections (35s vs ~3min)
|
|
68
|
+
to complete 10,000 requests)
|
|
69
|
+
-->
|
|
70
|
+
<Call name="addConnector">
|
|
71
|
+
<Arg>
|
|
72
|
+
<New class="org.mortbay.jetty.bio.SocketConnector">
|
|
73
|
+
<Set name="port"><SystemProperty name="jetty.port" default="8983"/></Set>
|
|
74
|
+
<Set name="maxIdleTime">50000</Set>
|
|
75
|
+
<Set name="lowResourceMaxIdleTime">1500</Set>
|
|
76
|
+
</New>
|
|
77
|
+
</Arg>
|
|
78
|
+
</Call>
|
|
79
|
+
|
|
80
|
+
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
|
81
|
+
<!-- To add a HTTPS SSL listener -->
|
|
82
|
+
<!-- see jetty-ssl.xml to add an ssl connector. use -->
|
|
83
|
+
<!-- java -jar start.jar etc/jetty.xml etc/jetty-ssl.xml -->
|
|
84
|
+
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
|
85
|
+
|
|
86
|
+
<!-- =========================================================== -->
|
|
87
|
+
<!-- Set up global session ID manager -->
|
|
88
|
+
<!-- =========================================================== -->
|
|
89
|
+
<!--
|
|
90
|
+
<Set name="sessionIdManager">
|
|
91
|
+
<New class="org.mortbay.jetty.servlet.HashSessionIdManager">
|
|
92
|
+
<Set name="workerName">node1</Set>
|
|
93
|
+
</New>
|
|
94
|
+
</Set>
|
|
95
|
+
-->
|
|
96
|
+
|
|
97
|
+
<!-- =========================================================== -->
|
|
98
|
+
<!-- Set handler Collection Structure -->
|
|
99
|
+
<!-- =========================================================== -->
|
|
100
|
+
<Set name="handler">
|
|
101
|
+
<New id="Handlers" class="org.mortbay.jetty.handler.HandlerCollection">
|
|
102
|
+
<Set name="handlers">
|
|
103
|
+
<Array type="org.mortbay.jetty.Handler">
|
|
104
|
+
<Item>
|
|
105
|
+
<New id="Contexts" class="org.mortbay.jetty.handler.ContextHandlerCollection"/>
|
|
106
|
+
</Item>
|
|
107
|
+
<Item>
|
|
108
|
+
<New id="DefaultHandler" class="org.mortbay.jetty.handler.DefaultHandler"/>
|
|
109
|
+
</Item>
|
|
110
|
+
<Item>
|
|
111
|
+
<New id="RequestLog" class="org.mortbay.jetty.handler.RequestLogHandler"/>
|
|
112
|
+
</Item>
|
|
113
|
+
</Array>
|
|
114
|
+
</Set>
|
|
115
|
+
</New>
|
|
116
|
+
</Set>
|
|
117
|
+
|
|
118
|
+
<!-- =========================================================== -->
|
|
119
|
+
<!-- Configure the context deployer -->
|
|
120
|
+
<!-- A context deployer will deploy contexts described in -->
|
|
121
|
+
<!-- configuration files discovered in a directory. -->
|
|
122
|
+
<!-- The configuration directory can be scanned for hot -->
|
|
123
|
+
<!-- deployments at the configured scanInterval. -->
|
|
124
|
+
<!-- -->
|
|
125
|
+
<!-- This deployer is configured to deploy contexts configured -->
|
|
126
|
+
<!-- in the $JETTY_HOME/contexts directory -->
|
|
127
|
+
<!-- -->
|
|
128
|
+
<!-- =========================================================== -->
|
|
129
|
+
<Call name="addLifeCycle">
|
|
130
|
+
<Arg>
|
|
131
|
+
<New class="org.mortbay.jetty.deployer.ContextDeployer">
|
|
132
|
+
<Set name="contexts"><Ref id="Contexts"/></Set>
|
|
133
|
+
<Set name="configurationDir"><SystemProperty name="jetty.home" default="."/>/contexts</Set>
|
|
134
|
+
<Set name="scanInterval">1</Set>
|
|
135
|
+
</New>
|
|
136
|
+
</Arg>
|
|
137
|
+
</Call>
|
|
138
|
+
|
|
139
|
+
<!-- =========================================================== -->
|
|
140
|
+
<!-- Configure the webapp deployer. -->
|
|
141
|
+
<!-- A webapp deployer will deploy standard webapps discovered -->
|
|
142
|
+
<!-- in a directory at startup, without the need for additional -->
|
|
143
|
+
<!-- configuration files. It does not support hot deploy or -->
|
|
144
|
+
<!-- non standard contexts (see ContextDeployer above). -->
|
|
145
|
+
<!-- -->
|
|
146
|
+
<!-- This deployer is configured to deploy webapps from the -->
|
|
147
|
+
<!-- $JETTY_HOME/webapps directory -->
|
|
148
|
+
<!-- -->
|
|
149
|
+
<!-- Normally only one type of deployer need be used. -->
|
|
150
|
+
<!-- -->
|
|
151
|
+
<!-- =========================================================== -->
|
|
152
|
+
<Call name="addLifeCycle">
|
|
153
|
+
<Arg>
|
|
154
|
+
<New class="org.mortbay.jetty.deployer.WebAppDeployer">
|
|
155
|
+
<Set name="contexts"><Ref id="Contexts"/></Set>
|
|
156
|
+
<Set name="webAppDir"><SystemProperty name="jetty.home" default="."/>/webapps</Set>
|
|
157
|
+
<Set name="parentLoaderPriority">false</Set>
|
|
158
|
+
<Set name="extract">true</Set>
|
|
159
|
+
<Set name="allowDuplicates">false</Set>
|
|
160
|
+
<Set name="defaultsDescriptor"><SystemProperty name="jetty.home" default="."/>/etc/webdefault.xml</Set>
|
|
161
|
+
</New>
|
|
162
|
+
</Arg>
|
|
163
|
+
</Call>
|
|
164
|
+
|
|
165
|
+
<!-- =========================================================== -->
|
|
166
|
+
<!-- Configure Authentication Realms -->
|
|
167
|
+
<!-- Realms may be configured for the entire server here, or -->
|
|
168
|
+
<!-- they can be configured for a specific web app in a context -->
|
|
169
|
+
<!-- configuration (see $(jetty.home)/contexts/test.xml for an -->
|
|
170
|
+
<!-- example). -->
|
|
171
|
+
<!-- =========================================================== -->
|
|
172
|
+
<Set name="UserRealms">
|
|
173
|
+
<Array type="org.mortbay.jetty.security.UserRealm">
|
|
174
|
+
<!--
|
|
175
|
+
<Item>
|
|
176
|
+
<New class="org.mortbay.jetty.security.HashUserRealm">
|
|
177
|
+
<Set name="name">Test Realm</Set>
|
|
178
|
+
<Set name="config"><SystemProperty name="jetty.home" default="."/>/etc/realm.properties</Set>
|
|
179
|
+
</New>
|
|
180
|
+
</Item>
|
|
181
|
+
-->
|
|
182
|
+
</Array>
|
|
183
|
+
</Set>
|
|
184
|
+
|
|
185
|
+
<!-- =========================================================== -->
|
|
186
|
+
<!-- Configure Request Log -->
|
|
187
|
+
<!-- Request logs may be configured for the entire server here, -->
|
|
188
|
+
<!-- or they can be configured for a specific web app in a -->
|
|
189
|
+
<!-- contexts configuration (see $(jetty.home)/contexts/test.xml -->
|
|
190
|
+
<!-- for an example). -->
|
|
191
|
+
<!-- =========================================================== -->
|
|
192
|
+
<Ref id="RequestLog">
|
|
193
|
+
<Set name="requestLog">
|
|
194
|
+
<!-- New id="RequestLogImpl" class="org.mortbay.jetty.NCSARequestLog">
|
|
195
|
+
<Arg><SystemProperty name="jetty.logs" default="./logs"/>/yyyy_mm_dd.request.log</Arg>
|
|
196
|
+
<Set name="retainDays">90</Set>
|
|
197
|
+
<Set name="append">true</Set>
|
|
198
|
+
<Set name="extended">false</Set>
|
|
199
|
+
<Set name="LogTimeZone">GMT</Set>
|
|
200
|
+
</New -->
|
|
201
|
+
</Set>
|
|
202
|
+
</Ref>
|
|
203
|
+
|
|
204
|
+
<!-- =========================================================== -->
|
|
205
|
+
<!-- extra options -->
|
|
206
|
+
<!-- =========================================================== -->
|
|
207
|
+
<Set name="stopAtShutdown">true</Set>
|
|
208
|
+
<!-- ensure/prevent Server: header being sent to browsers -->
|
|
209
|
+
<Set name="sendServerVersion">true</Set>
|
|
210
|
+
|
|
211
|
+
</Configure>
|
|
212
|
+
|