Skip to content

Commit 541f439

Browse files
author
Lucien van Wouw
committed
Allow the plugin to work in a multi core setup, where each core has its own oai configuration.
1 parent 7dcbda4 commit 541f439

Some content is hidden

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

51 files changed

+218
-178
lines changed

.gitignore

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Solr material
2-
data
3-
index
2+
data/
3+
index/
4+
core0/
5+
lib/
46

57
# Compiled source #
68
###################

Changelog.txt

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2017-10-28, version 3.1 to 6.1
2+
- Remove bug that throws an indexOutOfBounds error when no default for maxrecords was set.
3+
- Allow the plugin to work in a multi core setup.
4+
15
2017-07-05, version 6.1
26
- Port from Solr 5 to version 6. No further changes.
37

License.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
The oai4solr plugin offers an OAI2 protocol to open up Solr 3.x indexes.
1+
The oai4solr plugin offers an OAI2 protocol to open up Solr indexes.
22

3-
Copyright (c) 2010-2014 International Institute for Social History, The Netherlands.
3+
Copyright (c) 2010-2017 International Institute for Social History, The Netherlands.
44

55
This program is free software: you can redistribute it and/or modify
66
it under the terms of the GNU General Public License as published by

README.md

+20-14
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ A plugin that exposes your Solr 6.x indexes with the OAI2 protocol.
55

66
## How it works
77
You can use simple xslt documents to map the raw Solr XML response into the oai_dc metadata format; and any other
8-
metadata schema you may which to offer to your harvesting public. This way you can expose your index, regardless of your
8+
metadata schema you want to offer your harvesting public. This way you can expose your index, regardless of your
99
solr schema. It can be used for single and multicore instances.
1010

1111
## Declare the request and response handlers
@@ -48,7 +48,7 @@ then the setting ought to be
4848

4949
<str name="oai_home">/oai</str>
5050

51-
Alternatively, you can place a oai folder in each core as well. For example:
51+
Alternatively, you can place an oai folder in each core as well. For example:
5252

5353
<str name="oai_home">/core0/oai</str>
5454

@@ -62,9 +62,9 @@ Alternatively, you can place a oai folder in each core as well. For example:
6262

6363
### Non dynamic documents
6464
The Identify, ListSets and ListMetadataPrefix verbs are
65-
xml documents you need to set manually in the oai folder:
65+
xml documents you need to place manually in the oai folder.
6666

67-
### The Identify verb
67+
#### The Identify verb
6868
Place a suitable Identify.xml document in the -oai folder. For example:
6969

7070
<OAI-PMH xmlns="http://www.openarchives.org/OAI/2.0/"
@@ -98,7 +98,7 @@ Place a suitable Identify.xml document in the -oai folder. For example:
9898
</OAI-PMH>
9999

100100

101-
### The ListMetadataFormats verb
101+
#### The ListMetadataFormats verb
102102
The ListMetadataPrefix.xml document contains your metadata schema definitions. At startup the oai4Solr plugin will look
103103
for a 'ListMetadataPrefix.xml' document in the oai folder and use for the ListMetadataFormats response.
104104

@@ -137,7 +137,7 @@ oai_dc.xsl, marcxml.xsl and solr.xsl
137137
Valid OAI2 metadataPrefix parameter values will then be oai_dc, marcxml and solr. The OAI2 response will be manufactured by
138138
applying the corresponding (cached) xslt template.
139139

140-
###The ListSets verb
140+
#### The ListSets verb
141141
ListSets are not constructed dynamically from facets. Rather, like 'ListMetadataFormats' and 'Identify' they are
142142
declared in the file ListSets.xml. For example like:
143143

@@ -222,19 +222,19 @@ Use this when the OAI2 handler is invoked via a parent handler or proxy which at
222222
dynamically. For example when the client is not allowed to see certain records based on access policies.
223223
Filter query arguments must be appended to the oai handler with a -fq key.
224224

225-
For example, if set:
225+
For example, if set to `true`:
226226

227227
<bool name="enable_filter_query">true</bool>
228228

229-
Clients may then append an -fq parameter to the oai handler's query string. However this setting is intended for server side control,
230-
where you can call the oai2 service internally like so in this pseude code:
229+
then backend clients can append a -fq parameter to the oai handler's query string. This setting is intended for server side control,
230+
so you can call the oai2 service internally. For example like this with pseude code:
231231

232232
String OAI2_ARGUMENTS = capture_oai_arguments(client_request);
233233
String QUERY_FILTER_ARGUMENTS = get_query_arguments_from_user_authorities(client_id);
234234
HttpClient client = new HttpClient("http://localhost/solr/collection1/oai?" + OAI2_ARGUMENTS + "&qf=QUERY_FILTER_ARGUMENTS);
235235

236236
## Solrconfig.xml configuration in full
237-
Set the following in the solrconfig.xml document:
237+
If needed, set the following in the solrconfig.xml document:
238238

239239
<config>
240240

@@ -251,7 +251,7 @@ Set the following in the solrconfig.xml document:
251251
-->
252252
<str name="oai_home">/oai</str>
253253

254-
<!-- the base url... -->
254+
<!-- the base url. If you are begin a proxy, use the proxy domain.-->
255255
<str name="proxyurl">http://localhost:8080/oai</str>
256256

257257
<!-- index name of the oai identifier used for the -identifier parameter
@@ -437,8 +437,10 @@ The end result is a package in ./oai2-plugin/target/oai2-plugin-6.x-1.0.jar ( or
437437
You can also download the latest build from https://bamboo.socialhistoryservices.org/browse/OAI4SOLR-OAI4SOLR/latest from the artifacts tab.
438438

439439
## Install
440-
Place oai2-plugin-6.x-1.0.jar in the designated "lib" folder of your Solr application. Or add a symbolic link in the "lib"
441-
that points to the jar.
440+
Place oai2-plugin-6.x-1.0.jar in the designated "lib", "contrib" folder of your Solr application. Or add a symbolic link in the "lib"
441+
that points to the jar. For example:
442+
443+
<lib dir="${solr.install.dir:../../../..}/contrib/oai" />
442444

443445
## Runable demo
444446
Once the project is build, a demo is available. It contains an embedded Solr Jetty server. If you start it, it will load MarcXML test records.
@@ -462,4 +464,8 @@ Start the demo with:
462464

463465
Then explore the test OAI2 repository with your request to it, e.g.
464466

465-
http://localhost:8983/solr/core0/oai?verb=Identify
467+
http://localhost:8983/solr/core0/oai?verb=Identify
468+
469+
## Feature requests and contributions
470+
If you want a particular feature, make a feature request by opening up an issue. If on top of that you
471+
want to contribute, then please feel free to fork this project; branch off; implement the function with tests and make a pull request.

demo/solr/oai/Identify.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<!--
44
~ OAI4Solr exposes your Solr indexes by adding a OAI2 protocol handler.
55
~
6-
~ Copyright (c) 2011-2014 International Institute of Social History
6+
~ Copyright (c) 2011-2017 International Institute of Social History
77
~
88
~ This program is free software: you can redistribute it and/or modify
99
~ it under the terms of the GNU General Public License as published by

demo/solr/oai/ListMetadataFormats.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<!--
33
~ OAI4Solr exposes your Solr indexes using an OAI2 protocol handler.
44
~
5-
~ Copyright (c) 2011-2014 International Institute of Social History
5+
~ Copyright (c) 2011-2017 International Institute of Social History
66
~
77
~ This program is free software: you can redistribute it and/or modify
88
~ it under the terms of the GNU General Public License as published by

demo/solr/oai/ListSets.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<!--
33
~ OAI4Solr exposes your Solr indexes using an OAI2 protocol handler.
44
~
5-
~ Copyright (c) 2011-2014 International Institute of Social History
5+
~ Copyright (c) 2011-2017 International Institute of Social History
66
~
77
~ This program is free software: you can redistribute it and/or modify
88
~ it under the terms of the GNU General Public License as published by

demo/solr/oai/marcxml.xsl

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<!--
33
~ OAI4Solr exposes your Solr indexes using an OAI2 protocol handler.
44
~
5-
~ Copyright (c) 2011-2014 International Institute of Social History
5+
~ Copyright (c) 2011-2017 International Institute of Social History
66
~
77
~ This program is free software: you can redistribute it and/or modify
88
~ it under the terms of the GNU General Public License as published by

demo/solr/oai/oai.xsl

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<!--
33
~ OAI4Solr exposes your Solr indexes by adding a OAI2 protocol handler.
44
~
5-
~ Copyright (c) 2011-2014 International Institute of Social History
5+
~ Copyright (c) 2011-2017 International Institute of Social History
66
~
77
~ This program is free software: you can redistribute it and/or modify
88
~ it under the terms of the GNU General Public License as published by

demo/solr/oai/oai_dc.xsl

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<!--
33
~ OAI4Solr exposes your Solr indexes by adding a OAI2 protocol handler.
44
~
5-
~ Copyright (c) 2011-2014 International Institute of Social History
5+
~ Copyright (c) 2011-2017 International Institute of Social History
66
~
77
~ This program is free software: you can redistribute it and/or modify
88
~ it under the terms of the GNU General Public License as published by

demo/solr/oai/solr.xsl

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<!--
33
~ OAI4Solr exposes your Solr indexes by adding a OAI2 protocol handler.
44
~
5-
~ Copyright (c) 2011-2014 International Institute of Social History
5+
~ Copyright (c) 2011-2017 International Institute of Social History
66
~
77
~ This program is free software: you can redistribute it and/or modify
88
~ it under the terms of the GNU General Public License as published by

oai2-plugin/src/main/java/org/openarchives/oai2/AboutType.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/*
33
* OAI4Solr exposes your Solr indexes by adding a OAI2 protocol handler.
44
*
5-
* Copyright (c) 2011-2014 International Institute of Social History
5+
* Copyright (c) 2011-2017 International Institute of Social History
66
*
77
* This program is free software: you can redistribute it and/or modify
88
* it under the terms of the GNU General Public License as published by

oai2-plugin/src/main/java/org/openarchives/oai2/DeletedRecordType.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/*
33
* OAI4Solr exposes your Solr indexes by adding a OAI2 protocol handler.
44
*
5-
* Copyright (c) 2011-2014 International Institute of Social History
5+
* Copyright (c) 2011-2017 International Institute of Social History
66
*
77
* This program is free software: you can redistribute it and/or modify
88
* it under the terms of the GNU General Public License as published by

oai2-plugin/src/main/java/org/openarchives/oai2/DescriptionType.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/*
33
* OAI4Solr exposes your Solr indexes by adding a OAI2 protocol handler.
44
*
5-
* Copyright (c) 2011-2014 International Institute of Social History
5+
* Copyright (c) 2011-2017 International Institute of Social History
66
*
77
* This program is free software: you can redistribute it and/or modify
88
* it under the terms of the GNU General Public License as published by

oai2-plugin/src/main/java/org/openarchives/oai2/GetRecordType.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/*
33
* OAI4Solr exposes your Solr indexes by adding a OAI2 protocol handler.
44
*
5-
* Copyright (c) 2011-2014 International Institute of Social History
5+
* Copyright (c) 2011-2017 International Institute of Social History
66
*
77
* This program is free software: you can redistribute it and/or modify
88
* it under the terms of the GNU General Public License as published by

oai2-plugin/src/main/java/org/openarchives/oai2/GranularityType.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/*
33
* OAI4Solr exposes your Solr indexes by adding a OAI2 protocol handler.
44
*
5-
* Copyright (c) 2011-2014 International Institute of Social History
5+
* Copyright (c) 2011-2017 International Institute of Social History
66
*
77
* This program is free software: you can redistribute it and/or modify
88
* it under the terms of the GNU General Public License as published by

oai2-plugin/src/main/java/org/openarchives/oai2/HeaderType.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/*
33
* OAI4Solr exposes your Solr indexes by adding a OAI2 protocol handler.
44
*
5-
* Copyright (c) 2011-2014 International Institute of Social History
5+
* Copyright (c) 2011-2017 International Institute of Social History
66
*
77
* This program is free software: you can redistribute it and/or modify
88
* it under the terms of the GNU General Public License as published by

oai2-plugin/src/main/java/org/openarchives/oai2/IdentifyType.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/*
33
* OAI4Solr exposes your Solr indexes by adding a OAI2 protocol handler.
44
*
5-
* Copyright (c) 2011-2014 International Institute of Social History
5+
* Copyright (c) 2011-2017 International Institute of Social History
66
*
77
* This program is free software: you can redistribute it and/or modify
88
* it under the terms of the GNU General Public License as published by

oai2-plugin/src/main/java/org/openarchives/oai2/ListIdentifiersType.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/*
33
* OAI4Solr exposes your Solr indexes by adding a OAI2 protocol handler.
44
*
5-
* Copyright (c) 2011-2014 International Institute of Social History
5+
* Copyright (c) 2011-2017 International Institute of Social History
66
*
77
* This program is free software: you can redistribute it and/or modify
88
* it under the terms of the GNU General Public License as published by

oai2-plugin/src/main/java/org/openarchives/oai2/ListMetadataFormatsType.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/*
33
* OAI4Solr exposes your Solr indexes by adding a OAI2 protocol handler.
44
*
5-
* Copyright (c) 2011-2014 International Institute of Social History
5+
* Copyright (c) 2011-2017 International Institute of Social History
66
*
77
* This program is free software: you can redistribute it and/or modify
88
* it under the terms of the GNU General Public License as published by

oai2-plugin/src/main/java/org/openarchives/oai2/ListRecordsType.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/*
33
* OAI4Solr exposes your Solr indexes by adding a OAI2 protocol handler.
44
*
5-
* Copyright (c) 2011-2014 International Institute of Social History
5+
* Copyright (c) 2011-2017 International Institute of Social History
66
*
77
* This program is free software: you can redistribute it and/or modify
88
* it under the terms of the GNU General Public License as published by

oai2-plugin/src/main/java/org/openarchives/oai2/ListSetsType.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/*
33
* OAI4Solr exposes your Solr indexes by adding a OAI2 protocol handler.
44
*
5-
* Copyright (c) 2011-2014 International Institute of Social History
5+
* Copyright (c) 2011-2017 International Institute of Social History
66
*
77
* This program is free software: you can redistribute it and/or modify
88
* it under the terms of the GNU General Public License as published by

oai2-plugin/src/main/java/org/openarchives/oai2/MetadataFormatType.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/*
33
* OAI4Solr exposes your Solr indexes by adding a OAI2 protocol handler.
44
*
5-
* Copyright (c) 2011-2014 International Institute of Social History
5+
* Copyright (c) 2011-2017 International Institute of Social History
66
*
77
* This program is free software: you can redistribute it and/or modify
88
* it under the terms of the GNU General Public License as published by

oai2-plugin/src/main/java/org/openarchives/oai2/MetadataType.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/*
33
* OAI4Solr exposes your Solr indexes by adding a OAI2 protocol handler.
44
*
5-
* Copyright (c) 2011-2014 International Institute of Social History
5+
* Copyright (c) 2011-2017 International Institute of Social History
66
*
77
* This program is free software: you can redistribute it and/or modify
88
* it under the terms of the GNU General Public License as published by

oai2-plugin/src/main/java/org/openarchives/oai2/OAI-PMH.xsd

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!--
22
~ OAI4Solr exposes your Solr indexes by adding a OAI2 protocol handler.
33
~
4-
~ Copyright (c) 2011-2014 International Institute of Social History
4+
~ Copyright (c) 2011-2017 International Institute of Social History
55
~
66
~ This program is free software: you can redistribute it and/or modify
77
~ it under the terms of the GNU General Public License as published by

oai2-plugin/src/main/java/org/openarchives/oai2/OAIPMHerrorType.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/*
33
* OAI4Solr exposes your Solr indexes by adding a OAI2 protocol handler.
44
*
5-
* Copyright (c) 2011-2014 International Institute of Social History
5+
* Copyright (c) 2011-2017 International Institute of Social History
66
*
77
* This program is free software: you can redistribute it and/or modify
88
* it under the terms of the GNU General Public License as published by

oai2-plugin/src/main/java/org/openarchives/oai2/OAIPMHerrorcodeType.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/*
33
* OAI4Solr exposes your Solr indexes by adding a OAI2 protocol handler.
44
*
5-
* Copyright (c) 2011-2014 International Institute of Social History
5+
* Copyright (c) 2011-2017 International Institute of Social History
66
*
77
* This program is free software: you can redistribute it and/or modify
88
* it under the terms of the GNU General Public License as published by

oai2-plugin/src/main/java/org/openarchives/oai2/OAIPMHtype.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/*
33
* OAI4Solr exposes your Solr indexes by adding a OAI2 protocol handler.
44
*
5-
* Copyright (c) 2011-2014 International Institute of Social History
5+
* Copyright (c) 2011-2017 International Institute of Social History
66
*
77
* This program is free software: you can redistribute it and/or modify
88
* it under the terms of the GNU General Public License as published by

oai2-plugin/src/main/java/org/openarchives/oai2/ObjectFactory.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/*
33
* OAI4Solr exposes your Solr indexes by adding a OAI2 protocol handler.
44
*
5-
* Copyright (c) 2011-2014 International Institute of Social History
5+
* Copyright (c) 2011-2017 International Institute of Social History
66
*
77
* This program is free software: you can redistribute it and/or modify
88
* it under the terms of the GNU General Public License as published by

oai2-plugin/src/main/java/org/openarchives/oai2/RecordType.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/*
33
* OAI4Solr exposes your Solr indexes by adding a OAI2 protocol handler.
44
*
5-
* Copyright (c) 2011-2014 International Institute of Social History
5+
* Copyright (c) 2011-2017 International Institute of Social History
66
*
77
* This program is free software: you can redistribute it and/or modify
88
* it under the terms of the GNU General Public License as published by

oai2-plugin/src/main/java/org/openarchives/oai2/RequestType.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/*
33
* OAI4Solr exposes your Solr indexes by adding a OAI2 protocol handler.
44
*
5-
* Copyright (c) 2011-2014 International Institute of Social History
5+
* Copyright (c) 2011-2017 International Institute of Social History
66
*
77
* This program is free software: you can redistribute it and/or modify
88
* it under the terms of the GNU General Public License as published by

oai2-plugin/src/main/java/org/openarchives/oai2/ResumptionTokenType.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/*
33
* OAI4Solr exposes your Solr indexes by adding a OAI2 protocol handler.
44
*
5-
* Copyright (c) 2011-2014 International Institute of Social History
5+
* Copyright (c) 2011-2017 International Institute of Social History
66
*
77
* This program is free software: you can redistribute it and/or modify
88
* it under the terms of the GNU General Public License as published by

oai2-plugin/src/main/java/org/openarchives/oai2/SetType.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/*
33
* OAI4Solr exposes your Solr indexes by adding a OAI2 protocol handler.
44
*
5-
* Copyright (c) 2011-2014 International Institute of Social History
5+
* Copyright (c) 2011-2017 International Institute of Social History
66
*
77
* This program is free software: you can redistribute it and/or modify
88
* it under the terms of the GNU General Public License as published by

0 commit comments

Comments
 (0)