Skip to content

Commit bb841db

Browse files
Merge pull request #2 from 4Science/D4CRIS-506
Implementation of ResourceSync 1.1
2 parents f40b696 + 98fbe76 commit bb841db

31 files changed

Lines changed: 2703 additions & 887 deletions

.gitignore

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,39 @@
1-
.idea/
21
DSpaceResourceSync.iml
2+
*.bak
3+
## Ignore the MVN compiled output directories from version tracking
34
target/
5+
6+
## Ignore project files created by Eclipse
7+
.settings/
8+
/bin/
9+
.project
10+
.classpath
11+
12+
## Ignore project files created by IntelliJ IDEA
13+
*.iml
14+
*.ipr
15+
*.iws
16+
.idea/
17+
overlays/
18+
19+
## Ignore project files created by NetBeans
20+
nbproject/private/
21+
build/
22+
nbbuild/
23+
dist/
24+
nbdist/
25+
nbactions.xml
26+
nb-configuration.xml
27+
META-INF/
28+
29+
## Ignore all *.properties file in root folder, EXCEPT build.properties (the default)
30+
/*.properties
31+
!/build.properties
32+
33+
##Mac noise
34+
.DS_Store
35+
rebel.xml
36+
.externalToolBuilders/
37+
local.cfg
38+
39+

LICENSE

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Copyright (c) 2002-2018, DuraSpace.
2+
3+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
4+
5+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
6+
7+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8+
9+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
10+
11+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
12+
13+
See https://opensource.org/licenses/BSD-3-Clause

LICENSE_HEADER

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
The contents of this file are subject to the license and copyright
2+
detailed in the LICENSE and NOTICE files at the root of the source
3+
tree

NOTICE

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
Licensing Notice
3+
4+
The project is based on code initially developed by Richard Jones at CottageLabs.
5+
In May 2018 the copyright was waived in favour of the DuraSpace Foundation to
6+
allow wide contribution and simplify the adoption by the DSpace community.

README.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
#DSpace ResourceSync Module
1+
# DSpace ResourceSync Module
22

3-
This module provides ResourceSync capabilities for DSpace, supporting the metadata harvesting use case.
3+
This module provides ResourceSync capabilities for DSpace, supporting the metadata harvesting use case. It is based on the original work from Richard Jones of CottageLabs. 4Science has used fund from OpenAIRE to update, extend and improve it, see https://www.openaire.eu/openaire-tender-calls-winners
44

5-
##Dependencies
5+
**Please note this is the version for DSpace 5, check these other branches for a version compatible with [DSpace 6](https://github.com/4Science/DSpaceResourceSync/tree/D4CRIS-506-D6) and [DSpace 7](https://github.com/4Science/DSpaceResourceSync/tree/D4CRIS-506-D7)**
6+
7+
## Dependencies
68

79
This module depends on a generic ResourceSync Java library, which you will need to install before you can
810
build the code
911

10-
https://github.com/CottageLabs/ResourceSyncJava
12+
https://github.com/4Science/ResourceSyncJava
1113

12-
##Installation
14+
## Installation
1315

1416
The software can be compiled with simply
1517

@@ -26,7 +28,7 @@ and then update your dspace pom.xml file to depend on this module, with a depend
2628
<dependency>
2729
<groupId>org.dspace</groupId>
2830
<artifactId>dspace-resourcesync</artifactId>
29-
<version>1.0-SNAPSHOT</version>
31+
<version>1.1-SNAPSHOT</version>
3032
<type>jar</type>
3133
<classifier>classes</classifier>
3234
</dependency>
@@ -37,29 +39,29 @@ You can then deploy the dspace-resourcesync webapp in tomcat alongside your DSpa
3739

3840
You must also deploy the resourcesync.cfg file into the DSpace config/modules directory.
3941

40-
##Usage
42+
## Usage
4143

4244
In order to provide the ResourceSync documents via the webapp, you need to generate the documents.
4345

44-
###Create the initial Resource List
46+
### Create the initial Resource List
4547

4648
./dspace dsrun org.dspace.resourcesync.ResourceSyncGenerator -i
4749

48-
###Update the Change Lists periodically
50+
### Update the Change Lists periodically
4951

5052
This will generate a new Change List every time it is run, and make it available via the Change List Archive. It is
5153
best to run this as a cron job, at a frequency suitable to the rate of change of the content in your repository (for
5254
example, once a week).
5355

5456
./dspace dsrun org.dspace.resourcesync.ResourceSyncGenerator -u
5557

56-
###Rebase the documents periodically
58+
### Rebase the documents periodically
5759

5860
This will generate an up-to-date Resource List and a new Change List every time it is run. It is best to run this as
5961
a cron job at a longer frequency suitable to the rate of change of the content in your repository (for example, once
6062
a month)
6163

62-
##Configuration
64+
## Configuration
6365

6466
Configuration can be found in dspace/config/modules/resourcesync.cfg
6567

@@ -89,4 +91,4 @@ they need to authenticate, and to have user accounts.
8991
capabilitylist.described-by = ${dspace.baseUrl}/dspace-resourcesync/about.txt
9092

9193
This points to a web page that has a human-readable description of the service provided by the repository. You may
92-
replace this with any other web-page that suits you.
94+
replace this with any other web-page that suits you.

dspace/config/modules/resourcesync.cfg

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
# Base URL for the ResourceSync webapp
22
#
3-
base-url = ${dspace.baseUrl}/dspace-resourcesync
3+
4+
resourcesync.baseUrl = ${dspace.baseUrl}
5+
# If you want run the resourcesync webapp on another host/port please define your custom base-url
6+
#resourcesync.baseUrl = http://<hostname>:<port>
7+
8+
base-url = ${resourcesync.baseUrl}/dspace-resourcesync
49

510
# Directory where ResourceSync static documents will be stored
611
#
712
resourcesync.dir = ${dspace.dir}/resourcesync
8-
913
# List of bundles to expose via ResourceSync, comma separated list. If this option is omitted or no bundles
1014
# are specified, then no bitstreams will be exposed.
1115
#
1216
expose-bundles = ORIGINAL
1317

18+
solr.server = ${solr.server}/resourcesync
19+
1420
# NOTE: the metadata prefix for the dublin core terms is "qdc" here because we also use the prefix
1521
# to load the dissemination crosswalk. DSpace is already configured by default to offer a qualified
1622
# dublin core crosswalk using this configuration value, so it suits us to keep it the same, rather than
@@ -49,10 +55,12 @@ bitstream.change-freq = never
4955
#
5056
changelist.include-restricted = false
5157

58+
# site | all (site+community+collections) | top (find top community) | manual
59+
capabilitylists = site
5260
# URL to point users of the Capability List to in order to read more about the capabilities of the
5361
# repository. If left blank or omitted, no link will be provided in the Capability List
5462
#
55-
capabilitylist.described-by = ${dspace.baseUrl}/dspace-resourcesync/about.txt
63+
capabilitylist.described-by = ${resourcesync.baseUrl}/dspace-resourcesync/about.txt
5664

5765
# Should we generate a resourcedump when we initialise or rebase?
5866
#
@@ -63,4 +71,8 @@ capabilitylist.described-by = ${dspace.baseUrl}/dspace-resourcesync/about.txt
6371
# FIXME: at this point, resource dumps only describe a single zip file, later we should have configuration
6472
# that allows us to more closely manage the size of these files
6573
#
66-
resourcedump.enable = true
74+
resourcedump.enable = true
75+
resourcedump.onthefly = true
76+
changedump.onthefly = true
77+
resourcedump.onlymetadata = true
78+
usage-statistcs.track.download = true

manifest.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<sm:urlset xmlns:sm="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:rs="http://www.openarchives.org/rs/terms/">
3+
<rs:md capability="changedump-manifest" from="2018-05-11T16:16:11Z" />
4+
<rs:ln rel="up" href="http://petrucci.local.it:8082/dspace-resourcesync/123456789-11/capabilitylist.xml" />
5+
</sm:urlset>

pom.xml

Lines changed: 127 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,30 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0"
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5-
<modelVersion>4.0.0</modelVersion>
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
66

7-
<groupId>org.dspace</groupId>
8-
<artifactId>dspace-resourcesync</artifactId>
9-
<version>1.0-SNAPSHOT</version>
10-
<packaging>war</packaging>
7+
<groupId>org.dspace</groupId>
8+
<artifactId>dspace-resourcesync</artifactId>
9+
<version>1.1-SNAPSHOT</version>
10+
<packaging>war</packaging>
1111

12-
<build>
13-
<plugins>
14-
<plugin>
15-
<groupId>org.apache.maven.plugins</groupId>
16-
<artifactId>maven-compiler-plugin</artifactId>
17-
<version>3.1</version>
18-
<configuration>
19-
<source>1.6</source>
20-
<target>1.6</target>
21-
</configuration>
22-
</plugin>
12+
<properties>
13+
<dspace.version>5.9-SNAPSHOT</dspace.version>
14+
<root.basedir>${basedir}</root.basedir>
15+
</properties>
16+
17+
<build>
18+
<plugins>
19+
<plugin>
20+
<groupId>org.apache.maven.plugins</groupId>
21+
<artifactId>maven-compiler-plugin</artifactId>
22+
<version>3.1</version>
23+
<configuration>
24+
<source>1.8</source>
25+
<target>1.8</target>
26+
</configuration>
27+
</plugin>
2328
<plugin>
2429
<groupId>org.apache.maven.plugins</groupId>
2530
<artifactId>maven-war-plugin</artifactId>
@@ -44,33 +49,111 @@
4449
</execution>
4550
</executions>
4651
</plugin>
47-
</plugins>
48-
</build>
52+
<plugin>
53+
<groupId>com.mycila</groupId>
54+
<artifactId>license-maven-plugin</artifactId>
55+
<configuration>
56+
<!-- License header file (can be a URL, but that's less stable if external site is down on occasion) -->
57+
<header>${root.basedir}/LICENSE_HEADER</header>
58+
<!--Just check headers of everything in the /src directory -->
59+
<includes>
60+
<include>src/**</include>
61+
</includes>
62+
<!--Use all default exclusions for IDE files & Maven files, see:
63+
http://code.google.com/p/maven-license-plugin/wiki/Configuration#Default_excludes -->
64+
<useDefaultExcludes>true</useDefaultExcludes>
65+
<!-- Add some default DSpace exclusions not covered by <useDefaultExcludes>
66+
Individual Maven projects may choose to override these defaults. -->
67+
<excludes>
68+
<exclude>**/src/test/resources/**</exclude>
69+
<exclude>**/src/test/data/**</exclude>
70+
<exclude>**/src/main/license/**</exclude>
71+
<exclude>**/testEnvironment.properties</exclude>
72+
<exclude>**/META-INF/**</exclude>
73+
<exclude>**/robots.txt</exclude>
74+
<exclude>**/*.LICENSE</exclude>
75+
<exclude>**/LICENSE*</exclude>
76+
<exclude>**/README*</exclude>
77+
<exclude>**/readme*</exclude>
78+
<exclude>**/.gitignore</exclude>
79+
<exclude>**/build.properties*</exclude>
80+
<exclude>**/rebel.xml</exclude>
81+
</excludes>
82+
<mapping>
83+
<!-- Custom DSpace file extensions which are not recognized by maven-release-plugin:
84+
*.xmap, *.xslt, *.wsdd, *.wsdl, *.ttl, *.LICENSE -->
85+
<xmap>XML_STYLE</xmap>
86+
<xslt>XML_STYLE</xslt>
87+
<wsdd>XML_STYLE</wsdd>
88+
<wsdl>XML_STYLE</wsdl>
89+
<ttl>SCRIPT_STYLE</ttl>
90+
<LICENSE>TEXT</LICENSE>
91+
</mapping>
92+
<encoding>UTF-8</encoding>
93+
<!-- maven-license-plugin recommends a strict check (e.g. check spaces/tabs too) -->
94+
<strictCheck>true</strictCheck>
95+
</configuration>
96+
<executions>
97+
<execution>
98+
<id>check-headers</id>
99+
<phase>verify</phase>
100+
<goals>
101+
<goal>check</goal>
102+
</goals>
103+
</execution>
104+
</executions>
105+
</plugin>
106+
107+
<plugin>
108+
<groupId>org.apache.maven.plugins</groupId>
109+
<artifactId>maven-war-plugin</artifactId>
110+
<configuration>
111+
<attachClasses>true</attachClasses>
112+
<!-- In version 2.1-alpha-1, this was incorrectly named warSourceExcludes -->
113+
<!-- <packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes>
114+
<warSourceExcludes>WEB-INF/lib/*.jar</warSourceExcludes> -->
115+
<webResources>
116+
<resource>
117+
<filtering>true</filtering>
118+
<directory>${basedir}/src/main/webapp</directory>
119+
<includes>
120+
<include>WEB-INF/web.xml</include>
121+
</includes>
122+
</resource>
123+
</webResources>
124+
</configuration>
125+
<executions>
126+
<execution>
127+
<phase>prepare-package</phase>
128+
</execution>
129+
</executions>
130+
</plugin>
131+
</plugins>
132+
</build>
49133

50-
<dependencies>
51-
<dependency>
52-
<groupId>org.dspace</groupId>
53-
<artifactId>dspace-api</artifactId>
54-
<version>3.0</version>
55-
</dependency>
134+
<dependencies>
135+
<dependency>
136+
<groupId>org.dspace</groupId>
137+
<artifactId>dspace-api</artifactId>
138+
<version>${dspace.version}</version>
139+
</dependency>
140+
<dependency>
141+
<groupId>org.dspace</groupId>
142+
<artifactId>resourcesync</artifactId>
143+
<version>1.1-SNAPSHOT</version>
144+
</dependency>
56145

57-
<dependency>
58-
<groupId>org.openarchives</groupId>
59-
<artifactId>resourcesync</artifactId>
60-
<version>0.9-SNAPSHOT</version>
61-
</dependency>
146+
<dependency>
147+
<groupId>commons-cli</groupId>
148+
<artifactId>commons-cli</artifactId>
149+
<version>1.0</version>
150+
</dependency>
62151

63-
<dependency>
64-
<groupId>commons-cli</groupId>
65-
<artifactId>commons-cli</artifactId>
66-
<version>1.0</version>
67-
</dependency>
152+
<dependency>
153+
<groupId>javax.servlet</groupId>
154+
<artifactId>servlet-api</artifactId>
155+
<version>2.4</version>
156+
</dependency>
157+
</dependencies>
68158

69-
<dependency>
70-
<groupId>javax.servlet</groupId>
71-
<artifactId>servlet-api</artifactId>
72-
<version>2.4</version>
73-
</dependency>
74-
</dependencies>
75-
76-
</project>
159+
</project>

0 commit comments

Comments
 (0)