mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-11 03:53:07 +00:00
Compare commits
82 Commits
rest-tutor
...
dspace-4.3
Author | SHA1 | Date | |
---|---|---|---|
![]() |
3917c341f6 | ||
![]() |
d4c494f3ef | ||
![]() |
d47b37bcec | ||
![]() |
8ec62aa6a1 | ||
![]() |
9fd39f23a1 | ||
![]() |
6909d7e11e | ||
![]() |
f76481a521 | ||
![]() |
5e7aabec8a | ||
![]() |
d81e5d7078 | ||
![]() |
440cd3868d | ||
![]() |
7172f86038 | ||
![]() |
a15980b085 | ||
![]() |
05d92f593a | ||
![]() |
431b13d65d | ||
![]() |
c023cf3cc9 | ||
![]() |
1640ce1505 | ||
![]() |
d48fd500f4 | ||
![]() |
352f0d1bae | ||
![]() |
2f75666273 | ||
![]() |
69bdbac430 | ||
![]() |
b55ad8a53d | ||
![]() |
8fd038334e | ||
![]() |
f23efa460d | ||
![]() |
e7f6316bc6 | ||
![]() |
3ad061dbf4 | ||
![]() |
83cd5a19a7 | ||
![]() |
c8209642c0 | ||
![]() |
1f25e46714 | ||
![]() |
55ec14a0c7 | ||
![]() |
a7f453b55a | ||
![]() |
3b869eb465 | ||
![]() |
9eba21e188 | ||
![]() |
36d272ce75 | ||
![]() |
c7dacc226f | ||
![]() |
aa48136add | ||
![]() |
92c2e5e304 | ||
![]() |
62a8ee96a6 | ||
![]() |
5bf9584a65 | ||
![]() |
bd11bd6aa7 | ||
![]() |
ab45683d7a | ||
![]() |
e324c2745a | ||
![]() |
d8d3367483 | ||
![]() |
c71594f53e | ||
![]() |
7433eda1fc | ||
![]() |
2ca1828348 | ||
![]() |
83819fb986 | ||
![]() |
b2f1a98504 | ||
![]() |
61ceee3990 | ||
![]() |
ef1cb4ee0f | ||
![]() |
0cd0882c7c | ||
![]() |
a821384f82 | ||
![]() |
99adcad460 | ||
![]() |
64823636dd | ||
![]() |
093f0c77df | ||
![]() |
76913611ec | ||
![]() |
6d9fd03748 | ||
![]() |
d721abbadd | ||
![]() |
448853bc90 | ||
![]() |
f89cd7f85d | ||
![]() |
52cb291405 | ||
![]() |
004a8d8ffc | ||
![]() |
bb6f4fccb8 | ||
![]() |
be9af85d41 | ||
![]() |
413561ee34 | ||
![]() |
7737b8b7db | ||
![]() |
f8f0468f86 | ||
![]() |
05657285a2 | ||
![]() |
bf071dd936 | ||
![]() |
ae53e55150 | ||
![]() |
7832842e35 | ||
![]() |
de2e782553 | ||
![]() |
6871833bf3 | ||
![]() |
b91bff4fbd | ||
![]() |
b13bc58c47 | ||
![]() |
61255bfd24 | ||
![]() |
d1c5df9699 | ||
![]() |
7dcfdc39b6 | ||
![]() |
5dc4f40321 | ||
![]() |
e26c2e49e6 | ||
![]() |
c2bd2f03a0 | ||
![]() |
b6f0d0006b | ||
![]() |
046d96c44a |
24
.travis.yml
24
.travis.yml
@@ -1,2 +1,24 @@
|
|||||||
language: java
|
language: java
|
||||||
script: "mvn clean package license:check -Dmaven.test.skip=false"
|
|
||||||
|
env:
|
||||||
|
# Give Maven 1GB of memory to work with
|
||||||
|
- MAVEN_OPTS=-Xmx1024M
|
||||||
|
|
||||||
|
# Skip install stage, as we'll do it below
|
||||||
|
install: "echo 'Skipping install stage, dependencies will be downloaded during build and test stages.'"
|
||||||
|
|
||||||
|
# Two stage Build and Test
|
||||||
|
# 1. Install & Unit Test APIs
|
||||||
|
# 2. Assemble DSpace
|
||||||
|
script:
|
||||||
|
# 1. [Install & Unit Test] Check source code licenses and run source code Unit Tests
|
||||||
|
# (This explicitly skips building the 'dspace' assembly module, since we only want to do that ONCE.)
|
||||||
|
# license:check => Validate all source code license headers
|
||||||
|
# -Dmaven.test.skip=false => Enable DSpace Unit Tests
|
||||||
|
# -P !dspace => SKIP full DSpace assembly (will do below)
|
||||||
|
# -B => Maven batch/non-interactive mode (recommended for CI)
|
||||||
|
# -V => Display Maven version info before build
|
||||||
|
- "mvn clean install license:check -Dmaven.test.skip=false -P !dspace -B -V"
|
||||||
|
# 2. [Assemble DSpace] Ensure overlay & assembly process works (from [src]/dspace/)
|
||||||
|
# -P !assembly => SKIP the actual building of [src]/dspace/dspace-installer (as it can be memory intensive)
|
||||||
|
- "cd dspace && mvn package -P !assembly -B -V"
|
||||||
|
7
README
7
README
@@ -1,6 +1,9 @@
|
|||||||
Installation instructions are included in this release package under
|
Installation instructions may be found in DSpace-Manual.pdf, offered
|
||||||
|
with the source archives in the SourceForge project:
|
||||||
|
|
||||||
- dspace/docs/DSpace-Manual.pdf
|
http://sourceforge.net/projects/dspace/files/DSpace%20Stable/VERSION/
|
||||||
|
|
||||||
|
(Replace "VERSION" with the version you are installing, such as "4.0".)
|
||||||
|
|
||||||
DSpace version information can be viewed online at
|
DSpace version information can be viewed online at
|
||||||
- https://wiki.duraspace.org/display/DSDOC/
|
- https://wiki.duraspace.org/display/DSDOC/
|
||||||
|
@@ -12,7 +12,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.dspace</groupId>
|
<groupId>org.dspace</groupId>
|
||||||
<artifactId>dspace-parent</artifactId>
|
<artifactId>dspace-parent</artifactId>
|
||||||
<version>4.0</version>
|
<version>4.3</version>
|
||||||
<relativePath>..</relativePath>
|
<relativePath>..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
@@ -436,12 +436,12 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>gr.ekt.bte</groupId>
|
<groupId>gr.ekt.bte</groupId>
|
||||||
<artifactId>bte-core</artifactId>
|
<artifactId>bte-core</artifactId>
|
||||||
<version>0.9.3.3</version>
|
<version>0.9.2.4</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>gr.ekt.bte</groupId>
|
<groupId>gr.ekt.bte</groupId>
|
||||||
<artifactId>bte-io</artifactId>
|
<artifactId>bte-io</artifactId>
|
||||||
<version>0.9.3.3</version>
|
<version>0.9.2.4</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.httpcomponents</groupId>
|
<groupId>org.apache.httpcomponents</groupId>
|
||||||
@@ -463,6 +463,21 @@
|
|||||||
</exclusion>
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.solr</groupId>
|
||||||
|
<artifactId>solr-cell</artifactId>
|
||||||
|
<version>${solr.version}</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>jcl-over-slf4j</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>slf4j-api</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-configuration</groupId>
|
<groupId>commons-configuration</groupId>
|
||||||
<artifactId>commons-configuration</artifactId>
|
<artifactId>commons-configuration</artifactId>
|
||||||
|
@@ -7,6 +7,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.dspace.app.statistics;
|
package org.dspace.app.statistics;
|
||||||
|
|
||||||
|
import org.dspace.content.MetadataSchema;
|
||||||
import org.dspace.core.ConfigurationManager;
|
import org.dspace.core.ConfigurationManager;
|
||||||
import org.dspace.core.Context;
|
import org.dspace.core.Context;
|
||||||
import org.dspace.core.LogManager;
|
import org.dspace.core.LogManager;
|
||||||
@@ -153,10 +154,10 @@ public class LogAnalyser
|
|||||||
private static Pattern logRegex = null;
|
private static Pattern logRegex = null;
|
||||||
|
|
||||||
/** pattern to match commented out lines from the config file */
|
/** pattern to match commented out lines from the config file */
|
||||||
private static Pattern comment = Pattern.compile("^#");
|
private static final Pattern comment = Pattern.compile("^#");
|
||||||
|
|
||||||
/** pattern to match genuine lines from the config file */
|
/** pattern to match genuine lines from the config file */
|
||||||
private static Pattern real = Pattern.compile("^(.+)=(.+)");
|
private static final Pattern real = Pattern.compile("^(.+)=(.+)");
|
||||||
|
|
||||||
/** pattern to match all search types */
|
/** pattern to match all search types */
|
||||||
private static Pattern typeRX = null;
|
private static Pattern typeRX = null;
|
||||||
@@ -1165,8 +1166,12 @@ public class LogAnalyser
|
|||||||
"AND metadata_field_id = (" +
|
"AND metadata_field_id = (" +
|
||||||
" SELECT metadata_field_id " +
|
" SELECT metadata_field_id " +
|
||||||
" FROM metadatafieldregistry " +
|
" FROM metadatafieldregistry " +
|
||||||
" WHERE element = 'type' " +
|
" WHERE metadata_schema_id = (" +
|
||||||
" AND qualifier IS NULL) ";
|
" SELECT metadata_schema_id" +
|
||||||
|
" FROM MetadataSchemaRegistry" +
|
||||||
|
" WHERE short_id = '" + MetadataSchema.DC_SCHEMA + "')" +
|
||||||
|
" AND element = 'type' " +
|
||||||
|
" AND qualifier IS NULL) ";
|
||||||
}
|
}
|
||||||
|
|
||||||
// start the date constraint query buffer
|
// start the date constraint query buffer
|
||||||
@@ -1184,8 +1189,12 @@ public class LogAnalyser
|
|||||||
"WHERE metadata_field_id = (" +
|
"WHERE metadata_field_id = (" +
|
||||||
" SELECT metadata_field_id " +
|
" SELECT metadata_field_id " +
|
||||||
" FROM metadatafieldregistry " +
|
" FROM metadatafieldregistry " +
|
||||||
" WHERE element = 'date' " +
|
" WHERE metadata_schema_id = (" +
|
||||||
" AND qualifier = 'accessioned') ");
|
" SELECT metadata_schema_id" +
|
||||||
|
" FROM MetadataSchemaRegistry" +
|
||||||
|
" WHERE short_id = '" + MetadataSchema.DC_SCHEMA + "')" +
|
||||||
|
" AND element = 'date' " +
|
||||||
|
" AND qualifier = 'accessioned') ");
|
||||||
|
|
||||||
// Verifies that the metadata contains a valid date, otherwise the
|
// Verifies that the metadata contains a valid date, otherwise the
|
||||||
// postgres queries blow up when doing the ::timestamp cast.
|
// postgres queries blow up when doing the ::timestamp cast.
|
||||||
|
@@ -26,6 +26,7 @@ import java.util.Iterator;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
@@ -1094,6 +1095,22 @@ public class ShibAuthentication implements AuthenticationMethod
|
|||||||
value = request.getHeader(name.toLowerCase());
|
value = request.getHeader(name.toLowerCase());
|
||||||
if (StringUtils.isEmpty(value))
|
if (StringUtils.isEmpty(value))
|
||||||
value = request.getHeader(name.toUpperCase());
|
value = request.getHeader(name.toUpperCase());
|
||||||
|
|
||||||
|
boolean reconvertAttributes =
|
||||||
|
ConfigurationManager.getBooleanProperty(
|
||||||
|
"authentication-shibboleth",
|
||||||
|
"reconvert.attributes",
|
||||||
|
false);
|
||||||
|
|
||||||
|
if (!StringUtils.isEmpty(value) && reconvertAttributes)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
value = new String(value.getBytes("ISO-8859-1"), "UTF-8");
|
||||||
|
} catch (UnsupportedEncodingException ex) {
|
||||||
|
log.warn("Failed to reconvert shibboleth attribute ("
|
||||||
|
+ name + ").", ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
@@ -31,7 +31,8 @@ import org.dspace.utils.DSpace;
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Andrea Bollini (CILEA)
|
* @author Andrea Bollini (CILEA)
|
||||||
*
|
* @author Adán Román Ruiz at arvo.es (bugfix)
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
public class SolrBrowseDAO implements BrowseDAO
|
public class SolrBrowseDAO implements BrowseDAO
|
||||||
{
|
{
|
||||||
@@ -337,11 +338,11 @@ public class SolrBrowseDAO implements BrowseDAO
|
|||||||
query.addFilterQueries("search.resourcetype:" + Constants.ITEM);
|
query.addFilterQueries("search.resourcetype:" + Constants.ITEM);
|
||||||
if (isAscending)
|
if (isAscending)
|
||||||
{
|
{
|
||||||
query.setQuery("bi_"+column + "_sort" + ": [* TO \"" + value + "\"]");
|
query.setQuery("bi_"+column + "_sort" + ": [* TO \"" + value + "\"}");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
query.setQuery("bi_" + column + "_sort" + ": [\"" + value + "\" TO *]");
|
query.setQuery("bi_" + column + "_sort" + ": {\"" + value + "\" TO *]");
|
||||||
}
|
}
|
||||||
DiscoverResult resp = null;
|
DiscoverResult resp = null;
|
||||||
try
|
try
|
||||||
|
@@ -65,12 +65,16 @@ public class DailyReportEmailer
|
|||||||
public void sendReport(File attachment, int numberOfBitstreams)
|
public void sendReport(File attachment, int numberOfBitstreams)
|
||||||
throws IOException, javax.mail.MessagingException
|
throws IOException, javax.mail.MessagingException
|
||||||
{
|
{
|
||||||
Email email = new Email();
|
if(numberOfBitstreams > 0)
|
||||||
email.setSubject("Checksum checker Report - " + numberOfBitstreams + " Bitstreams found with POSSIBLE issues");
|
{
|
||||||
email.setContent("report is attached ...");
|
String hostname = ConfigurationManager.getProperty("dspace.hostname");
|
||||||
email.addAttachment(attachment, "checksum_checker_report.txt");
|
Email email = new Email();
|
||||||
email.addRecipient(ConfigurationManager.getProperty("mail.admin"));
|
email.setSubject("Checksum checker Report - " + numberOfBitstreams + " Bitstreams found with POSSIBLE issues on " + hostname);
|
||||||
email.send();
|
email.setContent("report is attached ...");
|
||||||
|
email.addAttachment(attachment, "checksum_checker_report.txt");
|
||||||
|
email.addRecipient(ConfigurationManager.getProperty("mail.admin"));
|
||||||
|
email.send();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -9,25 +9,107 @@ package org.dspace.content.dao;
|
|||||||
|
|
||||||
import org.dspace.core.Context;
|
import org.dspace.core.Context;
|
||||||
import org.dspace.content.Bitstream;
|
import org.dspace.content.Bitstream;
|
||||||
|
import org.dspace.storage.rdbms.DatabaseManager;
|
||||||
|
import org.dspace.storage.rdbms.TableRowIterator;
|
||||||
|
import org.dspace.storage.rdbms.TableRow;
|
||||||
|
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
|
|
||||||
public class ItemDAOOracle extends ItemDAO
|
public class ItemDAOOracle extends ItemDAO
|
||||||
{
|
{
|
||||||
|
private static final String selectPrimaryBitstreamID =
|
||||||
|
"SELECT bundle.primary_bitstream_id FROM item2bundle, bundle " +
|
||||||
|
"WHERE item2bundle.item_id=? AND item2bundle.bundle_id=bundle.bundle_id AND bundle.name=?";
|
||||||
|
|
||||||
|
private static final String selectFirstBitstreamID =
|
||||||
|
"SELECT bundle2bitstream.bitstream_id FROM item2bundle, bundle, bundle2bitstream " +
|
||||||
|
"WHERE item2bundle.item_id=? AND item2bundle.bundle_id=bundle.bundle_id AND bundle.name=? " +
|
||||||
|
"AND bundle.bundle_id=bundle2bitstream.bundle_id";
|
||||||
|
|
||||||
|
private static final String selectNamedBitstreamID =
|
||||||
|
"SELECT bitstream.bitstream_id FROM item2bundle, bundle, bundle2bitstream, bitstream " +
|
||||||
|
"WHERE item2bundle.item_id=? AND item2bundle.bundle_id=bundle.bundle_id AND bundle.name=? " +
|
||||||
|
"AND bundle.bundle_id=bundle2bitstream.bundle_id AND bundle2bitstream.bitstream_id=bitstream.bitstream_id " +
|
||||||
|
"AND bitstream.name=?";
|
||||||
|
|
||||||
ItemDAOOracle(Context ctx)
|
ItemDAOOracle(Context ctx)
|
||||||
{
|
{
|
||||||
super(ctx);
|
super(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Bitstream getPrimaryBitstream(int itemId, String bundleName) throws SQLException {
|
public Bitstream getPrimaryBitstream(int itemId, String bundleName) throws SQLException
|
||||||
return null; //To change body of implemented methods use File | Settings | File Templates.
|
{
|
||||||
|
TableRowIterator tri = null;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
tri = DatabaseManager.query(context, selectPrimaryBitstreamID, itemId, bundleName);
|
||||||
|
|
||||||
|
if (tri.hasNext())
|
||||||
|
{
|
||||||
|
TableRow row = tri.next();
|
||||||
|
int bid = row.getIntColumn("primary_bitstream_id");
|
||||||
|
return Bitstream.find(context, bid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
if (tri != null)
|
||||||
|
{
|
||||||
|
tri.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Bitstream getFirstBitstream(int itemId, String bundleName) throws SQLException {
|
public Bitstream getFirstBitstream(int itemId, String bundleName) throws SQLException
|
||||||
return null; //To change body of implemented methods use File | Settings | File Templates.
|
{
|
||||||
|
TableRowIterator tri = null;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
tri = DatabaseManager.query(context, selectFirstBitstreamID, itemId, bundleName);
|
||||||
|
if (tri.hasNext())
|
||||||
|
{
|
||||||
|
TableRow row = tri.next();
|
||||||
|
int bid = row.getIntColumn("bitstream_id");
|
||||||
|
return Bitstream.find(context, bid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
if (tri != null)
|
||||||
|
{
|
||||||
|
tri.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Bitstream getNamedBitstream(int itemId, String bundleName, String fileName) throws SQLException {
|
public Bitstream getNamedBitstream(int itemId, String bundleName, String fileName) throws SQLException
|
||||||
return null; //To change body of implemented methods use File | Settings | File Templates.
|
{
|
||||||
|
TableRowIterator tri = null;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
tri = DatabaseManager.query(context, selectNamedBitstreamID, itemId, bundleName, fileName);
|
||||||
|
if (tri.hasNext())
|
||||||
|
{
|
||||||
|
TableRow row = tri.next();
|
||||||
|
int bid = row.getIntColumn("bitstream_id");
|
||||||
|
return Bitstream.find(context, bid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
if (tri != null)
|
||||||
|
{
|
||||||
|
tri.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,73 @@
|
|||||||
|
/**
|
||||||
|
* The contents of this file are subject to the license and copyright
|
||||||
|
* detailed in the LICENSE and NOTICE files at the root of the source
|
||||||
|
* tree and available online at
|
||||||
|
*
|
||||||
|
* http://www.dspace.org/license/
|
||||||
|
*/
|
||||||
|
package org.dspace.discovery;
|
||||||
|
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
import org.apache.solr.common.util.ContentStreamBase;
|
||||||
|
import org.dspace.content.Bitstream;
|
||||||
|
|
||||||
|
import java.io.ByteArrayInputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Construct a <code>ContentStream</code> from a <code>File</code>
|
||||||
|
*/
|
||||||
|
public class BitstreamContentStream extends ContentStreamBase
|
||||||
|
{
|
||||||
|
private static final Logger log = Logger.getLogger(BitstreamContentStream.class);
|
||||||
|
private final Bitstream file;
|
||||||
|
|
||||||
|
public BitstreamContentStream( Bitstream f ) {
|
||||||
|
file = f;
|
||||||
|
|
||||||
|
contentType = f.getFormat().getMIMEType();
|
||||||
|
name = file.getName();
|
||||||
|
size = file.getSize();
|
||||||
|
sourceInfo = file.getName();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getContentType() {
|
||||||
|
if(contentType==null) {
|
||||||
|
InputStream stream = null;
|
||||||
|
try {
|
||||||
|
stream = file.retrieve();
|
||||||
|
char first = (char)stream.read();
|
||||||
|
if(first == '<') {
|
||||||
|
return "application/xml";
|
||||||
|
}
|
||||||
|
if(first == '{') {
|
||||||
|
return "application/json";
|
||||||
|
}
|
||||||
|
} catch(Exception ex) {
|
||||||
|
log.error("Error determining content type for bitstream:" + file.getID(), ex);
|
||||||
|
} finally {
|
||||||
|
if (stream != null) try {
|
||||||
|
stream.close();
|
||||||
|
} catch (IOException ioe) {
|
||||||
|
log.error("Error closing stream:" + file.getID(), ioe);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return contentType;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public InputStream getStream() throws IOException {
|
||||||
|
try {
|
||||||
|
return file.retrieve();
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.getMessage(),e);
|
||||||
|
return new ByteArrayInputStream(e.getMessage().getBytes(StandardCharsets.UTF_8));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@@ -66,6 +66,10 @@ public class IndexClient {
|
|||||||
"(re)build index, wiping out current one if it exists").create(
|
"(re)build index, wiping out current one if it exists").create(
|
||||||
"b"));
|
"b"));
|
||||||
|
|
||||||
|
options.addOption(OptionBuilder.isRequired(false).withDescription(
|
||||||
|
"Rebuild the spellchecker, can be combined with -b and -f.").create(
|
||||||
|
"s"));
|
||||||
|
|
||||||
options
|
options
|
||||||
.addOption(OptionBuilder
|
.addOption(OptionBuilder
|
||||||
.isRequired(false)
|
.isRequired(false)
|
||||||
@@ -111,15 +115,32 @@ public class IndexClient {
|
|||||||
} else if (line.hasOption("b")) {
|
} else if (line.hasOption("b")) {
|
||||||
log.info("(Re)building index from scratch.");
|
log.info("(Re)building index from scratch.");
|
||||||
indexer.createIndex(context);
|
indexer.createIndex(context);
|
||||||
|
checkRebuildSpellCheck(line, indexer);
|
||||||
} else if (line.hasOption("o")) {
|
} else if (line.hasOption("o")) {
|
||||||
log.info("Optimizing search core.");
|
log.info("Optimizing search core.");
|
||||||
indexer.optimize();
|
indexer.optimize();
|
||||||
|
} else if(line.hasOption('s')) {
|
||||||
|
checkRebuildSpellCheck(line, indexer);
|
||||||
} else {
|
} else {
|
||||||
log.info("Updating and Cleaning Index");
|
log.info("Updating and Cleaning Index");
|
||||||
indexer.cleanIndex(line.hasOption("f"));
|
indexer.cleanIndex(line.hasOption("f"));
|
||||||
indexer.updateIndex(context, line.hasOption("f"));
|
indexer.updateIndex(context, line.hasOption("f"));
|
||||||
|
checkRebuildSpellCheck(line, indexer);
|
||||||
}
|
}
|
||||||
|
|
||||||
log.info("Done with indexing");
|
log.info("Done with indexing");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check the command line options and rebuild the spell check if active.
|
||||||
|
* @param line the command line options
|
||||||
|
* @param indexer the solr indexer
|
||||||
|
* @throws SearchServiceException in case of a solr exception
|
||||||
|
*/
|
||||||
|
protected static void checkRebuildSpellCheck(CommandLine line, IndexingService indexer) throws SearchServiceException {
|
||||||
|
if (line.hasOption("s")) {
|
||||||
|
log.info("Rebuilding spell checker.");
|
||||||
|
indexer.buildSpellCheck();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -7,6 +7,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.dspace.discovery;
|
package org.dspace.discovery;
|
||||||
|
|
||||||
|
import org.apache.solr.client.solrj.SolrServerException;
|
||||||
import org.dspace.content.DSpaceObject;
|
import org.dspace.content.DSpaceObject;
|
||||||
import org.dspace.core.Context;
|
import org.dspace.core.Context;
|
||||||
|
|
||||||
@@ -58,4 +59,6 @@ public interface IndexingService {
|
|||||||
void commit() throws SearchServiceException;
|
void commit() throws SearchServiceException;
|
||||||
|
|
||||||
void optimize() throws SearchServiceException;
|
void optimize() throws SearchServiceException;
|
||||||
|
|
||||||
|
void buildSpellCheck() throws SearchServiceException;
|
||||||
}
|
}
|
||||||
|
@@ -7,12 +7,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.dspace.discovery;
|
package org.dspace.discovery;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.*;
|
||||||
import java.io.InputStream;
|
|
||||||
import java.io.InputStreamReader;
|
|
||||||
import java.io.PrintWriter;
|
|
||||||
import java.io.StringWriter;
|
|
||||||
import java.net.MalformedURLException;
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.net.URISyntaxException;
|
import java.net.URISyntaxException;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -31,7 +26,6 @@ import java.util.Locale;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
import java.util.TreeMap;
|
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
@@ -39,7 +33,6 @@ import org.apache.commons.collections.MapUtils;
|
|||||||
import org.apache.commons.collections.Transformer;
|
import org.apache.commons.collections.Transformer;
|
||||||
import org.apache.commons.httpclient.HttpClient;
|
import org.apache.commons.httpclient.HttpClient;
|
||||||
import org.apache.commons.httpclient.methods.GetMethod;
|
import org.apache.commons.httpclient.methods.GetMethod;
|
||||||
import org.apache.commons.io.IOUtils;
|
|
||||||
import org.apache.commons.lang.ArrayUtils;
|
import org.apache.commons.lang.ArrayUtils;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.commons.lang.time.DateFormatUtils;
|
import org.apache.commons.lang.time.DateFormatUtils;
|
||||||
@@ -53,6 +46,8 @@ import org.apache.log4j.Logger;
|
|||||||
import org.apache.solr.client.solrj.SolrQuery;
|
import org.apache.solr.client.solrj.SolrQuery;
|
||||||
import org.apache.solr.client.solrj.SolrServerException;
|
import org.apache.solr.client.solrj.SolrServerException;
|
||||||
import org.apache.solr.client.solrj.impl.HttpSolrServer;
|
import org.apache.solr.client.solrj.impl.HttpSolrServer;
|
||||||
|
import org.apache.solr.client.solrj.request.AbstractUpdateRequest;
|
||||||
|
import org.apache.solr.client.solrj.request.ContentStreamUpdateRequest;
|
||||||
import org.apache.solr.client.solrj.response.FacetField;
|
import org.apache.solr.client.solrj.response.FacetField;
|
||||||
import org.apache.solr.client.solrj.response.QueryResponse;
|
import org.apache.solr.client.solrj.response.QueryResponse;
|
||||||
import org.apache.solr.client.solrj.util.ClientUtils;
|
import org.apache.solr.client.solrj.util.ClientUtils;
|
||||||
@@ -61,6 +56,7 @@ import org.apache.solr.common.SolrDocumentList;
|
|||||||
import org.apache.solr.common.SolrInputDocument;
|
import org.apache.solr.common.SolrInputDocument;
|
||||||
import org.apache.solr.common.params.*;
|
import org.apache.solr.common.params.*;
|
||||||
import org.apache.solr.common.util.NamedList;
|
import org.apache.solr.common.util.NamedList;
|
||||||
|
import org.apache.solr.handler.extraction.ExtractingParams;
|
||||||
import org.dspace.content.Bitstream;
|
import org.dspace.content.Bitstream;
|
||||||
import org.dspace.content.Bundle;
|
import org.dspace.content.Bundle;
|
||||||
import org.dspace.content.Collection;
|
import org.dspace.content.Collection;
|
||||||
@@ -148,7 +144,7 @@ public class SolrServiceImpl implements SearchService, IndexingService {
|
|||||||
solr = new HttpSolrServer(solrService);
|
solr = new HttpSolrServer(solrService);
|
||||||
|
|
||||||
solr.setBaseURL(solrService);
|
solr.setBaseURL(solrService);
|
||||||
|
solr.setUseMultiPartPost(true);
|
||||||
SolrQuery solrQuery = new SolrQuery()
|
SolrQuery solrQuery = new SolrQuery()
|
||||||
.setQuery("search.resourcetype:2 AND search.resourceid:1");
|
.setQuery("search.resourcetype:2 AND search.resourceid:1");
|
||||||
|
|
||||||
@@ -504,11 +500,11 @@ public class SolrServiceImpl implements SearchService, IndexingService {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
long start = System.currentTimeMillis();
|
long start = System.currentTimeMillis();
|
||||||
System.out.println("SOLR Search Optimize -- Process Started:"+start);
|
System.out.println("SOLR Search Optimize -- Process Started:" + start);
|
||||||
getSolr().optimize();
|
getSolr().optimize();
|
||||||
long finish = System.currentTimeMillis();
|
long finish = System.currentTimeMillis();
|
||||||
System.out.println("SOLR Search Optimize -- Process Finished:"+finish);
|
System.out.println("SOLR Search Optimize -- Process Finished:" + finish);
|
||||||
System.out.println("SOLR Search Optimize -- Total time taken:"+(finish-start) + " (ms).");
|
System.out.println("SOLR Search Optimize -- Total time taken:" + (finish - start) + " (ms).");
|
||||||
} catch (SolrServerException sse)
|
} catch (SolrServerException sse)
|
||||||
{
|
{
|
||||||
System.err.println(sse.getMessage());
|
System.err.println(sse.getMessage());
|
||||||
@@ -518,6 +514,23 @@ public class SolrServiceImpl implements SearchService, IndexingService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void buildSpellCheck() throws SearchServiceException {
|
||||||
|
try {
|
||||||
|
if (getSolr() == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
SolrQuery solrQuery = new SolrQuery();
|
||||||
|
solrQuery.set("spellcheck", true);
|
||||||
|
solrQuery.set(SpellingParams.SPELLCHECK_BUILD, true);
|
||||||
|
getSolr().query(solrQuery);
|
||||||
|
}catch (SolrServerException e)
|
||||||
|
{
|
||||||
|
//Make sure to also log the exception since this command is usually run from a crontab.
|
||||||
|
log.error(e, e);
|
||||||
|
throw new SearchServiceException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// //////////////////////////////////
|
// //////////////////////////////////
|
||||||
// Private
|
// Private
|
||||||
// //////////////////////////////////
|
// //////////////////////////////////
|
||||||
@@ -666,15 +679,47 @@ public class SolrServiceImpl implements SearchService, IndexingService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Write the document to the index under the appropriate handle.
|
* Write the document to the index under the appropriate handle.
|
||||||
|
*
|
||||||
* @param doc the solr document to be written to the server
|
* @param doc the solr document to be written to the server
|
||||||
|
* @param streams
|
||||||
* @throws IOException IO exception
|
* @throws IOException IO exception
|
||||||
*/
|
*/
|
||||||
protected void writeDocument(SolrInputDocument doc) throws IOException {
|
protected void writeDocument(SolrInputDocument doc, List<BitstreamContentStream> streams) throws IOException {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if(getSolr() != null)
|
if(getSolr() != null)
|
||||||
{
|
{
|
||||||
getSolr().add(doc);
|
if(CollectionUtils.isNotEmpty(streams))
|
||||||
|
{
|
||||||
|
ContentStreamUpdateRequest req = new ContentStreamUpdateRequest("/update/extract");
|
||||||
|
|
||||||
|
for(BitstreamContentStream bce : streams)
|
||||||
|
{
|
||||||
|
req.addContentStream(bce);
|
||||||
|
}
|
||||||
|
|
||||||
|
ModifiableSolrParams params = new ModifiableSolrParams();
|
||||||
|
|
||||||
|
//req.setParam(ExtractingParams.EXTRACT_ONLY, "true");
|
||||||
|
for(String name : doc.getFieldNames())
|
||||||
|
{
|
||||||
|
for(Object val : doc.getFieldValues(name))
|
||||||
|
{
|
||||||
|
params.add(ExtractingParams.LITERALS_PREFIX + name,val.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
req.setParams(params);
|
||||||
|
req.setParam(ExtractingParams.UNKNOWN_FIELD_PREFIX, "attr_");
|
||||||
|
req.setParam(ExtractingParams.MAP_PREFIX + "content", "fulltext");
|
||||||
|
req.setParam(ExtractingParams.EXTRACT_FORMAT, "text");
|
||||||
|
req.setAction(AbstractUpdateRequest.ACTION.COMMIT, true, true);
|
||||||
|
req.process(getSolr());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
getSolr().add(doc);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (SolrServerException e)
|
} catch (SolrServerException e)
|
||||||
{
|
{
|
||||||
@@ -727,7 +772,7 @@ public class SolrServiceImpl implements SearchService, IndexingService {
|
|||||||
solrServiceIndexPlugin.additionalIndex(context, community, doc);
|
solrServiceIndexPlugin.additionalIndex(context, community, doc);
|
||||||
}
|
}
|
||||||
|
|
||||||
writeDocument(doc);
|
writeDocument(doc, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -783,7 +828,7 @@ public class SolrServiceImpl implements SearchService, IndexingService {
|
|||||||
solrServiceIndexPlugin.additionalIndex(context, collection, doc);
|
solrServiceIndexPlugin.additionalIndex(context, collection, doc);
|
||||||
}
|
}
|
||||||
|
|
||||||
writeDocument(doc);
|
writeDocument(doc, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1300,7 +1345,8 @@ public class SolrServiceImpl implements SearchService, IndexingService {
|
|||||||
log.debug(" Added Grouping");
|
log.debug(" Added Grouping");
|
||||||
|
|
||||||
|
|
||||||
Vector<InputStreamReader> readers = new Vector<InputStreamReader>();
|
|
||||||
|
List<BitstreamContentStream> streams = new ArrayList<BitstreamContentStream>();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// now get full text of any bitstreams in the TEXT bundle
|
// now get full text of any bitstreams in the TEXT bundle
|
||||||
@@ -1318,18 +1364,8 @@ public class SolrServiceImpl implements SearchService, IndexingService {
|
|||||||
for (Bitstream myBitstream : myBitstreams)
|
for (Bitstream myBitstream : myBitstreams)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
InputStreamReader is = new InputStreamReader(
|
|
||||||
myBitstream.retrieve()); // get input
|
|
||||||
readers.add(is);
|
|
||||||
|
|
||||||
// Add each InputStream to the Indexed Document
|
streams.add(new BitstreamContentStream(myBitstream));
|
||||||
String value = IOUtils.toString(is);
|
|
||||||
doc.addField("fulltext", value);
|
|
||||||
|
|
||||||
if(hitHighlightingFields.contains("*") || hitHighlightingFields.contains("fulltext"))
|
|
||||||
{
|
|
||||||
doc.addField("fulltext_hl", value);
|
|
||||||
}
|
|
||||||
|
|
||||||
log.debug(" Added BitStream: "
|
log.debug(" Added BitStream: "
|
||||||
+ myBitstream.getStoreNumber() + " "
|
+ myBitstream.getStoreNumber() + " "
|
||||||
@@ -1349,16 +1385,6 @@ public class SolrServiceImpl implements SearchService, IndexingService {
|
|||||||
{
|
{
|
||||||
log.error(e.getMessage(), e);
|
log.error(e.getMessage(), e);
|
||||||
}
|
}
|
||||||
finally {
|
|
||||||
Iterator<InputStreamReader> itr = readers.iterator();
|
|
||||||
while (itr.hasNext()) {
|
|
||||||
InputStreamReader reader = itr.next();
|
|
||||||
if (reader != null) {
|
|
||||||
reader.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
log.debug("closed " + readers.size() + " readers");
|
|
||||||
}
|
|
||||||
|
|
||||||
//Do any additional indexing, depends on the plugins
|
//Do any additional indexing, depends on the plugins
|
||||||
List<SolrServiceIndexPlugin> solrServiceIndexPlugins = new DSpace().getServiceManager().getServicesByType(SolrServiceIndexPlugin.class);
|
List<SolrServiceIndexPlugin> solrServiceIndexPlugins = new DSpace().getServiceManager().getServicesByType(SolrServiceIndexPlugin.class);
|
||||||
@@ -1369,7 +1395,7 @@ public class SolrServiceImpl implements SearchService, IndexingService {
|
|||||||
|
|
||||||
// write the index and close the inputstreamreaders
|
// write the index and close the inputstreamreaders
|
||||||
try {
|
try {
|
||||||
writeDocument(doc);
|
writeDocument(doc, streams);
|
||||||
log.info("Wrote Item: " + handle + " to Index");
|
log.info("Wrote Item: " + handle + " to Index");
|
||||||
} catch (RuntimeException e)
|
} catch (RuntimeException e)
|
||||||
{
|
{
|
||||||
|
@@ -29,6 +29,7 @@ import java.util.TimeZone;
|
|||||||
import javax.xml.parsers.ParserConfigurationException;
|
import javax.xml.parsers.ParserConfigurationException;
|
||||||
import javax.xml.transform.TransformerException;
|
import javax.xml.transform.TransformerException;
|
||||||
|
|
||||||
|
import ORG.oclc.oai.harvester2.verb.*;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.dspace.authorize.AuthorizeException;
|
import org.dspace.authorize.AuthorizeException;
|
||||||
@@ -64,12 +65,6 @@ import org.jdom.input.DOMBuilder;
|
|||||||
import org.jdom.output.XMLOutputter;
|
import org.jdom.output.XMLOutputter;
|
||||||
import org.xml.sax.SAXException;
|
import org.xml.sax.SAXException;
|
||||||
|
|
||||||
import ORG.oclc.oai.harvester2.verb.GetRecord;
|
|
||||||
import ORG.oclc.oai.harvester2.verb.Identify;
|
|
||||||
import ORG.oclc.oai.harvester2.verb.ListMetadataFormats;
|
|
||||||
import ORG.oclc.oai.harvester2.verb.ListRecords;
|
|
||||||
import ORG.oclc.oai.harvester2.verb.ListSets;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class handles OAI harvesting of externally located records into this repository.
|
* This class handles OAI harvesting of externally located records into this repository.
|
||||||
@@ -369,7 +364,13 @@ public class OAIHarvester {
|
|||||||
else {
|
else {
|
||||||
listRecords = new ListRecords(oaiSource, resumptionToken);
|
listRecords = new ListRecords(oaiSource, resumptionToken);
|
||||||
}
|
}
|
||||||
targetCollection.update();
|
ourContext.turnOffAuthorisationSystem();
|
||||||
|
try {
|
||||||
|
targetCollection.update();
|
||||||
|
} finally {
|
||||||
|
//In case of an exception, make sure to restore our authentication state to the previous state
|
||||||
|
ourContext.restoreAuthSystemState();
|
||||||
|
}
|
||||||
ourContext.commit();
|
ourContext.commit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -394,6 +395,7 @@ public class OAIHarvester {
|
|||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
harvestRow.update();
|
harvestRow.update();
|
||||||
|
ourContext.turnOffAuthorisationSystem();
|
||||||
targetCollection.update();
|
targetCollection.update();
|
||||||
ourContext.commit();
|
ourContext.commit();
|
||||||
ourContext.restoreAuthSystemState();
|
ourContext.restoreAuthSystemState();
|
||||||
@@ -954,29 +956,21 @@ public class OAIHarvester {
|
|||||||
try {
|
try {
|
||||||
//If we do not want to harvest from one set, then skip this.
|
//If we do not want to harvest from one set, then skip this.
|
||||||
if(!"all".equals(oaiSetId)){
|
if(!"all".equals(oaiSetId)){
|
||||||
ListSets ls = new ListSets(oaiSource);
|
ListIdentifiers ls = new ListIdentifiers(oaiSource, null, null, oaiSetId, DMDOAIPrefix);
|
||||||
|
|
||||||
// The only error we can really get here is "noSetHierarchy"
|
// The only error we can really get here is "noSetHierarchy"
|
||||||
if (ls.getErrors() != null && ls.getErrors().getLength() > 0) {
|
if (ls.getErrors() != null && ls.getErrors().getLength() > 0) {
|
||||||
for (int i=0; i<ls.getErrors().getLength(); i++) {
|
for (int i=0; i<ls.getErrors().getLength(); i++) {
|
||||||
String errorCode = ls.getErrors().item(i).getAttributes().getNamedItem("code").getTextContent();
|
String errorCode = ls.getErrors().item(i).getAttributes().getNamedItem("code").getTextContent();
|
||||||
errorSet.add(errorCode);
|
errorSet.add(OAI_SET_ERROR + ": The OAI server does not have a set with the specified setSpec (" + errorCode + ")");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Drilling down to /OAI-PMH/ListSets/set
|
// Drilling down to /OAI-PMH/ListSets/set
|
||||||
Document reply = db.build(ls.getDocument());
|
Document reply = db.build(ls.getDocument());
|
||||||
Element root = reply.getRootElement();
|
Element root = reply.getRootElement();
|
||||||
List<Element> sets= root.getChild("ListSets",OAI_NS).getChildren("set",OAI_NS);
|
//Check if we can find items, if so this indicates that we have children and our sets exist
|
||||||
|
foundSet = 0 < root.getChild("ListIdentifiers",OAI_NS).getChildren().size();
|
||||||
for (Element set : sets)
|
|
||||||
{
|
|
||||||
String setSpec = set.getChildText("setSpec", OAI_NS);
|
|
||||||
if (setSpec.equals(oaiSetId)) {
|
|
||||||
foundSet = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!foundSet) {
|
if (!foundSet) {
|
||||||
errorSet.add(OAI_SET_ERROR + ": The OAI server does not have a set with the specified setSpec");
|
errorSet.add(OAI_SET_ERROR + ": The OAI server does not have a set with the specified setSpec");
|
||||||
|
@@ -545,7 +545,7 @@ public class VersionedHandleIdentifierProvider extends IdentifierProvider {
|
|||||||
protected String getCanonical(Item item)
|
protected String getCanonical(Item item)
|
||||||
{
|
{
|
||||||
String canonical = item.getHandle();
|
String canonical = item.getHandle();
|
||||||
if( canonical.lastIndexOf(DOT)!=-1)
|
if( canonical.matches(".*/.*\\.\\d+") && canonical.lastIndexOf(DOT)!=-1)
|
||||||
{
|
{
|
||||||
canonical = canonical.substring(0, canonical.lastIndexOf(DOT));
|
canonical = canonical.substring(0, canonical.lastIndexOf(DOT));
|
||||||
}
|
}
|
||||||
@@ -556,7 +556,7 @@ public class VersionedHandleIdentifierProvider extends IdentifierProvider {
|
|||||||
protected String getCanonical(String identifier)
|
protected String getCanonical(String identifier)
|
||||||
{
|
{
|
||||||
String canonical = identifier;
|
String canonical = identifier;
|
||||||
if( canonical.lastIndexOf(DOT)!=-1)
|
if( canonical.matches(".*/.*\\.\\d+") && canonical.lastIndexOf(DOT)!=-1)
|
||||||
{
|
{
|
||||||
canonical = canonical.substring(0, canonical.lastIndexOf(DOT));
|
canonical = canonical.substring(0, canonical.lastIndexOf(DOT));
|
||||||
}
|
}
|
||||||
|
@@ -475,6 +475,9 @@ public class DSQuery
|
|||||||
lastModified = reader.getVersion();
|
lastModified = reader.getVersion();
|
||||||
searcher = new IndexSearcher(reader);
|
searcher = new IndexSearcher(reader);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
reader.close();
|
||||||
|
searchDir.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
return searcher;
|
return searcher;
|
||||||
|
@@ -7,7 +7,6 @@
|
|||||||
*/
|
*/
|
||||||
package org.dspace.statistics;
|
package org.dspace.statistics;
|
||||||
|
|
||||||
import au.com.bytecode.opencsv.CSVParser;
|
|
||||||
import au.com.bytecode.opencsv.CSVReader;
|
import au.com.bytecode.opencsv.CSVReader;
|
||||||
import au.com.bytecode.opencsv.CSVWriter;
|
import au.com.bytecode.opencsv.CSVWriter;
|
||||||
import com.maxmind.geoip.Location;
|
import com.maxmind.geoip.Location;
|
||||||
@@ -78,8 +77,6 @@ public class SolrLogger
|
|||||||
|
|
||||||
private static final LookupService locationService;
|
private static final LookupService locationService;
|
||||||
|
|
||||||
private static Map<String, String> metadataStorageInfo;
|
|
||||||
|
|
||||||
private static final boolean useProxies;
|
private static final boolean useProxies;
|
||||||
|
|
||||||
private static List<String> statisticYearCores = new ArrayList<String>();
|
private static List<String> statisticYearCores = new ArrayList<String>();
|
||||||
@@ -330,7 +327,10 @@ public class SolrLogger
|
|||||||
log.error("Failed DNS Lookup for IP:" + ip);
|
log.error("Failed DNS Lookup for IP:" + ip);
|
||||||
log.debug(e.getMessage(),e);
|
log.debug(e.getMessage(),e);
|
||||||
}
|
}
|
||||||
|
if(request.getHeader("User-Agent") != null)
|
||||||
|
{
|
||||||
|
doc1.addField("userAgent", request.getHeader("User-Agent"));
|
||||||
|
}
|
||||||
// Save the location information if valid, save the event without
|
// Save the location information if valid, save the event without
|
||||||
// location information if not valid
|
// location information if not valid
|
||||||
if(locationService != null)
|
if(locationService != null)
|
||||||
@@ -356,10 +356,7 @@ public class SolrLogger
|
|||||||
doc1.addField("longitude", location.longitude);
|
doc1.addField("longitude", location.longitude);
|
||||||
doc1.addField("isBot",isSpiderBot);
|
doc1.addField("isBot",isSpiderBot);
|
||||||
|
|
||||||
if(request.getHeader("User-Agent") != null)
|
|
||||||
{
|
|
||||||
doc1.addField("userAgent", request.getHeader("User-Agent"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -415,7 +412,10 @@ public class SolrLogger
|
|||||||
log.error("Failed DNS Lookup for IP:" + ip);
|
log.error("Failed DNS Lookup for IP:" + ip);
|
||||||
log.debug(e.getMessage(),e);
|
log.debug(e.getMessage(),e);
|
||||||
}
|
}
|
||||||
|
if(userAgent != null)
|
||||||
|
{
|
||||||
|
doc1.addField("userAgent", userAgent);
|
||||||
|
}
|
||||||
// Save the location information if valid, save the event without
|
// Save the location information if valid, save the event without
|
||||||
// location information if not valid
|
// location information if not valid
|
||||||
if(locationService != null)
|
if(locationService != null)
|
||||||
@@ -441,10 +441,7 @@ public class SolrLogger
|
|||||||
doc1.addField("longitude", location.longitude);
|
doc1.addField("longitude", location.longitude);
|
||||||
doc1.addField("isBot",isSpiderBot);
|
doc1.addField("isBot",isSpiderBot);
|
||||||
|
|
||||||
if(userAgent != null)
|
|
||||||
{
|
|
||||||
doc1.addField("userAgent", userAgent);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -563,11 +560,6 @@ public class SolrLogger
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Map<String, String> getMetadataStorageInfo()
|
|
||||||
{
|
|
||||||
return metadataStorageInfo;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method just used to log the parents.
|
* Method just used to log the parents.
|
||||||
* <ul>
|
* <ul>
|
||||||
@@ -676,18 +668,6 @@ public class SolrLogger
|
|||||||
|
|
||||||
// We have at least one document good
|
// We have at least one document good
|
||||||
SolrDocument document = response.getResults().get(0);
|
SolrDocument document = response.getResults().get(0);
|
||||||
for (Object storedField : metadataStorageInfo.keySet())
|
|
||||||
{
|
|
||||||
// For each of these fields that are stored we are to create a
|
|
||||||
// list of the values it holds now
|
|
||||||
java.util.Collection collection = document
|
|
||||||
.getFieldValues((String) storedField);
|
|
||||||
List<String> storedVals = new ArrayList<String>();
|
|
||||||
storedVals.addAll(collection);
|
|
||||||
// Now add it to our hashmap
|
|
||||||
currentValsStored.put((String) storedField, storedVals);
|
|
||||||
}
|
|
||||||
|
|
||||||
// System.out.println("HERE");
|
// System.out.println("HERE");
|
||||||
// Get the info we need
|
// Get the info we need
|
||||||
}
|
}
|
||||||
|
@@ -37,6 +37,7 @@ public class StatisticsLoggingConsumer implements Consumer
|
|||||||
|
|
||||||
private Set<String> toRemoveQueries = null;
|
private Set<String> toRemoveQueries = null;
|
||||||
|
|
||||||
|
@Override
|
||||||
public void initialize() throws Exception
|
public void initialize() throws Exception
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -45,6 +46,7 @@ public class StatisticsLoggingConsumer implements Consumer
|
|||||||
// TODO: checkout whether moving of collections, communities and bitstreams works
|
// TODO: checkout whether moving of collections, communities and bitstreams works
|
||||||
// TODO: use async threaded consumer as this might require some processing time
|
// TODO: use async threaded consumer as this might require some processing time
|
||||||
// TODO: we might be able to improve the performance: changing the collection will trigger 4 update commands
|
// TODO: we might be able to improve the performance: changing the collection will trigger 4 update commands
|
||||||
|
@Override
|
||||||
public void consume(Context ctx, Event event) throws Exception
|
public void consume(Context ctx, Event event) throws Exception
|
||||||
{
|
{
|
||||||
if (toRemoveQueries == null)
|
if (toRemoveQueries == null)
|
||||||
@@ -78,45 +80,9 @@ public class StatisticsLoggingConsumer implements Consumer
|
|||||||
updateQuery, null, null);
|
updateQuery, null, null);
|
||||||
|
|
||||||
// Get all the metadata
|
// Get all the metadata
|
||||||
Map<String, String> metadataStorageInfo = SolrLogger.getMetadataStorageInfo();
|
|
||||||
List<String> storageFieldList = new ArrayList<String>();
|
List<String> storageFieldList = new ArrayList<String>();
|
||||||
List<List<Object>> storageValuesList = new ArrayList<List<Object>>();
|
List<List<Object>> storageValuesList = new ArrayList<List<Object>>();
|
||||||
|
|
||||||
for (Map.Entry<String, String> entry : metadataStorageInfo.entrySet())
|
|
||||||
{
|
|
||||||
String[] metadataFieldInfo = entry.getValue().split("\\.");
|
|
||||||
|
|
||||||
List<Object> values = new ArrayList<Object>();
|
|
||||||
List<Object> valuesLow = new ArrayList<Object>();
|
|
||||||
for (int i = 0; i < item.getMetadata(metadataFieldInfo[0],
|
|
||||||
metadataFieldInfo[1], metadataFieldInfo[2], Item.ANY).length; i++)
|
|
||||||
{
|
|
||||||
values.add(item.getMetadata(metadataFieldInfo[0],
|
|
||||||
metadataFieldInfo[1], metadataFieldInfo[2],
|
|
||||||
Item.ANY)[i].value);
|
|
||||||
|
|
||||||
valuesLow.add(item.getMetadata(metadataFieldInfo[0],
|
|
||||||
metadataFieldInfo[1], metadataFieldInfo[2],
|
|
||||||
Item.ANY)[i].value.toLowerCase());
|
|
||||||
}
|
|
||||||
|
|
||||||
List<String> indexedVals = indexedValues.get(entry.getKey());
|
|
||||||
|
|
||||||
boolean update = true;
|
|
||||||
if (values.size() == indexedVals.size() && values.containsAll(indexedVals))
|
|
||||||
{
|
|
||||||
update = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (update)
|
|
||||||
{
|
|
||||||
storageFieldList.add(entry.getKey());
|
|
||||||
storageFieldList.add(entry.getKey() + "_search");
|
|
||||||
storageValuesList.add(values);
|
|
||||||
storageValuesList.add(valuesLow);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SolrLogger.update(updateQuery, "replace", storageFieldList,
|
SolrLogger.update(updateQuery, "replace", storageFieldList,
|
||||||
storageValuesList);
|
storageValuesList);
|
||||||
|
|
||||||
@@ -202,6 +168,7 @@ public class StatisticsLoggingConsumer implements Consumer
|
|||||||
findComms(comm.getParentCommunity(), parentComms);
|
findComms(comm.getParentCommunity(), parentComms);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void end(Context ctx) throws Exception
|
public void end(Context ctx) throws Exception
|
||||||
{
|
{
|
||||||
if (toRemoveQueries != null)
|
if (toRemoveQueries != null)
|
||||||
@@ -215,6 +182,7 @@ public class StatisticsLoggingConsumer implements Consumer
|
|||||||
toRemoveQueries = null;
|
toRemoveQueries = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void finish(Context ctx) throws Exception
|
public void finish(Context ctx) throws Exception
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@@ -33,10 +33,10 @@ import java.text.ParsePosition;
|
|||||||
* @author Stuart Lewis
|
* @author Stuart Lewis
|
||||||
*/
|
*/
|
||||||
public class ClassicDSpaceLogConverter {
|
public class ClassicDSpaceLogConverter {
|
||||||
private Logger log = Logger.getLogger(ClassicDSpaceLogConverter.class);
|
private final Logger log = Logger.getLogger(ClassicDSpaceLogConverter.class);
|
||||||
|
|
||||||
/** A DSpace context */
|
/** A DSpace context */
|
||||||
private Context context;
|
private final Context context;
|
||||||
|
|
||||||
/** Whether or not to provide verbose output */
|
/** Whether or not to provide verbose output */
|
||||||
private boolean verbose = false;
|
private boolean verbose = false;
|
||||||
@@ -45,19 +45,19 @@ public class ClassicDSpaceLogConverter {
|
|||||||
private boolean newEvents = false;
|
private boolean newEvents = false;
|
||||||
|
|
||||||
/** A regular expression for extracting the IP address from a log line */
|
/** A regular expression for extracting the IP address from a log line */
|
||||||
private Pattern ipaddrPattern = Pattern.compile("ip_addr=(\\d*\\.\\d*\\.\\d*\\.\\d*):");
|
private final Pattern ipaddrPattern = Pattern.compile("ip_addr=(\\d*\\.\\d*\\.\\d*\\.\\d*):");
|
||||||
|
|
||||||
/** Date format (in) from the log line */
|
/** Date format (in) from the log line */
|
||||||
private SimpleDateFormat dateFormatIn = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
private final SimpleDateFormat dateFormatIn = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
|
||||||
/** Date format out (for solr) */
|
/** Date format out (for solr) */
|
||||||
private SimpleDateFormat dateFormatOut = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
|
private final SimpleDateFormat dateFormatOut = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
|
||||||
|
|
||||||
/** Date format (in) from the log line for the UID */
|
/** Date format (in) from the log line for the UID */
|
||||||
private SimpleDateFormat dateFormatInUID = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss,SSS");
|
private final SimpleDateFormat dateFormatInUID = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss,SSS");
|
||||||
|
|
||||||
/** Date format out (for uid) */
|
/** Date format out (for uid) */
|
||||||
private SimpleDateFormat dateFormatOutUID = new SimpleDateFormat("yyyyMMddHHmmssSSS");
|
private final SimpleDateFormat dateFormatOutUID = new SimpleDateFormat("yyyyMMddHHmmssSSS");
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -349,24 +349,33 @@ public class ClassicDSpaceLogConverter {
|
|||||||
{
|
{
|
||||||
// Convert all the files
|
// Convert all the files
|
||||||
final File sample = new File(line.getOptionValue('i'));
|
final File sample = new File(line.getOptionValue('i'));
|
||||||
File dir = sample.getParentFile();
|
File dir = sample.getAbsoluteFile().getParentFile();
|
||||||
FilenameFilter filter = new FilenameFilter()
|
FilenameFilter filter = new FilenameFilter()
|
||||||
{
|
{
|
||||||
|
@Override
|
||||||
public boolean accept(File dir, String name)
|
public boolean accept(File dir, String name)
|
||||||
{
|
{
|
||||||
return name.startsWith(sample.getName());
|
return name.startsWith(sample.getName());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
String[] children = dir.list(filter);
|
String[] children = dir.list(filter);
|
||||||
for (String in : children)
|
if (null == children)
|
||||||
{
|
{
|
||||||
System.err.println(in);
|
System.err.println(sample + " could not be used to find a directory of log files.");
|
||||||
String out = line.getOptionValue('o') +
|
System.exit(1);
|
||||||
(dir.getAbsolutePath() +
|
|
||||||
System.getProperty("file.separator") + in).substring(line.getOptionValue('i').length());
|
|
||||||
|
|
||||||
converter.convert(dir.getAbsolutePath() + System.getProperty("file.separator") + in, out);
|
|
||||||
}
|
}
|
||||||
|
else if (children.length <= 0)
|
||||||
|
System.err.println(sample + " matched no files.");
|
||||||
|
else
|
||||||
|
for (String in : children)
|
||||||
|
{
|
||||||
|
System.err.println(in);
|
||||||
|
String out = line.getOptionValue('o') +
|
||||||
|
(dir.getAbsolutePath() +
|
||||||
|
System.getProperty("file.separator") + in).substring(line.getOptionValue('i').length());
|
||||||
|
|
||||||
|
converter.convert(dir.getAbsolutePath() + System.getProperty("file.separator") + in, out);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -205,7 +205,8 @@ public class SpiderDetector {
|
|||||||
|
|
||||||
for (Pattern candidate : agents)
|
for (Pattern candidate : agents)
|
||||||
{
|
{
|
||||||
if (candidate.matcher(agent).find())
|
// prevent matcher() invocation from a null Pattern object
|
||||||
|
if (null != candidate && candidate.matcher(agent).find())
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -236,7 +237,8 @@ public class SpiderDetector {
|
|||||||
|
|
||||||
for (Pattern candidate : domains)
|
for (Pattern candidate : domains)
|
||||||
{
|
{
|
||||||
if (candidate.matcher(hostname).find())
|
// prevent matcher() invocation from a null Pattern object
|
||||||
|
if (null != candidate && candidate.matcher(hostname).find())
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@@ -16,13 +16,10 @@ import org.dspace.core.Constants;
|
|||||||
import org.dspace.core.ConfigurationManager;
|
import org.dspace.core.ConfigurationManager;
|
||||||
import org.dspace.content.DSpaceObject;
|
import org.dspace.content.DSpaceObject;
|
||||||
import org.dspace.content.Bitstream;
|
import org.dspace.content.Bitstream;
|
||||||
import org.dspace.content.DCValue;
|
|
||||||
import org.dspace.content.Item;
|
|
||||||
import org.dspace.eperson.EPerson;
|
import org.dspace.eperson.EPerson;
|
||||||
import org.dspace.statistics.SolrLogger;
|
import org.dspace.statistics.SolrLogger;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Map;
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
|
|
||||||
import com.maxmind.geoip.LookupService;
|
import com.maxmind.geoip.LookupService;
|
||||||
@@ -196,8 +193,6 @@ public class StatisticsDataGenerator {
|
|||||||
solr.deleteByQuery("*:*");
|
solr.deleteByQuery("*:*");
|
||||||
solr.commit();
|
solr.commit();
|
||||||
|
|
||||||
Map<String, String> metadataStorageInfo = SolrLogger.getMetadataStorageInfo();
|
|
||||||
|
|
||||||
String prevIp = null;
|
String prevIp = null;
|
||||||
String dbfile = ConfigurationManager.getProperty("usage-statistics", "dbfile");
|
String dbfile = ConfigurationManager.getProperty("usage-statistics", "dbfile");
|
||||||
LookupService cl = new LookupService(dbfile,
|
LookupService cl = new LookupService(dbfile,
|
||||||
@@ -366,24 +361,6 @@ public class StatisticsDataGenerator {
|
|||||||
doc1.addField("dns", dns.toLowerCase());
|
doc1.addField("dns", dns.toLowerCase());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dso instanceof Item) {
|
|
||||||
Item item = (Item) dso;
|
|
||||||
// Store the metadata
|
|
||||||
for (Map.Entry<String, String> entry : metadataStorageInfo.entrySet())
|
|
||||||
{
|
|
||||||
String dcField = entry.getValue();
|
|
||||||
|
|
||||||
DCValue[] vals = item.getMetadata(dcField.split("\\.")[0],
|
|
||||||
dcField.split("\\.")[1], dcField.split("\\.")[2],
|
|
||||||
Item.ANY);
|
|
||||||
for (DCValue val1 : vals) {
|
|
||||||
String val = val1.value;
|
|
||||||
doc1.addField(entry.getKey(), val);
|
|
||||||
doc1.addField(entry.getKey() + "_search", val.toLowerCase());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SolrLogger.storeParents(doc1, dso);
|
SolrLogger.storeParents(doc1, dso);
|
||||||
|
|
||||||
solr.add(doc1);
|
solr.add(doc1);
|
||||||
|
@@ -29,7 +29,7 @@ import com.maxmind.geoip.LookupService;
|
|||||||
import com.maxmind.geoip.Location;
|
import com.maxmind.geoip.Location;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class to load intermediate statistics files (produced from log files by <code>ClassicDSpaceLogConverter</code>) into Solr
|
* Class to load intermediate statistics files (produced from log files by {@link ClassicDSpaceLogConverter}) into Solr.
|
||||||
*
|
*
|
||||||
* @see ClassicDSpaceLogConverter
|
* @see ClassicDSpaceLogConverter
|
||||||
*
|
*
|
||||||
@@ -40,7 +40,7 @@ public class StatisticsImporter
|
|||||||
private static final Logger log = Logger.getLogger(StatisticsImporter.class);
|
private static final Logger log = Logger.getLogger(StatisticsImporter.class);
|
||||||
|
|
||||||
/** Date format (for solr) */
|
/** Date format (for solr) */
|
||||||
private static SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
|
private static final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
|
||||||
|
|
||||||
/** Solr server connection */
|
/** Solr server connection */
|
||||||
private static HttpSolrServer solr;
|
private static HttpSolrServer solr;
|
||||||
@@ -48,9 +48,6 @@ public class StatisticsImporter
|
|||||||
/** GEOIP lookup service */
|
/** GEOIP lookup service */
|
||||||
private static LookupService geoipLookup;
|
private static LookupService geoipLookup;
|
||||||
|
|
||||||
/** Metadata storage information */
|
|
||||||
private static Map<String, String> metadataStorageInfo;
|
|
||||||
|
|
||||||
/** Whether to skip the DNS reverse lookup or not */
|
/** Whether to skip the DNS reverse lookup or not */
|
||||||
private static boolean skipReverseDNS = false;
|
private static boolean skipReverseDNS = false;
|
||||||
|
|
||||||
@@ -67,7 +64,7 @@ public class StatisticsImporter
|
|||||||
private List<Integer> localBitstreams;
|
private List<Integer> localBitstreams;
|
||||||
|
|
||||||
/** Whether or not to replace item IDs with local values (for testing) */
|
/** Whether or not to replace item IDs with local values (for testing) */
|
||||||
private boolean useLocal;
|
private final boolean useLocal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor. Optionally loads local data to replace foreign data
|
* Constructor. Optionally loads local data to replace foreign data
|
||||||
@@ -339,24 +336,6 @@ public class StatisticsImporter
|
|||||||
sid.addField("dns", dns.toLowerCase());
|
sid.addField("dns", dns.toLowerCase());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dso instanceof Item) {
|
|
||||||
Item item = (Item) dso;
|
|
||||||
// Store the metadata
|
|
||||||
for (String storedField : metadataStorageInfo.keySet()) {
|
|
||||||
String dcField = metadataStorageInfo.get(storedField);
|
|
||||||
|
|
||||||
DCValue[] vals = item.getMetadata(dcField.split("\\.")[0],
|
|
||||||
dcField.split("\\.")[1], dcField.split("\\.")[2],
|
|
||||||
Item.ANY);
|
|
||||||
for (DCValue val1 : vals) {
|
|
||||||
String val = val1.value;
|
|
||||||
sid.addField(String.valueOf(storedField), val);
|
|
||||||
sid.addField(String.valueOf(storedField + "_search"),
|
|
||||||
val.toLowerCase());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SolrLogger.storeParents(sid, dso);
|
SolrLogger.storeParents(sid, dso);
|
||||||
solr.add(sid);
|
solr.add(sid);
|
||||||
errors--;
|
errors--;
|
||||||
@@ -471,7 +450,6 @@ public class StatisticsImporter
|
|||||||
}
|
}
|
||||||
solr = new HttpSolrServer(sserver);
|
solr = new HttpSolrServer(sserver);
|
||||||
|
|
||||||
metadataStorageInfo = SolrLogger.getMetadataStorageInfo();
|
|
||||||
String dbfile = ConfigurationManager.getProperty("usage-statistics", "dbfile");
|
String dbfile = ConfigurationManager.getProperty("usage-statistics", "dbfile");
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -495,6 +473,7 @@ public class StatisticsImporter
|
|||||||
File dir = sample.getParentFile();
|
File dir = sample.getParentFile();
|
||||||
FilenameFilter filter = new FilenameFilter()
|
FilenameFilter filter = new FilenameFilter()
|
||||||
{
|
{
|
||||||
|
@Override
|
||||||
public boolean accept(File dir, String name)
|
public boolean accept(File dir, String name)
|
||||||
{
|
{
|
||||||
return name.startsWith(sample.getName());
|
return name.startsWith(sample.getName());
|
||||||
@@ -522,7 +501,7 @@ public class StatisticsImporter
|
|||||||
*/
|
*/
|
||||||
static class DNSCache<K,V> extends LinkedHashMap<K,V>
|
static class DNSCache<K,V> extends LinkedHashMap<K,V>
|
||||||
{
|
{
|
||||||
private int maxCapacity;
|
private final int maxCapacity;
|
||||||
|
|
||||||
public DNSCache(int initialCapacity, float loadFactor, int maxCapacity)
|
public DNSCache(int initialCapacity, float loadFactor, int maxCapacity)
|
||||||
{
|
{
|
||||||
|
@@ -112,11 +112,15 @@ public class MetadataSchemaTest extends AbstractUnitTest
|
|||||||
@Test
|
@Test
|
||||||
public void testSetName()
|
public void testSetName()
|
||||||
{
|
{
|
||||||
|
String oldname = ms.getName();
|
||||||
String name = "new name";
|
String name = "new name";
|
||||||
ms.setName(name);
|
ms.setName(name);
|
||||||
assertThat("testSetName 0",ms.getName(),notNullValue());
|
assertThat("testSetName 0",ms.getName(),notNullValue());
|
||||||
assertThat("testSetName 1",ms.getName(),not(equalTo("")));
|
assertThat("testSetName 1",ms.getName(),not(equalTo("")));
|
||||||
assertThat("testSetName 2",ms.getName(),equalTo(name));
|
assertThat("testSetName 2",ms.getName(),equalTo(name));
|
||||||
|
|
||||||
|
//we restore the old name to avoid issues in other tests
|
||||||
|
ms.setName(oldname);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -392,4 +396,4 @@ public class MetadataSchemaTest extends AbstractUnitTest
|
|||||||
assertThat("testFind_Context_String 4",found, nullValue());
|
assertThat("testFind_Context_String 4",found, nullValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.dspace</groupId>
|
<groupId>org.dspace</groupId>
|
||||||
<artifactId>dspace-parent</artifactId>
|
<artifactId>dspace-parent</artifactId>
|
||||||
<version>4.0</version>
|
<version>4.3</version>
|
||||||
<relativePath>..</relativePath>
|
<relativePath>..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
@@ -14,6 +14,7 @@ import javax.servlet.ServletException;
|
|||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.dspace.app.webui.util.UIUtil;
|
import org.dspace.app.webui.util.UIUtil;
|
||||||
import org.dspace.authorize.AuthorizeException;
|
import org.dspace.authorize.AuthorizeException;
|
||||||
@@ -30,6 +31,7 @@ import org.dspace.content.Community;
|
|||||||
import org.dspace.core.ConfigurationManager;
|
import org.dspace.core.ConfigurationManager;
|
||||||
import org.dspace.core.Context;
|
import org.dspace.core.Context;
|
||||||
import org.dspace.core.LogManager;
|
import org.dspace.core.LogManager;
|
||||||
|
import org.dspace.core.Utils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Servlet for browsing through indices, as they are defined in
|
* Servlet for browsing through indices, as they are defined in
|
||||||
@@ -86,6 +88,25 @@ public abstract class AbstractBrowserServlet extends DSpaceServlet
|
|||||||
String month = request.getParameter("month");
|
String month = request.getParameter("month");
|
||||||
String year = request.getParameter("year");
|
String year = request.getParameter("year");
|
||||||
String startsWith = request.getParameter("starts_with");
|
String startsWith = request.getParameter("starts_with");
|
||||||
|
//validate input to avoid cross-site scripting
|
||||||
|
try {
|
||||||
|
if (StringUtils.isNotBlank(month) && !"-1".equals(month)) {
|
||||||
|
Integer.valueOf(month);
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(year) && !"-1".equals(year)) {
|
||||||
|
Integer.valueOf(year);
|
||||||
|
}
|
||||||
|
if(StringUtils.isNotBlank(startsWith)) {
|
||||||
|
startsWith = Utils.addEntities(startsWith);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch(Exception ex) {
|
||||||
|
log.warn("We were unable to parse the browse request: maybe a cross-site scripting attach?");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String valueFocus = request.getParameter("vfocus");
|
String valueFocus = request.getParameter("vfocus");
|
||||||
String valueFocusLang = request.getParameter("vfocus_lang");
|
String valueFocusLang = request.getParameter("vfocus_lang");
|
||||||
String authority = request.getParameter("authority");
|
String authority = request.getParameter("authority");
|
||||||
@@ -108,7 +129,7 @@ public abstract class AbstractBrowserServlet extends DSpaceServlet
|
|||||||
|
|
||||||
// process the input, performing some inline validation
|
// process the input, performing some inline validation
|
||||||
BrowseIndex bi = null;
|
BrowseIndex bi = null;
|
||||||
if (type != null && !"".equals(type))
|
if (StringUtils.isNotEmpty(type))
|
||||||
{
|
{
|
||||||
bi = BrowseIndex.getBrowseIndex(type);
|
bi = BrowseIndex.getBrowseIndex(type);
|
||||||
}
|
}
|
||||||
|
@@ -65,7 +65,7 @@ public class BrowserServlet extends AbstractBrowserServlet
|
|||||||
// all browse requests currently come to GET.
|
// all browse requests currently come to GET.
|
||||||
BrowserScope scope = getBrowserScopeForRequest(context, request, response);
|
BrowserScope scope = getBrowserScopeForRequest(context, request, response);
|
||||||
|
|
||||||
if (scope.getBrowseIndex() == null)
|
if (scope == null || scope.getBrowseIndex() == null)
|
||||||
{
|
{
|
||||||
throw new ServletException("There is no browse index for the request");
|
throw new ServletException("There is no browse index for the request");
|
||||||
}
|
}
|
||||||
|
@@ -11,6 +11,7 @@ import java.io.IOException;
|
|||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.locks.*;
|
||||||
|
|
||||||
import javax.servlet.ServletException;
|
import javax.servlet.ServletException;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
@@ -33,46 +34,71 @@ import org.dspace.core.LogManager;
|
|||||||
*/
|
*/
|
||||||
public class CommunityListServlet extends DSpaceServlet
|
public class CommunityListServlet extends DSpaceServlet
|
||||||
{
|
{
|
||||||
|
|
||||||
|
// This will map community IDs to arrays of collections
|
||||||
|
private Map<Integer, Collection[]> colMap;
|
||||||
|
|
||||||
|
// This will map communityIDs to arrays of sub-communities
|
||||||
|
private Map<Integer, Community[]> commMap;
|
||||||
|
private static final Object staticLock = new Object();
|
||||||
|
|
||||||
/** log4j category */
|
/** log4j category */
|
||||||
private static Logger log = Logger.getLogger(CommunityListServlet.class);
|
private static Logger log = Logger.getLogger(CommunityListServlet.class);
|
||||||
|
|
||||||
protected void doDSGet(Context context, HttpServletRequest request,
|
protected void doDSGet(Context context, HttpServletRequest request,
|
||||||
HttpServletResponse response) throws ServletException, IOException,
|
HttpServletResponse response) throws ServletException, IOException,
|
||||||
SQLException, AuthorizeException
|
SQLException, AuthorizeException
|
||||||
{
|
{
|
||||||
log.info(LogManager.getHeader(context, "view_community_list", ""));
|
synchronized (staticLock)
|
||||||
|
{
|
||||||
|
colMap = new HashMap<Integer, Collection[]>();
|
||||||
|
commMap = new HashMap<Integer, Community[]>();
|
||||||
|
|
||||||
// This will map community IDs to arrays of collections
|
log.info(LogManager.getHeader(context, "view_community_list", ""));
|
||||||
Map<Integer, Collection[]> colMap = new HashMap<Integer, Collection[]>();
|
|
||||||
|
|
||||||
// This will map communityIDs to arrays of sub-communities
|
Community[] communities = Community.findAllTop(context);
|
||||||
Map<Integer, Community[]> commMap = new HashMap<Integer, Community[]>();
|
|
||||||
|
|
||||||
Community[] communities = Community.findAllTop(context);
|
for (int com = 0; com < communities.length; com++)
|
||||||
|
{
|
||||||
|
build(communities[com]);
|
||||||
|
}
|
||||||
|
|
||||||
for (int com = 0; com < communities.length; com++)
|
// can they admin communities?
|
||||||
|
if (AuthorizeManager.isAdmin(context))
|
||||||
|
{
|
||||||
|
// set a variable to create an edit button
|
||||||
|
request.setAttribute("admin_button", Boolean.TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
request.setAttribute("communities", communities);
|
||||||
|
request.setAttribute("collections.map", colMap);
|
||||||
|
request.setAttribute("subcommunities.map", commMap);
|
||||||
|
JSPManager.showJSP(request, response, "/community-list.jsp");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* Get all subcommunities and collections from a community
|
||||||
|
*/
|
||||||
|
private void build(Community c) throws SQLException {
|
||||||
|
|
||||||
|
Integer comID = Integer.valueOf(c.getID());
|
||||||
|
|
||||||
|
// Find collections in community
|
||||||
|
Collection[] colls = c.getCollections();
|
||||||
|
colMap.put(comID, colls);
|
||||||
|
|
||||||
|
// Find subcommunties in community
|
||||||
|
Community[] comms = c.getSubcommunities();
|
||||||
|
|
||||||
|
// Get all subcommunities for each communities if they have some
|
||||||
|
if (comms.length > 0)
|
||||||
{
|
{
|
||||||
Integer comID = Integer.valueOf(communities[com].getID());
|
|
||||||
|
|
||||||
// Find collections in community
|
|
||||||
Collection[] colls = communities[com].getCollections();
|
|
||||||
colMap.put(comID, colls);
|
|
||||||
|
|
||||||
// Find subcommunties in community
|
|
||||||
Community[] comms = communities[com].getSubcommunities();
|
|
||||||
commMap.put(comID, comms);
|
commMap.put(comID, comms);
|
||||||
|
|
||||||
|
for (int sub = 0; sub < comms.length; sub++) {
|
||||||
|
|
||||||
|
build(comms[sub]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// can they admin communities?
|
|
||||||
if (AuthorizeManager.isAdmin(context))
|
|
||||||
{
|
|
||||||
// set a variable to create an edit button
|
|
||||||
request.setAttribute("admin_button", Boolean.TRUE);
|
|
||||||
}
|
|
||||||
|
|
||||||
request.setAttribute("communities", communities);
|
|
||||||
request.setAttribute("collections.map", colMap);
|
|
||||||
request.setAttribute("subcommunities.map", commMap);
|
|
||||||
JSPManager.showJSP(request, response, "/community-list.jsp");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -19,6 +19,7 @@ import javax.servlet.http.HttpServletRequest;
|
|||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.apache.commons.lang.StringEscapeUtils;
|
import org.apache.commons.lang.StringEscapeUtils;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.dspace.app.util.GoogleMetadata;
|
import org.dspace.app.util.GoogleMetadata;
|
||||||
import org.dspace.app.webui.util.Authenticate;
|
import org.dspace.app.webui.util.Authenticate;
|
||||||
@@ -129,8 +130,7 @@ public class HandleServlet extends DSpaceServlet
|
|||||||
|
|
||||||
if (dso == null)
|
if (dso == null)
|
||||||
{
|
{
|
||||||
log.info(LogManager
|
log.info(LogManager.getHeader(context, "invalid_id", "path=" + path));
|
||||||
.getHeader(context, "invalid_id", "path=" + path));
|
|
||||||
JSPManager.showInvalidIDError(request, response, StringEscapeUtils.escapeHtml(path), -1);
|
JSPManager.showInvalidIDError(request, response, StringEscapeUtils.escapeHtml(path), -1);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -152,8 +152,28 @@ public class HandleServlet extends DSpaceServlet
|
|||||||
// and firing a usage event for the DSO we're reporting for
|
// and firing a usage event for the DSO we're reporting for
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
} else if ("/display-statistics.jsp".equals(extraPathInfo))
|
||||||
|
{
|
||||||
|
request.getRequestDispatcher(extraPathInfo).forward(request, response);
|
||||||
|
// If we don't return here, we keep processing and end up
|
||||||
|
// throwing a NPE when checking community authorization
|
||||||
|
// and firing a usage event for the DSO we're reporting for
|
||||||
|
return;
|
||||||
|
} else if ("/browse".equals((extraPathInfo)) || StringUtils.startsWith(extraPathInfo, "/browse?")) {
|
||||||
|
request.getRequestDispatcher(extraPathInfo).forward(request, response);
|
||||||
|
// If we don't return here, we keep processing and end up
|
||||||
|
// throwing a NPE when checking community authorization
|
||||||
|
// and firing a usage event for the DSO we're reporting for
|
||||||
|
return;
|
||||||
|
} else if ("/simple-search".equals(extraPathInfo) || StringUtils.startsWith(extraPathInfo, "simple-search?")) {
|
||||||
|
request.getRequestDispatcher(extraPathInfo).forward(request, response);
|
||||||
|
// If we don't return here, we keep processing and end up
|
||||||
|
// throwing a NPE when checking community authorization
|
||||||
|
// and firing a usage event for the DSO we're reporting for
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// OK, we have a valid Handle. What is it?
|
// OK, we have a valid Handle. What is it?
|
||||||
if (dso.getType() == Constants.ITEM)
|
if (dso.getType() == Constants.ITEM)
|
||||||
{
|
{
|
||||||
@@ -195,9 +215,9 @@ public class HandleServlet extends DSpaceServlet
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Forward to another servlet
|
log.debug("Found Item with extraPathInfo => Error.");
|
||||||
request.getRequestDispatcher(extraPathInfo).forward(request,
|
JSPManager.showInvalidIDError(request, response, StringEscapeUtils.escapeHtml(path), -1);
|
||||||
response);
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -231,9 +251,9 @@ public class HandleServlet extends DSpaceServlet
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Forward to another servlet
|
log.debug("Found Collection with extraPathInfo => Error.");
|
||||||
request.getRequestDispatcher(extraPathInfo).forward(request,
|
JSPManager.showInvalidIDError(request, response, StringEscapeUtils.escapeHtml(path), -1);
|
||||||
response);
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (dso.getType() == Constants.COMMUNITY)
|
else if (dso.getType() == Constants.COMMUNITY)
|
||||||
@@ -255,9 +275,9 @@ public class HandleServlet extends DSpaceServlet
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Forward to another servlet
|
log.debug("Found Community with extraPathInfo => Error.");
|
||||||
request.getRequestDispatcher(extraPathInfo).forward(request,
|
JSPManager.showInvalidIDError(request, response, StringEscapeUtils.escapeHtml(path), -1);
|
||||||
response);
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -38,6 +38,7 @@
|
|||||||
<%@ page import="org.dspace.content.*"%>
|
<%@ page import="org.dspace.content.*"%>
|
||||||
<%@ page import="org.dspace.core.ConfigurationManager"%>
|
<%@ page import="org.dspace.core.ConfigurationManager"%>
|
||||||
<%@ page import="org.dspace.core.Context" %>
|
<%@ page import="org.dspace.core.Context" %>
|
||||||
|
<%@ page import="org.dspace.core.Utils" %>
|
||||||
<%@ page import="org.dspace.eperson.Group" %>
|
<%@ page import="org.dspace.eperson.Group" %>
|
||||||
<%@ page import="javax.servlet.jsp.jstl.fmt.LocaleSupport" %>
|
<%@ page import="javax.servlet.jsp.jstl.fmt.LocaleSupport" %>
|
||||||
<%@ page import="java.net.URLEncoder" %>
|
<%@ page import="java.net.URLEncoder" %>
|
||||||
@@ -374,7 +375,7 @@
|
|||||||
{
|
{
|
||||||
if (dcv.length > 0)
|
if (dcv.length > 0)
|
||||||
{
|
{
|
||||||
displayTitle = dcv[0].value;
|
displayTitle = Utils.addEntities(dcv[0].value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
%><p class="recentItem"><a href="<%= request.getContextPath() %>/handle/<%= items[i].getHandle() %>"><%= displayTitle %></a></p><%
|
%><p class="recentItem"><a href="<%= request.getContextPath() %>/handle/<%= items[i].getHandle() %>"><%= displayTitle %></a></p><%
|
||||||
|
@@ -32,6 +32,7 @@
|
|||||||
<%@ page import="org.dspace.browse.ItemCounter" %>
|
<%@ page import="org.dspace.browse.ItemCounter" %>
|
||||||
<%@ page import="org.dspace.content.*" %>
|
<%@ page import="org.dspace.content.*" %>
|
||||||
<%@ page import="org.dspace.core.ConfigurationManager" %>
|
<%@ page import="org.dspace.core.ConfigurationManager" %>
|
||||||
|
<%@ page import="org.dspace.core.Utils" %>
|
||||||
<%@ page import="javax.servlet.jsp.jstl.fmt.LocaleSupport" %>
|
<%@ page import="javax.servlet.jsp.jstl.fmt.LocaleSupport" %>
|
||||||
|
|
||||||
|
|
||||||
@@ -158,7 +159,7 @@
|
|||||||
{
|
{
|
||||||
if (dcv.length > 0)
|
if (dcv.length > 0)
|
||||||
{
|
{
|
||||||
displayTitle = dcv[0].value;
|
displayTitle = Utils.addEntities(dcv[0].value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
%>
|
%>
|
||||||
@@ -401,4 +402,4 @@
|
|||||||
</div>
|
</div>
|
||||||
</dspace:sidebar>
|
</dspace:sidebar>
|
||||||
<% } %>
|
<% } %>
|
||||||
</dspace:layout>
|
</dspace:layout>
|
||||||
|
@@ -14,6 +14,7 @@
|
|||||||
The add-on may be turn off in dspace.cfg
|
The add-on may be turn off in dspace.cfg
|
||||||
--%>
|
--%>
|
||||||
|
|
||||||
|
<%@page import="org.dspace.core.Utils"%>
|
||||||
<%@ page contentType="text/html;charset=UTF-8" %>
|
<%@ page contentType="text/html;charset=UTF-8" %>
|
||||||
<%@ page import="javax.servlet.jsp.jstl.fmt.LocaleSupport" %>
|
<%@ page import="javax.servlet.jsp.jstl.fmt.LocaleSupport" %>
|
||||||
<%@ taglib uri="/WEB-INF/dspace-tags.tld" prefix="dspace" %>
|
<%@ taglib uri="/WEB-INF/dspace-tags.tld" prefix="dspace" %>
|
||||||
@@ -52,7 +53,7 @@
|
|||||||
<form name="filterVocabulary" method="post" action="<%= request.getContextPath() %>/subject-search">
|
<form name="filterVocabulary" method="post" action="<%= request.getContextPath() %>/subject-search">
|
||||||
<input style="border-width:1px;border-style:solid;"
|
<input style="border-width:1px;border-style:solid;"
|
||||||
name="filter" type="text" id="filter"
|
name="filter" type="text" id="filter"
|
||||||
size="15" value="<%= filter %>"
|
size="15" value="<%= Utils.addEntities(filter) %>"
|
||||||
title="<%= LocaleSupport.getLocalizedMessage(pageContext, "jsp.controlledvocabulary.search.trimmessage") %>"/>
|
title="<%= LocaleSupport.getLocalizedMessage(pageContext, "jsp.controlledvocabulary.search.trimmessage") %>"/>
|
||||||
<input type="submit" name="submit" value="<%= LocaleSupport.getLocalizedMessage(pageContext, "jsp.controlledvocabulary.search.trimbutton") %>"/>
|
<input type="submit" name="submit" value="<%= LocaleSupport.getLocalizedMessage(pageContext, "jsp.controlledvocabulary.search.trimbutton") %>"/>
|
||||||
<input type="hidden" name="action" value="filter"/>
|
<input type="hidden" name="action" value="filter"/>
|
||||||
|
@@ -15,6 +15,7 @@
|
|||||||
- recent.submissions - RecetSubmissions
|
- recent.submissions - RecetSubmissions
|
||||||
--%>
|
--%>
|
||||||
|
|
||||||
|
<%@page import="org.dspace.core.Utils"%>
|
||||||
<%@page import="org.dspace.content.Bitstream"%>
|
<%@page import="org.dspace.content.Bitstream"%>
|
||||||
<%@ page contentType="text/html;charset=UTF-8" %>
|
<%@ page contentType="text/html;charset=UTF-8" %>
|
||||||
|
|
||||||
@@ -133,13 +134,13 @@ if (submissions != null && submissions.count() > 0)
|
|||||||
String displayTitle = "Untitled";
|
String displayTitle = "Untitled";
|
||||||
if (dcv != null & dcv.length > 0)
|
if (dcv != null & dcv.length > 0)
|
||||||
{
|
{
|
||||||
displayTitle = dcv[0].value;
|
displayTitle = Utils.addEntities(dcv[0].value);
|
||||||
}
|
}
|
||||||
dcv = item.getMetadata("dc", "description", "abstract", Item.ANY);
|
dcv = item.getMetadata("dc", "description", "abstract", Item.ANY);
|
||||||
String displayAbstract = "";
|
String displayAbstract = "";
|
||||||
if (dcv != null & dcv.length > 0)
|
if (dcv != null & dcv.length > 0)
|
||||||
{
|
{
|
||||||
displayAbstract = dcv[0].value;
|
displayAbstract = Utils.addEntities(dcv[0].value);
|
||||||
}
|
}
|
||||||
%>
|
%>
|
||||||
<div style="padding-bottom: 50px; min-height: 200px;" class="item <%= first?"active":""%>">
|
<div style="padding-bottom: 50px; min-height: 200px;" class="item <%= first?"active":""%>">
|
||||||
|
@@ -106,7 +106,7 @@
|
|||||||
{
|
{
|
||||||
String key = "jsp.search.advanced.type." + index;
|
String key = "jsp.search.advanced.type." + index;
|
||||||
%>
|
%>
|
||||||
<option value="<%= index %>" <%= field1.equals(index) ? "selected=\"selected\"" : "" %>><fmt:message key="<%= key %>"/></option>
|
<option value="<%= StringEscapeUtils.escapeHtml(index) %>" <%= field1.equals(index) ? "selected=\"selected\"" : "" %>><fmt:message key="<%= key %>"/></option>
|
||||||
<%
|
<%
|
||||||
}
|
}
|
||||||
%>
|
%>
|
||||||
@@ -136,7 +136,7 @@
|
|||||||
{
|
{
|
||||||
String key = "jsp.search.advanced.type." + index;
|
String key = "jsp.search.advanced.type." + index;
|
||||||
%>
|
%>
|
||||||
<option value="<%= index %>" <%= field2.equals(index) ? "selected=\"selected\"" : "" %>><fmt:message key="<%= key %>"/></option>
|
<option value="<%= StringEscapeUtils.escapeHtml(index) %>" <%= field2.equals(index) ? "selected=\"selected\"" : "" %>><fmt:message key="<%= key %>"/></option>
|
||||||
<%
|
<%
|
||||||
}
|
}
|
||||||
%>
|
%>
|
||||||
@@ -162,7 +162,7 @@
|
|||||||
{
|
{
|
||||||
String key = "jsp.search.advanced.type." + index;
|
String key = "jsp.search.advanced.type." + index;
|
||||||
%>
|
%>
|
||||||
<option value="<%= index %>" <%= field3.equals(index) ? "selected=\"selected\"" : "" %>><fmt:message key="<%= key %>"/></option>
|
<option value="<%= StringEscapeUtils.escapeHtml(index) %>" <%= field3.equals(index) ? "selected=\"selected\"" : "" %>><fmt:message key="<%= key %>"/></option>
|
||||||
<%
|
<%
|
||||||
}
|
}
|
||||||
%>
|
%>
|
||||||
|
@@ -33,6 +33,7 @@
|
|||||||
- admin_button - If the user is an admin
|
- admin_button - If the user is an admin
|
||||||
--%>
|
--%>
|
||||||
|
|
||||||
|
<%@page import="org.dspace.core.Utils"%>
|
||||||
<%@page import="org.dspace.discovery.configuration.DiscoverySearchFilterFacet"%>
|
<%@page import="org.dspace.discovery.configuration.DiscoverySearchFilterFacet"%>
|
||||||
<%@page import="org.dspace.app.webui.util.UIUtil"%>
|
<%@page import="org.dspace.app.webui.util.UIUtil"%>
|
||||||
<%@page import="java.util.HashMap"%>
|
<%@page import="java.util.HashMap"%>
|
||||||
@@ -55,7 +56,6 @@
|
|||||||
prefix="c" %>
|
prefix="c" %>
|
||||||
|
|
||||||
<%@ taglib uri="http://www.dspace.org/dspace-tags.tld" prefix="dspace" %>
|
<%@ taglib uri="http://www.dspace.org/dspace-tags.tld" prefix="dspace" %>
|
||||||
<%@ page import="org.apache.commons.lang.StringEscapeUtils" %>
|
|
||||||
<%@ page import="java.net.URLEncoder" %>
|
<%@ page import="java.net.URLEncoder" %>
|
||||||
<%@ page import="org.dspace.content.Community" %>
|
<%@ page import="org.dspace.content.Community" %>
|
||||||
<%@ page import="org.dspace.content.Collection" %>
|
<%@ page import="org.dspace.content.Collection" %>
|
||||||
@@ -149,6 +149,9 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
function validateFilters() {
|
||||||
|
return document.getElementById("filterquery").value.length > 0;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</c:set>
|
</c:set>
|
||||||
|
|
||||||
@@ -189,10 +192,10 @@
|
|||||||
}
|
}
|
||||||
%> </select><br/>
|
%> </select><br/>
|
||||||
<label for="query"><fmt:message key="jsp.search.results.searchfor"/></label>
|
<label for="query"><fmt:message key="jsp.search.results.searchfor"/></label>
|
||||||
<input type="text" size="50" id="query" name="query" value="<%= (query==null ? "" : StringEscapeUtils.escapeHtml(query)) %>"/>
|
<input type="text" size="50" id="query" name="query" value="<%= (query==null ? "" : Utils.addEntities(query)) %>"/>
|
||||||
<input type="submit" id="main-query-submit" class="btn btn-primary" value="<fmt:message key="jsp.general.go"/>" />
|
<input type="submit" id="main-query-submit" class="btn btn-primary" value="<fmt:message key="jsp.general.go"/>" />
|
||||||
<% if (StringUtils.isNotBlank(spellCheckQuery)) {%>
|
<% if (StringUtils.isNotBlank(spellCheckQuery)) {%>
|
||||||
<p class="lead"><fmt:message key="jsp.search.didyoumean"><fmt:param><a id="spellCheckQuery" data-spell="<%= StringEscapeUtils.escapeHtml(spellCheckQuery) %>" href="#"><%= spellCheckQuery %></a></fmt:param></fmt:message></p>
|
<p class="lead"><fmt:message key="jsp.search.didyoumean"><fmt:param><a id="spellCheckQuery" data-spell="<%= Utils.addEntities(spellCheckQuery) %>" href="#"><%= spellCheckQuery %></a></fmt:param></fmt:message></p>
|
||||||
<% } %>
|
<% } %>
|
||||||
<input type="hidden" value="<%= rpp %>" name="rpp" />
|
<input type="hidden" value="<%= rpp %>" name="rpp" />
|
||||||
<input type="hidden" value="<%= sortedBy %>" name="sort_by" />
|
<input type="hidden" value="<%= sortedBy %>" name="sort_by" />
|
||||||
@@ -211,7 +214,7 @@
|
|||||||
for (DiscoverySearchFilter searchFilter : availableFilters)
|
for (DiscoverySearchFilter searchFilter : availableFilters)
|
||||||
{
|
{
|
||||||
String fkey = "jsp.search.filter."+searchFilter.getIndexFieldName();
|
String fkey = "jsp.search.filter."+searchFilter.getIndexFieldName();
|
||||||
%><option value="<%= searchFilter.getIndexFieldName() %>"<%
|
%><option value="<%= Utils.addEntities(searchFilter.getIndexFieldName()) %>"<%
|
||||||
if (filter[0].equals(searchFilter.getIndexFieldName()))
|
if (filter[0].equals(searchFilter.getIndexFieldName()))
|
||||||
{
|
{
|
||||||
%> selected="selected"<%
|
%> selected="selected"<%
|
||||||
@@ -222,7 +225,7 @@
|
|||||||
if (!found)
|
if (!found)
|
||||||
{
|
{
|
||||||
String fkey = "jsp.search.filter."+filter[0];
|
String fkey = "jsp.search.filter."+filter[0];
|
||||||
%><option value="<%= filter[0] %>" selected="selected"><fmt:message key="<%= fkey %>"/></option><%
|
%><option value="<%= Utils.addEntities(filter[0]) %>" selected="selected"><fmt:message key="<%= fkey %>"/></option><%
|
||||||
}
|
}
|
||||||
%>
|
%>
|
||||||
</select>
|
</select>
|
||||||
@@ -231,11 +234,11 @@
|
|||||||
for (String opt : options)
|
for (String opt : options)
|
||||||
{
|
{
|
||||||
String fkey = "jsp.search.filter.op."+opt;
|
String fkey = "jsp.search.filter.op."+opt;
|
||||||
%><option value="<%= opt %>"<%= opt.equals(filter[1])?" selected=\"selected\"":"" %>><fmt:message key="<%= fkey %>"/></option><%
|
%><option value="<%= Utils.addEntities(opt) %>"<%= opt.equals(filter[1])?" selected=\"selected\"":"" %>><fmt:message key="<%= fkey %>"/></option><%
|
||||||
}
|
}
|
||||||
%>
|
%>
|
||||||
</select>
|
</select>
|
||||||
<input type="text" id="filter_value_<%=idx %>" name="filter_value_<%=idx %>" value="<%= StringEscapeUtils.escapeHtml(filter[2]) %>" size="45"/>
|
<input type="text" id="filter_value_<%=idx %>" name="filter_value_<%=idx %>" value="<%= Utils.addEntities(filter[2]) %>" size="45"/>
|
||||||
<input class="btn btn-default" type="submit" id="submit_filter_remove_<%=idx %>" name="submit_filter_remove_<%=idx %>" value="X" />
|
<input class="btn btn-default" type="submit" id="submit_filter_remove_<%=idx %>" name="submit_filter_remove_<%=idx %>" value="X" />
|
||||||
<br/>
|
<br/>
|
||||||
<%
|
<%
|
||||||
@@ -252,17 +255,17 @@
|
|||||||
<h5><fmt:message key="jsp.search.filter.heading" /></h5>
|
<h5><fmt:message key="jsp.search.filter.heading" /></h5>
|
||||||
<p class="discovery-search-filters-hint"><fmt:message key="jsp.search.filter.hint" /></p>
|
<p class="discovery-search-filters-hint"><fmt:message key="jsp.search.filter.hint" /></p>
|
||||||
<form action="simple-search" method="get">
|
<form action="simple-search" method="get">
|
||||||
<input type="hidden" value="<%= StringEscapeUtils.escapeHtml(searchScope) %>" name="location" />
|
<input type="hidden" value="<%= Utils.addEntities(searchScope) %>" name="location" />
|
||||||
<input type="hidden" value="<%= StringEscapeUtils.escapeHtml(query) %>" name="query" />
|
<input type="hidden" value="<%= Utils.addEntities(query) %>" name="query" />
|
||||||
<% if (appliedFilterQueries.size() > 0 ) {
|
<% if (appliedFilterQueries.size() > 0 ) {
|
||||||
int idx = 1;
|
int idx = 1;
|
||||||
for (String[] filter : appliedFilters)
|
for (String[] filter : appliedFilters)
|
||||||
{
|
{
|
||||||
boolean found = false;
|
boolean found = false;
|
||||||
%>
|
%>
|
||||||
<input type="hidden" id="filter_field_<%=idx %>" name="filter_field_<%=idx %>" value="<%= filter[0] %>" />
|
<input type="hidden" id="filter_field_<%=idx %>" name="filter_field_<%=idx %>" value="<%= Utils.addEntities(filter[0]) %>" />
|
||||||
<input type="hidden" id="filter_type_<%=idx %>" name="filter_type_<%=idx %>" value="<%= filter[1] %>" />
|
<input type="hidden" id="filter_type_<%=idx %>" name="filter_type_<%=idx %>" value="<%= Utils.addEntities(filter[1]) %>" />
|
||||||
<input type="hidden" id="filter_value_<%=idx %>" name="filter_value_<%=idx %>" value="<%= StringEscapeUtils.escapeHtml(filter[2]) %>" />
|
<input type="hidden" id="filter_value_<%=idx %>" name="filter_value_<%=idx %>" value="<%= Utils.addEntities(filter[2]) %>" />
|
||||||
<%
|
<%
|
||||||
idx++;
|
idx++;
|
||||||
}
|
}
|
||||||
@@ -285,28 +288,28 @@
|
|||||||
}
|
}
|
||||||
%>
|
%>
|
||||||
</select>
|
</select>
|
||||||
<input type="text" id="filterquery" name="filterquery" size="45"/>
|
<input type="text" id="filterquery" name="filterquery" size="45" required="required" />
|
||||||
<input type="hidden" value="<%= rpp %>" name="rpp" />
|
<input type="hidden" value="<%= rpp %>" name="rpp" />
|
||||||
<input type="hidden" value="<%= sortedBy %>" name="sort_by" />
|
<input type="hidden" value="<%= sortedBy %>" name="sort_by" />
|
||||||
<input type="hidden" value="<%= order %>" name="order" />
|
<input type="hidden" value="<%= order %>" name="order" />
|
||||||
<input class="btn btn-default" type="submit" value="<fmt:message key="jsp.search.filter.add"/>" />
|
<input class="btn btn-default" type="submit" value="<fmt:message key="jsp.search.filter.add"/>" onclick="return validateFilters()" />
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<% } %>
|
<% } %>
|
||||||
<%-- Include a component for modifying sort by, order, results per page, and et-al limit --%>
|
<%-- Include a component for modifying sort by, order, results per page, and et-al limit --%>
|
||||||
<div class="discovery-pagination-controls panel-footer">
|
<div class="discovery-pagination-controls panel-footer">
|
||||||
<form action="simple-search" method="get">
|
<form action="simple-search" method="get">
|
||||||
<input type="hidden" value="<%= StringEscapeUtils.escapeHtml(searchScope) %>" name="location" />
|
<input type="hidden" value="<%= Utils.addEntities(searchScope) %>" name="location" />
|
||||||
<input type="hidden" value="<%= StringEscapeUtils.escapeHtml(query) %>" name="query" />
|
<input type="hidden" value="<%= Utils.addEntities(query) %>" name="query" />
|
||||||
<% if (appliedFilterQueries.size() > 0 ) {
|
<% if (appliedFilterQueries.size() > 0 ) {
|
||||||
int idx = 1;
|
int idx = 1;
|
||||||
for (String[] filter : appliedFilters)
|
for (String[] filter : appliedFilters)
|
||||||
{
|
{
|
||||||
boolean found = false;
|
boolean found = false;
|
||||||
%>
|
%>
|
||||||
<input type="hidden" id="filter_field_<%=idx %>" name="filter_field_<%=idx %>" value="<%= filter[0] %>" />
|
<input type="hidden" id="filter_field_<%=idx %>" name="filter_field_<%=idx %>" value="<%= Utils.addEntities(filter[0]) %>" />
|
||||||
<input type="hidden" id="filter_type_<%=idx %>" name="filter_type_<%=idx %>" value="<%= filter[1] %>" />
|
<input type="hidden" id="filter_type_<%=idx %>" name="filter_type_<%=idx %>" value="<%= Utils.addEntities(filter[1]) %>" />
|
||||||
<input type="hidden" id="filter_value_<%=idx %>" name="filter_value_<%=idx %>" value="<%= StringEscapeUtils.escapeHtml(filter[2]) %>" />
|
<input type="hidden" id="filter_value_<%=idx %>" name="filter_value_<%=idx %>" value="<%= Utils.addEntities(filter[2]) %>" />
|
||||||
<%
|
<%
|
||||||
idx++;
|
idx++;
|
||||||
}
|
}
|
||||||
@@ -432,7 +435,7 @@ else if( qResults != null)
|
|||||||
|
|
||||||
// create the URLs accessing the previous and next search result pages
|
// create the URLs accessing the previous and next search result pages
|
||||||
String baseURL = request.getContextPath()
|
String baseURL = request.getContextPath()
|
||||||
+ searchScope
|
+ (searchScope != "" ? "/handle/" + searchScope : "")
|
||||||
+ "/simple-search?query="
|
+ "/simple-search?query="
|
||||||
+ URLEncoder.encode(query,"UTF-8")
|
+ URLEncoder.encode(query,"UTF-8")
|
||||||
+ httpFilters
|
+ httpFilters
|
||||||
@@ -628,28 +631,30 @@ else
|
|||||||
|
|
||||||
for (DiscoverySearchFilterFacet facetConf : facetsConf)
|
for (DiscoverySearchFilterFacet facetConf : facetsConf)
|
||||||
{
|
{
|
||||||
String f = facetConf.getIndexFieldName();
|
if(qResults!=null) {
|
||||||
List<FacetResult> facet = qResults.getFacetResult(f);
|
String f = facetConf.getIndexFieldName();
|
||||||
if (facet.size() == 0)
|
List<FacetResult> facet = qResults.getFacetResult(f);
|
||||||
{
|
|
||||||
facet = qResults.getFacetResult(f+".year");
|
|
||||||
if (facet.size() == 0)
|
if (facet.size() == 0)
|
||||||
{
|
{
|
||||||
showFacets.put(f, false);
|
facet = qResults.getFacetResult(f+".year");
|
||||||
continue;
|
if (facet.size() == 0)
|
||||||
|
{
|
||||||
|
showFacets.put(f, false);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
boolean showFacet = false;
|
||||||
boolean showFacet = false;
|
for (FacetResult fvalue : facet)
|
||||||
for (FacetResult fvalue : facet)
|
{
|
||||||
{
|
if(!appliedFilterQueries.contains(f+"::"+fvalue.getFilterType()+"::"+fvalue.getAsFilterQuery()))
|
||||||
if(!appliedFilterQueries.contains(f+"::"+fvalue.getFilterType()+"::"+fvalue.getAsFilterQuery()))
|
{
|
||||||
{
|
showFacet = true;
|
||||||
showFacet = true;
|
break;
|
||||||
break;
|
}
|
||||||
}
|
}
|
||||||
}
|
showFacets.put(f, showFacet);
|
||||||
showFacets.put(f, showFacet);
|
brefine = brefine || showFacet;
|
||||||
brefine = brefine || showFacet;
|
}
|
||||||
}
|
}
|
||||||
if (brefine) {
|
if (brefine) {
|
||||||
%>
|
%>
|
||||||
@@ -743,5 +748,4 @@ else
|
|||||||
</div>
|
</div>
|
||||||
<% } %>
|
<% } %>
|
||||||
</dspace:sidebar>
|
</dspace:sidebar>
|
||||||
</dspace:layout>
|
</dspace:layout>
|
||||||
|
|
@@ -396,7 +396,7 @@ if (pageTotal > pageCurrent)
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<form id="dso-display" action="<%=request.getContextPath()%>/dso-display" method="post">
|
<form id="dso-display" action="<%=request.getContextPath()%>/dso-display" method="post">
|
||||||
<input type="hidden" name="query" value="<%=query%>"/>
|
<input type="hidden" name="query" value="<%=StringEscapeUtils.escapeHtml(query)%>"/>
|
||||||
<input type="hidden" name="rpp" value="<%=rpp%>"/>
|
<input type="hidden" name="rpp" value="<%=rpp%>"/>
|
||||||
<input type="hidden" name="page" value="<%=pageCurrent%>"/>
|
<input type="hidden" name="page" value="<%=pageCurrent%>"/>
|
||||||
<input type="hidden" name="sort_by" value="<%=(so != null ? so.getNumber() : 0)%>"/>
|
<input type="hidden" name="sort_by" value="<%=(so != null ? so.getNumber() : 0)%>"/>
|
||||||
|
@@ -130,7 +130,16 @@
|
|||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||||
<link rel="stylesheet" href="<%= request.getContextPath() %>/styles.css" type="text/css"/>
|
<link rel="stylesheet" href="<%= request.getContextPath() %>/styles.css" type="text/css"/>
|
||||||
<link rel="shortcut icon" href="<%= request.getContextPath() %>/favicon.ico" type="image/x-icon"/>
|
<link rel="shortcut icon" href="<%= request.getContextPath() %>/favicon.ico" type="image/x-icon"/>
|
||||||
|
<link rel="stylesheet" href="<%= request.getContextPath() %>/static/css/jquery-ui-1.10.3.custom/redmond/jquery-ui-1.10.3.custom.css" type="text/css" />
|
||||||
|
<link rel="stylesheet" href="<%= request.getContextPath() %>/static/css/bootstrap/bootstrap.min.css" type="text/css" />
|
||||||
|
<link rel="stylesheet" href="<%= request.getContextPath() %>/static/css/bootstrap/bootstrap-theme.min.css" type="text/css" />
|
||||||
|
<link rel="stylesheet" href="<%= request.getContextPath() %>/static/css/bootstrap/dspace-theme.css" type="text/css" />
|
||||||
|
<script type='text/javascript' src="<%= request.getContextPath() %>/static/js/jquery/jquery-1.10.2.min.js"></script>
|
||||||
|
<script type='text/javascript' src='<%= request.getContextPath() %>/static/js/jquery/jquery-ui-1.10.3.custom.min.js'></script>
|
||||||
|
<script type='text/javascript' src='<%= request.getContextPath() %>/static/js/bootstrap/bootstrap.min.js'></script>
|
||||||
|
<script type='text/javascript' src='<%= request.getContextPath() %>/static/js/holder.js'></script>
|
||||||
|
<script type="text/javascript" src="<%= request.getContextPath() %>/utils.js"></script>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
<!-- Begin
|
<!-- Begin
|
||||||
|
|
||||||
@@ -169,73 +178,65 @@ function clearEPeople()
|
|||||||
<p class="submitFormHelp"><fmt:message key="jsp.tools.eperson-list.info1"/></p>
|
<p class="submitFormHelp"><fmt:message key="jsp.tools.eperson-list.info1"/></p>
|
||||||
<% } %>
|
<% } %>
|
||||||
<center>
|
<center>
|
||||||
<form method="get">
|
<form method="get">
|
||||||
<input type="hidden" name="first" value="<%= first %>" />
|
<input type="hidden" name="first" value="<%= first %>" />
|
||||||
<input type="hidden" name="sortby" value="<%= sortBy %>" />
|
<input type="hidden" name="sortby" value="<%= sortBy %>" />
|
||||||
<input type="hidden" name="multiple" value="<%= multiple %>" />
|
<input type="hidden" name="multiple" value="<%= multiple %>" />
|
||||||
<label for="search"><fmt:message key="jsp.tools.eperson-list.search.query" /></label><input type="text" name="search" value="<%= search %>"/>
|
<label for="search"><fmt:message key="jsp.tools.eperson-list.search.query"/></label>
|
||||||
<input type="submit" value="<fmt:message key="jsp.tools.eperson-list.search.submit" />" />
|
<input class="form-control" style="width:200px;"type="text" name="search" value="<%= search %>"/>
|
||||||
<%
|
<input class="btn btn-success" type="submit" value="<fmt:message key="jsp.tools.eperson-list.search.submit" />" />
|
||||||
if (search != null && !search.equals(""))
|
<%
|
||||||
{ %>
|
if (search != null && !search.equals("")){ %>
|
||||||
<br/>
|
<a class="btn btn-warning" href="<%= request.getContextPath() + "/tools/eperson-list?multiple=" + multiple + "&sortby=" + sortByParam + "&first="+first %>"><fmt:message key="jsp.tools.eperson-list.search.return-browse" /></a>
|
||||||
<a href="<%= request.getContextPath() + "/tools/eperson-list?multiple=" + multiple + "&sortby=" + sortByParam + "&first="+first %>"><fmt:message key="jsp.tools.eperson-list.search.return-browse" /></a>
|
<%}%>
|
||||||
<%
|
|
||||||
}
|
</form>
|
||||||
%>
|
|
||||||
</form>
|
|
||||||
</center>
|
</center>
|
||||||
|
|
||||||
<%-- Controls for jumping around list--%>
|
<%-- Controls for jumping around list--%>
|
||||||
<table width="99%">
|
<div class="span12" style="text-align:center">
|
||||||
<tr>
|
<ul class="pagination">
|
||||||
<%-- <td width="17%" align="center"><small><strong><a href="<%= jumpLink %>0">First</a></strong></small></td>
|
<li><a href="<%= jumpLink %>0"><fmt:message key="jsp.tools.eperson-list.jump.first"/></a></li>
|
||||||
<td width="17%" align="center"><small><strong><a href="<%= jumpLink %><%= jumpFiveBack %>">< 5 Pages</a></strong></small></td>
|
<li><a href="<%= jumpLink %><%= jumpFiveBack %>"><fmt:message key="jsp.tools.eperson-list.jump.five-back"/></a></li>
|
||||||
<td width="17%" align="center"><small><strong><a href="<%= jumpLink %><%= jumpOneBack %>">< 1 Page</a></strong></small></td>
|
<li><a href="<%= jumpLink %><%= jumpOneBack %>"><fmt:message key="jsp.tools.eperson-list.jump.one-back"/></a></li>
|
||||||
<td width="17%" align="center"><small><strong><a href="<%= jumpLink %><%= jumpOneForward %>">1 Page ></a></strong></small></td>
|
<li><a href="<%= jumpLink %><%= jumpOneForward %>"><fmt:message key="jsp.tools.eperson-list.jump.one-forward"/></a></li>
|
||||||
<td width="17%" align="center"><small><strong><a href="<%= jumpLink %><%= jumpFiveForward %>">5 Pages ></a></strong></small></td>
|
<li><a href="<%= jumpLink %><%= jumpFiveForward %>"><fmt:message key="jsp.tools.eperson-list.jump.five-forward"/></a></li>
|
||||||
<td width="17%" align="center"><small><strong><a href="<%= jumpLink %><%= jumpEnd %>">Last</a></strong></small></td> --%>
|
<li><a href="<%= jumpLink %><%= jumpEnd %>"><fmt:message key="jsp.tools.eperson-list.jump.last"/></a></li>
|
||||||
|
</ul>
|
||||||
<td width="17%" align="center"><small><strong><a href="<%= jumpLink %>0"><fmt:message key="jsp.tools.eperson-list.jump.first"/></a></strong></small></td>
|
</div
|
||||||
<td width="17%" align="center"><small><strong><a href="<%= jumpLink %><%= jumpFiveBack %>"><fmt:message key="jsp.tools.eperson-list.jump.five-back"/></a></strong></small></td>
|
|
||||||
<td width="17%" align="center"><small><strong><a href="<%= jumpLink %><%= jumpOneBack %>"><fmt:message key="jsp.tools.eperson-list.jump.one-back"/></a></strong></small></td>
|
|
||||||
<td width="17%" align="center"><small><strong><a href="<%= jumpLink %><%= jumpOneForward %>"><fmt:message key="jsp.tools.eperson-list.jump.one-forward"/></a></strong></small></td>
|
|
||||||
<td width="17%" align="center"><small><strong><a href="<%= jumpLink %><%= jumpFiveForward %>"><fmt:message key="jsp.tools.eperson-list.jump.five-forward"/></a></strong></small></td>
|
|
||||||
<td width="17%" align="center"><small><strong><a href="<%= jumpLink %><%= jumpEnd %>"><fmt:message key="jsp.tools.eperson-list.jump.last"/></a></strong></small></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
<form method="get" action=""> <%-- Will never actually be posted, it's just so buttons will appear --%>
|
<form method="get" action=""> <%-- Will never actually be posted, it's just so buttons will appear --%>
|
||||||
|
|
||||||
<table class="miscTable" align="center" summary="Epeople list">
|
<table class="table table-striped" align="center" summary="Epeople list">
|
||||||
<% if (search != null && !search.equals(""))
|
<% if (search != null && !search.equals(""))
|
||||||
{ %>
|
{ %>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="oddRowOddCol"> </th>
|
<th> </th>
|
||||||
<th class="oddRowEvenCol"><fmt:message key="jsp.tools.eperson-list.th.id" /></th>
|
<th><fmt:message key="jsp.tools.eperson-list.th.id" /></th>
|
||||||
<th class="oddRowOddCol"><fmt:message key="jsp.tools.eperson-list.th.email" /></th>
|
<th><fmt:message key="jsp.tools.eperson-list.th.email" /></th>
|
||||||
<th class="oddRowEvenCol"><fmt:message key="jsp.tools.eperson-list.th.lastname" /></th>
|
<th><fmt:message key="jsp.tools.eperson-list.th.lastname" /></th>
|
||||||
<th class="oddRowOddCol"><fmt:message key="jsp.tools.eperson-list.th.lastname" /></th>
|
<th><fmt:message key="jsp.tools.eperson-list.th.lastname" /></th>
|
||||||
</tr>
|
</tr>
|
||||||
<% }
|
<% }
|
||||||
else
|
else
|
||||||
{ %>
|
{ %>
|
||||||
<tr>
|
<tr>
|
||||||
<th id="t1" class="oddRowOddCol"> </th>
|
<th id="t1"> </th>
|
||||||
<th id="t2" class="oddRowEvenCol"><%
|
<th id="t2"><%
|
||||||
if (sortBy == EPerson.ID)
|
if (sortBy == EPerson.ID)
|
||||||
{
|
{
|
||||||
%><strong><fmt:message key="jsp.tools.eperson-list.th.id.sortedby" /></strong><%
|
%><fmt:message key="jsp.tools.eperson-list.th.id"/><span class="glyphicon glyphicon-arrow-down"><%
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
%><a href="<%= sortLink %>id"><fmt:message key="jsp.tools.eperson-list.th.id" /></a><%
|
%><a href="<%= sortLink %>id"><fmt:message key="jsp.tools.eperson-list.th.id" /></a><%
|
||||||
}
|
}
|
||||||
%></th>
|
%></th>
|
||||||
<th id="t3" class="oddRowOddCol"><%
|
<th id="t3"><%
|
||||||
if (sortBy == EPerson.EMAIL)
|
if (sortBy == EPerson.EMAIL)
|
||||||
{
|
{
|
||||||
%><strong><fmt:message key="jsp.tools.eperson-list.th.email.sortedby" /></strong><%
|
%><fmt:message key="jsp.tools.eperson-list.th.email"/><span class="glyphicon glyphicon-arrow-down"><%
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -243,10 +244,10 @@ function clearEPeople()
|
|||||||
}
|
}
|
||||||
%></th>
|
%></th>
|
||||||
<%-- <th class="oddRowEvenCol"><%= sortBy == EPerson.LASTNAME ? "<strong>Last Name ↑</strong>" : "<a href=\"" + sortLink + "lastname\">Last Name</a>" %></th> --%>
|
<%-- <th class="oddRowEvenCol"><%= sortBy == EPerson.LASTNAME ? "<strong>Last Name ↑</strong>" : "<a href=\"" + sortLink + "lastname\">Last Name</a>" %></th> --%>
|
||||||
<th id="t4" class="oddRowEvenCol"><%
|
<th id="t4"><%
|
||||||
if (sortBy == EPerson.LASTNAME)
|
if (sortBy == EPerson.LASTNAME)
|
||||||
{
|
{
|
||||||
%><fmt:message key="jsp.tools.eperson-list.th.lastname.sortedby" /><%
|
%><fmt:message key="jsp.tools.eperson-list.th.lastname"/><span class="glyphicon glyphicon-arrow-down"><%
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -254,12 +255,12 @@ function clearEPeople()
|
|||||||
}
|
}
|
||||||
%></th>
|
%></th>
|
||||||
|
|
||||||
<th id="t5" class="oddRowOddCol"><fmt:message key="jsp.tools.eperson-list.th.firstname"/></th>
|
<th id="t5"><fmt:message key="jsp.tools.eperson-list.th.firstname"/></th>
|
||||||
|
|
||||||
<th id="t6" class="oddRowEvenCol"><%
|
<th id="t6"><%
|
||||||
if (sortBy == EPerson.LANGUAGE)
|
if (sortBy == EPerson.LANGUAGE)
|
||||||
{
|
{
|
||||||
%><fmt:message key="jsp.tools.eperson-list.th.language.sortedby" /><%
|
%><fmt:message key="jsp.tools.eperson-list.th.language"/><span class="glyphicon glyphicon-arrow-down"></span><%
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -285,20 +286,20 @@ function clearEPeople()
|
|||||||
String fullname = StringEscapeUtils.escapeXml(StringEscapeUtils.escapeJavaScript(e.getFullName()));
|
String fullname = StringEscapeUtils.escapeXml(StringEscapeUtils.escapeJavaScript(e.getFullName()));
|
||||||
String email = StringEscapeUtils.escapeXml(StringEscapeUtils.escapeJavaScript(e.getEmail()));
|
String email = StringEscapeUtils.escapeXml(StringEscapeUtils.escapeJavaScript(e.getEmail()));
|
||||||
%>
|
%>
|
||||||
<tr>
|
<tr>
|
||||||
<td headers="t1" class="<%= row %>RowOddCol">
|
<td headers="t1">
|
||||||
<input type="button" value="<%
|
<input class="btn btn-success" type="button" value="<%
|
||||||
if (multiple) { %><fmt:message key="jsp.tools.general.add"/><% }
|
if (multiple) { %><fmt:message key="jsp.tools.general.add"/><% }
|
||||||
else { %><fmt:message key="jsp.tools.general.select"/><% } %>" onclick="javascript:<%= clearList %>addEPerson(<%= e.getID() %>, '<%= email %>', '<%= fullname %>');<%= closeWindow %>"/></td>
|
else { %><fmt:message key="jsp.tools.general.select"/><% } %>" onclick="javascript:<%= clearList %>addEPerson(<%= e.getID() %>, '<%= email %>', '<%= fullname %>');<%= closeWindow %>"/></td>
|
||||||
<td headers="t2" class="<%= row %>RowEvenCol"><%= e.getID() %></td>
|
<td headers="t2"><%= e.getID() %></td>
|
||||||
<td headers="t3" class="<%= row %>RowOddCol"><%= (e.getEmail() == null ? "" : Utils.addEntities(e.getEmail())) %></td>
|
<td headers="t3"><%= (e.getEmail() == null ? "" : Utils.addEntities(e.getEmail())) %></td>
|
||||||
<td headers="t4" class="<%= row %>RowEvenCol">
|
<td headers="t4">
|
||||||
<%= (e.getLastName() == null ? "" : Utils.addEntities(e.getLastName())) %>
|
<%= (e.getLastName() == null ? "" : Utils.addEntities(e.getLastName())) %>
|
||||||
</td>
|
</td>
|
||||||
<td headers="t5" class="<%= row %>RowOddCol">
|
<td headers="t5">
|
||||||
<%= (e.getFirstName() == null ? "" : Utils.addEntities(e.getFirstName())) %>
|
<%= (e.getFirstName() == null ? "" : Utils.addEntities(e.getFirstName())) %>
|
||||||
</td>
|
</td>
|
||||||
<td headers="t6" class="<%= row %>RowOddCol">
|
<td headers="t6">
|
||||||
<%= (e.getLanguage() == null ? "" : Utils.addEntities(e.getLanguage())) %>
|
<%= (e.getLanguage() == null ? "" : Utils.addEntities(e.getLanguage())) %>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -311,28 +312,21 @@ function clearEPeople()
|
|||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
<%-- Controls for jumping around list--%>
|
<%-- Controls for jumping around list--%>
|
||||||
<table width="99%">
|
<div class="span12" style="text-align:center">
|
||||||
<tr>
|
<ul class="pagination">
|
||||||
<%--
|
<li><a href="<%= jumpLink %>0"><fmt:message key="jsp.tools.eperson-list.jump.first"/></a></li>
|
||||||
<td width="17%" align="center"><small><strong><a href="<%= jumpLink %>0">First</a></strong></small></td>
|
<li><a href="<%= jumpLink %><%= jumpFiveBack %>"><fmt:message key="jsp.tools.eperson-list.jump.five-back"/></a></li>
|
||||||
<td width="17%" align="center"><small><strong><a href="<%= jumpLink %><%= jumpFiveBack %>">< 5 Pages</a></strong></small></td>
|
<li><a href="<%= jumpLink %><%= jumpOneBack %>"><fmt:message key="jsp.tools.eperson-list.jump.one-back"/></a></li>
|
||||||
<td width="17%" align="center"><small><strong><a href="<%= jumpLink %><%= jumpOneBack %>">< 1 Page</a></strong></small></td>
|
<li><a href="<%= jumpLink %><%= jumpOneForward %>"><fmt:message key="jsp.tools.eperson-list.jump.one-forward"/></a></li>
|
||||||
<td width="17%" align="center"><small><strong><a href="<%= jumpLink %><%= jumpOneForward %>">1 Page ></a></strong></small></td>
|
<li><a href="<%= jumpLink %><%= jumpFiveForward %>"><fmt:message key="jsp.tools.eperson-list.jump.five-forward"/></a></li>
|
||||||
<td width="17%" align="center"><small><strong><a href="<%= jumpLink %><%= jumpFiveForward %>">5 Pages ></a></strong></small></td>
|
<li><a href="<%= jumpLink %><%= jumpEnd %>"><fmt:message key="jsp.tools.eperson-list.jump.last"/></a></li>
|
||||||
<td width="17%" align="center"><small><strong><a href="<%= jumpLink %><%= jumpEnd %>">Last</a></strong></small></td>
|
</ul>
|
||||||
--%>
|
</div>
|
||||||
|
|
||||||
<td width="17%" align="center"><small><strong><a href="<%= jumpLink %>0"><fmt:message key="jsp.tools.eperson-list.jump.first"/></a></strong></small></td>
|
|
||||||
<td width="17%" align="center"><small><strong><a href="<%= jumpLink %><%= jumpFiveBack %>"><fmt:message key="jsp.tools.eperson-list.jump.five-back"/></a></strong></small></td>
|
|
||||||
<td width="17%" align="center"><small><strong><a href="<%= jumpLink %><%= jumpOneBack %>"><fmt:message key="jsp.tools.eperson-list.jump.one-back"/></a></strong></small></td>
|
|
||||||
<td width="17%" align="center"><small><strong><a href="<%= jumpLink %><%= jumpOneForward %>"><fmt:message key="jsp.tools.eperson-list.jump.one-forward"/></a></strong></small></td>
|
|
||||||
<td width="17%" align="center"><small><strong><a href="<%= jumpLink %><%= jumpFiveForward %>"><fmt:message key="jsp.tools.eperson-list.jump.five-forward"/></a></strong></small></td>
|
|
||||||
<td width="17%" align="center"><small><strong><a href="<%= jumpLink %><%= jumpEnd %>"><fmt:message key="jsp.tools.eperson-list.jump.last"/></a></strong></small></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<%-- <p align="center"><input type="button" value="Close" onClick="window.close();"/></p> --%>
|
<%-- <p align="center"><input type="button" value="Close" onClick="window.close();"/></p> --%>
|
||||||
<p align="center"><input type="button" value="<fmt:message key="jsp.tools.eperson-list.close.button"/>" onclick="window.close();"/></p>
|
<p align="center">
|
||||||
|
<input type="button" class="btn btn-danger" value="<fmt:message key="jsp.tools.eperson-list.close.button"/>" onclick="window.close();"/>
|
||||||
|
</p>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
@@ -75,7 +75,11 @@
|
|||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||||
<link rel="stylesheet" href="<%= request.getContextPath() %>/styles.css" type="text/css"/>
|
<link rel="stylesheet" href="<%= request.getContextPath() %>/styles.css" type="text/css"/>
|
||||||
<link rel="shortcut icon" href="<%= request.getContextPath() %>/favicon.ico" type="image/x-icon"/>
|
<link rel="shortcut icon" href="<%= request.getContextPath() %>/favicon.ico" type="image/x-icon"/>
|
||||||
|
<link rel="stylesheet" href="<%= request.getContextPath() %>/static/css/bootstrap/bootstrap.min.css" type="text/css" />
|
||||||
|
<link rel="stylesheet" href="<%= request.getContextPath() %>/static/css/bootstrap/bootstrap-theme.min.css" type="text/css" />
|
||||||
|
<link rel="stylesheet" href="<%= request.getContextPath() %>/static/css/bootstrap/dspace-theme.css" type="text/css" />
|
||||||
|
<script type='text/javascript' src='<%= request.getContextPath() %>/static/js/bootstrap/bootstrap.min.js'></script>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
<!-- Begin
|
<!-- Begin
|
||||||
|
|
||||||
@@ -116,35 +120,27 @@ function clearGroups()
|
|||||||
<% } %>
|
<% } %>
|
||||||
|
|
||||||
<%-- Controls for jumping around list--%>
|
<%-- Controls for jumping around list--%>
|
||||||
<table width="99%">
|
<div class="span12" style="text-align:center">
|
||||||
<tr>
|
<ul class="pagination">
|
||||||
<%-- <td width="17%" align="center"><small><strong><a href="<%= jumpLink %>0">First</A></strong></small></td>
|
<li><a href="<%= jumpLink %>0"><fmt:message key="jsp.tools.group-select-list.jump.first"/></a></li>
|
||||||
<td width="17%" align="center"><small><strong><a href="<%= jumpLink %><%= jumpFiveBack %>">< 5 Pages</A></strong></small></td>
|
<li><a href="<%= jumpLink %><%= jumpFiveBack %>"><fmt:message key="jsp.tools.group-select-list.jump.five-back"/></a></li>
|
||||||
<td width="17%" align="center"><small><strong><a href="<%= jumpLink %><%= jumpOneBack %>">< 1 Page</A></strong></small></td>
|
<li><a href="<%= jumpLink %><%= jumpOneBack %>"><fmt:message key="jsp.tools.group-select-list.jump.one-back"/></a></li>
|
||||||
<td width="17%" align="center"><small><strong><a href="<%= jumpLink %><%= jumpOneForward %>">1 Page ></A></strong></small></td>
|
<li><a href="<%= jumpLink %><%= jumpOneForward %>"><fmt:message key="jsp.tools.group-select-list.jump.one-forward"/></a></li>
|
||||||
<td width="17%" align="center"><small><strong><a href="<%= jumpLink %><%= jumpFiveForward %>">5 Pages ></A></strong></small></td>
|
<li><a href="<%= jumpLink %><%= jumpFiveForward %>"><fmt:message key="jsp.tools.group-select-list.jump.five-forward"/></a></li>
|
||||||
<td width="17%" align="center"><small><strong><a href="<%= jumpLink %><%= jumpEnd %>">Last</A></strong></small></td>
|
<li><a href="<%= jumpLink %><%= jumpEnd %>"><fmt:message key="jsp.tools.group-select-list.jump.last"/></a></li>
|
||||||
--%>
|
</ul>
|
||||||
|
</div>
|
||||||
<td width="17%" align="center"><small><strong><a href="<%= jumpLink %>0"><fmt:message key="jsp.tools.group-select-list.jump.first"/></a></strong></small></td>
|
|
||||||
<td width="17%" align="center"><small><strong><a href="<%= jumpLink %><%= jumpFiveBack %>"><fmt:message key="jsp.tools.group-select-list.jump.five-back"/></a></strong></small></td>
|
|
||||||
<td width="17%" align="center"><small><strong><a href="<%= jumpLink %><%= jumpOneBack %>"><fmt:message key="jsp.tools.group-select-list.jump.one-back"/></a></strong></small></td>
|
|
||||||
<td width="17%" align="center"><small><strong><a href="<%= jumpLink %><%= jumpOneForward %>"><fmt:message key="jsp.tools.group-select-list.jump.one-forward"/></a></strong></small></td>
|
|
||||||
<td width="17%" align="center"><small><strong><a href="<%= jumpLink %><%= jumpFiveForward %>"><fmt:message key="jsp.tools.group-select-list.jump.five-forward"/></a></strong></small></td>
|
|
||||||
<td width="17%" align="center"><small><strong><a href="<%= jumpLink %><%= jumpEnd %>"><fmt:message key="jsp.tools.group-select-list.jump.last"/></a></strong></small></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
<form method="get" action=""> <%-- Will never actually be posted, it's just so buttons will appear --%>
|
<form method="get" action=""> <%-- Will never actually be posted, it's just so buttons will appear --%>
|
||||||
|
|
||||||
<table class="miscTable" align="center" summary="Group list">
|
<table class="table table-striped" align="center" summary="Group list">
|
||||||
<tr>
|
<tr>
|
||||||
<th id="t1" class="oddRowOddCol"> </th>
|
<th id="t1" class="oddRowOddCol"> </th>
|
||||||
<th id="t2" class="oddRowEvenCol"><%
|
<th id="t2" class="oddRowEvenCol"><%
|
||||||
if (sortBy == Group.ID)
|
if (sortBy == Group.ID)
|
||||||
{
|
{
|
||||||
%><strong><fmt:message key="jsp.tools.group-select-list.th.id.sortedby" /></strong><%
|
%><fmt:message key="jsp.tools.group-select-list.th.id"/><span class="glyphicon glyphicon-arrow-down"><%
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -154,7 +150,7 @@ function clearGroups()
|
|||||||
<th id="t3" class="oddRowOddCol"><%
|
<th id="t3" class="oddRowOddCol"><%
|
||||||
if (sortBy == Group.NAME)
|
if (sortBy == Group.NAME)
|
||||||
{
|
{
|
||||||
%><strong><fmt:message key="jsp.tools.group-select-list.th.name.sortedby" /></strong><%
|
%><fmt:message key="jsp.tools.group-select-list.th.name" /><span class="glyphicon glyphicon-arrow-down"><%
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -180,12 +176,12 @@ function clearGroups()
|
|||||||
String fullname = g.getName().replace('\'', ' ');
|
String fullname = g.getName().replace('\'', ' ');
|
||||||
%>
|
%>
|
||||||
<tr>
|
<tr>
|
||||||
<td headers="t1" class="<%= row %>RowOddCol">
|
<td headers="t1" class="">
|
||||||
<input type="button" value="<%
|
<input type="button" class="btn btn-success" value="<%
|
||||||
if (multiple) { %><fmt:message key="jsp.tools.general.add"/><% }
|
if (multiple) { %><fmt:message key="jsp.tools.general.add"/><% }
|
||||||
else { %><fmt:message key="jsp.tools.general.select"/><% } %>" onclick="javascript:<%= clearList %>addGroup('<%= g.getID() %>', '<%= Utils.addEntities(fullname) %>');<%= closeWindow %>"/></td>
|
else { %><fmt:message key="jsp.tools.general.select"/><% } %>" onclick="javascript:<%= clearList %>addGroup('<%= g.getID() %>', '<%= Utils.addEntities(fullname) %>');<%= closeWindow %>"/></td>
|
||||||
<td headers="t2" class="<%= row %>RowEvenCol"><%= g.getID() %></td>
|
<td headers="t2" class=""><%= g.getID() %></td>
|
||||||
<td headers="t3" class="<%= row %>RowOddCol"> <%= g.getName()%></td>
|
<td headers="t3" class=""> <%= g.getName()%></td>
|
||||||
</tr>
|
</tr>
|
||||||
<%
|
<%
|
||||||
row = (row.equals("odd") ? "even" : "odd");
|
row = (row.equals("odd") ? "even" : "odd");
|
||||||
@@ -196,27 +192,19 @@ function clearGroups()
|
|||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
<%-- Controls for jumping around list--%>
|
<%-- Controls for jumping around list--%>
|
||||||
<table width="99%">
|
<div class="span12" style="text-align:center">
|
||||||
<tr>
|
<ul class="pagination">
|
||||||
<%-- <td width="17%" align="center"><small><strong><a href="<%= jumpLink %>0">First</A></strong></small></td>
|
<li><a href="<%= jumpLink %>0"><fmt:message key="jsp.tools.group-select-list.jump.first"/></a></li>
|
||||||
<td width="17%" align="center"><small><strong><a href="<%= jumpLink %><%= jumpFiveBack %>">< 5 Pages</A></strong></small></td>
|
<li><a href="<%= jumpLink %><%= jumpFiveBack %>"><fmt:message key="jsp.tools.group-select-list.jump.five-back"/></a></li>
|
||||||
<td width="17%" align="center"><small><strong><a href="<%= jumpLink %><%= jumpOneBack %>">< 1 Page</A></strong></small></td>
|
<li><a href="<%= jumpLink %><%= jumpOneBack %>"><fmt:message key="jsp.tools.group-select-list.jump.one-back"/></a></li>
|
||||||
<td width="17%" align="center"><small><strong><a href="<%= jumpLink %><%= jumpOneForward %>">1 Page ></A></strong></small></td>
|
<li><a href="<%= jumpLink %><%= jumpOneForward %>"><fmt:message key="jsp.tools.group-select-list.jump.one-forward"/></a></li>
|
||||||
<td width="17%" align="center"><small><strong><a href="<%= jumpLink %><%= jumpFiveForward %>">5 Pages ></A></strong></small></td>
|
<li><a href="<%= jumpLink %><%= jumpFiveForward %>"><fmt:message key="jsp.tools.group-select-list.jump.five-forward"/></a></li>
|
||||||
<td width="17%" align="center"><small><strong><a href="<%= jumpLink %><%= jumpEnd %>">Last</A></strong></small></td>
|
<li><a href="<%= jumpLink %><%= jumpEnd %>"><fmt:message key="jsp.tools.group-select-list.jump.last"/></a></li>
|
||||||
--%>
|
</ul>
|
||||||
|
</div>
|
||||||
<td width="17%" align="center"><small><strong><a href="<%= jumpLink %>0"><fmt:message key="jsp.tools.group-select-list.jump.first"/></a></strong></small></td>
|
|
||||||
<td width="17%" align="center"><small><strong><a href="<%= jumpLink %><%= jumpFiveBack %>"><fmt:message key="jsp.tools.group-select-list.jump.five-back"/></a></strong></small></td>
|
|
||||||
<td width="17%" align="center"><small><strong><a href="<%= jumpLink %><%= jumpOneBack %>"><fmt:message key="jsp.tools.group-select-list.jump.one-back"/></a></strong></small></td>
|
|
||||||
<td width="17%" align="center"><small><strong><a href="<%= jumpLink %><%= jumpOneForward %>"><fmt:message key="jsp.tools.group-select-list.jump.one-forward"/></a></strong></small></td>
|
|
||||||
<td width="17%" align="center"><small><strong><a href="<%= jumpLink %><%= jumpFiveForward %>"><fmt:message key="jsp.tools.group-select-list.jump.five-forward"/></a></strong></small></td>
|
|
||||||
<td width="17%" align="center"><small><strong><a href="<%= jumpLink %><%= jumpEnd %>"><fmt:message key="jsp.tools.group-select-list.jump.last"/></a></strong></small></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<%-- <p align="center"><input type="button" value="Close" onClick="window.close();"></p> --%>
|
<%-- <p align="center"><input type="button" value="Close" onClick="window.close();"></p> --%>
|
||||||
<p align="center"><input type="button" value="<fmt:message key="jsp.tools.group-select-list.close.button"/>" onclick="window.close();"/></p>
|
<p align="center"><input type="button" class="btn btn-danger" value="<fmt:message key="jsp.tools.group-select-list.close.button"/>" onclick="window.close();"/></p>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
@@ -11,7 +11,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.dspace</groupId>
|
<groupId>org.dspace</groupId>
|
||||||
<artifactId>dspace-parent</artifactId>
|
<artifactId>dspace-parent</artifactId>
|
||||||
<version>4.0</version>
|
<version>4.3</version>
|
||||||
<relativePath>../..</relativePath>
|
<relativePath>../..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
@@ -11,7 +11,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.dspace</groupId>
|
<groupId>org.dspace</groupId>
|
||||||
<artifactId>dspace-parent</artifactId>
|
<artifactId>dspace-parent</artifactId>
|
||||||
<version>4.0</version>
|
<version>4.3</version>
|
||||||
<relativePath>..</relativePath>
|
<relativePath>..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>dspace-parent</artifactId>
|
<artifactId>dspace-parent</artifactId>
|
||||||
<groupId>org.dspace</groupId>
|
<groupId>org.dspace</groupId>
|
||||||
<version>4.0</version>
|
<version>4.3</version>
|
||||||
<relativePath>..</relativePath>
|
<relativePath>..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
@@ -158,6 +158,11 @@ public class DSpaceOAIDataProvider extends HttpServlet
|
|||||||
"Requested OAI context \""
|
"Requested OAI context \""
|
||||||
+ request.getPathInfo().replace("/", "")
|
+ request.getPathInfo().replace("/", "")
|
||||||
+ "\" does not exist");
|
+ "\" does not exist");
|
||||||
|
} finally {
|
||||||
|
if(context != null && context.isValid())
|
||||||
|
{
|
||||||
|
context.abort();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -7,13 +7,14 @@
|
|||||||
*/
|
*/
|
||||||
package org.dspace.xoai.util;
|
package org.dspace.xoai.util;
|
||||||
|
|
||||||
|
import org.apache.log4j.LogManager;
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
import java.util.TimeZone;
|
||||||
import org.apache.log4j.LogManager;
|
|
||||||
import org.apache.log4j.Logger;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -33,8 +34,8 @@ public class DateUtils
|
|||||||
// 2008-01-01T00:00:00Z
|
// 2008-01-01T00:00:00Z
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.'000Z'");
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.'000Z'");
|
||||||
if (!init) sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.'999Z'");
|
if (!init) sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.'999Z'");
|
||||||
|
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||||
String ret = sdf.format(date);
|
String ret = sdf.format(date);
|
||||||
System.out.println(ret);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -728,14 +728,20 @@
|
|||||||
</td>
|
</td>
|
||||||
<td class="clear"></td>
|
<td class="clear"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="info">
|
<tr class="info">
|
||||||
<td class="name">Description</td>
|
<td class="name">Repository identifier</td>
|
||||||
<td class="value">
|
<td class="value">
|
||||||
<xsl:value-of
|
<xsl:value-of select="oai:OAI-PMH/oai:Identify/oai:description//*[local-name() = 'repositoryIdentifier']/text()" />
|
||||||
select="oai:OAI-PMH/oai:Identify/oai:description/node()/text()" />
|
</td>
|
||||||
</td>
|
<td class="clear"></td>
|
||||||
<td class="clear"></td>
|
</tr>
|
||||||
</tr>
|
<tr class="info">
|
||||||
|
<td class="name">Sample identifier</td>
|
||||||
|
<td class="value">
|
||||||
|
<xsl:value-of select="oai:OAI-PMH/oai:Identify/oai:description//*[local-name() = 'sampleIdentifier']/text()" />
|
||||||
|
</td>
|
||||||
|
<td class="clear"></td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="separator"></td>
|
<td class="separator"></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@@ -3,14 +3,14 @@
|
|||||||
<groupId>org.dspace</groupId>
|
<groupId>org.dspace</groupId>
|
||||||
<artifactId>dspace-rest</artifactId>
|
<artifactId>dspace-rest</artifactId>
|
||||||
<packaging>war</packaging>
|
<packaging>war</packaging>
|
||||||
<version>4.0</version>
|
<version>4.3</version>
|
||||||
<name>DSpace RESTful web services API</name>
|
<name>DSpace RESTful web services API</name>
|
||||||
<url>http://demo.dspace.org</url>
|
<url>http://demo.dspace.org</url>
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.dspace</groupId>
|
<groupId>org.dspace</groupId>
|
||||||
<artifactId>dspace-parent</artifactId>
|
<artifactId>dspace-parent</artifactId>
|
||||||
<version>4.0</version>
|
<version>4.3</version>
|
||||||
<relativePath>..</relativePath>
|
<relativePath>..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
@@ -36,7 +36,6 @@ import java.sql.SQLException;
|
|||||||
@Path("/bitstreams")
|
@Path("/bitstreams")
|
||||||
public class BitstreamResource {
|
public class BitstreamResource {
|
||||||
Logger log = Logger.getLogger(BitstreamResource.class);
|
Logger log = Logger.getLogger(BitstreamResource.class);
|
||||||
private static org.dspace.core.Context context;
|
|
||||||
|
|
||||||
private static final boolean writeStatistics;
|
private static final boolean writeStatistics;
|
||||||
|
|
||||||
@@ -50,12 +49,9 @@ public class BitstreamResource {
|
|||||||
@Path("/{bitstream_id}")
|
@Path("/{bitstream_id}")
|
||||||
@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
|
@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
|
||||||
public Bitstream getBitstream(@PathParam("bitstream_id") Integer bitstream_id, @QueryParam("expand") String expand) {
|
public Bitstream getBitstream(@PathParam("bitstream_id") Integer bitstream_id, @QueryParam("expand") String expand) {
|
||||||
|
org.dspace.core.Context context = null;
|
||||||
try {
|
try {
|
||||||
if(context == null || !context.isValid()) {
|
context = new org.dspace.core.Context();
|
||||||
context = new org.dspace.core.Context();
|
|
||||||
//Failed SQL is ignored as a failed SQL statement, prevent: current transaction is aborted, commands ignored until end of transaction block
|
|
||||||
context.getDBConnection().setAutoCommit(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
org.dspace.content.Bitstream bitstream = org.dspace.content.Bitstream.find(context, bitstream_id);
|
org.dspace.content.Bitstream bitstream = org.dspace.content.Bitstream.find(context, bitstream_id);
|
||||||
|
|
||||||
@@ -67,6 +63,14 @@ public class BitstreamResource {
|
|||||||
} catch(SQLException e) {
|
} catch(SQLException e) {
|
||||||
log.error(e.getMessage());
|
log.error(e.getMessage());
|
||||||
throw new WebApplicationException(Response.Status.INTERNAL_SERVER_ERROR);
|
throw new WebApplicationException(Response.Status.INTERNAL_SERVER_ERROR);
|
||||||
|
} finally {
|
||||||
|
if(context != null) {
|
||||||
|
try {
|
||||||
|
context.complete();
|
||||||
|
} catch (SQLException e) {
|
||||||
|
log.error(e.getMessage() + " occurred while trying to close");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,17 +79,14 @@ public class BitstreamResource {
|
|||||||
public javax.ws.rs.core.Response getFile(@PathParam("bitstream_id") final Integer bitstream_id,
|
public javax.ws.rs.core.Response getFile(@PathParam("bitstream_id") final Integer bitstream_id,
|
||||||
@QueryParam("userIP") String user_ip, @QueryParam("userAgent") String user_agent, @QueryParam("xforwarderfor") String xforwarderfor,
|
@QueryParam("userIP") String user_ip, @QueryParam("userAgent") String user_agent, @QueryParam("xforwarderfor") String xforwarderfor,
|
||||||
@Context HttpHeaders headers, @Context HttpServletRequest request) {
|
@Context HttpHeaders headers, @Context HttpServletRequest request) {
|
||||||
|
org.dspace.core.Context context = null;
|
||||||
try {
|
try {
|
||||||
if(context == null || !context.isValid() ) {
|
context = new org.dspace.core.Context();
|
||||||
context = new org.dspace.core.Context();
|
|
||||||
//Failed SQL is ignored as a failed SQL statement, prevent: current transaction is aborted, commands ignored until end of transaction block
|
|
||||||
context.getDBConnection().setAutoCommit(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
org.dspace.content.Bitstream bitstream = org.dspace.content.Bitstream.find(context, bitstream_id);
|
org.dspace.content.Bitstream bitstream = org.dspace.content.Bitstream.find(context, bitstream_id);
|
||||||
if(AuthorizeManager.authorizeActionBoolean(context, bitstream, org.dspace.core.Constants.READ)) {
|
if(AuthorizeManager.authorizeActionBoolean(context, bitstream, org.dspace.core.Constants.READ)) {
|
||||||
if(writeStatistics){
|
if(writeStatistics){
|
||||||
writeStats(bitstream_id, user_ip, user_agent, xforwarderfor, headers, request);
|
writeStats(context, bitstream_id, user_ip, user_agent, xforwarderfor, headers, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Response.ok(bitstream.retrieve()).type(bitstream.getFormat().getMIMEType()).build();
|
return Response.ok(bitstream.retrieve()).type(bitstream.getFormat().getMIMEType()).build();
|
||||||
@@ -102,10 +103,18 @@ public class BitstreamResource {
|
|||||||
} catch (AuthorizeException e) {
|
} catch (AuthorizeException e) {
|
||||||
log.error(e.getMessage());
|
log.error(e.getMessage());
|
||||||
throw new WebApplicationException(Response.Status.UNAUTHORIZED);
|
throw new WebApplicationException(Response.Status.UNAUTHORIZED);
|
||||||
|
} finally {
|
||||||
|
if(context != null) {
|
||||||
|
try {
|
||||||
|
context.complete();
|
||||||
|
} catch (SQLException e) {
|
||||||
|
log.error(e.getMessage() + " occurred while trying to close");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void writeStats(Integer bitstream_id, String user_ip, String user_agent,
|
private void writeStats(org.dspace.core.Context context, Integer bitstream_id, String user_ip, String user_agent,
|
||||||
String xforwarderfor, HttpHeaders headers,
|
String xforwarderfor, HttpHeaders headers,
|
||||||
HttpServletRequest request) {
|
HttpServletRequest request) {
|
||||||
|
|
||||||
|
@@ -37,11 +37,8 @@ http://localhost:8080/<webapp>/collections
|
|||||||
@Path("/collections")
|
@Path("/collections")
|
||||||
public class CollectionsResource {
|
public class CollectionsResource {
|
||||||
private static Logger log = Logger.getLogger(CollectionsResource.class);
|
private static Logger log = Logger.getLogger(CollectionsResource.class);
|
||||||
|
|
||||||
|
|
||||||
@javax.ws.rs.core.Context ServletContext servletContext;
|
@javax.ws.rs.core.Context ServletContext servletContext;
|
||||||
|
|
||||||
private static org.dspace.core.Context context;
|
|
||||||
|
|
||||||
private static final boolean writeStatistics;
|
private static final boolean writeStatistics;
|
||||||
|
|
||||||
@@ -49,46 +46,13 @@ public class CollectionsResource {
|
|||||||
writeStatistics=ConfigurationManager.getBooleanProperty("rest","stats",false);
|
writeStatistics=ConfigurationManager.getBooleanProperty("rest","stats",false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
The "GET" annotation indicates this method will respond to HTTP Get requests.
|
|
||||||
The "Produces" annotation indicates the MIME response the method will return.
|
|
||||||
*/
|
|
||||||
@GET
|
|
||||||
@Path("/")
|
|
||||||
@Produces(MediaType.TEXT_HTML)
|
|
||||||
public String listHTML() {
|
|
||||||
StringBuilder everything = new StringBuilder();
|
|
||||||
try {
|
|
||||||
if(context == null || !context.isValid() ) {
|
|
||||||
context = new org.dspace.core.Context();
|
|
||||||
//Failed SQL is ignored as a failed SQL statement, prevent: current transaction is aborted, commands ignored until end of transaction block
|
|
||||||
context.getDBConnection().setAutoCommit(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
org.dspace.content.Collection[] collections = org.dspace.content.Collection.findAll(context);
|
|
||||||
for(org.dspace.content.Collection collection : collections) {
|
|
||||||
//TODO check auth...
|
|
||||||
everything.append("<li><a href='" + servletContext.getContextPath() + "/collections/" + collection.getID() + "'>" + collection.getID() + " - " + collection.getName() + "</a></li>\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
return "<html><title>Hello!</title><body>Collections<br/><ul>" + everything.toString() + "</ul>.</body></html> ";
|
|
||||||
|
|
||||||
} catch (SQLException e) {
|
|
||||||
log.error(e.getMessage());
|
|
||||||
throw new WebApplicationException(Response.Status.INTERNAL_SERVER_ERROR);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
@Path("/")
|
@Path("/")
|
||||||
@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
|
@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
|
||||||
public org.dspace.rest.common.Collection[] list(@QueryParam("expand") String expand, @QueryParam("limit") @DefaultValue("100") Integer limit, @QueryParam("offset") @DefaultValue("0") Integer offset) {
|
public org.dspace.rest.common.Collection[] list(@QueryParam("expand") String expand, @QueryParam("limit") @DefaultValue("100") Integer limit, @QueryParam("offset") @DefaultValue("0") Integer offset) {
|
||||||
|
org.dspace.core.Context context = null;
|
||||||
try {
|
try {
|
||||||
if(context == null || !context.isValid() ) {
|
context = new org.dspace.core.Context();
|
||||||
context = new org.dspace.core.Context();
|
|
||||||
//Failed SQL is ignored as a failed SQL statement, prevent: current transaction is aborted, commands ignored until end of transaction block
|
|
||||||
context.getDBConnection().setAutoCommit(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
org.dspace.content.Collection[] collections;
|
org.dspace.content.Collection[] collections;
|
||||||
|
|
||||||
@@ -112,6 +76,14 @@ public class CollectionsResource {
|
|||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
log.error(e.getMessage());
|
log.error(e.getMessage());
|
||||||
throw new WebApplicationException(Response.Status.INTERNAL_SERVER_ERROR);
|
throw new WebApplicationException(Response.Status.INTERNAL_SERVER_ERROR);
|
||||||
|
} finally {
|
||||||
|
if(context != null) {
|
||||||
|
try {
|
||||||
|
context.complete();
|
||||||
|
} catch (SQLException e) {
|
||||||
|
log.error(e.getMessage() + " occurred while trying to close");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,17 +94,14 @@ public class CollectionsResource {
|
|||||||
@QueryParam("limit") @DefaultValue("100") Integer limit, @QueryParam("offset") @DefaultValue("0") Integer offset,
|
@QueryParam("limit") @DefaultValue("100") Integer limit, @QueryParam("offset") @DefaultValue("0") Integer offset,
|
||||||
@QueryParam("userIP") String user_ip, @QueryParam("userAgent") String user_agent, @QueryParam("xforwarderfor") String xforwarderfor,
|
@QueryParam("userIP") String user_ip, @QueryParam("userAgent") String user_agent, @QueryParam("xforwarderfor") String xforwarderfor,
|
||||||
@Context HttpHeaders headers, @Context HttpServletRequest request) {
|
@Context HttpHeaders headers, @Context HttpServletRequest request) {
|
||||||
|
org.dspace.core.Context context = null;
|
||||||
try {
|
try {
|
||||||
if(context == null || !context.isValid() ) {
|
context = new org.dspace.core.Context();
|
||||||
context = new org.dspace.core.Context();
|
|
||||||
//Failed SQL is ignored as a failed SQL statement, prevent: current transaction is aborted, commands ignored until end of transaction block
|
|
||||||
context.getDBConnection().setAutoCommit(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
org.dspace.content.Collection collection = org.dspace.content.Collection.find(context, collection_id);
|
org.dspace.content.Collection collection = org.dspace.content.Collection.find(context, collection_id);
|
||||||
if(AuthorizeManager.authorizeActionBoolean(context, collection, org.dspace.core.Constants.READ)) {
|
if(AuthorizeManager.authorizeActionBoolean(context, collection, org.dspace.core.Constants.READ)) {
|
||||||
if(writeStatistics){
|
if(writeStatistics){
|
||||||
writeStats(collection_id, user_ip, user_agent, xforwarderfor, headers, request);
|
writeStats(context, collection_id, user_ip, user_agent, xforwarderfor, headers, request);
|
||||||
}
|
}
|
||||||
return new org.dspace.rest.common.Collection(collection, expand, context, limit, offset);
|
return new org.dspace.rest.common.Collection(collection, expand, context, limit, offset);
|
||||||
} else {
|
} else {
|
||||||
@@ -141,10 +110,18 @@ public class CollectionsResource {
|
|||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
log.error(e.getMessage());
|
log.error(e.getMessage());
|
||||||
throw new WebApplicationException(Response.Status.INTERNAL_SERVER_ERROR);
|
throw new WebApplicationException(Response.Status.INTERNAL_SERVER_ERROR);
|
||||||
|
} finally {
|
||||||
|
if(context != null) {
|
||||||
|
try {
|
||||||
|
context.complete();
|
||||||
|
} catch (SQLException e) {
|
||||||
|
log.error(e.getMessage() + " occurred while trying to close");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void writeStats(Integer collection_id, String user_ip, String user_agent,
|
private void writeStats(org.dspace.core.Context context, Integer collection_id, String user_ip, String user_agent,
|
||||||
String xforwarderfor, HttpHeaders headers,
|
String xforwarderfor, HttpHeaders headers,
|
||||||
HttpServletRequest request) {
|
HttpServletRequest request) {
|
||||||
|
|
||||||
|
@@ -36,52 +36,19 @@ http://localhost:8080/<webapp>/communities
|
|||||||
public class CommunitiesResource {
|
public class CommunitiesResource {
|
||||||
private static Logger log = Logger.getLogger(CommunitiesResource.class);
|
private static Logger log = Logger.getLogger(CommunitiesResource.class);
|
||||||
|
|
||||||
private static org.dspace.core.Context context;
|
|
||||||
|
|
||||||
private static final boolean writeStatistics;
|
private static final boolean writeStatistics;
|
||||||
|
|
||||||
static{
|
static{
|
||||||
writeStatistics=ConfigurationManager.getBooleanProperty("rest","stats",false);
|
writeStatistics=ConfigurationManager.getBooleanProperty("rest","stats",false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
The "GET" annotation indicates this method will respond to HTTP Get requests.
|
|
||||||
The "Produces" annotation indicates the MIME response the method will return.
|
|
||||||
*/
|
|
||||||
@GET
|
|
||||||
@Produces(MediaType.TEXT_HTML)
|
|
||||||
public String list() {
|
|
||||||
StringBuilder everything = new StringBuilder();
|
|
||||||
try {
|
|
||||||
if(context == null || !context.isValid() ) {
|
|
||||||
context = new org.dspace.core.Context();
|
|
||||||
//Failed SQL is ignored as a failed SQL statement, prevent: current transaction is aborted, commands ignored until end of transaction block
|
|
||||||
context.getDBConnection().setAutoCommit(true);
|
|
||||||
}
|
|
||||||
org.dspace.content.Community[] communities = org.dspace.content.Community.findAllTop(context);
|
|
||||||
for(org.dspace.content.Community community : communities) {
|
|
||||||
everything.append(community.getName() + "<br/>\n");
|
|
||||||
}
|
|
||||||
return "<html><title>Hello!</title><body>Communities:<br/>" + everything.toString() + ".</body></html> ";
|
|
||||||
|
|
||||||
} catch (SQLException e) {
|
|
||||||
log.error(e.getMessage());
|
|
||||||
throw new WebApplicationException(Response.Status.INTERNAL_SERVER_ERROR);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//TODO Respond to html for communities/:id
|
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
@Path("/")
|
@Path("/")
|
||||||
@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
|
@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
|
||||||
public org.dspace.rest.common.Community[] list(@QueryParam("expand") String expand) {
|
public org.dspace.rest.common.Community[] list(@QueryParam("expand") String expand) {
|
||||||
|
org.dspace.core.Context context = null;
|
||||||
try {
|
try {
|
||||||
if(context == null || !context.isValid() ) {
|
context = new org.dspace.core.Context();
|
||||||
context = new org.dspace.core.Context();
|
|
||||||
//Failed SQL is ignored as a failed SQL statement, prevent: current transaction is aborted, commands ignored until end of transaction block
|
|
||||||
context.getDBConnection().setAutoCommit(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
org.dspace.content.Community[] topCommunities = org.dspace.content.Community.findAllTop(context);
|
org.dspace.content.Community[] topCommunities = org.dspace.content.Community.findAllTop(context);
|
||||||
ArrayList<org.dspace.rest.common.Community> communityArrayList = new ArrayList<org.dspace.rest.common.Community>();
|
ArrayList<org.dspace.rest.common.Community> communityArrayList = new ArrayList<org.dspace.rest.common.Community>();
|
||||||
@@ -98,7 +65,15 @@ public class CommunitiesResource {
|
|||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
log.error(e.getMessage());
|
log.error(e.getMessage());
|
||||||
throw new WebApplicationException(Response.Status.INTERNAL_SERVER_ERROR);
|
throw new WebApplicationException(Response.Status.INTERNAL_SERVER_ERROR);
|
||||||
} //finally?
|
} finally {
|
||||||
|
if(context != null) {
|
||||||
|
try {
|
||||||
|
context.complete();
|
||||||
|
} catch (SQLException e) {
|
||||||
|
log.error(e.getMessage() + " occurred while trying to close");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
@@ -107,17 +82,14 @@ public class CommunitiesResource {
|
|||||||
public org.dspace.rest.common.Community getCommunity(@PathParam("community_id") Integer community_id, @QueryParam("expand") String expand,
|
public org.dspace.rest.common.Community getCommunity(@PathParam("community_id") Integer community_id, @QueryParam("expand") String expand,
|
||||||
@QueryParam("userIP") String user_ip, @QueryParam("userAgent") String user_agent, @QueryParam("xforwarderfor") String xforwarderfor,
|
@QueryParam("userIP") String user_ip, @QueryParam("userAgent") String user_agent, @QueryParam("xforwarderfor") String xforwarderfor,
|
||||||
@Context HttpHeaders headers, @Context HttpServletRequest request) {
|
@Context HttpHeaders headers, @Context HttpServletRequest request) {
|
||||||
|
org.dspace.core.Context context = null;
|
||||||
try {
|
try {
|
||||||
if(context == null || !context.isValid() ) {
|
context = new org.dspace.core.Context();
|
||||||
context = new org.dspace.core.Context();
|
|
||||||
//Failed SQL is ignored as a failed SQL statement, prevent: current transaction is aborted, commands ignored until end of transaction block
|
|
||||||
context.getDBConnection().setAutoCommit(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
org.dspace.content.Community community = org.dspace.content.Community.find(context, community_id);
|
org.dspace.content.Community community = org.dspace.content.Community.find(context, community_id);
|
||||||
if(AuthorizeManager.authorizeActionBoolean(context, community, org.dspace.core.Constants.READ)) {
|
if(AuthorizeManager.authorizeActionBoolean(context, community, org.dspace.core.Constants.READ)) {
|
||||||
if(writeStatistics){
|
if(writeStatistics){
|
||||||
writeStats(community_id, user_ip, user_agent, xforwarderfor, headers, request);
|
writeStats(context, community_id, user_ip, user_agent, xforwarderfor, headers, request);
|
||||||
}
|
}
|
||||||
return new org.dspace.rest.common.Community(community, expand, context);
|
return new org.dspace.rest.common.Community(community, expand, context);
|
||||||
} else {
|
} else {
|
||||||
@@ -126,10 +98,18 @@ public class CommunitiesResource {
|
|||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
log.error(e.getMessage());
|
log.error(e.getMessage());
|
||||||
throw new WebApplicationException(Response.Status.INTERNAL_SERVER_ERROR);
|
throw new WebApplicationException(Response.Status.INTERNAL_SERVER_ERROR);
|
||||||
} //finally?
|
} finally {
|
||||||
|
if(context != null) {
|
||||||
|
try {
|
||||||
|
context.complete();
|
||||||
|
} catch (SQLException e) {
|
||||||
|
log.error(e.getMessage() + " occurred while trying to close");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void writeStats(Integer community_id, String user_ip, String user_agent,
|
private void writeStats(org.dspace.core.Context context, Integer community_id, String user_ip, String user_agent,
|
||||||
String xforwarderfor, HttpHeaders headers,
|
String xforwarderfor, HttpHeaders headers,
|
||||||
HttpServletRequest request) {
|
HttpServletRequest request) {
|
||||||
|
|
||||||
|
@@ -32,18 +32,14 @@ import java.sql.SQLException;
|
|||||||
@Path("/handle")
|
@Path("/handle")
|
||||||
public class HandleResource {
|
public class HandleResource {
|
||||||
private static Logger log = Logger.getLogger(HandleResource.class);
|
private static Logger log = Logger.getLogger(HandleResource.class);
|
||||||
private static org.dspace.core.Context context;
|
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
@Path("/{prefix}/{suffix}")
|
@Path("/{prefix}/{suffix}")
|
||||||
@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
|
@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
|
||||||
public org.dspace.rest.common.DSpaceObject getObject(@PathParam("prefix") String prefix, @PathParam("suffix") String suffix, @QueryParam("expand") String expand) {
|
public org.dspace.rest.common.DSpaceObject getObject(@PathParam("prefix") String prefix, @PathParam("suffix") String suffix, @QueryParam("expand") String expand) {
|
||||||
|
org.dspace.core.Context context = null;
|
||||||
try {
|
try {
|
||||||
if(context == null || !context.isValid() ) {
|
context = new org.dspace.core.Context();
|
||||||
context = new Context();
|
|
||||||
//Failed SQL is ignored as a failed SQL statement, prevent: current transaction is aborted, commands ignored until end of transaction block
|
|
||||||
context.getDBConnection().setAutoCommit(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
org.dspace.content.DSpaceObject dso = HandleManager.resolveToObject(context, prefix + "/" + suffix);
|
org.dspace.content.DSpaceObject dso = HandleManager.resolveToObject(context, prefix + "/" + suffix);
|
||||||
if(dso == null) {
|
if(dso == null) {
|
||||||
@@ -68,6 +64,14 @@ public class HandleResource {
|
|||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
log.error(e.getMessage());
|
log.error(e.getMessage());
|
||||||
throw new WebApplicationException(Response.Status.INTERNAL_SERVER_ERROR);
|
throw new WebApplicationException(Response.Status.INTERNAL_SERVER_ERROR);
|
||||||
|
} finally {
|
||||||
|
if(context != null) {
|
||||||
|
try {
|
||||||
|
context.complete();
|
||||||
|
} catch (SQLException e) {
|
||||||
|
log.error(e.getMessage() + " occurred while trying to close");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -44,28 +44,22 @@ public class ItemsResource {
|
|||||||
private static final Logger log = Logger.getLogger(ItemsResource.class);
|
private static final Logger log = Logger.getLogger(ItemsResource.class);
|
||||||
//ItemList - Not Implemented
|
//ItemList - Not Implemented
|
||||||
|
|
||||||
private static org.dspace.core.Context context;
|
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
@Path("/{item_id}")
|
@Path("/{item_id}")
|
||||||
@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
|
@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
|
||||||
public org.dspace.rest.common.Item getItem(@PathParam("item_id") Integer item_id, @QueryParam("expand") String expand,
|
public org.dspace.rest.common.Item getItem(@PathParam("item_id") Integer item_id, @QueryParam("expand") String expand,
|
||||||
@QueryParam("userIP") String user_ip, @QueryParam("userAgent") String user_agent, @QueryParam("xforwarderfor") String xforwarderfor,
|
@QueryParam("userIP") String user_ip, @QueryParam("userAgent") String user_agent, @QueryParam("xforwarderfor") String xforwarderfor,
|
||||||
@Context HttpHeaders headers, @Context HttpServletRequest request) throws WebApplicationException {
|
@Context HttpHeaders headers, @Context HttpServletRequest request) throws WebApplicationException {
|
||||||
|
|
||||||
|
org.dspace.core.Context context = null;
|
||||||
try {
|
try {
|
||||||
if(context == null || !context.isValid()) {
|
context = new org.dspace.core.Context();
|
||||||
context = new org.dspace.core.Context();
|
|
||||||
//Failed SQL is ignored as a failed SQL statement, prevent: current transaction is aborted, commands ignored until end of transaction block
|
|
||||||
context.getDBConnection().setAutoCommit(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
org.dspace.content.Item item = org.dspace.content.Item.find(context, item_id);
|
org.dspace.content.Item item = org.dspace.content.Item.find(context, item_id);
|
||||||
|
|
||||||
if(AuthorizeManager.authorizeActionBoolean(context, item, org.dspace.core.Constants.READ)) {
|
if(AuthorizeManager.authorizeActionBoolean(context, item, org.dspace.core.Constants.READ)) {
|
||||||
if(writeStatistics){
|
if(writeStatistics){
|
||||||
writeStats(item_id, user_ip, user_agent, xforwarderfor, headers, request);
|
writeStats(context, item_id, user_ip, user_agent, xforwarderfor, headers, request);
|
||||||
}
|
}
|
||||||
return new org.dspace.rest.common.Item(item, expand, context);
|
return new org.dspace.rest.common.Item(item, expand, context);
|
||||||
} else {
|
} else {
|
||||||
@@ -75,11 +69,19 @@ public class ItemsResource {
|
|||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
log.error(e.getMessage());
|
log.error(e.getMessage());
|
||||||
throw new WebApplicationException(Response.Status.INTERNAL_SERVER_ERROR);
|
throw new WebApplicationException(Response.Status.INTERNAL_SERVER_ERROR);
|
||||||
|
} finally {
|
||||||
|
if(context != null) {
|
||||||
|
try {
|
||||||
|
context.complete();
|
||||||
|
} catch (SQLException e) {
|
||||||
|
log.error(e.getMessage() + " occurred while trying to close");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void writeStats(Integer item_id, String user_ip, String user_agent,
|
private void writeStats(org.dspace.core.Context context, Integer item_id, String user_ip, String user_agent,
|
||||||
String xforwarderfor, HttpHeaders headers,
|
String xforwarderfor, HttpHeaders headers,
|
||||||
HttpServletRequest request) {
|
HttpServletRequest request) {
|
||||||
|
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.dspace</groupId>
|
<groupId>org.dspace</groupId>
|
||||||
<artifactId>dspace-parent</artifactId>
|
<artifactId>dspace-parent</artifactId>
|
||||||
<version>4.0</version>
|
<version>4.3</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
@@ -20,7 +20,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.dspace</groupId>
|
<groupId>org.dspace</groupId>
|
||||||
<artifactId>dspace-parent</artifactId>
|
<artifactId>dspace-parent</artifactId>
|
||||||
<version>4.0</version>
|
<version>4.3</version>
|
||||||
<relativePath>..</relativePath>
|
<relativePath>..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
@@ -126,6 +126,11 @@
|
|||||||
<artifactId>solr-solrj</artifactId>
|
<artifactId>solr-solrj</artifactId>
|
||||||
<version>${solr.version}</version>
|
<version>${solr.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.solr</groupId>
|
||||||
|
<artifactId>solr-cell</artifactId>
|
||||||
|
<version>${solr.version}</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.lucene</groupId>
|
<groupId>org.apache.lucene</groupId>
|
||||||
<artifactId>lucene-core</artifactId>
|
<artifactId>lucene-core</artifactId>
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.dspace</groupId>
|
<groupId>org.dspace</groupId>
|
||||||
<artifactId>dspace-parent</artifactId>
|
<artifactId>dspace-parent</artifactId>
|
||||||
<version>4.0</version>
|
<version>4.3</version>
|
||||||
<relativePath>..</relativePath>
|
<relativePath>..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.dspace</groupId>
|
<groupId>org.dspace</groupId>
|
||||||
<artifactId>dspace-parent</artifactId>
|
<artifactId>dspace-parent</artifactId>
|
||||||
<version>4.0</version>
|
<version>4.3</version>
|
||||||
<relativePath>..</relativePath>
|
<relativePath>..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
@@ -11,7 +11,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.dspace</groupId>
|
<groupId>org.dspace</groupId>
|
||||||
<artifactId>dspace-parent</artifactId>
|
<artifactId>dspace-parent</artifactId>
|
||||||
<version>4.0</version>
|
<version>4.3</version>
|
||||||
<relativePath>..</relativePath>
|
<relativePath>..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
@@ -707,7 +707,7 @@ public class ConfigurableBrowse extends AbstractDSpaceTransformer implements
|
|||||||
// This is so that we can then highlight the correct option in the navigation
|
// This is so that we can then highlight the correct option in the navigation
|
||||||
SortOption bso = bi.getSortOption();
|
SortOption bso = bi.getSortOption();
|
||||||
SortOption so = SortOption.getSortOption(sortBy);
|
SortOption so = SortOption.getSortOption(sortBy);
|
||||||
if ( bso != null && bso.equals(so))
|
if ( bso != null && !bso.equals(so))
|
||||||
{
|
{
|
||||||
BrowseIndex newBi = BrowseIndex.getBrowseIndex(so);
|
BrowseIndex newBi = BrowseIndex.getBrowseIndex(so);
|
||||||
if (newBi != null)
|
if (newBi != null)
|
||||||
|
@@ -12,6 +12,7 @@ import com.yahoo.platform.yui.compressor.JavaScriptCompressor;
|
|||||||
import org.apache.avalon.framework.parameters.ParameterException;
|
import org.apache.avalon.framework.parameters.ParameterException;
|
||||||
import org.apache.avalon.framework.parameters.Parameters;
|
import org.apache.avalon.framework.parameters.Parameters;
|
||||||
import org.apache.cocoon.ProcessingException;
|
import org.apache.cocoon.ProcessingException;
|
||||||
|
import org.apache.cocoon.ResourceNotFoundException;
|
||||||
import org.apache.cocoon.environment.*;
|
import org.apache.cocoon.environment.*;
|
||||||
import org.apache.cocoon.reading.ResourceReader;
|
import org.apache.cocoon.reading.ResourceReader;
|
||||||
import org.apache.excalibur.source.Source;
|
import org.apache.excalibur.source.Source;
|
||||||
@@ -69,10 +70,19 @@ public class ConcatenationReader extends ResourceReader {
|
|||||||
|
|
||||||
// setup list of sources, get relevant parts of path
|
// setup list of sources, get relevant parts of path
|
||||||
this.inputSources = new ArrayList<Source>();
|
this.inputSources = new ArrayList<Source>();
|
||||||
String path = src.substring(0, src.lastIndexOf('/'));
|
|
||||||
|
// Check for an empty path
|
||||||
|
String path = "";
|
||||||
|
if(src.contains("/"))
|
||||||
|
{
|
||||||
|
path = src.substring(0, src.lastIndexOf('/'));
|
||||||
|
}
|
||||||
String file = src.substring(src.lastIndexOf('/')+1);
|
String file = src.substring(src.lastIndexOf('/')+1);
|
||||||
|
|
||||||
// now build own list of inputsources
|
// Now build own list of inputsources
|
||||||
|
// Several files may be passed in at once, e.g.
|
||||||
|
// "themes/Mirage/lib/css/reset,base,helper,style,print.css"
|
||||||
|
// So, we need to build the fullPath to *each* file individually
|
||||||
String[] files = file.split(",");
|
String[] files = file.split(",");
|
||||||
for (String f : files) {
|
for (String f : files) {
|
||||||
if (file.endsWith(".json") && !f.endsWith(".json")) {
|
if (file.endsWith(".json") && !f.endsWith(".json")) {
|
||||||
@@ -85,8 +95,21 @@ public class ConcatenationReader extends ResourceReader {
|
|||||||
f += ".css";
|
f += ".css";
|
||||||
}
|
}
|
||||||
|
|
||||||
String fullPath = path + "/" + f;
|
// Build full path to this individual file
|
||||||
this.inputSources.add(resolver.resolveURI(fullPath));
|
String fullPath;
|
||||||
|
if(!path.isEmpty())
|
||||||
|
fullPath = path + "/" + f;
|
||||||
|
else
|
||||||
|
fullPath = f;
|
||||||
|
|
||||||
|
// Add to list of inputsources if this file exists
|
||||||
|
Source inSource = resolver.resolveURI(fullPath);
|
||||||
|
if(inSource.exists())
|
||||||
|
{
|
||||||
|
this.inputSources.add(inSource);
|
||||||
|
}
|
||||||
|
else // else throw a ResourceNotFound (which triggers a 404)
|
||||||
|
throw new ResourceNotFoundException("Resource not found (" + fullPath + ")");
|
||||||
}
|
}
|
||||||
|
|
||||||
// do super stuff
|
// do super stuff
|
||||||
|
@@ -0,0 +1,68 @@
|
|||||||
|
package org.dspace.app.xmlui.cocoon;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.avalon.framework.configuration.Configurable;
|
||||||
|
import org.apache.avalon.framework.parameters.Parameters;
|
||||||
|
import org.apache.cocoon.ResourceNotFoundException;
|
||||||
|
import org.apache.cocoon.reading.ResourceReader;
|
||||||
|
|
||||||
|
import org.apache.cocoon.ProcessingException;
|
||||||
|
import org.apache.cocoon.caching.CacheableProcessingComponent;
|
||||||
|
import org.apache.cocoon.environment.SourceResolver;
|
||||||
|
import org.apache.excalibur.source.Source;
|
||||||
|
|
||||||
|
import org.xml.sax.SAXException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The SafeResourceReader blocks access to specific paths which we do NOT want
|
||||||
|
* to be readable on the web. By default, the Cocoon ResourceReader just loads
|
||||||
|
* whatever local file you request, which is not very secure and exposes XMLUI
|
||||||
|
* to possible directory traversal vulnerabilities (when encoded dots or slashes
|
||||||
|
* are passed on the URL).
|
||||||
|
*/
|
||||||
|
public class SafeResourceReader extends ResourceReader
|
||||||
|
implements CacheableProcessingComponent, Configurable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Setup the reader.
|
||||||
|
* The resource is opened to get an <code>InputStream</code>,
|
||||||
|
* the length and the last modification date
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void setup(SourceResolver resolver, Map objectModel, String src, Parameters par)
|
||||||
|
throws ProcessingException, SAXException, IOException {
|
||||||
|
|
||||||
|
// If the requested path includes any of the following strings/characters
|
||||||
|
// then block access and return "Resource Not Found"
|
||||||
|
if(src != null && (
|
||||||
|
// %252e = double encoded dot (.)
|
||||||
|
src.toLowerCase().contains("%252e") ||
|
||||||
|
// %2e = encoded dot (.)
|
||||||
|
src.toLowerCase().contains("%2e") ||
|
||||||
|
// %2f = encoded slash (/)
|
||||||
|
src.toLowerCase().contains("%2f") ||
|
||||||
|
// block public access to all Cocoon Sitemaps (*.xmap)
|
||||||
|
src.toLowerCase().contains(".xmap") ||
|
||||||
|
// block public access to all Theme XSLs
|
||||||
|
src.toLowerCase().contains(".xsl")
|
||||||
|
))
|
||||||
|
{
|
||||||
|
// Block access by throwing a ResourceNotFound (triggers a 404)
|
||||||
|
throw new ResourceNotFoundException("Resource not found (" + src + ")");
|
||||||
|
}
|
||||||
|
|
||||||
|
// See if this resource actually exists by attempting to resolve it
|
||||||
|
// If not, throw a ResourceNotFound (triggers a 404)
|
||||||
|
Source resource = resolver.resolveURI(src);
|
||||||
|
if(!resource.exists())
|
||||||
|
{
|
||||||
|
throw new ResourceNotFoundException("Resource not found (" + src + ")");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Otherwise, simply load the requested resource via ResourceReader
|
||||||
|
super.setup(resolver, objectModel, src, par);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -2120,6 +2120,7 @@
|
|||||||
<message key="xmlui.dri2xhtml.METS-1.0.item-files-view">View</message>
|
<message key="xmlui.dri2xhtml.METS-1.0.item-files-view">View</message>
|
||||||
<message key="xmlui.dri2xhtml.METS-1.0.item-files-description">Description</message>
|
<message key="xmlui.dri2xhtml.METS-1.0.item-files-description">Description</message>
|
||||||
<message key="xmlui.dri2xhtml.METS-1.0.item-files-viewOpen">View/<wbr/>Open</message>
|
<message key="xmlui.dri2xhtml.METS-1.0.item-files-viewOpen">View/<wbr/>Open</message>
|
||||||
|
<message key="xmlui.dri2xhtml.METS-1.0.item-files-access-rights">Read access available for</message>
|
||||||
<message key="xmlui.dri2xhtml.METS-1.0.item-no-files">There are no files associated with this item.</message>
|
<message key="xmlui.dri2xhtml.METS-1.0.item-no-files">There are no files associated with this item.</message>
|
||||||
|
|
||||||
<message key="xmlui.dri2xhtml.METS-1.0.size-bytes">bytes</message>
|
<message key="xmlui.dri2xhtml.METS-1.0.size-bytes">bytes</message>
|
||||||
|
@@ -184,7 +184,7 @@
|
|||||||
<map:selector name="AuthenticatedSelector" src="org.dspace.app.xmlui.aspect.general.AuthenticatedSelector"/>
|
<map:selector name="AuthenticatedSelector" src="org.dspace.app.xmlui.aspect.general.AuthenticatedSelector"/>
|
||||||
</map:selectors>
|
</map:selectors>
|
||||||
<map:readers default="resource">
|
<map:readers default="resource">
|
||||||
<map:reader name="resource" src="org.apache.cocoon.reading.ResourceReader"
|
<map:reader name="resource" src="org.dspace.app.xmlui.cocoon.SafeResourceReader"
|
||||||
logger="sitemap.reader.resource" pool-max="32">
|
logger="sitemap.reader.resource" pool-max="32">
|
||||||
<expires>3600000</expires> <!-- 1000 * 60 * 60 = 3600000 = One hour -->
|
<expires>3600000</expires> <!-- 1000 * 60 * 60 = 3600000 = One hour -->
|
||||||
</map:reader>
|
</map:reader>
|
||||||
|
@@ -65,8 +65,8 @@
|
|||||||
}
|
}
|
||||||
orderElement.val(newOrder);
|
orderElement.val(newOrder);
|
||||||
|
|
||||||
var upArrow = row.find('input[name$^="submit_order_"][name$="_up"]');
|
var upArrow = row.find('input[name^="submit_order_"][name$="_up"]');
|
||||||
var downArrow = row.find('input[name$^="submit_order_"][name$="_down"]');
|
var downArrow = row.find('input[name^="submit_order_"][name$="_down"]');
|
||||||
|
|
||||||
//Check if we are the first row, if so hide the up arrow
|
//Check if we are the first row, if so hide the up arrow
|
||||||
if(isBundleRow(row.prev())){
|
if(isBundleRow(row.prev())){
|
||||||
@@ -93,7 +93,11 @@
|
|||||||
*/
|
*/
|
||||||
function isBundleRow(row){
|
function isBundleRow(row){
|
||||||
// Checks if the identifier starts with the bundle head identifier
|
// Checks if the identifier starts with the bundle head identifier
|
||||||
return row.attr("id").indexOf("aspect_administrative_item_EditItemBitstreamsForm_row_bundle_head_") == 0;
|
|
||||||
|
//DS-2027, found error condition in which attribute is not set when reordering original bitstreams
|
||||||
|
var id = row.attr("id");
|
||||||
|
if (id === undefined) return false;
|
||||||
|
return id.indexOf("aspect_administrative_item_EditItemBitstreamsForm_row_bundle_head_") == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -539,11 +539,15 @@
|
|||||||
</xsl:otherwise>
|
</xsl:otherwise>
|
||||||
</xsl:choose>
|
</xsl:choose>
|
||||||
</xsl:variable>
|
</xsl:variable>
|
||||||
|
<xsl:variable name="alt-text"><i18n:text>xmlui.dri2xhtml.METS-1.0.item-files-access-rights</i18n:text> <xsl:value-of select="$users"/></xsl:variable>
|
||||||
|
|
||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
<xsl:when test="(not ($rights_context/@CONTEXTCLASS = 'GENERAL PUBLIC') and ($rights_context/rights:Permissions/@DISPLAY = 'true')) or not ($rights_context)">
|
<xsl:when test="(not ($rights_context/@CONTEXTCLASS = 'GENERAL PUBLIC') and ($rights_context/rights:Permissions/@DISPLAY = 'true')) or not ($rights_context)">
|
||||||
<a href="{mets:FLocat[@LOCTYPE='URL']/@xlink:href}">
|
<a href="{mets:FLocat[@LOCTYPE='URL']/@xlink:href}">
|
||||||
<img width="64" height="64" src="{concat($theme-path,'/images/Crystal_Clear_action_lock3_64px.png')}" title="Read access available for {$users}"/>
|
<img width="64" height="64" src="{concat($theme-path,'/images/Crystal_Clear_action_lock3_64px.png')}">
|
||||||
|
<xsl:attribute name="title"><xsl:value-of select="$alt-text"/></xsl:attribute>
|
||||||
|
<xsl:attribute name="alt"><xsl:value-of select="$alt-text"/></xsl:attribute>
|
||||||
|
</img>
|
||||||
<!-- icon source: http://commons.wikimedia.org/wiki/File:Crystal_Clear_action_lock3.png -->
|
<!-- icon source: http://commons.wikimedia.org/wiki/File:Crystal_Clear_action_lock3.png -->
|
||||||
</a>
|
</a>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
|
@@ -222,11 +222,15 @@
|
|||||||
<xsl:if test="position() != last()">, </xsl:if>
|
<xsl:if test="position() != last()">, </xsl:if>
|
||||||
</xsl:for-each>
|
</xsl:for-each>
|
||||||
</xsl:variable>
|
</xsl:variable>
|
||||||
|
<xsl:variable name="alt-text"><i18n:text>xmlui.dri2xhtml.METS-1.0.item-files-access-rights</i18n:text> <xsl:value-of select="$users"/></xsl:variable>
|
||||||
|
|
||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
<xsl:when test="not ($rights_context/@CONTEXTCLASS = 'GENERAL PUBLIC') and ($rights_context/rights:Permissions/@DISPLAY = 'true')">
|
<xsl:when test="not ($rights_context/@CONTEXTCLASS = 'GENERAL PUBLIC') and ($rights_context/rights:Permissions/@DISPLAY = 'true')">
|
||||||
<a href="{mets:FLocat[@LOCTYPE='URL']/@xlink:href}">
|
<a href="{mets:FLocat[@LOCTYPE='URL']/@xlink:href}">
|
||||||
<img width="64" height="64" src="{concat($theme-path,'/images/Crystal_Clear_action_lock3_64px.png')}" title="Read access available for {$users}"/>
|
<img width="64" height="64" src="{concat($theme-path,'/images/Crystal_Clear_action_lock3_64px.png')}">
|
||||||
|
<xsl:attribute name="title"><xsl:value-of select="$alt-text"/></xsl:attribute>
|
||||||
|
<xsl:attribute name="alt"><xsl:value-of select="$alt-text"/></xsl:attribute>
|
||||||
|
</img>
|
||||||
<!-- icon source: http://commons.wikimedia.org/wiki/File:Crystal_Clear_action_lock3.png -->
|
<!-- icon source: http://commons.wikimedia.org/wiki/File:Crystal_Clear_action_lock3.png -->
|
||||||
</a>
|
</a>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
|
@@ -133,12 +133,6 @@
|
|||||||
<xsl:attribute name="src">
|
<xsl:attribute name="src">
|
||||||
<xsl:value-of select="$mobile-url"/>
|
<xsl:value-of select="$mobile-url"/>
|
||||||
<xsl:text>/themes/mobile/lib/cookies.js</xsl:text>
|
<xsl:text>/themes/mobile/lib/cookies.js</xsl:text>
|
||||||
</xsl:attribute> </script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
<xsl:attribute name="src">
|
|
||||||
<xsl:value-of select="$mobile-url"/>
|
|
||||||
<xsl:text>/themes/mobile/lib/m-tweaks.js</xsl:text>
|
|
||||||
</xsl:attribute> </script>
|
</xsl:attribute> </script>
|
||||||
|
|
||||||
<!-- Add the title in -->
|
<!-- Add the title in -->
|
||||||
@@ -694,7 +688,7 @@
|
|||||||
</xsl:attribute>
|
</xsl:attribute>
|
||||||
<img alt="Thumbnail">
|
<img alt="Thumbnail">
|
||||||
<xsl:attribute name="src">
|
<xsl:attribute name="src">
|
||||||
<xsl:variable name="request-uri" select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='contextPath'])"/>
|
<xsl:variable name="request-uri" select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='contextPath']"/>
|
||||||
<xsl:text>/themes/mobile/lib/images/default-thumbnail.png</xsl:text>
|
<xsl:text>/themes/mobile/lib/images/default-thumbnail.png</xsl:text>
|
||||||
</xsl:attribute>
|
</xsl:attribute>
|
||||||
</img>
|
</img>
|
||||||
|
@@ -61,6 +61,12 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# If the user only wants the CLASSPATH, just give it now.
|
||||||
|
if [ "$1" = "classpath" ]; then
|
||||||
|
echo $FULLPATH
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#Allow user to specify java options through JAVA_OPTS variable
|
#Allow user to specify java options through JAVA_OPTS variable
|
||||||
|
@@ -1 +1,6 @@
|
|||||||
<XOAIDescription xmlns="http://www.lyncode.com/XOAIConfiguration">XOAI: OAI-PMH Java Toolkit</XOAIDescription>
|
<oai-identifier xmlns="http://www.openarchives.org/OAI/2.0/oai-identifier" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai-identifier http://www.openarchives.org/OAI/2.0/oai-identifier.xsd">
|
||||||
|
<scheme>oai</scheme>
|
||||||
|
<repositoryIdentifier>${dspace.hostname}</repositoryIdentifier>
|
||||||
|
<delimiter>:</delimiter>
|
||||||
|
<sampleIdentifier>oai:${dspace.hostname}:${handle.prefix}/1234</sampleIdentifier>
|
||||||
|
</oai-identifier>
|
||||||
|
@@ -9,78 +9,89 @@
|
|||||||
|
|
||||||
-->
|
-->
|
||||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||||
xmlns:doc="http://www.lyncode.com/xoai" version="1.0">
|
xmlns:doc="http://www.lyncode.com/xoai"
|
||||||
<xsl:output omit-xml-declaration="yes" method="xml" indent="yes" />
|
xmlns:dim="http://www.dspace.org/xmlns/dspace/dim" version="1.0">
|
||||||
|
<xsl:output omit-xml-declaration="yes" method="xml" indent="yes"/>
|
||||||
|
|
||||||
|
<!-- An identity transformation to show the internal XOAI generated XML -->
|
||||||
|
<xsl:template match="/">
|
||||||
|
<dim:dim xmlns:dim="http://www.dspace.org/xmlns/dspace/dim" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://www.dspace.org/xmlns/dspace/dim http://www.dspace.org/schema/dim.xsd">
|
||||||
|
<xsl:apply-templates select="//doc:field[@name='value']"/>
|
||||||
|
</dim:dim>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="/doc:metadata/doc:element[@name='dc']/doc:element/doc:element/doc:field[@name='value']">
|
||||||
|
<xsl:call-template name="dimfield">
|
||||||
|
<xsl:with-param name="mdschema" select="../../../@name"/>
|
||||||
|
<xsl:with-param name="element" select="../../@name"/>
|
||||||
|
<xsl:with-param name="qualifier"/>
|
||||||
|
<xsl:with-param name="language" select="../@name"/>
|
||||||
|
<xsl:with-param name="authority" select="../doc:field[@name='authority']"/>
|
||||||
|
<xsl:with-param name="confidence" select="../doc:field[@name='confidence']"/>
|
||||||
|
<xsl:with-param name="value" select="text()"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="/doc:metadata/doc:element[@name='dc']/doc:element/doc:element/doc:element/doc:field[@name='value']">
|
||||||
|
<xsl:call-template name="dimfield">
|
||||||
|
<xsl:with-param name="mdschema" select="../../../../@name"/>
|
||||||
|
<xsl:with-param name="element" select="../../../@name"/>
|
||||||
|
<xsl:with-param name="qualifier" select="../../@name"/>
|
||||||
|
<xsl:with-param name="language" select="../@name" />
|
||||||
|
<xsl:with-param name="authority" select="../doc:field[@name='authority']"/>
|
||||||
|
<xsl:with-param name="confidence" select="../doc:field[@name='confidence']"/>
|
||||||
|
<xsl:with-param name="value" select="text()"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template name="dimfield">
|
||||||
|
<xsl:param name="mdschema"/>
|
||||||
|
<xsl:param name="element"/>
|
||||||
|
<xsl:param name="qualifier"/>
|
||||||
|
<xsl:param name="language"/>
|
||||||
|
<xsl:param name="authority"/>
|
||||||
|
<xsl:param name="confidence"/>
|
||||||
|
<xsl:param name="value"/>
|
||||||
|
|
||||||
|
<dim:field>
|
||||||
|
<xsl:attribute name="mdschema">
|
||||||
|
<xsl:value-of select="$mdschema"/>
|
||||||
|
</xsl:attribute>
|
||||||
|
|
||||||
|
<xsl:attribute name="element">
|
||||||
|
<xsl:value-of select="$element"/>
|
||||||
|
</xsl:attribute>
|
||||||
|
|
||||||
|
<xsl:if test="$qualifier">
|
||||||
|
<xsl:attribute name="qualifier">
|
||||||
|
<xsl:value-of select="$qualifier"/>
|
||||||
|
</xsl:attribute>
|
||||||
|
</xsl:if>
|
||||||
|
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="$language='none'"/>
|
||||||
|
<xsl:otherwise>
|
||||||
|
<xsl:attribute name="lang">
|
||||||
|
<xsl:value-of select="$language"/>
|
||||||
|
</xsl:attribute>
|
||||||
|
</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
|
||||||
|
<xsl:if test="$authority">
|
||||||
|
<xsl:attribute name="authority">
|
||||||
|
<xsl:value-of select="$authority"/>
|
||||||
|
</xsl:attribute>
|
||||||
|
</xsl:if>
|
||||||
|
|
||||||
|
<xsl:if test="$confidence">
|
||||||
|
<xsl:attribute name="confidence">
|
||||||
|
<xsl:value-of select="$confidence"/>
|
||||||
|
</xsl:attribute>
|
||||||
|
</xsl:if>
|
||||||
|
|
||||||
|
<xsl:value-of select="$value"/>
|
||||||
|
</dim:field>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
<!-- An identity transformation to show the internal XOAI generated XML -->
|
|
||||||
<xsl:template match="/">
|
|
||||||
<dim:dim xmlns:dim="http://www.dspace.org/xmlns/dspace/dim" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://www.dspace.org/xmlns/dspace/dim http://www.dspace.org/schema/dim.xsd">
|
|
||||||
<xsl:for-each select="doc:metadata/doc:element[@name='dc']/doc:element/doc:element">
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="doc:element">
|
|
||||||
<dim:field>
|
|
||||||
<xsl:attribute name="mdschema">
|
|
||||||
<xsl:value-of select="../../@name" />
|
|
||||||
</xsl:attribute>
|
|
||||||
<xsl:attribute name="element">
|
|
||||||
<xsl:value-of select="../@name" />
|
|
||||||
</xsl:attribute>
|
|
||||||
<xsl:attribute name="qualifier">
|
|
||||||
<xsl:value-of select="@name" />
|
|
||||||
</xsl:attribute>
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="doc:element[@name='none']"></xsl:when>
|
|
||||||
<xsl:otherwise>
|
|
||||||
<xsl:attribute name="lang">
|
|
||||||
<xsl:value-of select="doc:element/@name" />
|
|
||||||
</xsl:attribute>
|
|
||||||
</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
<xsl:if test="doc:element/doc:field[@name='authority']">
|
|
||||||
<xsl:attribute name="authority">
|
|
||||||
<xsl:value-of select="doc:element/doc:field[@name='authority']/text()" />
|
|
||||||
</xsl:attribute>
|
|
||||||
</xsl:if>
|
|
||||||
<xsl:if test="doc:element/doc:field[@name='confidence']">
|
|
||||||
<xsl:attribute name="confidence">
|
|
||||||
<xsl:value-of select="doc:element/doc:field[@name='confidence']/text()" />
|
|
||||||
</xsl:attribute>
|
|
||||||
</xsl:if>
|
|
||||||
<xsl:value-of select="doc:element/doc:field[@name='value']/text()"></xsl:value-of>
|
|
||||||
</dim:field>
|
|
||||||
</xsl:when>
|
|
||||||
<xsl:otherwise>
|
|
||||||
<dim:field>
|
|
||||||
<xsl:attribute name="mdschema">
|
|
||||||
<xsl:value-of select="../../@name" />
|
|
||||||
</xsl:attribute>
|
|
||||||
<xsl:attribute name="element">
|
|
||||||
<xsl:value-of select="../@name" />
|
|
||||||
</xsl:attribute>
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="@name='none'"></xsl:when>
|
|
||||||
<xsl:otherwise>
|
|
||||||
<xsl:attribute name="lang">
|
|
||||||
<xsl:value-of select="@name" />
|
|
||||||
</xsl:attribute>
|
|
||||||
</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
<xsl:if test="doc:field[@name='authority']">
|
|
||||||
<xsl:attribute name="authority">
|
|
||||||
<xsl:value-of select="doc:field[@name='authority']/text()" />
|
|
||||||
</xsl:attribute>
|
|
||||||
</xsl:if>
|
|
||||||
<xsl:if test="doc:field[@name='confidence']">
|
|
||||||
<xsl:attribute name="confidence">
|
|
||||||
<xsl:value-of select="doc:field[@name='confidence']/text()" />
|
|
||||||
</xsl:attribute>
|
|
||||||
</xsl:if>
|
|
||||||
<xsl:value-of select="doc:field[@name='value']/text()"></xsl:value-of>
|
|
||||||
</dim:field>
|
|
||||||
</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
</xsl:for-each>
|
|
||||||
</dim:dim>
|
|
||||||
</xsl:template>
|
|
||||||
</xsl:stylesheet>
|
</xsl:stylesheet>
|
||||||
|
@@ -830,6 +830,10 @@ webui.submit.blocktheses = false
|
|||||||
# Defaults to true; If set to 'false', submitter has option to skip upload
|
# Defaults to true; If set to 'false', submitter has option to skip upload
|
||||||
#webui.submit.upload.required = true
|
#webui.submit.upload.required = true
|
||||||
|
|
||||||
|
# Whether to enable the AJAX-based upload progress meter. Defaults to
|
||||||
|
# 'true'.
|
||||||
|
#webui.submit.upload.ajax = true
|
||||||
|
|
||||||
# Whether or not to use the 'advanced' form of the access step.
|
# Whether or not to use the 'advanced' form of the access step.
|
||||||
# Defaults to false, ie the simple form is used.
|
# Defaults to false, ie the simple form is used.
|
||||||
#webui.submission.restrictstep.enableAdvancedForm = false
|
#webui.submission.restrictstep.enableAdvancedForm = false
|
||||||
|
@@ -391,12 +391,16 @@ it, please enter the types and the actual numbers or codes below.</hint>
|
|||||||
<displayed-value>Chinese</displayed-value>
|
<displayed-value>Chinese</displayed-value>
|
||||||
<stored-value>zh</stored-value>
|
<stored-value>zh</stored-value>
|
||||||
</pair>
|
</pair>
|
||||||
|
<pair>
|
||||||
|
<displayed-value>Turkish</displayed-value>
|
||||||
|
<stored-value>tr</stored-value>
|
||||||
|
</pair>
|
||||||
<pair>
|
<pair>
|
||||||
<displayed-value>(Other)</displayed-value>
|
<displayed-value>(Other)</displayed-value>
|
||||||
<stored-value>other</stored-value>
|
<stored-value>other</stored-value>
|
||||||
</pair>
|
</pair>
|
||||||
</value-pairs>
|
</value-pairs>
|
||||||
|
|
||||||
</form-value-pairs>
|
</form-value-pairs>
|
||||||
|
|
||||||
</input-forms>
|
</input-forms>
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
# Logging level
|
# Logging level
|
||||||
solr.log=logs/
|
solr.log=logs/
|
||||||
log4j.rootLogger=INFO, file, CONSOLE
|
log4j.rootLogger=INFO, file
|
||||||
|
|
||||||
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
|
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
|
||||||
|
|
||||||
|
@@ -137,6 +137,12 @@ lastname-header = SHIB-SURNAME
|
|||||||
# If the eperson metadata field is not found, should it be automatically created?
|
# If the eperson metadata field is not found, should it be automatically created?
|
||||||
eperson.metadata.autocreate = true;
|
eperson.metadata.autocreate = true;
|
||||||
|
|
||||||
|
# Shibboleth attributes are by default UTF-8 encoded. Some servlet container
|
||||||
|
# automatically converts the attributes from ISO-8859-1 (latin-1) to UTF-8.
|
||||||
|
# As the attributes already were UTF-8 encoded it may be necessary to reconvert
|
||||||
|
# them. If you detect problems with special characters in shibboleth attributes
|
||||||
|
# set this to true (default to false).
|
||||||
|
reconvert.attributes = false
|
||||||
|
|
||||||
##
|
##
|
||||||
## Role-based Groups:
|
## Role-based Groups:
|
||||||
|
@@ -235,6 +235,32 @@
|
|||||||
<property name="useAsHomePage" value="false"/>
|
<property name="useAsHomePage" value="false"/>
|
||||||
</bean>
|
</bean>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="hitHighlightingConfiguration">
|
||||||
|
<bean class="org.dspace.discovery.configuration.DiscoveryHitHighlightingConfiguration">
|
||||||
|
<property name="metadataFields">
|
||||||
|
<list>
|
||||||
|
<bean class="org.dspace.discovery.configuration.DiscoveryHitHighlightFieldConfiguration">
|
||||||
|
<property name="field" value="dc.title"/>
|
||||||
|
<property name="snippets" value="5"/>
|
||||||
|
</bean>
|
||||||
|
<bean class="org.dspace.discovery.configuration.DiscoveryHitHighlightFieldConfiguration">
|
||||||
|
<property name="field" value="dc.contributor.author"/>
|
||||||
|
<property name="snippets" value="5"/>
|
||||||
|
</bean>
|
||||||
|
<bean class="org.dspace.discovery.configuration.DiscoveryHitHighlightFieldConfiguration">
|
||||||
|
<property name="field" value="dc.description.abstract"/>
|
||||||
|
<property name="maxSize" value="250"/>
|
||||||
|
<property name="snippets" value="2"/>
|
||||||
|
</bean>
|
||||||
|
<bean class="org.dspace.discovery.configuration.DiscoveryHitHighlightFieldConfiguration">
|
||||||
|
<property name="field" value="fulltext"/>
|
||||||
|
<property name="maxSize" value="250"/>
|
||||||
|
<property name="snippets" value="2"/>
|
||||||
|
</bean>
|
||||||
|
</list>
|
||||||
|
</property>
|
||||||
|
</bean>
|
||||||
|
</property>
|
||||||
<!-- When true a "did you mean" example will be displayed, value can be true or false -->
|
<!-- When true a "did you mean" example will be displayed, value can be true or false -->
|
||||||
<property name="spellCheckEnabled" value="true"/>
|
<property name="spellCheckEnabled" value="true"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
Binary file not shown.
@@ -80,6 +80,8 @@ DROP TABLE harvested_item;
|
|||||||
DROP TABLE Group2GroupCache;
|
DROP TABLE Group2GroupCache;
|
||||||
DROP TABLE Group2Group;
|
DROP TABLE Group2Group;
|
||||||
DROP TABLE FileExtension;
|
DROP TABLE FileExtension;
|
||||||
|
DROP TABLE webapp;
|
||||||
|
DROP TABLE requestitem;
|
||||||
-- Drop main object tables near end as many other tables have dependencies on them
|
-- Drop main object tables near end as many other tables have dependencies on them
|
||||||
DROP TABLE versionitem;
|
DROP TABLE versionitem;
|
||||||
DROP TABLE versionhistory;
|
DROP TABLE versionhistory;
|
||||||
@@ -132,6 +134,8 @@ DROP SEQUENCE harvested_collection_seq;
|
|||||||
DROP SEQUENCE harvested_item_seq;
|
DROP SEQUENCE harvested_item_seq;
|
||||||
DROP SEQUENCE versionhistory_seq;
|
DROP SEQUENCE versionhistory_seq;
|
||||||
DROP SEQUENCE versionitem_seq;
|
DROP SEQUENCE versionitem_seq;
|
||||||
|
DROP SEQUENCE webapp_seq;
|
||||||
|
DROP SEQUENCE requestitem_seq;
|
||||||
|
|
||||||
-- Drop the getnextid() function
|
-- Drop the getnextid() function
|
||||||
DROP FUNCTION getnextid;
|
DROP FUNCTION getnextid;
|
||||||
|
@@ -47,7 +47,7 @@ CREATE TABLE Webapp
|
|||||||
(
|
(
|
||||||
webapp_id INTEGER NOT NULL PRIMARY KEY,
|
webapp_id INTEGER NOT NULL PRIMARY KEY,
|
||||||
AppName VARCHAR2(32),
|
AppName VARCHAR2(32),
|
||||||
URL VARCHAR2,
|
URL VARCHAR2(1000),
|
||||||
Started TIMESTAMP,
|
Started TIMESTAMP,
|
||||||
isUI NUMBER(1)
|
isUI NUMBER(1)
|
||||||
);
|
);
|
||||||
@@ -62,7 +62,7 @@ CREATE TABLE requestitem
|
|||||||
(
|
(
|
||||||
requestitem_id INTEGER NOT NULL,
|
requestitem_id INTEGER NOT NULL,
|
||||||
token varchar(48),
|
token varchar(48),
|
||||||
item_id INDEX,
|
item_id INTEGER,
|
||||||
bitstream_id INTEGER,
|
bitstream_id INTEGER,
|
||||||
allfiles NUMBER(1),
|
allfiles NUMBER(1),
|
||||||
request_email VARCHAR2(64),
|
request_email VARCHAR2(64),
|
||||||
@@ -87,4 +87,4 @@ update workflowitem set multiple_titles=1, published_before=1, multiple_files=1;
|
|||||||
-- DS-1811 Removing a collection fails if non-Solr DAO has been used before for item count
|
-- DS-1811 Removing a collection fails if non-Solr DAO has been used before for item count
|
||||||
-------------------------------------------------------
|
-------------------------------------------------------
|
||||||
delete from collection_item_count;
|
delete from collection_item_count;
|
||||||
delete from community_item_count;
|
delete from community_item_count;
|
||||||
|
@@ -121,7 +121,7 @@ DELETE FROM resourcepolicy
|
|||||||
WHERE resource_type_id = 0 AND resource_id IN
|
WHERE resource_type_id = 0 AND resource_id IN
|
||||||
(SELECT bundle2bitstream.bitstream_id FROM
|
(SELECT bundle2bitstream.bitstream_id FROM
|
||||||
((workflowitem INNER JOIN item2bundle ON workflowitem.item_id = item2bundle.item_id)
|
((workflowitem INNER JOIN item2bundle ON workflowitem.item_id = item2bundle.item_id)
|
||||||
INNER JOIN bundle2bitstream ON item2bundle.bundle_id = bundle2bitstream.bundle_id);
|
INNER JOIN bundle2bitstream ON item2bundle.bundle_id = bundle2bitstream.bundle_id));
|
||||||
-- Create policies for claimtasks
|
-- Create policies for claimtasks
|
||||||
-- public static final int BITSTREAM = 0;
|
-- public static final int BITSTREAM = 0;
|
||||||
-- public static final int BUNDLE = 1;
|
-- public static final int BUNDLE = 1;
|
||||||
@@ -137,7 +137,7 @@ WHERE resource_type_id = 0 AND resource_id IN
|
|||||||
-- Create a temporarty table with action ID's
|
-- Create a temporarty table with action ID's
|
||||||
CREATE TABLE temptable(
|
CREATE TABLE temptable(
|
||||||
action_id INTEGER PRIMARY KEY
|
action_id INTEGER PRIMARY KEY
|
||||||
)
|
);
|
||||||
INSERT ALL
|
INSERT ALL
|
||||||
INTO temptable (action_id) VALUES (0)
|
INTO temptable (action_id) VALUES (0)
|
||||||
INTO temptable (action_id) VALUES (1)
|
INTO temptable (action_id) VALUES (1)
|
||||||
@@ -266,11 +266,11 @@ FROM (((cwf_workflowitem INNER JOIN item ON cwf_workflowitem.item_id = item.item
|
|||||||
);
|
);
|
||||||
|
|
||||||
-- TODO: not tested yet
|
-- TODO: not tested yet
|
||||||
INSERT INTO cwf_in_progress_user (in_progress_user_id, workflowitem_id, step_id, user_id, finished)
|
INSERT INTO cwf_in_progress_user (in_progress_user_id, workflowitem_id, user_id, finished)
|
||||||
SELECT
|
SELECT
|
||||||
cwf_in_progress_user_seq.nextval AS in_progress_user_id,
|
cwf_in_progress_user_seq.nextval AS in_progress_user_id,
|
||||||
cwf_workflowitem.item_id AS workflowitem_id,
|
cwf_workflowitem.workflowitem_id AS workflowitem_id,
|
||||||
cwf_claimtask.owner_id AS user_id
|
cwf_claimtask.owner_id AS user_id,
|
||||||
0 as finished
|
0 as finished
|
||||||
FROM
|
FROM
|
||||||
(cwf_claimtask INNER JOIN cwf_workflowitem ON cwf_workflowitem.workflowitem_id = cwf_claimtask.workflowitem_id);
|
(cwf_claimtask INNER JOIN cwf_workflowitem ON cwf_workflowitem.workflowitem_id = cwf_claimtask.workflowitem_id);
|
||||||
|
@@ -5,58 +5,55 @@ CREATE SEQUENCE cwf_claimtask_seq;
|
|||||||
CREATE SEQUENCE cwf_in_progress_user_seq;
|
CREATE SEQUENCE cwf_in_progress_user_seq;
|
||||||
CREATE SEQUENCE cwf_pooltask_seq;
|
CREATE SEQUENCE cwf_pooltask_seq;
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE cwf_workflowitem
|
CREATE TABLE cwf_workflowitem
|
||||||
(
|
(
|
||||||
workflowitem_id INTEGER PRIMARY KEY,
|
workflowitem_id INTEGER PRIMARY KEY,
|
||||||
item_id INTEGER REFERENCES item(item_id) UNIQUE,
|
item_id INTEGER REFERENCES item(item_id) UNIQUE,
|
||||||
collection_id INTEGER REFERENCES collection(collection_id),
|
collection_id INTEGER REFERENCES collection(collection_id),
|
||||||
|
--
|
||||||
-- Answers to questions on first page of submit UI
|
-- Answers to questions on first page of submit UI
|
||||||
multiple_titles NUMBER(1),
|
multiple_titles NUMBER(1),
|
||||||
published_before NUMBER(1),
|
published_before NUMBER(1),
|
||||||
multiple_files NUMBER(1)
|
multiple_files NUMBER(1)
|
||||||
-- Note: stage reached not applicable here - people involved in workflow
|
-- Note: stage reached not applicable here - people involved in workflow
|
||||||
-- can always jump around submission UI
|
-- can always jump around submission UI
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
-- TODO: it seems like this index is already created by the 'unique' constraint in the table creation
|
|
||||||
-- CREATE INDEX xmlwf_wf_item_fk_idx ON xmlwf_workflowitem(item_id);
|
CREATE INDEX cwf_workflowitem_coll_fk_idx ON cwf_workflowitem(collection_id);
|
||||||
CREATE INDEX xmlwf_wf_coll_fk_idx ON xmlwf_workflowitem(collection_id);
|
|
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE cwf_collectionrole (
|
||||||
CREATE TABLE xmlwf_collectionrole (
|
|
||||||
collectionrole_id INTEGER PRIMARY KEY,
|
collectionrole_id INTEGER PRIMARY KEY,
|
||||||
role_id VARCHAR2(256),
|
role_id VARCHAR2(256),
|
||||||
collection_id integer REFERENCES collection(collection_id),
|
collection_id integer REFERENCES collection(collection_id),
|
||||||
group_id integer REFERENCES epersongroup(eperson_group_id)
|
group_id integer REFERENCES epersongroup(eperson_group_id)
|
||||||
);
|
);
|
||||||
ALTER TABLE xmlwf_collectionrole ADD CONSTRAINT xmlwf_collectionrole_unique UNIQUE (role_id, collection_id, group_id);
|
ALTER TABLE cwf_collectionrole
|
||||||
|
ADD CONSTRAINT cwf_collectionrole_unique UNIQUE (role_id, collection_id, group_id);
|
||||||
|
|
||||||
CREATE INDEX xmlwf_cr_coll_role_fk_idx ON xmlwf_collectionrole(collection_id,role_id);
|
CREATE INDEX cwf_cr_coll_role_fk_idx ON cwf_collectionrole(collection_id,role_id);
|
||||||
CREATE INDEX xmlwf_cr_coll_fk_idx ON xmlwf_collectionrole(collection_id);
|
CREATE INDEX cwf_cr_coll_fk_idx ON cwf_collectionrole(collection_id);
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE xmlwf_workflowitemrole (
|
CREATE TABLE cwf_workflowitemrole (
|
||||||
workflowitemrole_id INTEGER PRIMARY KEY,
|
workflowitemrole_id INTEGER PRIMARY KEY,
|
||||||
role_id VARCHAR2(256),
|
role_id VARCHAR2(256),
|
||||||
workflowitem_id integer REFERENCES xmlwf_workflowitem(workflowitem_id),
|
workflowitem_id integer REFERENCES cwf_workflowitem(workflowitem_id),
|
||||||
eperson_id integer REFERENCES eperson(eperson_id),
|
eperson_id integer REFERENCES eperson(eperson_id),
|
||||||
group_id integer REFERENCES epersongroup(eperson_group_id)
|
group_id integer REFERENCES epersongroup(eperson_group_id)
|
||||||
);
|
);
|
||||||
|
ALTER TABLE cwf_workflowitemrole
|
||||||
|
ADD CONSTRAINT cwf_workflowitemrole_unique UNIQUE (role_id, workflowitem_id, eperson_id, group_id);
|
||||||
|
|
||||||
ALTER TABLE xmlwf_workflowitemrole
|
CREATE INDEX cwf_wfir_item_role_fk_idx ON cwf_workflowitemrole(workflowitem_id,role_id);
|
||||||
ADD CONSTRAINT xmlwf_workflowitemrole_unique UNIQUE (role_id, workflowitem_id, eperson_id);
|
CREATE INDEX cwf_wfir_item_fk_idx ON cwf_workflowitemrole(workflowitem_id);
|
||||||
|
|
||||||
|
|
||||||
CREATE INDEX xmlwf_wfir_item_role_fk_idx ON xmlwf_workflowitemrole(workflowitem_id,role_id);
|
CREATE TABLE cwf_pooltask (
|
||||||
CREATE INDEX xmlwf_wfir_item_fk_idx ON xmlwf_workflowitemrole(workflowitem_id);
|
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE xmlwf_pooltask (
|
|
||||||
pooltask_id INTEGER PRIMARY KEY,
|
pooltask_id INTEGER PRIMARY KEY,
|
||||||
workflowitem_id INTEGER REFERENCES xmlwf_workflowitem(workflowitem_id),
|
workflowitem_id INTEGER REFERENCES cwf_workflowitem(workflowitem_id),
|
||||||
workflow_id VARCHAR2(256),
|
workflow_id VARCHAR2(256),
|
||||||
step_id VARCHAR2(256),
|
step_id VARCHAR2(256),
|
||||||
action_id VARCHAR2(256),
|
action_id VARCHAR2(256),
|
||||||
@@ -64,10 +61,11 @@ CREATE TABLE xmlwf_pooltask (
|
|||||||
group_id INTEGER REFERENCES epersongroup(eperson_group_id)
|
group_id INTEGER REFERENCES epersongroup(eperson_group_id)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
CREATE INDEX cwf_pt_eperson_fk_idx ON cwf_pooltask(eperson_id);
|
||||||
|
CREATE INDEX cwf_pt_workflow_fk_idx ON cwf_pooltask(workflowitem_id);
|
||||||
|
CREATE INDEX cwf_pt_workflow_eperson_fk_idx ON cwf_pooltask(eperson_id,workflowitem_id);
|
||||||
|
|
||||||
|
|
||||||
CREATE INDEX cwf_pt_epers_fk_idx ON cwf_pooltask(eperson_id);
|
|
||||||
CREATE INDEX cwf_pt_wf_fk_idx ON cwf_pooltask(workflowitem_id);
|
|
||||||
CREATE INDEX cwf_pt_wf_epers_fk_idx ON cwf_pooltask(eperson_id,workflowitem_id);
|
|
||||||
|
|
||||||
CREATE TABLE cwf_claimtask (
|
CREATE TABLE cwf_claimtask (
|
||||||
claimtask_id INTEGER PRIMARY KEY,
|
claimtask_id INTEGER PRIMARY KEY,
|
||||||
@@ -81,27 +79,24 @@ CREATE TABLE cwf_claimtask (
|
|||||||
ALTER TABLE cwf_claimtask
|
ALTER TABLE cwf_claimtask
|
||||||
ADD CONSTRAINT cwf_claimtask_unique UNIQUE (step_id, workflowitem_id, workflow_id, owner_id, action_id);
|
ADD CONSTRAINT cwf_claimtask_unique UNIQUE (step_id, workflowitem_id, workflow_id, owner_id, action_id);
|
||||||
|
|
||||||
|
CREATE INDEX cwf_ct_workflow_fk_idx ON cwf_claimtask(workflowitem_id);
|
||||||
CREATE INDEX cwf_ct_wf_fk_idx ON cwf_claimtask(workflowitem_id);
|
CREATE INDEX cwf_ct_workflow_eperson_fk_idx ON cwf_claimtask(workflowitem_id,owner_id);
|
||||||
CREATE INDEX cwf_ct_wf_epers_fk_idx ON cwf_claimtask(workflowitem_id,owner_id);
|
CREATE INDEX cwf_ct_eperson_fk_idx ON cwf_claimtask(owner_id);
|
||||||
CREATE INDEX cwf_ct_epers_fk_idx ON cwf_claimtask(owner_id);
|
CREATE INDEX cwf_ct_wfs_fk_idx ON cwf_claimtask(workflowitem_id,step_id);
|
||||||
CREATE INDEX cwf_ct_wf_step_fk_idx ON cwf_claimtask(workflowitem_id,step_id);
|
CREATE INDEX cwf_ct_wfs_action_fk_idx ON cwf_claimtask(workflowitem_id,step_id,action_id);
|
||||||
CREATE INDEX cwf_ct_wf_step_act_fk_idx ON cwf_claimtask(workflowitem_id,step_id,action_id);
|
CREATE INDEX cwf_ct_wfs_action_e_fk_idx ON cwf_claimtask(workflowitem_id,step_id,action_id,owner_id);
|
||||||
CREATE INDEX cwf_ct_wf_st_ac_ep_fk_idx ON cwf_claimtask(workflowitem_id,step_id,action_id,owner_id);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE cwf_in_progress_user (
|
CREATE TABLE cwf_in_progress_user (
|
||||||
in_progress_user_id INTEGER PRIMARY KEY,
|
in_progress_user_id INTEGER PRIMARY KEY,
|
||||||
workflowitem_id integer REFERENCES cwf_workflowitem(workflowitem_id),
|
workflowitem_id integer REFERENCES cwf_workflowitem(workflowitem_id),
|
||||||
user_id integer REFERENCES eperson(eperson_id),
|
user_id integer REFERENCES eperson(eperson_id),
|
||||||
finished NUMBER(1)
|
finished NUMBER(1) DEFAULT 0
|
||||||
);
|
);
|
||||||
|
|
||||||
ALTER TABLE cwf_in_progress_user
|
ALTER TABLE cwf_in_progress_user
|
||||||
ADD CONSTRAINT cwf_in_progress_user_unique UNIQUE (workflowitem_id, user_id);
|
ADD CONSTRAINT cwf_in_progress_user_unique UNIQUE (workflowitem_id, user_id);
|
||||||
|
|
||||||
CREATE INDEX cwf_ipu_wf_fk_idx ON cwf_in_progress_user(workflowitem_id);
|
CREATE INDEX cwf_ipu_workflow_fk_idx ON cwf_in_progress_user(workflowitem_id);
|
||||||
CREATE INDEX cwf_ipu_epers_fk_idx ON cwf_in_progress_user(user_id);
|
CREATE INDEX cwf_ipu_eperson_fk_idx ON cwf_in_progress_user(user_id);
|
||||||
-- TODO: it seems like this index is already created by the 'unique' constraint in the table creation
|
|
||||||
-- CREATE INDEX xmlwf_ipu_wf_epers_fk_idx ON xmlwf_in_progress_user(workflowitem_id,user_id);
|
|
||||||
|
@@ -84,7 +84,7 @@ SELECT setval('metadatavalue_seq', max(metadata_value_id)) FROM metadatavalue;
|
|||||||
SELECT setval('metadataschemaregistry_seq', max(metadata_schema_id)) FROM metadataschemaregistry;
|
SELECT setval('metadataschemaregistry_seq', max(metadata_schema_id)) FROM metadataschemaregistry;
|
||||||
SELECT setval('harvested_collection_seq', max(id)) FROM harvested_collection;
|
SELECT setval('harvested_collection_seq', max(id)) FROM harvested_collection;
|
||||||
SELECT setval('harvested_item_seq', max(id)) FROM harvested_item;
|
SELECT setval('harvested_item_seq', max(id)) FROM harvested_item;
|
||||||
SELECT setval('webapp_seq', max(id)) FROM webapp;
|
SELECT setval('webapp_seq', max(webapp_id)) FROM webapp;
|
||||||
SELECT setval('requestitem_seq', max(requestitem_id)) FROM requestitem;
|
SELECT setval('requestitem_seq', max(requestitem_id)) FROM requestitem;
|
||||||
|
|
||||||
-- Handle Sequence is a special case. Since Handles minted by DSpace use the 'handle_seq',
|
-- Handle Sequence is a special case. Since Handles minted by DSpace use the 'handle_seq',
|
||||||
|
@@ -17,7 +17,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.dspace</groupId>
|
<groupId>org.dspace</groupId>
|
||||||
<artifactId>modules</artifactId>
|
<artifactId>modules</artifactId>
|
||||||
<version>4.0</version>
|
<version>4.3</version>
|
||||||
<relativePath>..</relativePath>
|
<relativePath>..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
@@ -12,7 +12,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.dspace</groupId>
|
<groupId>org.dspace</groupId>
|
||||||
<artifactId>modules</artifactId>
|
<artifactId>modules</artifactId>
|
||||||
<version>4.0</version>
|
<version>4.3</version>
|
||||||
<relativePath>..</relativePath>
|
<relativePath>..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.dspace</groupId>
|
<groupId>org.dspace</groupId>
|
||||||
<artifactId>modules</artifactId>
|
<artifactId>modules</artifactId>
|
||||||
<version>4.0</version>
|
<version>4.3</version>
|
||||||
<relativePath>..</relativePath>
|
<relativePath>..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
@@ -12,7 +12,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>modules</artifactId>
|
<artifactId>modules</artifactId>
|
||||||
<groupId>org.dspace</groupId>
|
<groupId>org.dspace</groupId>
|
||||||
<version>4.0</version>
|
<version>4.3</version>
|
||||||
<relativePath>..</relativePath>
|
<relativePath>..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.dspace</groupId>
|
<groupId>org.dspace</groupId>
|
||||||
<artifactId>dspace-parent</artifactId>
|
<artifactId>dspace-parent</artifactId>
|
||||||
<version>4.0</version>
|
<version>4.3</version>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
@@ -11,7 +11,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.dspace</groupId>
|
<groupId>org.dspace</groupId>
|
||||||
<artifactId>modules</artifactId>
|
<artifactId>modules</artifactId>
|
||||||
<version>4.0</version>
|
<version>4.3</version>
|
||||||
<relativePath>..</relativePath>
|
<relativePath>..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
@@ -94,7 +94,7 @@
|
|||||||
<groupId>org.dspace</groupId>
|
<groupId>org.dspace</groupId>
|
||||||
<artifactId>dspace-rest</artifactId>
|
<artifactId>dspace-rest</artifactId>
|
||||||
<type>war</type>
|
<type>war</type>
|
||||||
<version>4.0</version>
|
<version>4.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>org.dspace.modules</groupId>
|
<groupId>org.dspace.modules</groupId>
|
||||||
<artifactId>solr</artifactId>
|
<artifactId>solr</artifactId>
|
||||||
<version>4.0</version>
|
<version>4.3</version>
|
||||||
<packaging>war</packaging>
|
<packaging>war</packaging>
|
||||||
<name>DSpace SOLR :: Local Customizations</name>
|
<name>DSpace SOLR :: Local Customizations</name>
|
||||||
<description>
|
<description>
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.dspace</groupId>
|
<groupId>org.dspace</groupId>
|
||||||
<artifactId>modules</artifactId>
|
<artifactId>modules</artifactId>
|
||||||
<version>4.0</version>
|
<version>4.3</version>
|
||||||
<relativePath>..</relativePath>
|
<relativePath>..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
@@ -58,7 +58,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.dspace</groupId>
|
<groupId>org.dspace</groupId>
|
||||||
<artifactId>dspace-solr</artifactId>
|
<artifactId>dspace-solr</artifactId>
|
||||||
<version>4.0</version>
|
<version>4.3</version>
|
||||||
<classifier>skinny</classifier>
|
<classifier>skinny</classifier>
|
||||||
<type>war</type>
|
<type>war</type>
|
||||||
</dependency>
|
</dependency>
|
||||||
@@ -66,7 +66,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.dspace</groupId>
|
<groupId>org.dspace</groupId>
|
||||||
<artifactId>dspace-solr</artifactId>
|
<artifactId>dspace-solr</artifactId>
|
||||||
<version>4.0</version>
|
<version>4.3</version>
|
||||||
<classifier>classes</classifier>
|
<classifier>classes</classifier>
|
||||||
<type>jar</type>
|
<type>jar</type>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.dspace</groupId>
|
<groupId>org.dspace</groupId>
|
||||||
<artifactId>modules</artifactId>
|
<artifactId>modules</artifactId>
|
||||||
<version>4.0</version>
|
<version>4.3</version>
|
||||||
<relativePath>..</relativePath>
|
<relativePath>..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.dspace</groupId>
|
<groupId>org.dspace</groupId>
|
||||||
<artifactId>modules</artifactId>
|
<artifactId>modules</artifactId>
|
||||||
<version>4.0</version>
|
<version>4.3</version>
|
||||||
<relativePath>..</relativePath>
|
<relativePath>..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
@@ -12,7 +12,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.dspace</groupId>
|
<groupId>org.dspace</groupId>
|
||||||
<artifactId>modules</artifactId>
|
<artifactId>modules</artifactId>
|
||||||
<version>4.0</version>
|
<version>4.3</version>
|
||||||
<relativePath>..</relativePath>
|
<relativePath>..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.dspace</groupId>
|
<groupId>org.dspace</groupId>
|
||||||
<artifactId>dspace-parent</artifactId>
|
<artifactId>dspace-parent</artifactId>
|
||||||
<version>4.0</version>
|
<version>4.3</version>
|
||||||
<relativePath>..</relativePath>
|
<relativePath>..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
@@ -58,23 +58,88 @@
|
|||||||
|
|
||||||
<profiles>
|
<profiles>
|
||||||
|
|
||||||
<!-- Default Profile. This builds all Overlay modules for DSpace -->
|
<!-- Build Profile. This builds all Overlay modules for DSpace -->
|
||||||
<profile>
|
<profile>
|
||||||
<id>default</id>
|
<id>build</id>
|
||||||
<activation>
|
<activation>
|
||||||
<activeByDefault>true</activeByDefault>
|
<!-- Enabled as long as we are NOT creating a zip/tarball distribution -->
|
||||||
|
<property>
|
||||||
|
<name>!distributions</name>
|
||||||
|
</property>
|
||||||
</activation>
|
</activation>
|
||||||
<!--
|
<!--
|
||||||
Builds Overlay Modules for DSpace
|
Builds Overlay Modules for DSpace
|
||||||
-->
|
-->
|
||||||
<modules>
|
<modules>
|
||||||
<module>modules</module>
|
<module>modules</module>
|
||||||
</modules>
|
</modules>
|
||||||
</profile>
|
</profile>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
DSpace Assembly profile. By default this is enabled.
|
||||||
|
This profile actually builds all submodules and then assembles
|
||||||
|
the 'dspace-installer' from the resulting JARs/WARs.
|
||||||
|
See 'assembly.xml' for more info.
|
||||||
|
This profile can be optionally deactivated by passing '-P!assembly'.
|
||||||
|
-->
|
||||||
|
<profile>
|
||||||
|
<id>assembly</id>
|
||||||
|
<activation>
|
||||||
|
<!-- Enabled as long as we are NOT creating a zip/tarball distribution -->
|
||||||
|
<property>
|
||||||
|
<name>!distributions</name>
|
||||||
|
</property>
|
||||||
|
</activation>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<!-- Assemble 'target/dspace-installer' using 'assembly.xml' -->
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-assembly-plugin</artifactId>
|
||||||
|
<inherited>false</inherited>
|
||||||
|
<configuration>
|
||||||
|
<!-- Don't "attach" the assembly results to this project. As
|
||||||
|
this assembly builds a directory, setting this to "true"
|
||||||
|
(default value) will just result in a WARNING message.-->
|
||||||
|
<attach>false</attach>
|
||||||
|
<finalName>${project.artifactId}</finalName>
|
||||||
|
<descriptors>
|
||||||
|
<descriptor>src/main/assembly/assembly.xml</descriptor>
|
||||||
|
</descriptors>
|
||||||
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>single</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</profile>
|
||||||
|
|
||||||
|
<!-- This profile simply determines whether we are creating
|
||||||
|
zip / tarball distributions to upload to SourceFore or similar.
|
||||||
|
By running "mvn package -Ddistributions=true" you'll
|
||||||
|
SKIP normal build & assembly (see above profiles) and
|
||||||
|
INSTEAD just run the "distributions" profile below. -->
|
||||||
|
<profile>
|
||||||
|
<id>build-and-assembly</id>
|
||||||
|
<activation>
|
||||||
|
<!-- This profile should be active at all times, unless the user
|
||||||
|
specifies a different value for "distributions" -->
|
||||||
|
<property>
|
||||||
|
<name>!distributions</name>
|
||||||
|
</property>
|
||||||
|
</activation>
|
||||||
|
<properties>
|
||||||
|
<distributions>false</distributions>
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Run this profile (e.g. 'mvn package -Pdistributions') to create
|
Run this profile (e.g. 'mvn package -Ddistributions=true') to create
|
||||||
zip / tarball distributions to upload to SourceForge or similar.
|
zip / tarball distributions to upload to SourceForge or similar.
|
||||||
When this profile is run, DSpace is NOT compiled as normal.
|
When this profile is run, DSpace is NOT compiled as normal.
|
||||||
Instead, a zip/tarball is generated from the parent [dspace-src] directory.
|
Instead, a zip/tarball is generated from the parent [dspace-src] directory.
|
||||||
@@ -82,7 +147,11 @@
|
|||||||
<profile>
|
<profile>
|
||||||
<id>distributions</id>
|
<id>distributions</id>
|
||||||
<activation>
|
<activation>
|
||||||
<activeByDefault>false</activeByDefault>
|
<!-- Only enabled if "distributions=true" was passed on commandline -->
|
||||||
|
<property>
|
||||||
|
<name>distributions</name>
|
||||||
|
<value>true</value>
|
||||||
|
</property>
|
||||||
</activation>
|
</activation>
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
@@ -544,6 +544,7 @@
|
|||||||
|
|
||||||
<field name="a_spell" type="textSpell" />
|
<field name="a_spell" type="textSpell" />
|
||||||
<copyField source="fulltext" dest="a_spell" />
|
<copyField source="fulltext" dest="a_spell" />
|
||||||
|
<copyField source="fulltext" dest="fulltext_hl" />
|
||||||
|
|
||||||
<!-- used by the DSpace Discovery Solr Indexer to track the last time a document was indexed -->
|
<!-- used by the DSpace Discovery Solr Indexer to track the last time a document was indexed -->
|
||||||
<field name="SolrIndexer.lastIndexed" type="date" indexed="true" stored="true" default="NOW" multiValued="false" omitNorms="true" />
|
<field name="SolrIndexer.lastIndexed" type="date" indexed="true" stored="true" default="NOW" multiValued="false" omitNorms="true" />
|
||||||
|
@@ -1042,13 +1042,13 @@
|
|||||||
startup="lazy"
|
startup="lazy"
|
||||||
class="solr.extraction.ExtractingRequestHandler" >
|
class="solr.extraction.ExtractingRequestHandler" >
|
||||||
<lst name="defaults">
|
<lst name="defaults">
|
||||||
<str name="lowernames">true</str>
|
<!--<str name="lowernames">true</str>-->
|
||||||
<str name="uprefix">ignored_</str>
|
<str name="uprefix">ignored_</str>
|
||||||
|
|
||||||
<!-- capture link hrefs but ignore div attributes -->
|
<!-- capture link hrefs but ignore div attributes -->
|
||||||
<str name="captureAttr">true</str>
|
<str name="captureAttr">false</str>
|
||||||
<str name="fmap.a">links</str>
|
<!--<str name="fmap.a">links</str>-->
|
||||||
<str name="fmap.div">ignored_</str>
|
<!--<str name="fmap.div">ignored_</str>-->
|
||||||
</lst>
|
</lst>
|
||||||
</requestHandler>
|
</requestHandler>
|
||||||
|
|
||||||
@@ -1244,7 +1244,7 @@
|
|||||||
<str name="name">default</str>
|
<str name="name">default</str>
|
||||||
<str name="field">a_spell</str>
|
<str name="field">a_spell</str>
|
||||||
<str name="spellcheckIndexDir">./spellchecker</str>
|
<str name="spellcheckIndexDir">./spellchecker</str>
|
||||||
<str name="buildOnCommit">true</str>
|
<str name="buildOnOptimize">true</str>
|
||||||
<str name="spellcheck.onlyMorePopular">false</str>
|
<str name="spellcheck.onlyMorePopular">false</str>
|
||||||
</lst>
|
</lst>
|
||||||
|
|
||||||
|
@@ -48,7 +48,6 @@
|
|||||||
<includes>
|
<includes>
|
||||||
<include>bin/**</include>
|
<include>bin/**</include>
|
||||||
<include>config/**</include>
|
<include>config/**</include>
|
||||||
<include>docs/**</include>
|
|
||||||
<include>etc/**</include>
|
<include>etc/**</include>
|
||||||
<include>solr/**</include>
|
<include>solr/**</include>
|
||||||
</includes>
|
</includes>
|
||||||
@@ -82,11 +81,16 @@
|
|||||||
<outputDirectory>config</outputDirectory>
|
<outputDirectory>config</outputDirectory>
|
||||||
<filtered>true</filtered>
|
<filtered>true</filtered>
|
||||||
</file>
|
</file>
|
||||||
|
<file>
|
||||||
|
<source>config/crosswalks/oai/description.xml</source>
|
||||||
|
<outputDirectory>config</outputDirectory>
|
||||||
|
<filtered>true</filtered>
|
||||||
|
</file>
|
||||||
</files>
|
</files>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Still allow anyone to put a JAR dependency into
|
Copy ALL JAR dependencies specified in [src]/dspace/pom.xml
|
||||||
[src]/dspace/pom.xml and have it go into 'lib' directory
|
into the DSpace 'lib' directory.
|
||||||
-->
|
-->
|
||||||
<dependencySets>
|
<dependencySets>
|
||||||
<dependencySet>
|
<dependencySet>
|
||||||
@@ -100,30 +104,30 @@
|
|||||||
|
|
||||||
<moduleSets>
|
<moduleSets>
|
||||||
<!--
|
<!--
|
||||||
Take all jar modules in [src]/dspace/modules/ dir
|
Take all JAR modules (and their dependencies) under
|
||||||
and add them into 'lib' directory
|
[src]/dspace/modules/ dir and add them into 'lib' directory
|
||||||
-->
|
-->
|
||||||
<moduleSet>
|
<moduleSet>
|
||||||
<includes>
|
<includes>
|
||||||
<include>*:jar:*</include>
|
<include>org.dspace.modules:*:jar:*</include>
|
||||||
</includes>
|
</includes>
|
||||||
<binaries>
|
<binaries>
|
||||||
<includeDependencies>true</includeDependencies>
|
<includeDependencies>true</includeDependencies>
|
||||||
<outputDirectory>lib</outputDirectory>
|
<outputDirectory>lib</outputDirectory>
|
||||||
<unpack>false</unpack>
|
<unpack>false</unpack>
|
||||||
|
<!-- Include any dependency JARs as well -->
|
||||||
<dependencySets>
|
<dependencySets>
|
||||||
<dependencySet>
|
<dependencySet>
|
||||||
<includes>
|
<includes>
|
||||||
<include>*:jar:*</include>
|
<include>*:jar:*</include>
|
||||||
</includes>
|
</includes>
|
||||||
<outputDirectory>lib</outputDirectory>
|
|
||||||
</dependencySet>
|
</dependencySet>
|
||||||
</dependencySets>
|
</dependencySets>
|
||||||
</binaries>
|
</binaries>
|
||||||
</moduleSet>
|
</moduleSet>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Take all war modules (in [src]/dspace/modules/) and explode them into
|
Take all WAR modules (in [src]/dspace/modules/) and unpack them into
|
||||||
'webapps' directory
|
'webapps' directory
|
||||||
-->
|
-->
|
||||||
<moduleSet>
|
<moduleSet>
|
||||||
|
56
pom.xml
56
pom.xml
@@ -4,7 +4,7 @@
|
|||||||
<groupId>org.dspace</groupId>
|
<groupId>org.dspace</groupId>
|
||||||
<artifactId>dspace-parent</artifactId>
|
<artifactId>dspace-parent</artifactId>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<version>4.0</version>
|
<version>4.3</version>
|
||||||
<name>DSpace Parent Project</name>
|
<name>DSpace Parent Project</name>
|
||||||
<description>
|
<description>
|
||||||
DSpace open source software is a turnkey institutional repository application.
|
DSpace open source software is a turnkey institutional repository application.
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.sonatype.oss</groupId>
|
<groupId>org.sonatype.oss</groupId>
|
||||||
<artifactId>oss-parent</artifactId>
|
<artifactId>oss-parent</artifactId>
|
||||||
<version>7</version>
|
<version>9</version>
|
||||||
<relativePath />
|
<relativePath />
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
@@ -41,6 +41,14 @@
|
|||||||
(NOTE: individual POMs can override specific settings). -->
|
(NOTE: individual POMs can override specific settings). -->
|
||||||
<pluginManagement>
|
<pluginManagement>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-javadoc-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<minmemory>128m</minmemory>
|
||||||
|
<maxmemory>1g</maxmemory>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>2.3.2</version>
|
<version>2.3.2</version>
|
||||||
@@ -89,6 +97,8 @@
|
|||||||
<excludes>
|
<excludes>
|
||||||
<exclude>**/Abstract*</exclude>
|
<exclude>**/Abstract*</exclude>
|
||||||
</excludes>
|
</excludes>
|
||||||
|
<!-- Detailed logs in reportsDirectory/testName-output.txt instead of stdout -->
|
||||||
|
<redirectTestOutputToFile>true</redirectTestOutputToFile>
|
||||||
<!--
|
<!--
|
||||||
Enable to debug Maven Surefire tests in remote proces
|
Enable to debug Maven Surefire tests in remote proces
|
||||||
<debugForkedProcess>true</debugForkedProcess>
|
<debugForkedProcess>true</debugForkedProcess>
|
||||||
@@ -121,7 +131,7 @@
|
|||||||
<id>native2ascii-utf8</id>
|
<id>native2ascii-utf8</id>
|
||||||
<phase>generate-resources</phase>
|
<phase>generate-resources</phase>
|
||||||
<configuration>
|
<configuration>
|
||||||
<target name="Encode any UTF-8 chars in [src]/*.properties">
|
<target name="Encode any UTF-8 chars in properties">
|
||||||
<!-- Run 'native2ascii' to encode UTF-8 characters in properties files. Place the resulting file(s) in /target -->
|
<!-- Run 'native2ascii' to encode UTF-8 characters in properties files. Place the resulting file(s) in /target -->
|
||||||
<native2ascii encoding="UTF8" src="${root.basedir}" dest="${root.basedir}/target" includes="*.properties" />
|
<native2ascii encoding="UTF8" src="${root.basedir}" dest="${root.basedir}/target" includes="*.properties" />
|
||||||
</target>
|
</target>
|
||||||
@@ -146,7 +156,7 @@
|
|||||||
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-release-plugin</artifactId>
|
<artifactId>maven-release-plugin</artifactId>
|
||||||
<version>2.3.2</version>
|
<version>2.5</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<!-- During release:perform, enable the "release" profile (see below) -->
|
<!-- During release:perform, enable the "release" profile (see below) -->
|
||||||
<releaseProfiles>release</releaseProfiles>
|
<releaseProfiles>release</releaseProfiles>
|
||||||
@@ -543,102 +553,102 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.dspace</groupId>
|
<groupId>org.dspace</groupId>
|
||||||
<artifactId>dspace-api</artifactId>
|
<artifactId>dspace-api</artifactId>
|
||||||
<version>4.0</version>
|
<version>4.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.dspace.modules</groupId>
|
<groupId>org.dspace.modules</groupId>
|
||||||
<artifactId>additions</artifactId>
|
<artifactId>additions</artifactId>
|
||||||
<version>4.0</version>
|
<version>4.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.dspace</groupId>
|
<groupId>org.dspace</groupId>
|
||||||
<artifactId>dspace-sword</artifactId>
|
<artifactId>dspace-sword</artifactId>
|
||||||
<version>4.0</version>
|
<version>4.3</version>
|
||||||
<type>jar</type>
|
<type>jar</type>
|
||||||
<classifier>classes</classifier>
|
<classifier>classes</classifier>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.dspace</groupId>
|
<groupId>org.dspace</groupId>
|
||||||
<artifactId>dspace-sword</artifactId>
|
<artifactId>dspace-sword</artifactId>
|
||||||
<version>4.0</version>
|
<version>4.3</version>
|
||||||
<type>war</type>
|
<type>war</type>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.dspace</groupId>
|
<groupId>org.dspace</groupId>
|
||||||
<artifactId>dspace-swordv2</artifactId>
|
<artifactId>dspace-swordv2</artifactId>
|
||||||
<version>4.0</version>
|
<version>4.3</version>
|
||||||
<type>jar</type>
|
<type>jar</type>
|
||||||
<classifier>classes</classifier>
|
<classifier>classes</classifier>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.dspace</groupId>
|
<groupId>org.dspace</groupId>
|
||||||
<artifactId>dspace-swordv2</artifactId>
|
<artifactId>dspace-swordv2</artifactId>
|
||||||
<version>4.0</version>
|
<version>4.3</version>
|
||||||
<type>war</type>
|
<type>war</type>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.dspace</groupId>
|
<groupId>org.dspace</groupId>
|
||||||
<artifactId>dspace-jspui</artifactId>
|
<artifactId>dspace-jspui</artifactId>
|
||||||
<version>4.0</version>
|
<version>4.3</version>
|
||||||
<type>jar</type>
|
<type>jar</type>
|
||||||
<classifier>classes</classifier>
|
<classifier>classes</classifier>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.dspace</groupId>
|
<groupId>org.dspace</groupId>
|
||||||
<artifactId>dspace-jspui</artifactId>
|
<artifactId>dspace-jspui</artifactId>
|
||||||
<version>4.0</version>
|
<version>4.3</version>
|
||||||
<type>war</type>
|
<type>war</type>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.dspace</groupId>
|
<groupId>org.dspace</groupId>
|
||||||
<artifactId>dspace-oai</artifactId>
|
<artifactId>dspace-oai</artifactId>
|
||||||
<version>4.0</version>
|
<version>4.3</version>
|
||||||
<type>jar</type>
|
<type>jar</type>
|
||||||
<classifier>classes</classifier>
|
<classifier>classes</classifier>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.dspace</groupId>
|
<groupId>org.dspace</groupId>
|
||||||
<artifactId>dspace-oai</artifactId>
|
<artifactId>dspace-oai</artifactId>
|
||||||
<version>4.0</version>
|
<version>4.3</version>
|
||||||
<type>war</type>
|
<type>war</type>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.dspace</groupId>
|
<groupId>org.dspace</groupId>
|
||||||
<artifactId>dspace-lni</artifactId>
|
<artifactId>dspace-lni</artifactId>
|
||||||
<version>4.0</version>
|
<version>4.3</version>
|
||||||
<type>jar</type>
|
<type>jar</type>
|
||||||
<classifier>classes</classifier>
|
<classifier>classes</classifier>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.dspace</groupId>
|
<groupId>org.dspace</groupId>
|
||||||
<artifactId>dspace-lni-client</artifactId>
|
<artifactId>dspace-lni-client</artifactId>
|
||||||
<version>4.0</version>
|
<version>4.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.dspace</groupId>
|
<groupId>org.dspace</groupId>
|
||||||
<artifactId>dspace-lni</artifactId>
|
<artifactId>dspace-lni</artifactId>
|
||||||
<version>4.0</version>
|
<version>4.3</version>
|
||||||
<type>war</type>
|
<type>war</type>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.dspace</groupId>
|
<groupId>org.dspace</groupId>
|
||||||
<artifactId>dspace-xmlui</artifactId>
|
<artifactId>dspace-xmlui</artifactId>
|
||||||
<version>4.0</version>
|
<version>4.3</version>
|
||||||
<type>jar</type>
|
<type>jar</type>
|
||||||
<classifier>classes</classifier>
|
<classifier>classes</classifier>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.dspace</groupId>
|
<groupId>org.dspace</groupId>
|
||||||
<artifactId>dspace-xmlui</artifactId>
|
<artifactId>dspace-xmlui</artifactId>
|
||||||
<version>4.0</version>
|
<version>4.3</version>
|
||||||
<type>war</type>
|
<type>war</type>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.dspace</groupId>
|
<groupId>org.dspace</groupId>
|
||||||
<artifactId>dspace-services</artifactId>
|
<artifactId>dspace-services</artifactId>
|
||||||
<version>4.0</version>
|
<version>4.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- DSpace Localization Packages -->
|
<!-- DSpace Localization Packages -->
|
||||||
<dependency>
|
<dependency>
|
||||||
@@ -1309,7 +1319,7 @@
|
|||||||
<connection>scm:git:git@github.com:DSpace/DSpace.git</connection>
|
<connection>scm:git:git@github.com:DSpace/DSpace.git</connection>
|
||||||
<developerConnection>scm:git:git@github.com:DSpace/DSpace.git</developerConnection>
|
<developerConnection>scm:git:git@github.com:DSpace/DSpace.git</developerConnection>
|
||||||
<url>git@github.com:DSpace/DSpace.git</url>
|
<url>git@github.com:DSpace/DSpace.git</url>
|
||||||
<tag>dspace-4.0</tag>
|
<tag>dspace-4.3</tag>
|
||||||
</scm>
|
</scm>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
@@ -1326,8 +1336,8 @@
|
|||||||
<repository>
|
<repository>
|
||||||
<id>sonatype-releases</id>
|
<id>sonatype-releases</id>
|
||||||
<name>Sonatype Releases Repository</name>
|
<name>Sonatype Releases Repository</name>
|
||||||
<url>http://oss.sonatype.org/content/repositories/releases/</url>
|
<url>https://oss.sonatype.org/content/repositories/releases/</url>
|
||||||
</repository>
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
@@ -21,43 +21,57 @@
|
|||||||
</formats>
|
</formats>
|
||||||
<includeBaseDirectory>false</includeBaseDirectory>
|
<includeBaseDirectory>false</includeBaseDirectory>
|
||||||
|
|
||||||
|
<!-- First, copy the following from our 'dspace' subfolder assembly project into the
|
||||||
|
same subdirectory in the final ZIP file. NOTE: We do this in a <fileSet> INSTEAD
|
||||||
|
of a <moduleSet> so that we don't have to first build the "dspace" module. -->
|
||||||
|
<fileSets>
|
||||||
|
<fileSet>
|
||||||
|
<!-- Copy necessary DSpace subdirectories into Test environment -->
|
||||||
|
<includes>
|
||||||
|
<include>dspace/bin/**</include>
|
||||||
|
<include>dspace/config/**</include>
|
||||||
|
<include>dspace/etc/**</include>
|
||||||
|
<include>dspace/solr/**</include>
|
||||||
|
</includes>
|
||||||
|
<!-- But, exclude specific configs (which require filtering) -->
|
||||||
|
<excludes>
|
||||||
|
<exclude>dspace/config/dspace.cfg</exclude>
|
||||||
|
<exclude>dspace/config/log4j.properties</exclude>
|
||||||
|
<exclude>dspace/config/modules/**</exclude>
|
||||||
|
</excludes>
|
||||||
|
</fileSet>
|
||||||
|
<fileSet>
|
||||||
|
<!-- Copy specific configs (filtering their content) also into Test environment -->
|
||||||
|
<includes>
|
||||||
|
<include>dspace/config/modules/**</include>
|
||||||
|
<include>dspace/config/dspace.cfg</include>
|
||||||
|
<include>dspace/config/log4j.properties</include>
|
||||||
|
</includes>
|
||||||
|
<filtered>true</filtered>
|
||||||
|
</fileSet>
|
||||||
|
</fileSets>
|
||||||
|
|
||||||
<moduleSets>
|
<moduleSets>
|
||||||
|
<!-- Next, search for a 'src/test/data/dspaceFolder' data directory in
|
||||||
|
ANY of our modules. If found, copy its contents into the same "dspace"
|
||||||
|
subdirectory in the final ZIP file, as this is data to be used in testing.
|
||||||
|
NOTE: This *might* overwrite/overlay default files copied from above. -->
|
||||||
<moduleSet>
|
<moduleSet>
|
||||||
|
<includes>
|
||||||
|
<include>org.dspace:*</include>
|
||||||
|
</includes>
|
||||||
<sources>
|
<sources>
|
||||||
<outputDirectoryMapping>dspace</outputDirectoryMapping>
|
<outputDirectoryMapping>dspace</outputDirectoryMapping>
|
||||||
<fileSets>
|
<fileSets>
|
||||||
<fileSet> <!-- installable DSpace files -->
|
<fileSet>
|
||||||
<directory />
|
|
||||||
<outputDirectory />
|
|
||||||
<!-- Copy necessary DSpace subdirectories into Test environment -->
|
|
||||||
<includes>
|
|
||||||
<include>bin/**</include>
|
|
||||||
<include>config/**</include>
|
|
||||||
<include>etc/**</include>
|
|
||||||
<include>solr/**</include>
|
|
||||||
</includes>
|
|
||||||
<!-- Exclude specific configs (which require filtering) -->
|
|
||||||
<excludes>
|
|
||||||
<exclude>config/dspace.cfg</exclude>
|
|
||||||
<exclude>config/log4j.properties</exclude>
|
|
||||||
<exclude>config/modules/**</exclude>
|
|
||||||
</excludes>
|
|
||||||
</fileSet>
|
|
||||||
<fileSet> <!-- Copy specific configs (filtering their content) also into Test environment -->
|
|
||||||
<includes>
|
|
||||||
<include>config/modules/**</include>
|
|
||||||
<include>config/dspace.cfg</include>
|
|
||||||
<include>config/log4j.properties</include>
|
|
||||||
</includes>
|
|
||||||
<filtered>true</filtered>
|
|
||||||
</fileSet>
|
|
||||||
<fileSet> <!-- test data -->
|
|
||||||
<directory>src/test/data/dspaceFolder</directory>
|
<directory>src/test/data/dspaceFolder</directory>
|
||||||
<outputDirectory />
|
|
||||||
</fileSet>
|
</fileSet>
|
||||||
</fileSets>
|
</fileSets>
|
||||||
</sources>
|
</sources>
|
||||||
</moduleSet>
|
</moduleSet>
|
||||||
|
<!-- Finally, copy the 'dspace.cfg.more' from the 'dspace-api' into
|
||||||
|
the root directory of the ZIP. This config will be merged/weaved
|
||||||
|
into the default dspace.cfg (see fileweaver maven plugin) -->
|
||||||
<moduleSet>
|
<moduleSet>
|
||||||
<includes>
|
<includes>
|
||||||
<include>org.dspace:dspace-api</include>
|
<include>org.dspace:dspace-api</include>
|
||||||
|
Reference in New Issue
Block a user