mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +00:00
Merge branch 'master' of https://github.com/DSpace/DSpace into DS-3904
This commit is contained in:
@@ -1,5 +1,12 @@
|
||||
# This image will be published as dspace/dspace
|
||||
# See https://dspace-labs.github.io/DSpace-Docker-Images/ for usage details
|
||||
#
|
||||
# This version is JDK8 compatible
|
||||
# - tomcat:8-jre8
|
||||
# - ANT 1.10.5
|
||||
# - maven:latest
|
||||
# - note:
|
||||
# - default tag for branch: dspace/dspace: dspace/dspace:dspace-7_x-jdk8
|
||||
|
||||
# Step 1 - Run Maven Build
|
||||
FROM maven as build
|
||||
@@ -12,7 +19,7 @@ COPY dspace/src/main/docker/local.cfg /app/local.cfg
|
||||
RUN mvn package
|
||||
|
||||
# Step 2 - Run Ant Deploy
|
||||
FROM tomcat:8 as ant_build
|
||||
FROM tomcat:8-jre8 as ant_build
|
||||
ARG TARGET_DIR=dspace-installer
|
||||
COPY --from=build /app /dspace-src
|
||||
WORKDIR /dspace-src/dspace/target/${TARGET_DIR}
|
||||
@@ -29,7 +36,7 @@ RUN ant update_configs update_code update_webapps update_solr_indexes
|
||||
|
||||
# Step 3 - Run tomcat
|
||||
# Create a new tomcat image that does not retain the the build directory contents
|
||||
FROM tomcat:8
|
||||
FROM tomcat:8-jre8
|
||||
COPY --from=ant_build /dspace /dspace
|
||||
EXPOSE 8080 8009
|
||||
|
64
Dockerfile.jdk8-test
Normal file
64
Dockerfile.jdk8-test
Normal file
@@ -0,0 +1,64 @@
|
||||
# This image will be published as dspace/dspace
|
||||
# See https://dspace-labs.github.io/DSpace-Docker-Images/ for usage details
|
||||
#
|
||||
# This version is JDK8 compatible
|
||||
# - tomcat:8-jre8
|
||||
# - ANT 1.10.5
|
||||
# - maven:latest
|
||||
# - note: expose /solr to any host; provide /rest over http
|
||||
# - default tag for branch: dspace/dspace: dspace/dspace:dspace-7_x-jdk8-test
|
||||
|
||||
# Step 1 - Run Maven Build
|
||||
FROM maven as build
|
||||
WORKDIR /app
|
||||
|
||||
# Copy the DSpace source code into the workdir (excluding .dockerignore contents)
|
||||
ADD . /app/
|
||||
COPY dspace/src/main/docker/local.cfg /app/local.cfg
|
||||
|
||||
# Provide web.xml overrides to make webapps easier to test
|
||||
COPY dspace/src/main/docker/test/solr_web.xml /app/dspace-solr/src/main/webapp/WEB-INF/web.xml
|
||||
COPY dspace/src/main/docker/test/rest_web.xml /app/dspace-rest/src/main/webapp/WEB-INF/web.xml
|
||||
|
||||
RUN mvn package
|
||||
|
||||
# Step 2 - Run Ant Deploy
|
||||
FROM tomcat:8-jre8 as ant_build
|
||||
ARG TARGET_DIR=dspace-installer
|
||||
COPY --from=build /app /dspace-src
|
||||
WORKDIR /dspace-src/dspace/target/${TARGET_DIR}
|
||||
|
||||
# Create the initial install deployment using ANT
|
||||
ENV ANT_VERSION 1.10.5
|
||||
ENV ANT_HOME /tmp/ant-$ANT_VERSION
|
||||
ENV PATH $ANT_HOME/bin:$PATH
|
||||
|
||||
RUN mkdir $ANT_HOME && \
|
||||
wget -qO- "https://www.apache.org/dist/ant/binaries/apache-ant-$ANT_VERSION-bin.tar.gz" | tar -zx --strip-components=1 -C $ANT_HOME
|
||||
|
||||
RUN ant update_configs update_code update_webapps update_solr_indexes
|
||||
|
||||
# Step 3 - Run tomcat
|
||||
# Create a new tomcat image that does not retain the the build directory contents
|
||||
FROM tomcat:8-jre8
|
||||
COPY --from=ant_build /dspace /dspace
|
||||
EXPOSE 8080 8009
|
||||
|
||||
# Ant will be embedded in the final container to allow additional deployments
|
||||
ENV ANT_VERSION 1.10.5
|
||||
ENV ANT_HOME /tmp/ant-$ANT_VERSION
|
||||
ENV PATH $ANT_HOME/bin:$PATH
|
||||
|
||||
RUN mkdir $ANT_HOME && \
|
||||
wget -qO- "https://www.apache.org/dist/ant/binaries/apache-ant-$ANT_VERSION-bin.tar.gz" | tar -zx --strip-components=1 -C $ANT_HOME
|
||||
|
||||
ENV DSPACE_INSTALL=/dspace
|
||||
ENV JAVA_OPTS=-Xmx2000m
|
||||
|
||||
RUN ln -s $DSPACE_INSTALL/webapps/solr /usr/local/tomcat/webapps/solr && \
|
||||
ln -s $DSPACE_INSTALL/webapps/spring-rest /usr/local/tomcat/webapps/spring-rest && \
|
||||
ln -s $DSPACE_INSTALL/webapps/rest /usr/local/tomcat/webapps/rest && \
|
||||
ln -s $DSPACE_INSTALL/webapps/oai /usr/local/tomcat/webapps/oai && \
|
||||
ln -s $DSPACE_INSTALL/webapps/rdf /usr/local/tomcat/webapps/rdf && \
|
||||
ln -s $DSPACE_INSTALL/webapps/sword /usr/local/tomcat/webapps/sword && \
|
||||
ln -s $DSPACE_INSTALL/webapps/swordv2 /usr/local/tomcat/webapps/swordv2
|
@@ -40,6 +40,9 @@ Please be aware that, as a Java web application, DSpace requires a database (Pos
|
||||
and a servlet container (usually Tomcat) in order to function.
|
||||
More information about these and all other prerequisites can be found in the Installation instructions above.
|
||||
|
||||
## Dockerfile Usage
|
||||
See the [DSpace Docker Tutorial](https://dspace-labs.github.io/DSpace-Docker-Images/).
|
||||
|
||||
## Contributing
|
||||
|
||||
DSpace is a community built and supported project. We do not have a centralized development or support team,
|
||||
|
@@ -351,6 +351,24 @@
|
||||
<groupId>org.apache.jena</groupId>
|
||||
<artifactId>apache-jena-libs</artifactId>
|
||||
<type>pom</type>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-core</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-cli</groupId>
|
||||
@@ -364,10 +382,6 @@
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-collections4</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-collections4</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-dbcp2</artifactId>
|
||||
@@ -382,8 +396,8 @@
|
||||
<artifactId>commons-io</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-lang</groupId>
|
||||
<artifactId>commons-lang</artifactId>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
@@ -399,7 +413,7 @@
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>servlet-api</artifactId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -417,8 +431,16 @@
|
||||
<artifactId>jdom</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-1.2-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>oro</groupId>
|
||||
@@ -530,6 +552,10 @@
|
||||
<exclusion>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
@@ -547,6 +573,10 @@
|
||||
<exclusion>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
@@ -575,8 +605,8 @@
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>commons-configuration</groupId>
|
||||
<artifactId>commons-configuration</artifactId>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-configuration2</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.maxmind.geoip2</groupId>
|
||||
@@ -615,7 +645,6 @@
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>19.0</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
@@ -15,7 +15,7 @@ import org.apache.commons.cli.CommandLine;
|
||||
import org.apache.commons.cli.CommandLineParser;
|
||||
import org.apache.commons.cli.Options;
|
||||
import org.apache.commons.cli.PosixParser;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.dspace.core.ConfigurationManager;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.core.I18nUtil;
|
||||
|
@@ -17,7 +17,7 @@ import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import javax.xml.transform.TransformerException;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.xpath.XPathAPI;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.content.BitstreamFormat;
|
||||
@@ -47,7 +47,7 @@ public class RegistryLoader {
|
||||
/**
|
||||
* log4j category
|
||||
*/
|
||||
private static Logger log = Logger.getLogger(RegistryLoader.class);
|
||||
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(RegistryLoader.class);
|
||||
|
||||
protected static BitstreamFormatService bitstreamFormatService = ContentServiceFactory.getInstance()
|
||||
.getBitstreamFormatService();
|
||||
|
@@ -25,8 +25,8 @@ import org.apache.commons.cli.HelpFormatter;
|
||||
import org.apache.commons.cli.Options;
|
||||
import org.apache.commons.cli.ParseException;
|
||||
import org.apache.commons.cli.PosixParser;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.authority.AuthorityValue;
|
||||
import org.dspace.authority.factory.AuthorityServiceFactory;
|
||||
import org.dspace.authority.service.AuthorityValueService;
|
||||
@@ -92,7 +92,7 @@ public class MetadataImport {
|
||||
/**
|
||||
* Logger
|
||||
*/
|
||||
protected static final Logger log = Logger.getLogger(MetadataImport.class);
|
||||
protected static final Logger log = org.apache.logging.log4j.LogManager.getLogger(MetadataImport.class);
|
||||
|
||||
protected final AuthorityValueService authorityValueService;
|
||||
|
||||
|
@@ -23,7 +23,8 @@ import org.apache.commons.cli.OptionBuilder;
|
||||
import org.apache.commons.cli.Options;
|
||||
import org.apache.commons.cli.ParseException;
|
||||
import org.apache.commons.cli.PosixParser;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.checker.BitstreamDispatcher;
|
||||
import org.dspace.checker.CheckerCommand;
|
||||
import org.dspace.checker.HandleDispatcher;
|
||||
@@ -48,7 +49,7 @@ import org.dspace.core.Utils;
|
||||
* @author Nathan Sarr
|
||||
*/
|
||||
public final class ChecksumChecker {
|
||||
private static final Logger LOG = Logger.getLogger(ChecksumChecker.class);
|
||||
private static final Logger LOG = LogManager.getLogger(ChecksumChecker.class);
|
||||
|
||||
private static final BitstreamService bitstreamService = ContentServiceFactory.getInstance().getBitstreamService();
|
||||
|
||||
|
@@ -32,8 +32,8 @@ import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
import javax.mail.MessagingException;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.app.itemexport.service.ItemExportService;
|
||||
import org.dspace.content.Bitstream;
|
||||
import org.dspace.content.Bundle;
|
||||
@@ -98,7 +98,7 @@ public class ItemExportServiceImpl implements ItemExportService {
|
||||
/**
|
||||
* log4j logger
|
||||
*/
|
||||
private Logger log = Logger.getLogger(ItemExportServiceImpl.class);
|
||||
private Logger log = org.apache.logging.log4j.LogManager.getLogger(ItemExportServiceImpl.class);
|
||||
|
||||
protected ItemExportServiceImpl() {
|
||||
|
||||
|
@@ -55,10 +55,10 @@ import gr.ekt.bteio.loaders.OAIPMHDataLoader;
|
||||
import org.apache.commons.collections4.ComparatorUtils;
|
||||
import org.apache.commons.io.FileDeleteStrategy;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.lang.RandomStringUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.RandomStringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.exception.ExceptionUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.xpath.XPathAPI;
|
||||
import org.dspace.app.itemimport.service.ItemImportService;
|
||||
import org.dspace.app.util.LocalSchemaFilenameFilter;
|
||||
@@ -124,7 +124,7 @@ import org.xml.sax.SAXException;
|
||||
* allow the registration of files (bitstreams) into DSpace.
|
||||
*/
|
||||
public class ItemImportServiceImpl implements ItemImportService, InitializingBean {
|
||||
private final Logger log = Logger.getLogger(ItemImportServiceImpl.class);
|
||||
private final Logger log = org.apache.logging.log4j.LogManager.getLogger(ItemImportServiceImpl.class);
|
||||
|
||||
@Autowired(required = true)
|
||||
protected AuthorizeService authorizeService;
|
||||
|
@@ -30,7 +30,7 @@ import javax.xml.transform.TransformerConfigurationException;
|
||||
import javax.xml.transform.TransformerException;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.app.util.LocalSchemaFilenameFilter;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.content.DSpaceObject;
|
||||
@@ -47,7 +47,7 @@ import org.w3c.dom.Document;
|
||||
* Encapsulates the Item in the context of the DSpace Archive Format
|
||||
*/
|
||||
public class ItemArchive {
|
||||
private static final Logger log = Logger.getLogger(ItemArchive.class);
|
||||
private static final Logger log = org.apache.logging.log4j.LogManager.getLogger(ItemArchive.class);
|
||||
|
||||
public static final String DUBLIN_CORE_XML = "dublin_core.xml";
|
||||
|
||||
|
@@ -28,7 +28,7 @@ import javax.xml.transform.TransformerException;
|
||||
import javax.xml.transform.dom.DOMSource;
|
||||
import javax.xml.transform.stream.StreamResult;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.xpath.XPathAPI;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.content.Item;
|
||||
|
@@ -11,7 +11,7 @@ import java.io.InputStream;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.poi.POITextExtractor;
|
||||
import org.apache.poi.extractor.ExtractorFactory;
|
||||
import org.apache.poi.hssf.extractor.ExcelExtractor;
|
||||
@@ -36,7 +36,7 @@ import org.dspace.content.Item;
|
||||
*/
|
||||
public class ExcelFilter extends MediaFilter {
|
||||
|
||||
private static Logger log = Logger.getLogger(ExcelFilter.class);
|
||||
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(ExcelFilter.class);
|
||||
|
||||
public String getFilteredName(String oldFilename) {
|
||||
return oldFilename + ".txt";
|
||||
|
@@ -22,7 +22,7 @@ import org.apache.commons.cli.Option;
|
||||
import org.apache.commons.cli.OptionBuilder;
|
||||
import org.apache.commons.cli.Options;
|
||||
import org.apache.commons.cli.PosixParser;
|
||||
import org.apache.commons.lang.ArrayUtils;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.dspace.app.mediafilter.factory.MediaFilterServiceFactory;
|
||||
import org.dspace.app.mediafilter.service.MediaFilterService;
|
||||
import org.dspace.content.Collection;
|
||||
|
@@ -16,7 +16,7 @@ import java.io.InputStream;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.io.Writer;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.pdfbox.pdmodel.PDDocument;
|
||||
import org.apache.pdfbox.text.PDFTextStripper;
|
||||
import org.dspace.content.Item;
|
||||
@@ -30,7 +30,7 @@ import org.dspace.core.ConfigurationManager;
|
||||
*/
|
||||
public class PDFFilter extends MediaFilter {
|
||||
|
||||
private static Logger log = Logger.getLogger(PDFFilter.class);
|
||||
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(PDFFilter.class);
|
||||
|
||||
@Override
|
||||
public String getFilteredName(String oldFilename) {
|
||||
|
@@ -10,7 +10,7 @@ package org.dspace.app.mediafilter;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.InputStream;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.poi.POITextExtractor;
|
||||
import org.apache.poi.extractor.ExtractorFactory;
|
||||
import org.apache.poi.hslf.extractor.PowerPointExtractor;
|
||||
@@ -23,7 +23,7 @@ import org.dspace.content.Item;
|
||||
*/
|
||||
public class PowerPointFilter extends MediaFilter {
|
||||
|
||||
private static Logger log = Logger.getLogger(PowerPointFilter.class);
|
||||
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(PowerPointFilter.class);
|
||||
|
||||
@Override
|
||||
public String getFilteredName(String oldFilename) {
|
||||
|
@@ -11,7 +11,7 @@ import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.content.Item;
|
||||
import org.textmining.extraction.TextExtractor;
|
||||
import org.textmining.extraction.word.WordTextExtractorFactory;
|
||||
@@ -24,7 +24,7 @@ import org.textmining.extraction.word.WordTextExtractorFactory;
|
||||
*/
|
||||
public class WordFilter extends MediaFilter {
|
||||
|
||||
private static Logger log = Logger.getLogger(WordFilter.class);
|
||||
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(WordFilter.class);
|
||||
|
||||
@Override
|
||||
public String getFilteredName(String oldFilename) {
|
||||
|
@@ -9,8 +9,8 @@ package org.dspace.app.requestitem;
|
||||
|
||||
import java.sql.SQLException;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.content.Item;
|
||||
import org.dspace.core.ConfigurationManager;
|
||||
import org.dspace.core.Context;
|
||||
@@ -31,7 +31,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
*/
|
||||
public class RequestItemHelpdeskStrategy extends RequestItemSubmitterStrategy {
|
||||
|
||||
private Logger log = Logger.getLogger(RequestItemHelpdeskStrategy.class);
|
||||
private Logger log = org.apache.logging.log4j.LogManager.getLogger(RequestItemHelpdeskStrategy.class);
|
||||
|
||||
@Autowired(required = true)
|
||||
protected EPersonService ePersonService;
|
||||
|
@@ -10,7 +10,7 @@ package org.dspace.app.requestitem;
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.dspace.content.Item;
|
||||
import org.dspace.content.MetadataValue;
|
||||
import org.dspace.content.service.ItemService;
|
||||
|
@@ -10,7 +10,7 @@ package org.dspace.app.requestitem;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Date;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.app.requestitem.dao.RequestItemDAO;
|
||||
import org.dspace.app.requestitem.service.RequestItemService;
|
||||
import org.dspace.content.Bitstream;
|
||||
@@ -28,7 +28,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
*/
|
||||
public class RequestItemServiceImpl implements RequestItemService {
|
||||
|
||||
private final Logger log = Logger.getLogger(RequestItemServiceImpl.class);
|
||||
private final Logger log = org.apache.logging.log4j.LogManager.getLogger(RequestItemServiceImpl.class);
|
||||
|
||||
@Autowired(required = true)
|
||||
protected RequestItemDAO requestItemDAO;
|
||||
|
@@ -15,8 +15,8 @@ import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.app.sfx.service.SFXFileReaderService;
|
||||
import org.dspace.content.DCPersonName;
|
||||
import org.dspace.content.Item;
|
||||
@@ -58,7 +58,7 @@ public class SFXFileReaderServiceImpl implements SFXFileReaderService {
|
||||
/**
|
||||
* log4j logger
|
||||
*/
|
||||
private final Logger log = Logger.getLogger(SFXFileReaderServiceImpl.class);
|
||||
private final Logger log = org.apache.logging.log4j.LogManager.getLogger(SFXFileReaderServiceImpl.class);
|
||||
|
||||
protected SFXFileReaderServiceImpl() {
|
||||
}
|
||||
|
@@ -13,7 +13,7 @@ import java.util.List;
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.dspace.app.util.XMLUtils;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
package org.dspace.app.sherpa;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.HttpStatus;
|
||||
@@ -16,7 +16,7 @@ import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.client.utils.URIBuilder;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClientBuilder;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.core.ConfigurationManager;
|
||||
|
||||
public class SHERPAService {
|
||||
@@ -29,7 +29,7 @@ public class SHERPAService {
|
||||
/**
|
||||
* log4j category
|
||||
*/
|
||||
private static final Logger log = Logger.getLogger(SHERPAService.class);
|
||||
private static final Logger log = org.apache.logging.log4j.LogManager.getLogger(SHERPAService.class);
|
||||
|
||||
public SHERPAService() {
|
||||
HttpClientBuilder builder = HttpClientBuilder.create();
|
||||
|
@@ -11,8 +11,8 @@ import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.app.sherpa.SHERPAResponse;
|
||||
import org.dspace.app.sherpa.SHERPAService;
|
||||
import org.dspace.content.Item;
|
||||
@@ -27,7 +27,7 @@ public class SHERPASubmitService {
|
||||
/**
|
||||
* log4j logger
|
||||
*/
|
||||
private static Logger log = Logger.getLogger(SHERPASubmitService.class);
|
||||
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(SHERPASubmitService.class);
|
||||
|
||||
public void setConfiguration(SHERPASubmitConfigurationService configuration) {
|
||||
this.configuration = configuration;
|
||||
|
@@ -27,9 +27,9 @@ import org.apache.commons.cli.HelpFormatter;
|
||||
import org.apache.commons.cli.Options;
|
||||
import org.apache.commons.cli.ParseException;
|
||||
import org.apache.commons.cli.PosixParser;
|
||||
import org.apache.commons.lang.ArrayUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.content.Collection;
|
||||
import org.dspace.content.Community;
|
||||
import org.dspace.content.Item;
|
||||
@@ -52,7 +52,7 @@ public class GenerateSitemaps {
|
||||
/**
|
||||
* Logger
|
||||
*/
|
||||
private static Logger log = Logger.getLogger(GenerateSitemaps.class);
|
||||
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(GenerateSitemaps.class);
|
||||
|
||||
private static final CommunityService communityService = ContentServiceFactory.getInstance().getCommunityService();
|
||||
private static final CollectionService collectionService =
|
||||
|
@@ -21,7 +21,7 @@ import java.util.Set;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.apache.commons.lang.time.DateUtils;
|
||||
import org.apache.commons.lang3.time.DateUtils;
|
||||
import org.dspace.core.ConfigurationManager;
|
||||
|
||||
/**
|
||||
|
@@ -13,7 +13,7 @@ import java.util.Map;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.regex.PatternSyntaxException;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.dspace.content.MetadataSchema;
|
||||
import org.dspace.core.Utils;
|
||||
import org.slf4j.Logger;
|
||||
@@ -63,6 +63,12 @@ public class DCInput {
|
||||
*/
|
||||
private String label = null;
|
||||
|
||||
/**
|
||||
* a style instruction to apply to the input. The exact way to use the style value is UI depending that receive the
|
||||
* value from the REST API as is
|
||||
*/
|
||||
private String style = null;
|
||||
|
||||
/**
|
||||
* the input type
|
||||
*/
|
||||
@@ -199,7 +205,7 @@ public class DCInput {
|
||||
typeBind.add(type.trim());
|
||||
}
|
||||
}
|
||||
|
||||
style = fieldMap.get("style");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -262,7 +268,7 @@ public class DCInput {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the DC element for this form row.
|
||||
* Get the DC element for this form field.
|
||||
*
|
||||
* @return the DC element
|
||||
*/
|
||||
@@ -271,7 +277,7 @@ public class DCInput {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the DC namespace prefix for this form row.
|
||||
* Get the DC namespace prefix for this form field.
|
||||
*
|
||||
* @return the DC namespace prefix
|
||||
*/
|
||||
@@ -290,7 +296,7 @@ public class DCInput {
|
||||
}
|
||||
|
||||
/**
|
||||
* Is there a required string for this form row?
|
||||
* Is there a required string for this form field?
|
||||
*
|
||||
* @return true if a required string is set
|
||||
*/
|
||||
@@ -299,7 +305,7 @@ public class DCInput {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the DC qualifier for this form row.
|
||||
* Get the DC qualifier for this form field.
|
||||
*
|
||||
* @return the DC qualifier
|
||||
*/
|
||||
@@ -308,7 +314,7 @@ public class DCInput {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the language for this form row.
|
||||
* Get the language for this form field.
|
||||
*
|
||||
* @return the language state
|
||||
*/
|
||||
@@ -317,7 +323,7 @@ public class DCInput {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the hint for this form row, formatted for an HTML table
|
||||
* Get the hint for this form field
|
||||
*
|
||||
* @return the hints
|
||||
*/
|
||||
@@ -326,7 +332,7 @@ public class DCInput {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the label for this form row.
|
||||
* Get the label for this form field.
|
||||
*
|
||||
* @return the label
|
||||
*/
|
||||
@@ -334,6 +340,15 @@ public class DCInput {
|
||||
return label;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the style for this form field
|
||||
*
|
||||
* @return the style
|
||||
*/
|
||||
public String getStyle() {
|
||||
return style;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the name of the pairs type
|
||||
*
|
||||
|
@@ -25,25 +25,26 @@ public class DCInputSet {
|
||||
/**
|
||||
* the inputs ordered by row position
|
||||
*/
|
||||
private DCInput[] inputs = null;
|
||||
private DCInput[][] inputs = null;
|
||||
|
||||
/**
|
||||
* constructor
|
||||
*
|
||||
* @param formName form name
|
||||
* @param headings
|
||||
* @param mandatoryFlags
|
||||
* @param fields fields
|
||||
* @param rows the rows
|
||||
* @param listMap map
|
||||
*/
|
||||
public DCInputSet(String formName,
|
||||
List<Map<String, String>> fields, Map<String, List<String>> listMap) {
|
||||
public DCInputSet(String formName, List<List<Map<String, String>>> rows, Map<String, List<String>> listMap) {
|
||||
this.formName = formName;
|
||||
this.inputs = new DCInput[fields.size()];
|
||||
this.inputs = new DCInput[rows.size()][];
|
||||
for (int i = 0; i < inputs.length; i++) {
|
||||
Map<String, String> field = fields.get(i);
|
||||
inputs[i] = new DCInput(field, listMap);
|
||||
|
||||
List<Map<String, String>> fields = rows.get(i);
|
||||
inputs[i] = new DCInput[fields.size()];
|
||||
for (int j = 0; j < inputs[i].length; j++) {
|
||||
Map<String, String> field = rows.get(i).get(j);
|
||||
inputs[i][j] = new DCInput(field, listMap);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +72,7 @@ public class DCInputSet {
|
||||
* @return an array containing the fields
|
||||
*/
|
||||
|
||||
public DCInput[] getFields() {
|
||||
public DCInput[][] getFields() {
|
||||
return inputs;
|
||||
}
|
||||
|
||||
@@ -104,10 +105,12 @@ public class DCInputSet {
|
||||
*/
|
||||
public boolean isFieldPresent(String fieldName) {
|
||||
for (int i = 0; i < inputs.length; i++) {
|
||||
DCInput field = inputs[i];
|
||||
String fullName = field.getFieldName();
|
||||
if (fullName.equals(fieldName)) {
|
||||
return true;
|
||||
for (int j = 0; j < inputs[i].length; j++) {
|
||||
DCInput field = inputs[i][j];
|
||||
String fullName = field.getFieldName();
|
||||
if (fullName.equals(fieldName)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
@@ -127,11 +130,13 @@ public class DCInputSet {
|
||||
documentType = "";
|
||||
}
|
||||
for (int i = 0; i < inputs.length; i++) {
|
||||
DCInput field = inputs[i];
|
||||
String fullName = field.getFieldName();
|
||||
if (fullName.equals(fieldName)) {
|
||||
if (field.isAllowedFor(documentType)) {
|
||||
return true;
|
||||
for (int j = 0; j < inputs[i].length; j++) {
|
||||
DCInput field = inputs[i][j];
|
||||
String fullName = field.getFieldName();
|
||||
if (fullName.equals(fieldName)) {
|
||||
if (field.isAllowedFor(documentType)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -74,7 +74,7 @@ public class DCInputsReader {
|
||||
* Reference to the forms definitions map, computed from the forms
|
||||
* definition file
|
||||
*/
|
||||
private Map<String, List<Map<String, String>>> formDefns = null;
|
||||
private Map<String, List<List<Map<String, String>>>> formDefns = null;
|
||||
|
||||
/**
|
||||
* Reference to the value-pairs map, computed from the forms definition file
|
||||
@@ -115,7 +115,7 @@ public class DCInputsReader {
|
||||
|
||||
private void buildInputs(String fileName)
|
||||
throws DCInputsReaderException {
|
||||
formDefns = new HashMap<String, List<Map<String, String>>>();
|
||||
formDefns = new HashMap<String, List<List<Map<String, String>>>>();
|
||||
valuePairs = new HashMap<String, List<String>>();
|
||||
|
||||
String uri = "file:" + new File(fileName).getAbsolutePath();
|
||||
@@ -212,7 +212,7 @@ public class DCInputsReader {
|
||||
return lastInputSet;
|
||||
}
|
||||
// cache miss - construct new DCInputSet
|
||||
List<Map<String, String>> pages = formDefns.get(formName);
|
||||
List<List<Map<String, String>>> pages = formDefns.get(formName);
|
||||
if (pages == null) {
|
||||
throw new DCInputsReaderException("Missing the " + formName + " form");
|
||||
}
|
||||
@@ -292,8 +292,8 @@ public class DCInputsReader {
|
||||
|
||||
/**
|
||||
* Process the form-definitions section of the XML file. Each element is
|
||||
* formed thusly: <form name="formname">...pages...</form> Each pages
|
||||
* subsection is formed: <page number="#"> ...fields... </page> Each field
|
||||
* formed thusly: <form name="formname">...row...</form> Each rows
|
||||
* subsection is formed: <row> ...fields... </row> Each field
|
||||
* is formed from: dc-element, dc-qualifier, label, hint, input-type name,
|
||||
* required text, and repeatable flag.
|
||||
*/
|
||||
@@ -311,26 +311,24 @@ public class DCInputsReader {
|
||||
if (formName == null) {
|
||||
throw new SAXException("form element has no name attribute");
|
||||
}
|
||||
List<Map<String, String>> fields = new ArrayList<Map<String, String>>(); // the form contains fields
|
||||
formDefns.put(formName, fields);
|
||||
List<List<Map<String, String>>> rows = new ArrayList<List<Map<String, String>>>(); // the form
|
||||
// contains rows of fields
|
||||
formDefns.put(formName, rows);
|
||||
NodeList pl = nd.getChildNodes();
|
||||
int lenpg = pl.getLength();
|
||||
for (int j = 0; j < lenpg; j++) {
|
||||
Node npg = pl.item(j);
|
||||
|
||||
if (npg.getNodeName().equals("field")) {
|
||||
// process each field definition
|
||||
Map<String, String> field = new HashMap<String, String>();
|
||||
processField(formName, npg, field);
|
||||
fields.add(field);
|
||||
// we omit the duplicate validation, allowing multiple
|
||||
// fields definition for
|
||||
// the same metadata and different visibility/type-bind
|
||||
if (npg.getNodeName().equals("row")) {
|
||||
List<Map<String, String>> fields = new ArrayList<Map<String, String>>(); // the fields in the
|
||||
// row
|
||||
// process each row definition
|
||||
processRow(formName, j, npg, fields);
|
||||
rows.add(fields);
|
||||
}
|
||||
}
|
||||
// sanity check number of fields
|
||||
if (fields.size() < 1) {
|
||||
throw new DCInputsReaderException("Form " + formName + " has no fields");
|
||||
if (rows.size() < 1) {
|
||||
throw new DCInputsReaderException("Form " + formName + " has no rows");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -339,6 +337,48 @@ public class DCInputsReader {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Process parts of a row
|
||||
*/
|
||||
private void processRow(String formName, int rowIdx, Node n, List<Map<String, String>> fields)
|
||||
throws SAXException, DCInputsReaderException {
|
||||
|
||||
NodeList pl = n.getChildNodes();
|
||||
int lenpg = pl.getLength();
|
||||
for (int j = 0; j < lenpg; j++) {
|
||||
Node npg = pl.item(j);
|
||||
|
||||
if (npg.getNodeName().equals("field")) {
|
||||
// process each field definition
|
||||
Map<String, String> field = new HashMap<String, String>();
|
||||
processField(formName, npg, field);
|
||||
fields.add(field);
|
||||
String key = field.get(PAIR_TYPE_NAME);
|
||||
if (StringUtils
|
||||
.isNotBlank(key)) {
|
||||
String schema = field.get("dc-schema");
|
||||
String element = field.get("dc-element");
|
||||
String qualifier = field
|
||||
.get("dc-qualifier");
|
||||
String metadataField = schema + "."
|
||||
+ element;
|
||||
if (StringUtils.isNotBlank(qualifier)) {
|
||||
metadataField += "." + qualifier;
|
||||
}
|
||||
}
|
||||
|
||||
// we omit the duplicate validation, allowing multiple
|
||||
// fields definition for
|
||||
// the same metadata and different visibility/type-bind
|
||||
}
|
||||
}
|
||||
// sanity check number of fields
|
||||
if (fields.size() < 1) {
|
||||
throw new DCInputsReaderException("Form " + formName + "row " + rowIdx + " has no fields");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Process parts of a field
|
||||
* At the end, make sure that input-types 'qualdrop_value' and
|
||||
@@ -537,26 +577,29 @@ public class DCInputsReader {
|
||||
Iterator<String> ki = formDefns.keySet().iterator();
|
||||
while (ki.hasNext()) {
|
||||
String idName = ki.next();
|
||||
List<Map<String, String>> fields = formDefns.get(idName);
|
||||
for (int i = 0; i < fields.size(); i++) {
|
||||
Map<String, String> fld = fields.get(i);
|
||||
// verify reference in certain input types
|
||||
String type = fld.get("input-type");
|
||||
if (type.equals("dropdown")
|
||||
|| type.equals("qualdrop_value")
|
||||
|| type.equals("list")) {
|
||||
String pairsName = fld.get(PAIR_TYPE_NAME);
|
||||
List<String> v = valuePairs.get(pairsName);
|
||||
if (v == null) {
|
||||
String errString = "Cannot find value pairs for " + pairsName;
|
||||
throw new DCInputsReaderException(errString);
|
||||
List<List<Map<String, String>>> rows = formDefns.get(idName);
|
||||
for (int j = 0; j < rows.size(); j++) {
|
||||
List<Map<String, String>> fields = rows.get(j);
|
||||
for (int i = 0; i < fields.size(); i++) {
|
||||
Map<String, String> fld = fields.get(i);
|
||||
// verify reference in certain input types
|
||||
String type = fld.get("input-type");
|
||||
if (type.equals("dropdown")
|
||||
|| type.equals("qualdrop_value")
|
||||
|| type.equals("list")) {
|
||||
String pairsName = fld.get(PAIR_TYPE_NAME);
|
||||
List<String> v = valuePairs.get(pairsName);
|
||||
if (v == null) {
|
||||
String errString = "Cannot find value pairs for " + pairsName;
|
||||
throw new DCInputsReaderException(errString);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// we omit the "required" and "visibility" validation, provided this must be checked in the
|
||||
// processing class
|
||||
// only when it makes sense (if the field isn't visible means that it is not applicable, therefore it
|
||||
// can't be required)
|
||||
// we omit the "required" and "visibility" validation, provided this must be checked in the
|
||||
// processing class
|
||||
// only when it makes sense (if the field isn't visible means that it is not applicable,
|
||||
// therefore it can't be required)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -639,4 +682,5 @@ public class DCInputsReader {
|
||||
}
|
||||
throw new DCInputsReaderException("No field configuration found!");
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -16,14 +16,14 @@ import java.util.Enumeration;
|
||||
import javax.servlet.ServletContextEvent;
|
||||
import javax.servlet.ServletContextListener;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
/**
|
||||
* Class to initialize / cleanup resources used by DSpace when the web application
|
||||
* is started or stopped.
|
||||
*/
|
||||
public class DSpaceContextListener implements ServletContextListener {
|
||||
private static Logger log = Logger.getLogger(DSpaceContextListener.class);
|
||||
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(DSpaceContextListener.class);
|
||||
|
||||
/**
|
||||
* Initialize any resources required by the application.
|
||||
|
@@ -1,299 +0,0 @@
|
||||
/**
|
||||
* 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.app.util;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.UnknownHostException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
||||
import org.apache.commons.lang.time.DateUtils;
|
||||
import org.apache.log4j.FileAppender;
|
||||
import org.apache.log4j.helpers.LogLog;
|
||||
import org.apache.log4j.spi.LoggingEvent;
|
||||
|
||||
/**
|
||||
* Special log appender for log4j. Adds the current date (ie. year-mon) to
|
||||
* the end of the file name, so that rolling on to the next log is simply
|
||||
* a case of starting a new one - no renaming of old logs.
|
||||
*
|
||||
* This is advisable if you are using Windows, and have multiple applications
|
||||
* (ie. dspace, dspace-oai, dspace-sword) that all want to write to the same log file,
|
||||
* as each would otherwise try to rename the old files during rollover.
|
||||
*
|
||||
* An example log4j.properties (one log per month, retains three months of logs)
|
||||
*
|
||||
* log4j.rootCategory=INFO, A1
|
||||
* log4j.appender.A1=org.dspace.app.util.DailyFileAppender
|
||||
* log4j.appender.A1.File=@@log.dir@@/dspace.log
|
||||
* log4j.appender.A1.DatePattern=yyyy-MM
|
||||
* log4j.appender.A1.MaxLogs=3
|
||||
* log4j.appender.A1.layout=org.apache.log4j.PatternLayout
|
||||
* log4j.appender.A1.layout.ConversionPattern=%d %-5p %c @ %m%n
|
||||
*/
|
||||
public class DailyFileAppender extends FileAppender {
|
||||
/**
|
||||
* The fixed date pattern to be used if one is not specified.
|
||||
*/
|
||||
private static final String DATE_PATTERN = "yyyy-MM-dd";
|
||||
|
||||
/**
|
||||
* The folder under which daily folders are created. This can be a absolute path
|
||||
* or relative path also.
|
||||
* e.g. JavaLogs/CPRILog or F:/LogFiles/CPRILog
|
||||
*/
|
||||
private String mstrFileName;
|
||||
|
||||
/**
|
||||
* Used internally and contains the name of the date derived from current system date.
|
||||
*/
|
||||
private Date mstrDate = new Date(System.currentTimeMillis());
|
||||
|
||||
/**
|
||||
* Holds the user specified DatePattern,
|
||||
*/
|
||||
private String mstrDatePattern = DATE_PATTERN;
|
||||
|
||||
private boolean mMonthOnly = false;
|
||||
|
||||
/**
|
||||
* The date formatter object used for parsing the user specified DatePattern.
|
||||
*/
|
||||
private SimpleDateFormat mobjSDF;
|
||||
|
||||
private boolean mWithHostName = false;
|
||||
|
||||
private int mMaxLogs = 0;
|
||||
|
||||
/**
|
||||
* Default constructor. This is required as the appender class is dynamically
|
||||
* loaded.
|
||||
*/
|
||||
public DailyFileAppender() {
|
||||
super();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.apache.log4j.FileAppender#activateOptions()
|
||||
*/
|
||||
@Override
|
||||
public void activateOptions() {
|
||||
setFileName();
|
||||
cleanupOldFiles();
|
||||
super.activateOptions();
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Getters
|
||||
*----------------------------------------------------------------------------*/
|
||||
public String getDatePattern() {
|
||||
return this.mstrDatePattern;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFile() {
|
||||
return this.mstrFileName;
|
||||
}
|
||||
|
||||
public boolean getWithHost() {
|
||||
return mWithHostName;
|
||||
}
|
||||
|
||||
public int getMaxLogs() {
|
||||
return mMaxLogs;
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Setters
|
||||
*----------------------------------------------------------------------------*/
|
||||
public void setDatePattern(String pstrPattern) {
|
||||
this.mstrDatePattern = checkPattern(pstrPattern);
|
||||
if (mstrDatePattern.contains("dd") || mstrDatePattern.contains("DD")) {
|
||||
mMonthOnly = false;
|
||||
} else {
|
||||
mMonthOnly = true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFile(String file) {
|
||||
// Trim spaces from both ends. The users probably does not want
|
||||
// trailing spaces in file names.
|
||||
String val = file.trim();
|
||||
mstrFileName = val;
|
||||
}
|
||||
|
||||
public void setWithHost(boolean wh) {
|
||||
mWithHostName = wh;
|
||||
}
|
||||
|
||||
public void setMaxLogs(int ml) {
|
||||
mMaxLogs = ml;
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Methods
|
||||
*----------------------------------------------------------------------------*/
|
||||
/* (non-Javadoc)
|
||||
* @see org.apache.log4j.WriterAppender#subAppend(org.apache.log4j.spi.LoggingEvent)
|
||||
*/
|
||||
@Override
|
||||
protected void subAppend(LoggingEvent pobjEvent) {
|
||||
Date dtNow = new Date(System.currentTimeMillis());
|
||||
|
||||
boolean rollover = false;
|
||||
|
||||
if (mMonthOnly) {
|
||||
Calendar now = Calendar.getInstance();
|
||||
Calendar cur = Calendar.getInstance();
|
||||
now.setTime(dtNow);
|
||||
cur.setTime(mstrDate);
|
||||
rollover = !(now.get(Calendar.YEAR) == cur.get(Calendar.YEAR) && now.get(Calendar.MONTH) == cur
|
||||
.get(Calendar.MONTH));
|
||||
} else {
|
||||
rollover = !(DateUtils.isSameDay(dtNow, mstrDate));
|
||||
}
|
||||
|
||||
if (rollover) {
|
||||
try {
|
||||
rollOver(dtNow);
|
||||
} catch (IOException IOEx) {
|
||||
LogLog.error("rollOver() failed!", IOEx);
|
||||
}
|
||||
}
|
||||
|
||||
super.subAppend(pobjEvent);
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Helpers
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* The helper function to validate the DatePattern.
|
||||
*
|
||||
* @param pstrPattern The DatePattern to be validated.
|
||||
* @return The validated date pattern or defautlt DATE_PATTERN
|
||||
*/
|
||||
private String checkPattern(String pstrPattern) {
|
||||
String strRet = null;
|
||||
SimpleDateFormat objFmt = new SimpleDateFormat(DATE_PATTERN);
|
||||
|
||||
try {
|
||||
this.mobjSDF = new SimpleDateFormat(pstrPattern);
|
||||
strRet = pstrPattern;
|
||||
} catch (NullPointerException NPExIgnore) {
|
||||
LogLog.error("Invalid DatePattern " + pstrPattern, NPExIgnore);
|
||||
this.mobjSDF = objFmt;
|
||||
strRet = DATE_PATTERN;
|
||||
} catch (IllegalArgumentException IlArgExIgnore) {
|
||||
LogLog.error("Invalid DatePattern " + pstrPattern, IlArgExIgnore);
|
||||
this.mobjSDF = objFmt;
|
||||
strRet = DATE_PATTERN;
|
||||
} finally {
|
||||
objFmt = null;
|
||||
}
|
||||
return strRet;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is responsible for performing the actual file rollover.
|
||||
*
|
||||
* @param pstrName The name of the new folder based on current system date.
|
||||
* @throws IOException if IO error
|
||||
*/
|
||||
private static boolean deletingFiles = false;
|
||||
|
||||
private void cleanupOldFiles() {
|
||||
// If we need to delete log files
|
||||
if (mMaxLogs > 0 && !deletingFiles) {
|
||||
deletingFiles = true;
|
||||
|
||||
// Determine the final file extension with the hostname
|
||||
String hostFileExt = null;
|
||||
try {
|
||||
hostFileExt = "." + java.net.InetAddress.getLocalHost().getHostName();
|
||||
} catch (UnknownHostException e) {
|
||||
LogLog.error("Unable to retrieve host name");
|
||||
}
|
||||
|
||||
try {
|
||||
// Array to hold the logs we are going to keep
|
||||
File[] logsToKeep = new File[mMaxLogs];
|
||||
|
||||
// Get a 'master' file handle, and the parent directory from it
|
||||
File logMaster = new File(mstrFileName);
|
||||
File logDir = logMaster.getParentFile();
|
||||
if (logDir.isDirectory()) {
|
||||
// Iterate all the files in that directory
|
||||
File[] logArr = logDir.listFiles();
|
||||
for (File curLog : logArr) {
|
||||
LogLog.debug("Comparing '" + curLog.getAbsolutePath() + "' to '" + mstrFileName + "'");
|
||||
String name = curLog.getAbsolutePath();
|
||||
|
||||
// First, see if we are not using hostname, or the log file ends with this host
|
||||
if (!mWithHostName || (hostFileExt != null && name.endsWith(hostFileExt))) {
|
||||
// Check that the file is indeed one we want (contains the master file name)
|
||||
if (name.contains(mstrFileName)) {
|
||||
// Iterate through the array of logs we are keeping
|
||||
for (int i = 0; curLog != null && i < logsToKeep.length; i++) {
|
||||
// Have we exhausted the 'to keep' array?
|
||||
if (logsToKeep[i] == null) {
|
||||
// Empty space, retain this log file
|
||||
logsToKeep[i] = curLog;
|
||||
curLog = null;
|
||||
} else if (logsToKeep[i].getName().compareTo(curLog.getName()) < 0) {
|
||||
// If the 'kept' file is older than the current one
|
||||
// Replace tested entry with current file
|
||||
File temp = logsToKeep[i];
|
||||
logsToKeep[i] = curLog;
|
||||
curLog = temp;
|
||||
}
|
||||
}
|
||||
|
||||
// If we have a 'current' entry at this point, it's a log we don't want
|
||||
if (curLog != null) {
|
||||
LogLog.debug("Deleting log " + curLog.getName());
|
||||
if (!curLog.delete()) {
|
||||
LogLog.error("Unable to delete log file");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// Don't worry about exceptions
|
||||
} finally {
|
||||
deletingFiles = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void rollOver(Date dtNow) throws IOException {
|
||||
mstrDate = dtNow;
|
||||
setFileName();
|
||||
this.setFile(fileName, true, bufferedIO, bufferSize);
|
||||
|
||||
cleanupOldFiles();
|
||||
}
|
||||
|
||||
private void setFileName() {
|
||||
fileName = mstrFileName + "." + mobjSDF.format(mstrDate);
|
||||
|
||||
if (mWithHostName) {
|
||||
try {
|
||||
fileName += "." + java.net.InetAddress.getLocalHost().getHostName();
|
||||
} catch (UnknownHostException e) {
|
||||
LogLog.error("Unable to retrieve host name");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -12,7 +12,7 @@ import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.content.Bitstream;
|
||||
import org.dspace.content.BitstreamFormat;
|
||||
import org.dspace.content.factory.ContentServiceFactory;
|
||||
@@ -24,7 +24,7 @@ import org.dspace.core.Context;
|
||||
*/
|
||||
public class GoogleBitstreamComparator implements Comparator<Bitstream> {
|
||||
|
||||
private final static Logger log = Logger.getLogger(GoogleBitstreamComparator.class);
|
||||
private final static Logger log = org.apache.logging.log4j.LogManager.getLogger(GoogleBitstreamComparator.class);
|
||||
|
||||
HashMap<String, Integer> priorityMap = new HashMap<>();
|
||||
|
||||
|
@@ -26,7 +26,7 @@ import java.util.Properties;
|
||||
|
||||
import com.google.common.collect.ArrayListMultimap;
|
||||
import com.google.common.collect.ListMultimap;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.authorize.factory.AuthorizeServiceFactory;
|
||||
import org.dspace.content.Bitstream;
|
||||
import org.dspace.content.Bundle;
|
||||
@@ -51,7 +51,7 @@ import org.jdom.Element;
|
||||
@SuppressWarnings("deprecation")
|
||||
public class GoogleMetadata {
|
||||
|
||||
private final static Logger log = Logger.getLogger(GoogleMetadata.class);
|
||||
private final static Logger log = org.apache.logging.log4j.LogManager.getLogger(GoogleMetadata.class);
|
||||
|
||||
protected static final String GOOGLE_PREFIX = "google.";
|
||||
|
||||
|
@@ -14,7 +14,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.app.util.service.MetadataExposureService;
|
||||
import org.dspace.authorize.service.AuthorizeService;
|
||||
import org.dspace.core.Context;
|
||||
@@ -58,7 +58,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
* @version $Revision: 3734 $
|
||||
*/
|
||||
public class MetadataExposureServiceImpl implements MetadataExposureService {
|
||||
protected Logger log = Logger.getLogger(MetadataExposureServiceImpl.class);
|
||||
protected Logger log = org.apache.logging.log4j.LogManager.getLogger(MetadataExposureServiceImpl.class);
|
||||
|
||||
protected Map<String, Set<String>> hiddenElementSets = null;
|
||||
protected Map<String, Map<String, Set<String>>> hiddenElementMaps = null;
|
||||
|
@@ -20,7 +20,7 @@ import com.sun.syndication.feed.module.opensearch.OpenSearchModule;
|
||||
import com.sun.syndication.feed.module.opensearch.entity.OSQuery;
|
||||
import com.sun.syndication.feed.module.opensearch.impl.OpenSearchModuleImpl;
|
||||
import com.sun.syndication.io.FeedException;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.app.util.service.OpenSearchService;
|
||||
import org.dspace.content.DSpaceObject;
|
||||
import org.dspace.core.Constants;
|
||||
@@ -54,7 +54,7 @@ import org.w3c.dom.Document;
|
||||
* @author Richard Rodgers
|
||||
*/
|
||||
public class OpenSearchServiceImpl implements OpenSearchService, InitializingBean {
|
||||
private static final Logger log = Logger.getLogger(OpenSearchServiceImpl.class);
|
||||
private static final Logger log = org.apache.logging.log4j.LogManager.getLogger(OpenSearchServiceImpl.class);
|
||||
|
||||
// are open search queries enabled?
|
||||
protected boolean enabled = false;
|
||||
|
@@ -11,7 +11,7 @@ import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.content.Collection;
|
||||
import org.dspace.content.factory.ContentServiceFactory;
|
||||
import org.dspace.content.service.CollectionService;
|
||||
@@ -28,7 +28,7 @@ import org.springframework.util.StopWatch;
|
||||
* Invocation: dsrun org.dspace.app.util.OptimizeSelectCollection
|
||||
*/
|
||||
public class OptimizeSelectCollection {
|
||||
private static final Logger log = Logger.getLogger(OptimizeSelectCollection.class);
|
||||
private static final Logger log = org.apache.logging.log4j.LogManager.getLogger(OptimizeSelectCollection.class);
|
||||
private static Context context;
|
||||
|
||||
private static ArrayList<EPerson> brokenPeople;
|
||||
|
@@ -12,7 +12,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
/**
|
||||
* Class representing a single Item Submission config definition, organized into
|
||||
@@ -44,7 +44,7 @@ public class SubmissionConfig implements Serializable {
|
||||
/**
|
||||
* log4j logger
|
||||
*/
|
||||
private static Logger log = Logger.getLogger(SubmissionConfig.class);
|
||||
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(SubmissionConfig.class);
|
||||
|
||||
/**
|
||||
* Constructs a new Submission Configuration object, based on the XML
|
||||
|
@@ -19,7 +19,7 @@ import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.FactoryConfigurationError;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.content.Collection;
|
||||
import org.dspace.content.DSpaceObject;
|
||||
import org.dspace.core.Context;
|
||||
@@ -71,7 +71,7 @@ public class SubmissionConfigReader {
|
||||
/**
|
||||
* log4j logger
|
||||
*/
|
||||
private static Logger log = Logger.getLogger(SubmissionConfigReader.class);
|
||||
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(SubmissionConfigReader.class);
|
||||
|
||||
/**
|
||||
* The fully qualified pathname of the directory containing the Item Submission Configuration file
|
||||
|
@@ -34,9 +34,9 @@ import com.sun.syndication.feed.synd.SyndPerson;
|
||||
import com.sun.syndication.feed.synd.SyndPersonImpl;
|
||||
import com.sun.syndication.io.FeedException;
|
||||
import com.sun.syndication.io.SyndFeedOutput;
|
||||
import org.apache.commons.lang.ArrayUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.content.Bitstream;
|
||||
import org.dspace.content.Bundle;
|
||||
import org.dspace.content.Collection;
|
||||
@@ -69,7 +69,7 @@ import org.w3c.dom.Document;
|
||||
* @author Larry Stone
|
||||
*/
|
||||
public class SyndicationFeed {
|
||||
protected final Logger log = Logger.getLogger(SyndicationFeed.class);
|
||||
protected final Logger log = org.apache.logging.log4j.LogManager.getLogger(SyndicationFeed.class);
|
||||
|
||||
|
||||
/**
|
||||
|
@@ -23,8 +23,8 @@ import java.util.UUID;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.content.Collection;
|
||||
import org.dspace.content.Item;
|
||||
import org.dspace.content.MetadataValue;
|
||||
@@ -44,7 +44,7 @@ public class Util {
|
||||
// cache for source version result
|
||||
private static String sourceVersion = null;
|
||||
|
||||
private static Logger log = Logger.getLogger(Util.class);
|
||||
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(Util.class);
|
||||
|
||||
/**
|
||||
* Default constructor. Must be protected as org.dspace.xmlworkflow.WorkflowUtils extends it
|
||||
@@ -418,11 +418,12 @@ public class Util {
|
||||
|
||||
List<DCInputSet> inputSets = inputsReader.getInputsByCollectionHandle(col_handle);
|
||||
|
||||
// Replace the values of Metadatum[] with the correct ones in case
|
||||
// of
|
||||
// controlled vocabularies
|
||||
String currentField = Utils.standardize(schema, element, qualifier, ".");
|
||||
|
||||
for (DCInputSet inputSet : inputSets) {
|
||||
// Replace the values of Metadatum[] with the correct ones in case
|
||||
// of
|
||||
// controlled vocabularies
|
||||
String currentField = Utils.standardize(schema, element, qualifier, ".");
|
||||
|
||||
if (inputSet != null) {
|
||||
|
||||
@@ -430,19 +431,20 @@ public class Util {
|
||||
|
||||
for (int p = 0; p < fieldsNums; p++) {
|
||||
|
||||
DCInput[] inputs = inputSet.getFields();
|
||||
DCInput[][] inputs = inputSet.getFields();
|
||||
|
||||
if (inputs != null) {
|
||||
|
||||
for (int i = 0; i < inputs.length; i++) {
|
||||
String inputField = Utils.standardize(inputs[i].getSchema(), inputs[i].getElement(),
|
||||
inputs[i].getQualifier(), ".");
|
||||
if (currentField.equals(inputField)) {
|
||||
|
||||
myInputs = inputs[i];
|
||||
myInputsFound = true;
|
||||
break;
|
||||
|
||||
for (int j = 0; j < inputs[i].length; j++) {
|
||||
String inputField = Utils
|
||||
.standardize(inputs[i][j].getSchema(), inputs[i][j].getElement(),
|
||||
inputs[i][j].getQualifier(), ".");
|
||||
if (currentField.equals(inputField)) {
|
||||
myInputs = inputs[i][j];
|
||||
myInputsFound = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -480,13 +482,17 @@ public class Util {
|
||||
Set<String> fromFieldName = new HashSet<>();
|
||||
Set<String> toFieldName = new HashSet<>();
|
||||
for (DCInputSet ff : from) {
|
||||
for (DCInput fdc : ff.getFields()) {
|
||||
fromFieldName.add(fdc.getFieldName());
|
||||
for (DCInput[] fdcrow : ff.getFields()) {
|
||||
for (DCInput fdc : fdcrow) {
|
||||
fromFieldName.add(fdc.getFieldName());
|
||||
}
|
||||
}
|
||||
}
|
||||
for (DCInputSet tt : to) {
|
||||
for (DCInput tdc : tt.getFields()) {
|
||||
toFieldName.add(tdc.getFieldName());
|
||||
for (DCInput[] tdcrow : tt.getFields()) {
|
||||
for (DCInput tdc : tdcrow) {
|
||||
toFieldName.add(tdc.getFieldName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -18,7 +18,7 @@ import org.apache.http.HttpStatus;
|
||||
import org.apache.http.client.HttpClient;
|
||||
import org.apache.http.client.methods.HttpHead;
|
||||
import org.apache.http.impl.client.DefaultHttpClient;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.app.util.dao.WebAppDAO;
|
||||
import org.dspace.app.util.service.WebAppService;
|
||||
import org.dspace.core.Context;
|
||||
@@ -33,7 +33,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
*/
|
||||
public class WebAppServiceImpl implements WebAppService {
|
||||
|
||||
private final Logger log = Logger.getLogger(WebAppServiceImpl.class);
|
||||
private final Logger log = org.apache.logging.log4j.LogManager.getLogger(WebAppServiceImpl.class);
|
||||
|
||||
@Autowired(required = true)
|
||||
protected WebAppDAO webAppDAO;
|
||||
|
@@ -11,7 +11,7 @@ import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.NodeList;
|
||||
|
||||
|
@@ -17,14 +17,15 @@ import java.util.UUID;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.dspace.core.ConfigurationManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.core.LogManager;
|
||||
import org.dspace.core.factory.CoreServiceFactory;
|
||||
import org.dspace.eperson.EPerson;
|
||||
import org.dspace.eperson.Group;
|
||||
import org.dspace.eperson.factory.EPersonServiceFactory;
|
||||
import org.dspace.eperson.service.GroupService;
|
||||
import org.dspace.service.ClientInfoService;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
|
||||
/**
|
||||
@@ -49,7 +50,7 @@ public class IPAuthentication implements AuthenticationMethod {
|
||||
/**
|
||||
* Our logger
|
||||
*/
|
||||
private static Logger log = Logger.getLogger(IPAuthentication.class);
|
||||
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(IPAuthentication.class);
|
||||
|
||||
/**
|
||||
* Whether to look for x-forwarded headers for logging IP addresses
|
||||
@@ -67,6 +68,7 @@ public class IPAuthentication implements AuthenticationMethod {
|
||||
protected List<IPMatcher> ipNegativeMatchers;
|
||||
|
||||
protected GroupService groupService;
|
||||
protected ClientInfoService clientInfoService;
|
||||
|
||||
|
||||
/**
|
||||
@@ -91,6 +93,7 @@ public class IPAuthentication implements AuthenticationMethod {
|
||||
ipMatcherGroupIDs = new HashMap<>();
|
||||
ipMatcherGroupNames = new HashMap<>();
|
||||
groupService = EPersonServiceFactory.getInstance().getGroupService();
|
||||
clientInfoService = CoreServiceFactory.getInstance().getClientInfoService();
|
||||
|
||||
List<String> propNames = DSpaceServicesFactory.getInstance().getConfigurationService()
|
||||
.getPropertyKeys("authentication-ip");
|
||||
@@ -169,18 +172,7 @@ public class IPAuthentication implements AuthenticationMethod {
|
||||
List<Group> groups = new ArrayList<Group>();
|
||||
|
||||
// Get the user's IP address
|
||||
String addr = request.getRemoteAddr();
|
||||
if (useProxies == null) {
|
||||
useProxies = ConfigurationManager.getBooleanProperty("useProxies", false);
|
||||
}
|
||||
if (useProxies && request.getHeader("X-Forwarded-For") != null) {
|
||||
/* This header is a comma delimited list */
|
||||
for (String xfip : request.getHeader("X-Forwarded-For").split(",")) {
|
||||
if (!request.getHeader("X-Forwarded-For").contains(addr)) {
|
||||
addr = xfip.trim();
|
||||
}
|
||||
}
|
||||
}
|
||||
String addr = clientInfoService.getClientIp(request);
|
||||
|
||||
for (IPMatcher ipm : ipMatchers) {
|
||||
try {
|
||||
|
@@ -10,7 +10,7 @@ package org.dspace.authenticate;
|
||||
import java.net.Inet6Address;
|
||||
import java.net.UnknownHostException;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -38,7 +38,7 @@ import org.apache.log4j.Logger;
|
||||
* @version $Revision$
|
||||
*/
|
||||
public class IPMatcher {
|
||||
private static Logger log = Logger.getLogger(IPMatcher.class);
|
||||
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(IPMatcher.class);
|
||||
|
||||
/**
|
||||
* Network to match
|
||||
|
@@ -28,8 +28,8 @@ import javax.naming.ldap.StartTlsResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.authenticate.factory.AuthenticateServiceFactory;
|
||||
import org.dspace.authenticate.service.AuthenticationService;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
@@ -61,7 +61,7 @@ public class LDAPAuthentication
|
||||
/**
|
||||
* log4j category
|
||||
*/
|
||||
private static Logger log = Logger.getLogger(LDAPAuthentication.class);
|
||||
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(LDAPAuthentication.class);
|
||||
|
||||
protected AuthenticationService authenticationService = AuthenticateServiceFactory.getInstance()
|
||||
.getAuthenticationService();
|
||||
|
@@ -15,7 +15,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.core.LogManager;
|
||||
import org.dspace.eperson.EPerson;
|
||||
@@ -49,7 +49,7 @@ public class PasswordAuthentication
|
||||
/**
|
||||
* log4j category
|
||||
*/
|
||||
private static Logger log = Logger.getLogger(PasswordAuthentication.class);
|
||||
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(PasswordAuthentication.class);
|
||||
|
||||
|
||||
/**
|
||||
|
@@ -23,8 +23,8 @@ import java.util.UUID;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.authenticate.factory.AuthenticateServiceFactory;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.content.MetadataField;
|
||||
@@ -70,7 +70,7 @@ public class ShibAuthentication implements AuthenticationMethod {
|
||||
/**
|
||||
* log4j category
|
||||
*/
|
||||
private static Logger log = Logger.getLogger(ShibAuthentication.class);
|
||||
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(ShibAuthentication.class);
|
||||
|
||||
/**
|
||||
* Additional metadata mappings
|
||||
|
@@ -29,8 +29,8 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import org.apache.commons.lang.ArrayUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.authenticate.factory.AuthenticateServiceFactory;
|
||||
import org.dspace.authenticate.service.AuthenticationService;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
@@ -105,7 +105,7 @@ public class X509Authentication implements AuthenticationMethod {
|
||||
/**
|
||||
* log4j category
|
||||
*/
|
||||
private static Logger log = Logger.getLogger(X509Authentication.class);
|
||||
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(X509Authentication.class);
|
||||
|
||||
/**
|
||||
* public key of CA to check client certs against.
|
||||
|
@@ -12,7 +12,7 @@ import java.net.MalformedURLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.solr.client.solrj.SolrQuery;
|
||||
import org.apache.solr.client.solrj.SolrServerException;
|
||||
import org.apache.solr.client.solrj.impl.HttpSolrServer;
|
||||
@@ -30,7 +30,7 @@ import org.dspace.core.ConfigurationManager;
|
||||
*/
|
||||
public class AuthoritySolrServiceImpl implements AuthorityIndexingService, AuthoritySearchService {
|
||||
|
||||
private static final Logger log = Logger.getLogger(AuthoritySolrServiceImpl.class);
|
||||
private static final Logger log = org.apache.logging.log4j.LogManager.getLogger(AuthoritySolrServiceImpl.class);
|
||||
|
||||
protected AuthoritySolrServiceImpl() {
|
||||
|
||||
|
@@ -12,7 +12,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
/**
|
||||
* This class contains a list of active authority types.
|
||||
@@ -32,7 +32,7 @@ public class AuthorityTypes {
|
||||
/**
|
||||
* log4j logger
|
||||
*/
|
||||
private static Logger log = Logger.getLogger(AuthorityTypes.class);
|
||||
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(AuthorityTypes.class);
|
||||
|
||||
protected List<AuthorityValue> types = new ArrayList<AuthorityValue>();
|
||||
|
||||
|
@@ -14,8 +14,8 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.solr.common.SolrDocument;
|
||||
import org.apache.solr.common.SolrInputDocument;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
@@ -234,7 +234,7 @@ public class AuthorityValue {
|
||||
/**
|
||||
* log4j logger
|
||||
*/
|
||||
private static Logger log = Logger.getLogger(AuthorityValue.class);
|
||||
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(AuthorityValue.class);
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
|
@@ -13,8 +13,8 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.solr.client.solrj.SolrQuery;
|
||||
import org.apache.solr.client.solrj.response.QueryResponse;
|
||||
import org.apache.solr.common.SolrDocument;
|
||||
@@ -34,7 +34,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
*/
|
||||
public class AuthorityValueServiceImpl implements AuthorityValueService {
|
||||
|
||||
private final Logger log = Logger.getLogger(AuthorityValueServiceImpl.class);
|
||||
private final Logger log = org.apache.logging.log4j.LogManager.getLogger(AuthorityValueServiceImpl.class);
|
||||
|
||||
@Autowired(required = true)
|
||||
protected AuthorityTypes authorityTypes;
|
||||
|
@@ -12,8 +12,8 @@ import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.lang.ObjectUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.solr.common.SolrDocument;
|
||||
import org.apache.solr.common.SolrInputDocument;
|
||||
|
||||
|
@@ -19,7 +19,7 @@ import org.apache.commons.cli.HelpFormatter;
|
||||
import org.apache.commons.cli.Options;
|
||||
import org.apache.commons.cli.ParseException;
|
||||
import org.apache.commons.cli.PosixParser;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.authority.factory.AuthorityServiceFactory;
|
||||
import org.dspace.authority.service.AuthorityValueService;
|
||||
import org.dspace.content.Item;
|
||||
@@ -40,7 +40,7 @@ public class UpdateAuthorities {
|
||||
/**
|
||||
* log4j logger
|
||||
*/
|
||||
private static Logger log = Logger.getLogger(UpdateAuthorities.class);
|
||||
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(UpdateAuthorities.class);
|
||||
|
||||
protected PrintWriter print = null;
|
||||
|
||||
|
@@ -12,7 +12,7 @@ import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.authority.factory.AuthorityServiceFactory;
|
||||
import org.dspace.authority.service.AuthorityService;
|
||||
import org.dspace.content.DSpaceObject;
|
||||
@@ -33,7 +33,7 @@ import org.dspace.event.Event;
|
||||
*/
|
||||
public class AuthorityConsumer implements Consumer {
|
||||
|
||||
private final Logger log = Logger.getLogger(AuthorityConsumer.class);
|
||||
private final Logger log = org.apache.logging.log4j.LogManager.getLogger(AuthorityConsumer.class);
|
||||
|
||||
/**
|
||||
* A set of all item IDs installed which need their authority updated
|
||||
|
@@ -12,7 +12,7 @@ import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.authority.AuthorityValue;
|
||||
import org.dspace.authority.factory.AuthorityServiceFactory;
|
||||
import org.dspace.authority.service.AuthorityService;
|
||||
@@ -29,7 +29,7 @@ import org.dspace.core.Context;
|
||||
*/
|
||||
public class AuthorityIndexClient {
|
||||
|
||||
private static Logger log = Logger.getLogger(AuthorityIndexClient.class);
|
||||
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(AuthorityIndexClient.class);
|
||||
|
||||
protected static final AuthorityService authorityService =
|
||||
AuthorityServiceFactory.getInstance().getAuthorityService();
|
||||
|
@@ -13,8 +13,8 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.authority.AuthorityValue;
|
||||
import org.dspace.authority.service.AuthorityValueService;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
@@ -45,7 +45,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
*/
|
||||
public class DSpaceAuthorityIndexer implements AuthorityIndexerInterface, InitializingBean {
|
||||
|
||||
private static final Logger log = Logger.getLogger(DSpaceAuthorityIndexer.class);
|
||||
private static final Logger log = org.apache.logging.log4j.LogManager.getLogger(DSpaceAuthorityIndexer.class);
|
||||
|
||||
/**
|
||||
* The list of metadata fields which are to be indexed *
|
||||
@@ -124,7 +124,7 @@ public class DSpaceAuthorityIndexer implements AuthorityIndexerInterface, Initia
|
||||
* This method looks at the authority of a metadata value.
|
||||
* If the authority can be found in solr, that value is reused.
|
||||
* Otherwise a new authority value will be generated that will be indexed in solr.
|
||||
*
|
||||
*
|
||||
* If the authority starts with AuthorityValueGenerator.GENERATE, a specific type of AuthorityValue will be
|
||||
* generated.
|
||||
* Depending on the type this may involve querying an external REST service
|
||||
|
@@ -15,12 +15,13 @@ import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.client.HttpClient;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.impl.client.HttpClientBuilder;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.authority.AuthorityValue;
|
||||
import org.dspace.authority.SolrAuthorityInterface;
|
||||
import org.dspace.authority.orcid.xml.XMLtoBio;
|
||||
@@ -35,7 +36,7 @@ import org.orcid.jaxb.model.record_v2.Person;
|
||||
*/
|
||||
public class Orcidv2 implements SolrAuthorityInterface {
|
||||
|
||||
private static Logger log = Logger.getLogger(Orcidv2.class);
|
||||
private static Logger log = LogManager.getLogger(Orcidv2.class);
|
||||
|
||||
public RESTConnector restConnector;
|
||||
private String OAUTHUrl;
|
||||
@@ -46,7 +47,9 @@ public class Orcidv2 implements SolrAuthorityInterface {
|
||||
private String accessToken;
|
||||
|
||||
/**
|
||||
* Initialize the accessToken that is required for all subsequent calls to ORCID
|
||||
* Initialize the accessToken that is required for all subsequent calls to ORCID.
|
||||
*
|
||||
* @throws java.io.IOException passed through from HTTPclient.
|
||||
*/
|
||||
public void init() throws IOException {
|
||||
if (StringUtils.isNotBlank(accessToken) && StringUtils.isNotBlank(clientSecret)) {
|
||||
|
@@ -15,7 +15,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.solr.common.SolrDocument;
|
||||
import org.apache.solr.common.SolrInputDocument;
|
||||
import org.dspace.authority.AuthorityValue;
|
||||
|
@@ -14,10 +14,9 @@ import javax.xml.bind.JAXBContext;
|
||||
import javax.xml.bind.JAXBException;
|
||||
import javax.xml.bind.Unmarshaller;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
|
||||
/**
|
||||
* @param <T> type
|
||||
* @author Antoine Snyers (antoine at atmire.com)
|
||||
@@ -30,7 +29,7 @@ public abstract class Converter<T> {
|
||||
/**
|
||||
* log4j logger
|
||||
*/
|
||||
private static Logger log = Logger.getLogger(Converter.class);
|
||||
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(Converter.class);
|
||||
|
||||
public abstract T convert(InputStream document);
|
||||
|
||||
|
@@ -12,7 +12,7 @@ import java.net.URISyntaxException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.authority.orcid.Orcidv2;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.orcid.jaxb.model.common_v2.OrcidId;
|
||||
@@ -21,8 +21,6 @@ import org.orcid.jaxb.model.search_v2.Result;
|
||||
import org.orcid.jaxb.model.search_v2.Search;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @author Antoine Snyers (antoine at atmire.com)
|
||||
* @author Kevin Van de Velde (kevin at atmire dot com)
|
||||
@@ -34,7 +32,7 @@ public class XMLtoBio extends Converter {
|
||||
/**
|
||||
* log4j logger
|
||||
*/
|
||||
private static Logger log = Logger.getLogger(XMLtoBio.class);
|
||||
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(XMLtoBio.class);
|
||||
|
||||
@Override
|
||||
public List<Person> convert(InputStream xml) {
|
||||
|
@@ -15,7 +15,7 @@ import org.apache.http.HttpResponse;
|
||||
import org.apache.http.client.HttpClient;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.impl.client.HttpClientBuilder;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
/**
|
||||
* @author Antoine Snyers (antoine at atmire.com)
|
||||
@@ -28,7 +28,7 @@ public class RESTConnector {
|
||||
/**
|
||||
* log4j logger
|
||||
*/
|
||||
private static Logger log = Logger.getLogger(RESTConnector.class);
|
||||
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(RESTConnector.class);
|
||||
|
||||
private String url;
|
||||
|
||||
|
@@ -7,8 +7,8 @@
|
||||
*/
|
||||
package org.dspace.authority.util;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
/**
|
||||
* @author Antoine Snyers (antoine at atmire.com)
|
||||
@@ -21,7 +21,7 @@ public class EnumUtils {
|
||||
/**
|
||||
* log4j logger
|
||||
*/
|
||||
private static Logger log = Logger.getLogger(EnumUtils.class);
|
||||
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(EnumUtils.class);
|
||||
|
||||
/**
|
||||
* Default constructor
|
||||
|
@@ -17,7 +17,7 @@ import javax.xml.parsers.ParserConfigurationException;
|
||||
import javax.xml.transform.TransformerException;
|
||||
import javax.xml.xpath.XPathExpressionException;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.xpath.XPathAPI;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
@@ -36,7 +36,7 @@ public class XMLUtils {
|
||||
/**
|
||||
* log4j logger
|
||||
*/
|
||||
private static Logger log = Logger.getLogger(XMLUtils.class);
|
||||
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(XMLUtils.class);
|
||||
|
||||
/**
|
||||
* Default constructor
|
||||
|
@@ -16,7 +16,7 @@ import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.dspace.authorize.service.AuthorizeService;
|
||||
import org.dspace.authorize.service.ResourcePolicyService;
|
||||
import org.dspace.content.Bitstream;
|
||||
|
@@ -23,7 +23,7 @@ import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
|
||||
import org.apache.commons.lang.ObjectUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.dspace.content.DSpaceObject;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.core.ReloadableEntity;
|
||||
|
@@ -15,8 +15,8 @@ import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang.ObjectUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.authorize.dao.ResourcePolicyDAO;
|
||||
import org.dspace.authorize.service.ResourcePolicyService;
|
||||
import org.dspace.content.DSpaceObject;
|
||||
@@ -38,7 +38,7 @@ public class ResourcePolicyServiceImpl implements ResourcePolicyService {
|
||||
/**
|
||||
* log4j logger
|
||||
*/
|
||||
private static Logger log = Logger.getLogger(ResourcePolicyServiceImpl.class);
|
||||
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(ResourcePolicyServiceImpl.class);
|
||||
|
||||
@Autowired(required = true)
|
||||
protected ContentServiceFactory contentServiceFactory;
|
||||
|
@@ -12,7 +12,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.content.Collection;
|
||||
import org.dspace.content.Community;
|
||||
import org.dspace.content.Item;
|
||||
@@ -34,7 +34,7 @@ public class BrowseEngine {
|
||||
/**
|
||||
* the logger for this class
|
||||
*/
|
||||
private static final Logger log = Logger.getLogger(BrowseEngine.class);
|
||||
private static final Logger log = org.apache.logging.log4j.LogManager.getLogger(BrowseEngine.class);
|
||||
|
||||
/**
|
||||
* the browse scope which is the basis for our browse
|
||||
|
@@ -11,7 +11,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.content.Collection;
|
||||
import org.dspace.content.Community;
|
||||
import org.dspace.content.DSpaceObject;
|
||||
@@ -36,7 +36,7 @@ public class ItemCountDAOSolr implements ItemCountDAO {
|
||||
/**
|
||||
* Log4j logger
|
||||
*/
|
||||
private static Logger log = Logger.getLogger(ItemCountDAOSolr.class);
|
||||
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(ItemCountDAOSolr.class);
|
||||
|
||||
/**
|
||||
* DSpace context
|
||||
|
@@ -9,7 +9,7 @@ package org.dspace.browse;
|
||||
|
||||
import java.sql.SQLException;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.content.Collection;
|
||||
import org.dspace.content.Community;
|
||||
import org.dspace.content.DSpaceObject;
|
||||
@@ -37,7 +37,7 @@ public class ItemCounter {
|
||||
/**
|
||||
* Log4j logger
|
||||
*/
|
||||
private static Logger log = Logger.getLogger(ItemCounter.class);
|
||||
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(ItemCounter.class);
|
||||
|
||||
/**
|
||||
* DAO to use to store and retrieve data
|
||||
|
@@ -12,7 +12,7 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import org.apache.commons.lang.ArrayUtils;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
|
||||
|
@@ -12,7 +12,7 @@ import java.util.Locale;
|
||||
import com.ibm.icu.text.CollationElementIterator;
|
||||
import com.ibm.icu.text.Collator;
|
||||
import com.ibm.icu.text.RuleBasedCollator;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.core.ConfigurationManager;
|
||||
import org.dspace.text.filter.TextFilter;
|
||||
|
||||
@@ -32,7 +32,7 @@ import org.dspace.text.filter.TextFilter;
|
||||
* @author Graham Triggs
|
||||
*/
|
||||
public class LocaleOrderingFilter implements TextFilter {
|
||||
private static Logger log = Logger.getLogger(LocaleOrderingFilter.class);
|
||||
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(LocaleOrderingFilter.class);
|
||||
|
||||
/**
|
||||
* Uses a Locale dependent Collator to generate a sort string
|
||||
|
@@ -16,7 +16,7 @@ import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.authorize.factory.AuthorizeServiceFactory;
|
||||
import org.dspace.authorize.service.AuthorizeService;
|
||||
import org.dspace.content.DSpaceObject;
|
||||
@@ -68,7 +68,7 @@ public class SolrBrowseDAO implements BrowseDAO {
|
||||
/**
|
||||
* Log4j log
|
||||
*/
|
||||
private static final Logger log = Logger.getLogger(SolrBrowseDAO.class);
|
||||
private static final Logger log = org.apache.logging.log4j.LogManager.getLogger(SolrBrowseDAO.class);
|
||||
|
||||
/**
|
||||
* The DSpace context
|
||||
|
@@ -13,7 +13,7 @@ import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.collections4.MapUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.checker.factory.CheckerServiceFactory;
|
||||
import org.dspace.checker.service.ChecksumHistoryService;
|
||||
import org.dspace.checker.service.ChecksumResultService;
|
||||
@@ -42,7 +42,7 @@ public final class CheckerCommand {
|
||||
/**
|
||||
* Usual Log4J logger.
|
||||
*/
|
||||
private static final Logger LOG = Logger.getLogger(CheckerCommand.class);
|
||||
private static final Logger LOG = org.apache.logging.log4j.LogManager.getLogger(CheckerCommand.class);
|
||||
|
||||
private Context context;
|
||||
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
package org.dspace.checker;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.checker.factory.CheckerServiceFactory;
|
||||
import org.dspace.checker.service.ChecksumHistoryService;
|
||||
import org.dspace.content.Bitstream;
|
||||
@@ -26,7 +26,7 @@ public class CheckerConsumer implements Consumer {
|
||||
/**
|
||||
* log4j logger
|
||||
*/
|
||||
private static Logger log = Logger.getLogger(CheckerConsumer.class);
|
||||
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(CheckerConsumer.class);
|
||||
|
||||
protected ChecksumHistoryService checksumHistoryService = CheckerServiceFactory.getInstance()
|
||||
.getChecksumHistoryService();
|
||||
|
@@ -21,7 +21,7 @@ import org.apache.commons.cli.HelpFormatter;
|
||||
import org.apache.commons.cli.Options;
|
||||
import org.apache.commons.cli.ParseException;
|
||||
import org.apache.commons.cli.PosixParser;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.checker.factory.CheckerServiceFactory;
|
||||
import org.dspace.checker.service.SimpleReporterService;
|
||||
import org.dspace.core.ConfigurationManager;
|
||||
@@ -43,7 +43,7 @@ public class DailyReportEmailer {
|
||||
/**
|
||||
* log4j logger.
|
||||
*/
|
||||
private static Logger log = Logger.getLogger(DailyReportEmailer.class);
|
||||
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(DailyReportEmailer.class);
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
|
@@ -12,7 +12,7 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.content.Bitstream;
|
||||
import org.dspace.content.DSpaceObject;
|
||||
import org.dspace.content.factory.ContentServiceFactory;
|
||||
@@ -35,7 +35,7 @@ public class HandleDispatcher implements BitstreamDispatcher {
|
||||
/**
|
||||
* Log 4j logger.
|
||||
*/
|
||||
private static final Logger LOG = Logger.getLogger(HandleDispatcher.class);
|
||||
private static final Logger LOG = org.apache.logging.log4j.LogManager.getLogger(HandleDispatcher.class);
|
||||
|
||||
protected Context context;
|
||||
|
||||
|
@@ -19,8 +19,8 @@ import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
import javax.persistence.Transient;
|
||||
|
||||
import org.apache.commons.lang.builder.EqualsBuilder;
|
||||
import org.apache.commons.lang.builder.HashCodeBuilder;
|
||||
import org.apache.commons.lang3.builder.EqualsBuilder;
|
||||
import org.apache.commons.lang3.builder.HashCodeBuilder;
|
||||
import org.dspace.content.Bitstream;
|
||||
|
||||
/**
|
||||
|
@@ -11,7 +11,7 @@ import java.sql.SQLException;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.checker.dao.MostRecentChecksumDAO;
|
||||
import org.dspace.checker.service.ChecksumResultService;
|
||||
import org.dspace.checker.service.MostRecentChecksumService;
|
||||
@@ -28,7 +28,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
* @author kevinvandevelde at atmire.com
|
||||
*/
|
||||
public class MostRecentChecksumServiceImpl implements MostRecentChecksumService {
|
||||
private static final Logger log = Logger.getLogger(MostRecentChecksumServiceImpl.class);
|
||||
private static final Logger log =
|
||||
org.apache.logging.log4j.LogManager.getLogger(MostRecentChecksumServiceImpl.class);
|
||||
|
||||
@Autowired(required = true)
|
||||
protected MostRecentChecksumDAO mostRecentChecksumDAO;
|
||||
|
@@ -12,7 +12,7 @@ import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.content.Bitstream;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.core.I18nUtil;
|
||||
@@ -30,7 +30,7 @@ public class ResultsLogger implements ChecksumResultsCollector {
|
||||
/**
|
||||
* Usual Log4J logger.
|
||||
*/
|
||||
private static final Logger LOG = Logger.getLogger(ResultsLogger.class);
|
||||
private static final Logger LOG = org.apache.logging.log4j.LogManager.getLogger(ResultsLogger.class);
|
||||
|
||||
/**
|
||||
* Utility date format.
|
||||
|
@@ -19,7 +19,7 @@ import java.util.Properties;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.checker.factory.CheckerServiceFactory;
|
||||
import org.dspace.checker.service.ChecksumHistoryService;
|
||||
import org.dspace.core.ConfigurationManager;
|
||||
@@ -40,7 +40,7 @@ public final class ResultsPruner {
|
||||
/**
|
||||
* Default logger.
|
||||
*/
|
||||
private static final Logger LOG = Logger.getLogger(ResultsPruner.class);
|
||||
private static final Logger LOG = org.apache.logging.log4j.LogManager.getLogger(ResultsPruner.class);
|
||||
|
||||
/**
|
||||
* Factory method for the default results pruner configuration using
|
||||
|
@@ -12,7 +12,7 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.authorize.service.AuthorizeService;
|
||||
import org.dspace.content.dao.BitstreamFormatDAO;
|
||||
@@ -33,7 +33,7 @@ public class BitstreamFormatServiceImpl implements BitstreamFormatService {
|
||||
/**
|
||||
* log4j logger
|
||||
*/
|
||||
private static Logger log = Logger.getLogger(BitstreamFormat.class);
|
||||
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(BitstreamFormat.class);
|
||||
|
||||
@Autowired(required = true)
|
||||
protected BitstreamFormatDAO bitstreamFormatDAO;
|
||||
|
@@ -15,8 +15,8 @@ import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.authorize.service.AuthorizeService;
|
||||
import org.dspace.content.dao.BitstreamDAO;
|
||||
@@ -43,7 +43,7 @@ public class BitstreamServiceImpl extends DSpaceObjectServiceImpl<Bitstream> imp
|
||||
/**
|
||||
* log4j logger
|
||||
*/
|
||||
private static Logger log = Logger.getLogger(BitstreamServiceImpl.class);
|
||||
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(BitstreamServiceImpl.class);
|
||||
|
||||
|
||||
@Autowired(required = true)
|
||||
@@ -103,6 +103,8 @@ public class BitstreamServiceImpl extends DSpaceObjectServiceImpl<Bitstream> imp
|
||||
clonedBitstream.setSizeBytes(bitstream.getSizeBytes());
|
||||
clonedBitstream.setChecksum(bitstream.getChecksum());
|
||||
clonedBitstream.setChecksumAlgorithm(bitstream.getChecksumAlgorithm());
|
||||
clonedBitstream.setFormat(bitstream.getBitstreamFormat());
|
||||
|
||||
try {
|
||||
//Update our bitstream but turn off the authorization system since permissions
|
||||
//haven't been set at this point in time.
|
||||
|
@@ -16,8 +16,8 @@ import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.authorize.AuthorizeConfiguration;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.authorize.ResourcePolicy;
|
||||
@@ -45,7 +45,7 @@ public class BundleServiceImpl extends DSpaceObjectServiceImpl<Bundle> implement
|
||||
/**
|
||||
* log4j logger
|
||||
*/
|
||||
private static Logger log = Logger.getLogger(Bundle.class);
|
||||
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(Bundle.class);
|
||||
|
||||
@Autowired(required = true)
|
||||
protected BundleDAO bundleDAO;
|
||||
|
@@ -20,8 +20,8 @@ import java.util.MissingResourceException;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.app.util.AuthorizeUtil;
|
||||
import org.dspace.authorize.AuthorizeConfiguration;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
@@ -61,7 +61,7 @@ public class CollectionServiceImpl extends DSpaceObjectServiceImpl<Collection> i
|
||||
/**
|
||||
* log4j category
|
||||
*/
|
||||
private static final Logger log = Logger.getLogger(CollectionServiceImpl.class);
|
||||
private static final Logger log = org.apache.logging.log4j.LogManager.getLogger(CollectionServiceImpl.class);
|
||||
|
||||
@Autowired(required = true)
|
||||
protected CollectionDAO collectionDAO;
|
||||
|
@@ -23,8 +23,8 @@ import javax.persistence.OneToOne;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Transient;
|
||||
|
||||
import org.apache.commons.lang.builder.HashCodeBuilder;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.commons.lang3.builder.HashCodeBuilder;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.content.comparator.NameAscendingComparator;
|
||||
import org.dspace.content.factory.ContentServiceFactory;
|
||||
import org.dspace.content.service.CommunityService;
|
||||
@@ -52,7 +52,7 @@ public class Community extends DSpaceObject implements DSpaceObjectLegacySupport
|
||||
/**
|
||||
* log4j category
|
||||
*/
|
||||
private static final Logger log = Logger.getLogger(Community.class);
|
||||
private static final Logger log = org.apache.logging.log4j.LogManager.getLogger(Community.class);
|
||||
|
||||
@Column(name = "community_id", insertable = false, updatable = false)
|
||||
private Integer legacyId;
|
||||
|
@@ -17,8 +17,8 @@ import java.util.MissingResourceException;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.app.util.AuthorizeUtil;
|
||||
import org.dspace.authorize.AuthorizeConfiguration;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
@@ -51,7 +51,7 @@ public class CommunityServiceImpl extends DSpaceObjectServiceImpl<Community> imp
|
||||
/**
|
||||
* log4j category
|
||||
*/
|
||||
private static Logger log = Logger.getLogger(CommunityServiceImpl.class);
|
||||
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(CommunityServiceImpl.class);
|
||||
|
||||
@Autowired(required = true)
|
||||
protected CommunityDAO communityDAO;
|
||||
|
@@ -18,7 +18,7 @@ import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
// FIXME: Not very robust - assumes dates will always be valid
|
||||
|
||||
@@ -45,7 +45,7 @@ public class DCDate {
|
||||
/**
|
||||
* Logger
|
||||
*/
|
||||
private static Logger log = Logger.getLogger(DCDate.class);
|
||||
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(DCDate.class);
|
||||
|
||||
// UTC timezone
|
||||
private static final TimeZone utcZone = TimeZone.getTimeZone("UTC");
|
||||
|
@@ -17,9 +17,9 @@ import java.util.Map;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang.ArrayUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.content.authority.Choices;
|
||||
import org.dspace.content.authority.service.ChoiceAuthorityService;
|
||||
@@ -48,7 +48,7 @@ public abstract class DSpaceObjectServiceImpl<T extends DSpaceObject> implements
|
||||
/**
|
||||
* log4j category
|
||||
*/
|
||||
private static final Logger log = Logger.getLogger(DSpaceObjectServiceImpl.class);
|
||||
private static final Logger log = org.apache.logging.log4j.LogManager.getLogger(DSpaceObjectServiceImpl.class);
|
||||
|
||||
@Autowired(required = true)
|
||||
protected ChoiceAuthorityService choiceAuthorityService;
|
||||
|
@@ -15,7 +15,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.lang.builder.HashCodeBuilder;
|
||||
import org.apache.commons.lang3.builder.HashCodeBuilder;
|
||||
import org.dspace.content.factory.ContentServiceFactory;
|
||||
import org.dspace.content.service.ItemService;
|
||||
import org.dspace.sort.OrderFormat;
|
||||
|
@@ -17,8 +17,8 @@ import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.app.util.AuthorizeUtil;
|
||||
import org.dspace.authorize.AuthorizeConfiguration;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
@@ -63,7 +63,7 @@ public class ItemServiceImpl extends DSpaceObjectServiceImpl<Item> implements It
|
||||
/**
|
||||
* log4j category
|
||||
*/
|
||||
private static final Logger log = Logger.getLogger(Item.class);
|
||||
private static final Logger log = org.apache.logging.log4j.LogManager.getLogger(Item.class);
|
||||
|
||||
@Autowired(required = true)
|
||||
protected ItemDAO itemDAO;
|
||||
|
@@ -12,7 +12,7 @@ import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.authorize.service.AuthorizeService;
|
||||
import org.dspace.content.dao.MetadataFieldDAO;
|
||||
@@ -33,7 +33,7 @@ public class MetadataFieldServiceImpl implements MetadataFieldService {
|
||||
/**
|
||||
* log4j logger
|
||||
*/
|
||||
private static Logger log = Logger.getLogger(MetadataFieldServiceImpl.class);
|
||||
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(MetadataFieldServiceImpl.class);
|
||||
|
||||
@Autowired(required = true)
|
||||
protected MetadataFieldDAO metadataFieldDAO;
|
||||
|
@@ -10,7 +10,7 @@ package org.dspace.content;
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.authorize.service.AuthorizeService;
|
||||
import org.dspace.content.dao.MetadataSchemaDAO;
|
||||
@@ -31,7 +31,7 @@ public class MetadataSchemaServiceImpl implements MetadataSchemaService {
|
||||
/**
|
||||
* log4j logger
|
||||
*/
|
||||
private static Logger log = Logger.getLogger(MetadataSchemaServiceImpl.class);
|
||||
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(MetadataSchemaServiceImpl.class);
|
||||
|
||||
@Autowired(required = true)
|
||||
protected AuthorizeService authorizeService;
|
||||
|
@@ -12,7 +12,7 @@ import java.sql.SQLException;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.authorize.service.AuthorizeService;
|
||||
import org.dspace.content.dao.MetadataValueDAO;
|
||||
@@ -33,7 +33,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
*/
|
||||
public class MetadataValueServiceImpl implements MetadataValueService {
|
||||
|
||||
private static final Logger log = Logger.getLogger(MetadataValueServiceImpl.class);
|
||||
private static final Logger log = org.apache.logging.log4j.LogManager.getLogger(MetadataValueServiceImpl.class);
|
||||
|
||||
@Autowired(required = true)
|
||||
protected AuthorizeService authorizeService;
|
||||
|
@@ -25,7 +25,7 @@ import javax.persistence.OneToOne;
|
||||
import javax.persistence.SequenceGenerator;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import org.apache.commons.lang.builder.HashCodeBuilder;
|
||||
import org.apache.commons.lang3.builder.HashCodeBuilder;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.core.ReloadableEntity;
|
||||
import org.dspace.eperson.EPerson;
|
||||
|
@@ -13,7 +13,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.app.util.DCInputsReaderException;
|
||||
import org.dspace.app.util.Util;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
@@ -40,7 +40,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
*/
|
||||
public class WorkspaceItemServiceImpl implements WorkspaceItemService {
|
||||
|
||||
private static final Logger log = Logger.getLogger(WorkspaceItemServiceImpl.class);
|
||||
private static final Logger log = org.apache.logging.log4j.LogManager.getLogger(WorkspaceItemServiceImpl.class);
|
||||
|
||||
@Autowired(required = true)
|
||||
protected WorkspaceItemDAO workspaceItemDAO;
|
||||
@@ -147,6 +147,12 @@ public class WorkspaceItemServiceImpl implements WorkspaceItemService {
|
||||
return workspaceItemDAO.findByEPerson(context, ep);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WorkspaceItem> findByEPerson(Context context, EPerson ep, Integer limit, Integer offset)
|
||||
throws SQLException {
|
||||
return workspaceItemDAO.findByEPerson(context, ep, limit, offset);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WorkspaceItem> findByCollection(Context context, Collection collection) throws SQLException {
|
||||
return workspaceItemDAO.findByCollection(context, collection);
|
||||
@@ -231,6 +237,11 @@ public class WorkspaceItemServiceImpl implements WorkspaceItemService {
|
||||
return workspaceItemDAO.countRows(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int countByEPerson(Context context, EPerson ep) throws SQLException {
|
||||
return workspaceItemDAO.countRows(context, ep);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map.Entry<Integer, Long>> getStageReachedCounts(Context context) throws SQLException {
|
||||
return workspaceItemDAO.getStageReachedCounts(context);
|
||||
|
@@ -14,7 +14,7 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.app.util.DCInput;
|
||||
import org.dspace.app.util.DCInputSet;
|
||||
import org.dspace.app.util.DCInputsReader;
|
||||
@@ -49,7 +49,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
* @see ChoiceAuthority
|
||||
*/
|
||||
public final class ChoiceAuthorityServiceImpl implements ChoiceAuthorityService {
|
||||
private Logger log = Logger.getLogger(ChoiceAuthorityServiceImpl.class);
|
||||
private Logger log = org.apache.logging.log4j.LogManager.getLogger(ChoiceAuthorityServiceImpl.class);
|
||||
|
||||
// map of field key to authority plugin
|
||||
protected Map<String, ChoiceAuthority> controller = new HashMap<String, ChoiceAuthority>();
|
||||
@@ -264,39 +264,42 @@ public final class ChoiceAuthorityServiceImpl implements ChoiceAuthorityService
|
||||
try {
|
||||
DCInputsReader dcInputsReader = new DCInputsReader();
|
||||
for (DCInputSet dcinputSet : dcInputsReader.getAllInputs(Integer.MAX_VALUE, 0)) {
|
||||
DCInput[] dcinputs = dcinputSet.getFields();
|
||||
for (DCInput dcinput : dcinputs) {
|
||||
if (StringUtils.isNotBlank(dcinput.getPairsType())
|
||||
|| StringUtils.isNotBlank(dcinput.getVocabulary())) {
|
||||
String authorityName = dcinput.getPairsType();
|
||||
if (StringUtils.isBlank(authorityName)) {
|
||||
authorityName = dcinput.getVocabulary();
|
||||
}
|
||||
if (!StringUtils.equals(dcinput.getInputType(), "qualdrop_value")) {
|
||||
String fieldKey = makeFieldKey(dcinput.getSchema(), dcinput.getElement(),
|
||||
dcinput.getQualifier());
|
||||
ChoiceAuthority ca = controller.get(authorityName);
|
||||
if (ca == null) {
|
||||
InputFormSelfRegisterWrapperAuthority ifa = new InputFormSelfRegisterWrapperAuthority();
|
||||
if (controller.containsKey(fieldKey)) {
|
||||
ifa = (InputFormSelfRegisterWrapperAuthority) controller.get(fieldKey);
|
||||
DCInput[][] dcinputs = dcinputSet.getFields();
|
||||
for (DCInput[] dcrows : dcinputs) {
|
||||
for (DCInput dcinput : dcrows) {
|
||||
if (StringUtils.isNotBlank(dcinput.getPairsType())
|
||||
|| StringUtils.isNotBlank(dcinput.getVocabulary())) {
|
||||
String authorityName = dcinput.getPairsType();
|
||||
if (StringUtils.isBlank(authorityName)) {
|
||||
authorityName = dcinput.getVocabulary();
|
||||
}
|
||||
if (!StringUtils.equals(dcinput.getInputType(), "qualdrop_value")) {
|
||||
String fieldKey = makeFieldKey(dcinput.getSchema(), dcinput.getElement(),
|
||||
dcinput.getQualifier());
|
||||
ChoiceAuthority ca = controller.get(authorityName);
|
||||
if (ca == null) {
|
||||
InputFormSelfRegisterWrapperAuthority ifa = new
|
||||
InputFormSelfRegisterWrapperAuthority();
|
||||
if (controller.containsKey(fieldKey)) {
|
||||
ifa = (InputFormSelfRegisterWrapperAuthority) controller.get(fieldKey);
|
||||
}
|
||||
|
||||
ChoiceAuthority ma = (ChoiceAuthority) pluginService
|
||||
.getNamedPlugin(ChoiceAuthority.class, authorityName);
|
||||
if (ma == null) {
|
||||
log.warn("Skipping invalid configuration for " + fieldKey
|
||||
+ " because named plugin not found: " + authorityName);
|
||||
continue;
|
||||
}
|
||||
ifa.getDelegates().put(dcinputSet.getFormName(), ma);
|
||||
controller.put(fieldKey, ifa);
|
||||
}
|
||||
|
||||
ChoiceAuthority ma = (ChoiceAuthority) pluginService
|
||||
.getNamedPlugin(ChoiceAuthority.class, authorityName);
|
||||
if (ma == null) {
|
||||
log.warn("Skipping invalid configuration for " + fieldKey
|
||||
+ " because named plugin not found: " + authorityName);
|
||||
continue;
|
||||
if (!authorities.containsKey(authorityName)) {
|
||||
authorities.put(authorityName, fieldKey);
|
||||
}
|
||||
ifa.getDelegates().put(dcinputSet.getFormName(), ma);
|
||||
controller.put(fieldKey, ifa);
|
||||
}
|
||||
|
||||
if (!authorities.containsKey(authorityName)) {
|
||||
authorities.put(authorityName, fieldKey);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
package org.dspace.content.authority;
|
||||
|
||||
import org.apache.commons.lang.ArrayUtils;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
/**
|
||||
* Record class to hold a set of Choices returned by an authority in response
|
||||
|
@@ -12,8 +12,8 @@ import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang.ArrayUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.app.util.DCInputsReader;
|
||||
import org.dspace.app.util.DCInputsReaderException;
|
||||
import org.dspace.content.Collection;
|
||||
@@ -42,7 +42,7 @@ import org.dspace.core.SelfNamedPlugin;
|
||||
* fields.
|
||||
*/
|
||||
public class DCInputAuthority extends SelfNamedPlugin implements ChoiceAuthority {
|
||||
private static Logger log = Logger.getLogger(DCInputAuthority.class);
|
||||
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(DCInputAuthority.class);
|
||||
|
||||
private String values[] = null;
|
||||
private String labels[] = null;
|
||||
|
@@ -16,9 +16,9 @@ import javax.xml.xpath.XPathConstants;
|
||||
import javax.xml.xpath.XPathExpressionException;
|
||||
import javax.xml.xpath.XPathFactory;
|
||||
|
||||
import org.apache.commons.lang.ArrayUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.content.Collection;
|
||||
import org.dspace.core.SelfNamedPlugin;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
@@ -56,7 +56,7 @@ import org.xml.sax.InputSource;
|
||||
|
||||
public class DSpaceControlledVocabulary extends SelfNamedPlugin implements ChoiceAuthority {
|
||||
|
||||
private static Logger log = Logger.getLogger(DSpaceControlledVocabulary.class);
|
||||
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(DSpaceControlledVocabulary.class);
|
||||
protected static String xpathTemplate = "//node[contains(translate(@label,'ABCDEFGHIJKLMNOPQRSTUVWXYZ'," +
|
||||
"'abcdefghijklmnopqrstuvwxyz'),'%s')]";
|
||||
protected static String idTemplate = "//node[@id = '%s']";
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user