mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-15 22:13:08 +00:00
[DS-3782] Upgrade Commons Collections to version 4
This commit is contained in:

committed by
Tom Desair

parent
eb2b4184ef
commit
8ffbec58ca
@@ -363,8 +363,8 @@
|
|||||||
<artifactId>commons-codec</artifactId>
|
<artifactId>commons-codec</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-collections</groupId>
|
<groupId>org.apache.commons</groupId>
|
||||||
<artifactId>commons-collections</artifactId>
|
<artifactId>commons-collections4</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.commons</groupId>
|
<groupId>org.apache.commons</groupId>
|
||||||
|
@@ -17,7 +17,7 @@ import org.apache.commons.cli.CommandLineParser;
|
|||||||
import org.apache.commons.cli.HelpFormatter;
|
import org.apache.commons.cli.HelpFormatter;
|
||||||
import org.apache.commons.cli.Options;
|
import org.apache.commons.cli.Options;
|
||||||
import org.apache.commons.cli.PosixParser;
|
import org.apache.commons.cli.PosixParser;
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.dspace.authorize.AuthorizeException;
|
import org.dspace.authorize.AuthorizeException;
|
||||||
import org.dspace.content.Community;
|
import org.dspace.content.Community;
|
||||||
import org.dspace.content.factory.ContentServiceFactory;
|
import org.dspace.content.factory.ContentServiceFactory;
|
||||||
|
@@ -52,7 +52,7 @@ import gr.ekt.bte.core.TransformationSpec;
|
|||||||
import gr.ekt.bte.dataloader.FileDataLoader;
|
import gr.ekt.bte.dataloader.FileDataLoader;
|
||||||
import gr.ekt.bteio.generators.DSpaceOutputGenerator;
|
import gr.ekt.bteio.generators.DSpaceOutputGenerator;
|
||||||
import gr.ekt.bteio.loaders.OAIPMHDataLoader;
|
import gr.ekt.bteio.loaders.OAIPMHDataLoader;
|
||||||
import org.apache.commons.collections.ComparatorUtils;
|
import org.apache.commons.collections4.ComparatorUtils;
|
||||||
import org.apache.commons.io.FileDeleteStrategy;
|
import org.apache.commons.io.FileDeleteStrategy;
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
import org.apache.commons.lang.RandomStringUtils;
|
import org.apache.commons.lang.RandomStringUtils;
|
||||||
|
@@ -22,7 +22,7 @@ import java.util.Set;
|
|||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
import org.apache.commons.collections.ListUtils;
|
import org.apache.commons.collections4.ListUtils;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.dspace.content.Collection;
|
import org.dspace.content.Collection;
|
||||||
|
@@ -9,6 +9,7 @@ package org.dspace.authenticate;
|
|||||||
|
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -16,7 +17,6 @@ import java.util.UUID;
|
|||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.apache.commons.collections.ListUtils;
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.dspace.core.ConfigurationManager;
|
import org.dspace.core.ConfigurationManager;
|
||||||
import org.dspace.core.Context;
|
import org.dspace.core.Context;
|
||||||
@@ -164,7 +164,7 @@ public class IPAuthentication implements AuthenticationMethod {
|
|||||||
public List<Group> getSpecialGroups(Context context, HttpServletRequest request)
|
public List<Group> getSpecialGroups(Context context, HttpServletRequest request)
|
||||||
throws SQLException {
|
throws SQLException {
|
||||||
if (request == null) {
|
if (request == null) {
|
||||||
return ListUtils.EMPTY_LIST;
|
return Collections.EMPTY_LIST;
|
||||||
}
|
}
|
||||||
List<Group> groups = new ArrayList<Group>();
|
List<Group> groups = new ArrayList<Group>();
|
||||||
|
|
||||||
|
@@ -10,6 +10,7 @@ package org.dspace.authenticate;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.Hashtable;
|
import java.util.Hashtable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.naming.NamingEnumeration;
|
import javax.naming.NamingEnumeration;
|
||||||
@@ -27,7 +28,6 @@ import javax.naming.ldap.StartTlsResponse;
|
|||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.apache.commons.collections.ListUtils;
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.dspace.authenticate.factory.AuthenticateServiceFactory;
|
import org.dspace.authenticate.factory.AuthenticateServiceFactory;
|
||||||
@@ -136,7 +136,7 @@ public class LDAPAuthentication
|
|||||||
log.warn(LogManager.getHeader(context,
|
log.warn(LogManager.getHeader(context,
|
||||||
"ldap_specialgroup",
|
"ldap_specialgroup",
|
||||||
"Group defined in login.specialgroup does not exist"));
|
"Group defined in login.specialgroup does not exist"));
|
||||||
return ListUtils.EMPTY_LIST;
|
return Collections.EMPTY_LIST;
|
||||||
} else {
|
} else {
|
||||||
return Arrays.asList(ldapGroup);
|
return Arrays.asList(ldapGroup);
|
||||||
}
|
}
|
||||||
@@ -145,7 +145,7 @@ public class LDAPAuthentication
|
|||||||
} catch (Exception npe) {
|
} catch (Exception npe) {
|
||||||
// The user is not an LDAP user, so we don't need to worry about them
|
// The user is not an LDAP user, so we don't need to worry about them
|
||||||
}
|
}
|
||||||
return ListUtils.EMPTY_LIST;
|
return Collections.EMPTY_LIST;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -9,11 +9,11 @@ package org.dspace.authenticate;
|
|||||||
|
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.apache.commons.collections.ListUtils;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.dspace.core.Context;
|
import org.dspace.core.Context;
|
||||||
@@ -151,7 +151,7 @@ public class PasswordAuthentication
|
|||||||
"password_specialgroup",
|
"password_specialgroup",
|
||||||
"Group defined in modules/authentication-password.cfg login" +
|
"Group defined in modules/authentication-password.cfg login" +
|
||||||
".specialgroup does not exist"));
|
".specialgroup does not exist"));
|
||||||
return ListUtils.EMPTY_LIST;
|
return Collections.EMPTY_LIST;
|
||||||
} else {
|
} else {
|
||||||
return Arrays.asList(specialGroup);
|
return Arrays.asList(specialGroup);
|
||||||
}
|
}
|
||||||
@@ -160,7 +160,7 @@ public class PasswordAuthentication
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error(LogManager.getHeader(context, "getSpecialGroups", ""), e);
|
log.error(LogManager.getHeader(context, "getSpecialGroups", ""), e);
|
||||||
}
|
}
|
||||||
return ListUtils.EMPTY_LIST;
|
return Collections.EMPTY_LIST;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -12,6 +12,7 @@ import java.net.URLEncoder;
|
|||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.Enumeration;
|
import java.util.Enumeration;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
@@ -22,7 +23,6 @@ import java.util.UUID;
|
|||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.apache.commons.collections.ListUtils;
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.dspace.authenticate.factory.AuthenticateServiceFactory;
|
import org.dspace.authenticate.factory.AuthenticateServiceFactory;
|
||||||
@@ -288,7 +288,7 @@ public class ShibAuthentication implements AuthenticationMethod {
|
|||||||
if (request == null ||
|
if (request == null ||
|
||||||
context.getCurrentUser() == null ||
|
context.getCurrentUser() == null ||
|
||||||
request.getSession().getAttribute("shib.authenticated") == null) {
|
request.getSession().getAttribute("shib.authenticated") == null) {
|
||||||
return ListUtils.EMPTY_LIST;
|
return Collections.EMPTY_LIST;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we have already calculated the special groups then return them.
|
// If we have already calculated the special groups then return them.
|
||||||
@@ -404,7 +404,7 @@ public class ShibAuthentication implements AuthenticationMethod {
|
|||||||
return new ArrayList<>(groups);
|
return new ArrayList<>(groups);
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
log.error("Unable to validate any sepcial groups this user may belong too because of an exception.", t);
|
log.error("Unable to validate any sepcial groups this user may belong too because of an exception.", t);
|
||||||
return ListUtils.EMPTY_LIST;
|
return Collections.EMPTY_LIST;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -21,6 +21,7 @@ import java.security.cert.CertificateFactory;
|
|||||||
import java.security.cert.X509Certificate;
|
import java.security.cert.X509Certificate;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.Enumeration;
|
import java.util.Enumeration;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.StringTokenizer;
|
import java.util.StringTokenizer;
|
||||||
@@ -28,7 +29,6 @@ import javax.servlet.http.HttpServletRequest;
|
|||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import javax.servlet.http.HttpSession;
|
import javax.servlet.http.HttpSession;
|
||||||
|
|
||||||
import org.apache.commons.collections.ListUtils;
|
|
||||||
import org.apache.commons.lang.ArrayUtils;
|
import org.apache.commons.lang.ArrayUtils;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.dspace.authenticate.factory.AuthenticateServiceFactory;
|
import org.dspace.authenticate.factory.AuthenticateServiceFactory;
|
||||||
@@ -442,7 +442,7 @@ public class X509Authentication implements AuthenticationMethod {
|
|||||||
public List<Group> getSpecialGroups(Context context, HttpServletRequest request)
|
public List<Group> getSpecialGroups(Context context, HttpServletRequest request)
|
||||||
throws SQLException {
|
throws SQLException {
|
||||||
if (request == null) {
|
if (request == null) {
|
||||||
return ListUtils.EMPTY_LIST;
|
return Collections.EMPTY_LIST;
|
||||||
}
|
}
|
||||||
|
|
||||||
Boolean authenticated = false;
|
Boolean authenticated = false;
|
||||||
@@ -472,7 +472,7 @@ public class X509Authentication implements AuthenticationMethod {
|
|||||||
return groups;
|
return groups;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ListUtils.EMPTY_LIST;
|
return Collections.EMPTY_LIST;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -14,7 +14,7 @@ import java.util.Iterator;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.dspace.authority.AuthorityValue;
|
import org.dspace.authority.AuthorityValue;
|
||||||
|
@@ -15,7 +15,7 @@ import java.util.LinkedList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.dspace.authorize.service.AuthorizeService;
|
import org.dspace.authorize.service.AuthorizeService;
|
||||||
import org.dspace.authorize.service.ResourcePolicyService;
|
import org.dspace.authorize.service.ResourcePolicyService;
|
||||||
|
@@ -14,7 +14,7 @@ import java.util.HashSet;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang.ObjectUtils;
|
import org.apache.commons.lang.ObjectUtils;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.dspace.authorize.dao.ResourcePolicyDAO;
|
import org.dspace.authorize.dao.ResourcePolicyDAO;
|
||||||
|
@@ -12,7 +12,7 @@ import java.sql.SQLException;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.apache.commons.collections.MapUtils;
|
import org.apache.commons.collections4.MapUtils;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.dspace.checker.factory.CheckerServiceFactory;
|
import org.dspace.checker.factory.CheckerServiceFactory;
|
||||||
import org.dspace.checker.service.ChecksumHistoryService;
|
import org.dspace.checker.service.ChecksumHistoryService;
|
||||||
|
@@ -11,7 +11,7 @@ import java.sql.SQLException;
|
|||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.dspace.authorize.AuthorizeException;
|
import org.dspace.authorize.AuthorizeException;
|
||||||
import org.dspace.authorize.service.AuthorizeService;
|
import org.dspace.authorize.service.AuthorizeService;
|
||||||
|
@@ -14,7 +14,7 @@ import java.util.Iterator;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.dspace.authorize.AuthorizeException;
|
import org.dspace.authorize.AuthorizeException;
|
||||||
|
@@ -15,7 +15,7 @@ import java.util.LinkedList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.dspace.authorize.AuthorizeConfiguration;
|
import org.dspace.authorize.AuthorizeConfiguration;
|
||||||
|
@@ -19,7 +19,7 @@ import java.util.Map;
|
|||||||
import java.util.MissingResourceException;
|
import java.util.MissingResourceException;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.dspace.app.util.AuthorizeUtil;
|
import org.dspace.app.util.AuthorizeUtil;
|
||||||
|
@@ -16,7 +16,7 @@ import java.util.List;
|
|||||||
import java.util.MissingResourceException;
|
import java.util.MissingResourceException;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.dspace.app.util.AuthorizeUtil;
|
import org.dspace.app.util.AuthorizeUtil;
|
||||||
|
@@ -24,7 +24,7 @@ import javax.persistence.OrderBy;
|
|||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
import javax.persistence.Transient;
|
import javax.persistence.Transient;
|
||||||
|
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.dspace.authorize.ResourcePolicy;
|
import org.dspace.authorize.ResourcePolicy;
|
||||||
import org.dspace.core.ReloadableEntity;
|
import org.dspace.core.ReloadableEntity;
|
||||||
import org.dspace.handle.Handle;
|
import org.dspace.handle.Handle;
|
||||||
|
@@ -16,7 +16,7 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.StringTokenizer;
|
import java.util.StringTokenizer;
|
||||||
|
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang.ArrayUtils;
|
import org.apache.commons.lang.ArrayUtils;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
@@ -680,7 +680,6 @@ public abstract class DSpaceObjectServiceImpl<T extends DSpaceObject> implements
|
|||||||
moved.getAuthority(), moved.getConfidence());
|
moved.getAuthority(), moved.getConfidence());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void replaceMetadata(Context context, T dso, String schema, String element, String qualifier, String lang,
|
public void replaceMetadata(Context context, T dso, String schema, String element, String qualifier, String lang,
|
||||||
String value, String authority, int confidence, int index) throws SQLException {
|
String value, String authority, int confidence, int index) throws SQLException {
|
||||||
|
@@ -16,7 +16,7 @@ import java.util.Iterator;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.dspace.app.util.AuthorizeUtil;
|
import org.dspace.app.util.AuthorizeUtil;
|
||||||
|
@@ -11,7 +11,7 @@ import java.io.IOException;
|
|||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.dspace.authorize.AuthorizeException;
|
import org.dspace.authorize.AuthorizeException;
|
||||||
import org.dspace.authorize.service.AuthorizeService;
|
import org.dspace.authorize.service.AuthorizeService;
|
||||||
@@ -59,7 +59,7 @@ public class MetadataFieldServiceImpl implements MetadataFieldService {
|
|||||||
// Ensure the element and qualifier are unique within a given schema.
|
// Ensure the element and qualifier are unique within a given schema.
|
||||||
if (hasElement(context, -1, metadataSchema, element, qualifier)) {
|
if (hasElement(context, -1, metadataSchema, element, qualifier)) {
|
||||||
throw new NonUniqueMetadataException("Please make " + element + "."
|
throw new NonUniqueMetadataException("Please make " + element + "."
|
||||||
+ qualifier + " unique within schema #" + metadataSchema.getID());
|
+ qualifier + " unique within schema #" + metadataSchema.getID());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create a table row and update it with the values
|
// Create a table row and update it with the values
|
||||||
@@ -72,7 +72,7 @@ public class MetadataFieldServiceImpl implements MetadataFieldService {
|
|||||||
metadataFieldDAO.save(context, metadataField);
|
metadataFieldDAO.save(context, metadataField);
|
||||||
|
|
||||||
log.info(LogManager.getHeader(context, "create_metadata_field",
|
log.info(LogManager.getHeader(context, "create_metadata_field",
|
||||||
"metadata_field_id=" + metadataField.getID()));
|
"metadata_field_id=" + metadataField.getID()));
|
||||||
return metadataField;
|
return metadataField;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,7 +121,7 @@ public class MetadataFieldServiceImpl implements MetadataFieldService {
|
|||||||
|
|
||||||
// Ensure the element and qualifier are unique within a given schema.
|
// Ensure the element and qualifier are unique within a given schema.
|
||||||
if (hasElement(context, metadataField.getID(), metadataField.getMetadataSchema(), metadataField.getElement(),
|
if (hasElement(context, metadataField.getID(), metadataField.getMetadataSchema(), metadataField.getElement(),
|
||||||
metadataField.getQualifier())) {
|
metadataField.getQualifier())) {
|
||||||
throw new NonUniqueMetadataException(
|
throw new NonUniqueMetadataException(
|
||||||
"Please make " + metadataField.getMetadataSchema().getName() + "." + metadataField.getElement() + "."
|
"Please make " + metadataField.getMetadataSchema().getName() + "." + metadataField.getElement() + "."
|
||||||
+ metadataField.getQualifier());
|
+ metadataField.getQualifier());
|
||||||
@@ -130,9 +130,9 @@ public class MetadataFieldServiceImpl implements MetadataFieldService {
|
|||||||
metadataFieldDAO.save(context, metadataField);
|
metadataFieldDAO.save(context, metadataField);
|
||||||
|
|
||||||
log.info(LogManager.getHeader(context, "update_metadatafieldregistry",
|
log.info(LogManager.getHeader(context, "update_metadatafieldregistry",
|
||||||
"metadata_field_id=" + metadataField.getID() + "element=" + metadataField
|
"metadata_field_id=" + metadataField.getID() + "element=" + metadataField
|
||||||
.getElement()
|
.getElement()
|
||||||
+ "qualifier=" + metadataField.getQualifier()));
|
+ "qualifier=" + metadataField.getQualifier()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -160,7 +160,7 @@ public class MetadataFieldServiceImpl implements MetadataFieldService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
log.info(LogManager.getHeader(context, "delete_metadata_field",
|
log.info(LogManager.getHeader(context, "delete_metadata_field",
|
||||||
"metadata_field_id=" + metadataField.getID()));
|
"metadata_field_id=" + metadataField.getID()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -12,7 +12,7 @@ import java.sql.SQLException;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.dspace.authorize.AuthorizeException;
|
import org.dspace.authorize.AuthorizeException;
|
||||||
import org.dspace.content.Bitstream;
|
import org.dspace.content.Bitstream;
|
||||||
|
@@ -9,9 +9,9 @@ package org.dspace.content.dao.impl;
|
|||||||
|
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.commons.collections.ListUtils;
|
|
||||||
import org.dspace.content.Community;
|
import org.dspace.content.Community;
|
||||||
import org.dspace.content.MetadataField;
|
import org.dspace.content.MetadataField;
|
||||||
import org.dspace.content.dao.CommunityDAO;
|
import org.dspace.content.dao.CommunityDAO;
|
||||||
@@ -56,9 +56,9 @@ public class CommunityDAOImpl extends AbstractHibernateDSODAO<Community> impleme
|
|||||||
throws SQLException {
|
throws SQLException {
|
||||||
StringBuilder queryBuilder = new StringBuilder();
|
StringBuilder queryBuilder = new StringBuilder();
|
||||||
queryBuilder.append("SELECT ").append(Community.class.getSimpleName()).append(" FROM Community as ")
|
queryBuilder.append("SELECT ").append(Community.class.getSimpleName()).append(" FROM Community as ")
|
||||||
.append(Community.class.getSimpleName()).append(" ");
|
.append(Community.class.getSimpleName()).append(" ");
|
||||||
addMetadataLeftJoin(queryBuilder, Community.class.getSimpleName(), Arrays.asList(sortField));
|
addMetadataLeftJoin(queryBuilder, Community.class.getSimpleName(), Arrays.asList(sortField));
|
||||||
addMetadataSortQuery(queryBuilder, Arrays.asList(sortField), ListUtils.EMPTY_LIST);
|
addMetadataSortQuery(queryBuilder, Arrays.asList(sortField), Collections.EMPTY_LIST);
|
||||||
|
|
||||||
Query query = createQuery(context, queryBuilder.toString());
|
Query query = createQuery(context, queryBuilder.toString());
|
||||||
if (offset != null) {
|
if (offset != null) {
|
||||||
@@ -83,8 +83,8 @@ public class CommunityDAOImpl extends AbstractHibernateDSODAO<Community> impleme
|
|||||||
StringBuilder queryBuilder = new StringBuilder();
|
StringBuilder queryBuilder = new StringBuilder();
|
||||||
queryBuilder.append("SELECT community FROM Community as community ");
|
queryBuilder.append("SELECT community FROM Community as community ");
|
||||||
addMetadataLeftJoin(queryBuilder, Community.class.getSimpleName().toLowerCase(), Arrays.asList(sortField));
|
addMetadataLeftJoin(queryBuilder, Community.class.getSimpleName().toLowerCase(), Arrays.asList(sortField));
|
||||||
addMetadataValueWhereQuery(queryBuilder, ListUtils.EMPTY_LIST, null, " community.parentCommunities IS EMPTY");
|
addMetadataValueWhereQuery(queryBuilder, Collections.EMPTY_LIST, null, " community.parentCommunities IS EMPTY");
|
||||||
addMetadataSortQuery(queryBuilder, Arrays.asList(sortField), ListUtils.EMPTY_LIST);
|
addMetadataSortQuery(queryBuilder, Arrays.asList(sortField), Collections.EMPTY_LIST);
|
||||||
|
|
||||||
Query query = createQuery(context, queryBuilder.toString());
|
Query query = createQuery(context, queryBuilder.toString());
|
||||||
query.setParameter(sortField.toString(), sortField.getID());
|
query.setParameter(sortField.toString(), sortField.getID());
|
||||||
|
@@ -19,7 +19,7 @@ import java.util.List;
|
|||||||
import java.util.zip.ZipEntry;
|
import java.util.zip.ZipEntry;
|
||||||
import java.util.zip.ZipFile;
|
import java.util.zip.ZipFile;
|
||||||
|
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.dspace.authorize.AuthorizeException;
|
import org.dspace.authorize.AuthorizeException;
|
||||||
import org.dspace.content.Bitstream;
|
import org.dspace.content.Bitstream;
|
||||||
|
@@ -27,7 +27,7 @@ import edu.harvard.hul.ois.mets.StructMap;
|
|||||||
import edu.harvard.hul.ois.mets.Type;
|
import edu.harvard.hul.ois.mets.Type;
|
||||||
import edu.harvard.hul.ois.mets.helper.MetsException;
|
import edu.harvard.hul.ois.mets.helper.MetsException;
|
||||||
import edu.harvard.hul.ois.mets.helper.PCData;
|
import edu.harvard.hul.ois.mets.helper.PCData;
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang.ArrayUtils;
|
import org.apache.commons.lang.ArrayUtils;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.dspace.app.util.Util;
|
import org.dspace.app.util.Util;
|
||||||
@@ -228,7 +228,7 @@ public class DSpaceAIPDisseminator extends AbstractMETSDisseminator {
|
|||||||
agentCreator.setOTHERTYPE("DSpace Software");
|
agentCreator.setOTHERTYPE("DSpace Software");
|
||||||
Name creatorName = new Name();
|
Name creatorName = new Name();
|
||||||
creatorName.getContent()
|
creatorName.getContent()
|
||||||
.add(new PCData("DSpace " + Util.getSourceVersion()));
|
.add(new PCData("DSpace " + Util.getSourceVersion()));
|
||||||
agentCreator.getContent().add(creatorName);
|
agentCreator.getContent().add(creatorName);
|
||||||
metsHdr.getContent().add(agentCreator);
|
metsHdr.getContent().add(agentCreator);
|
||||||
|
|
||||||
@@ -254,7 +254,7 @@ public class DSpaceAIPDisseminator extends AbstractMETSDisseminator {
|
|||||||
throws SQLException, IOException, AuthorizeException {
|
throws SQLException, IOException, AuthorizeException {
|
||||||
String[] dmdTypes = configurationService.getArrayProperty("aip.disseminate.dmd");
|
String[] dmdTypes = configurationService.getArrayProperty("aip.disseminate.dmd");
|
||||||
if (ArrayUtils.isEmpty(dmdTypes)) {
|
if (ArrayUtils.isEmpty(dmdTypes)) {
|
||||||
return new String[] {"MODS", "DIM"};
|
return new String[]{"MODS", "DIM"};
|
||||||
} else {
|
} else {
|
||||||
return dmdTypes;
|
return dmdTypes;
|
||||||
}
|
}
|
||||||
@@ -280,7 +280,7 @@ public class DSpaceAIPDisseminator extends AbstractMETSDisseminator {
|
|||||||
String[] techTypes = configurationService.getArrayProperty("aip.disseminate.techMD");
|
String[] techTypes = configurationService.getArrayProperty("aip.disseminate.techMD");
|
||||||
if (ArrayUtils.isEmpty(techTypes)) {
|
if (ArrayUtils.isEmpty(techTypes)) {
|
||||||
if (dso.getType() == Constants.BITSTREAM) {
|
if (dso.getType() == Constants.BITSTREAM) {
|
||||||
return new String[] {"PREMIS"};
|
return new String[]{"PREMIS"};
|
||||||
} else {
|
} else {
|
||||||
return new String[0];
|
return new String[0];
|
||||||
}
|
}
|
||||||
@@ -312,7 +312,7 @@ public class DSpaceAIPDisseminator extends AbstractMETSDisseminator {
|
|||||||
throws SQLException, IOException, AuthorizeException {
|
throws SQLException, IOException, AuthorizeException {
|
||||||
String[] sourceTypes = configurationService.getArrayProperty("aip.disseminate.sourceMD");
|
String[] sourceTypes = configurationService.getArrayProperty("aip.disseminate.sourceMD");
|
||||||
if (ArrayUtils.isEmpty(sourceTypes)) {
|
if (ArrayUtils.isEmpty(sourceTypes)) {
|
||||||
return new String[] {"AIP-TECHMD"};
|
return new String[]{"AIP-TECHMD"};
|
||||||
} else {
|
} else {
|
||||||
return sourceTypes;
|
return sourceTypes;
|
||||||
}
|
}
|
||||||
|
@@ -20,7 +20,7 @@ import java.util.Map;
|
|||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.dspace.authorize.AuthorizeException;
|
import org.dspace.authorize.AuthorizeException;
|
||||||
import org.dspace.content.Bitstream;
|
import org.dspace.content.Bitstream;
|
||||||
|
@@ -12,7 +12,7 @@ import java.util.Iterator;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.hibernate.Criteria;
|
import org.hibernate.Criteria;
|
||||||
import org.hibernate.Query;
|
import org.hibernate.Query;
|
||||||
import org.hibernate.Session;
|
import org.hibernate.Session;
|
||||||
|
@@ -9,10 +9,10 @@ package org.dspace.core;
|
|||||||
|
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.collections.ListUtils;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.dspace.content.DSpaceObject;
|
import org.dspace.content.DSpaceObject;
|
||||||
import org.dspace.content.MetadataField;
|
import org.dspace.content.MetadataField;
|
||||||
@@ -63,7 +63,7 @@ public abstract class AbstractHibernateDSODAO<T extends DSpaceObject> extends Ab
|
|||||||
for (MetadataField metadataField : metadataFields) {
|
for (MetadataField metadataField : metadataFields) {
|
||||||
query.append(" left join ").append(tableIdentifier).append(".metadata ").append(metadataField.toString());
|
query.append(" left join ").append(tableIdentifier).append(".metadata ").append(metadataField.toString());
|
||||||
query.append(" WITH ").append(metadataField.toString()).append(".metadataField.id").append(" = :")
|
query.append(" WITH ").append(metadataField.toString()).append(".metadataField.id").append(" = :")
|
||||||
.append(metadataField.toString());
|
.append(metadataField.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,7 +87,7 @@ public abstract class AbstractHibernateDSODAO<T extends DSpaceObject> extends Ab
|
|||||||
if (StringUtils.isNotBlank(operator)) {
|
if (StringUtils.isNotBlank(operator)) {
|
||||||
query.append(" (");
|
query.append(" (");
|
||||||
query.append("lower(STR(" + metadataField.toString()).append(".value)) ").append(operator)
|
query.append("lower(STR(" + metadataField.toString()).append(".value)) ").append(operator)
|
||||||
.append(" lower(:queryParam)");
|
.append(" lower(:queryParam)");
|
||||||
query.append(")");
|
query.append(")");
|
||||||
if (i < metadataFields.size() - 1) {
|
if (i < metadataFields.size() - 1) {
|
||||||
query.append(" OR ");
|
query.append(" OR ");
|
||||||
@@ -115,7 +115,7 @@ public abstract class AbstractHibernateDSODAO<T extends DSpaceObject> extends Ab
|
|||||||
*/
|
*/
|
||||||
protected void addMetadataSortQuery(StringBuilder query, List<MetadataField> metadataSortFields,
|
protected void addMetadataSortQuery(StringBuilder query, List<MetadataField> metadataSortFields,
|
||||||
List<String> columnSortFields) {
|
List<String> columnSortFields) {
|
||||||
addMetadataSortQuery(query, metadataSortFields, columnSortFields, ListUtils.EMPTY_LIST);
|
addMetadataSortQuery(query, metadataSortFields, columnSortFields, Collections.EMPTY_LIST);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -24,7 +24,7 @@ import javax.annotation.Nullable;
|
|||||||
|
|
||||||
import com.google.common.base.Function;
|
import com.google.common.base.Function;
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.io.Charsets;
|
import org.apache.commons.io.Charsets;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
@@ -32,9 +32,9 @@ import java.util.TimeZone;
|
|||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.collections.MapUtils;
|
import org.apache.commons.collections4.MapUtils;
|
||||||
import org.apache.commons.collections.Transformer;
|
import org.apache.commons.collections4.Transformer;
|
||||||
import org.apache.commons.lang.ArrayUtils;
|
import org.apache.commons.lang.ArrayUtils;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.commons.lang.time.DateFormatUtils;
|
import org.apache.commons.lang.time.DateFormatUtils;
|
||||||
|
@@ -17,7 +17,7 @@ import java.util.Set;
|
|||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.apache.commons.codec.DecoderException;
|
import org.apache.commons.codec.DecoderException;
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.dspace.authorize.AuthorizeException;
|
import org.dspace.authorize.AuthorizeException;
|
||||||
|
@@ -17,7 +17,7 @@ import java.util.Map;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang.ObjectUtils;
|
import org.apache.commons.lang.ObjectUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.commons.lang3.tuple.Pair;
|
import org.apache.commons.lang3.tuple.Pair;
|
||||||
|
@@ -11,7 +11,7 @@ import java.sql.SQLException;
|
|||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.dspace.authorize.AuthorizeException;
|
import org.dspace.authorize.AuthorizeException;
|
||||||
import org.dspace.core.Context;
|
import org.dspace.core.Context;
|
||||||
import org.dspace.eperson.dao.RegistrationDataDAO;
|
import org.dspace.eperson.dao.RegistrationDataDAO;
|
||||||
|
@@ -16,8 +16,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.collections.ListUtils;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.dspace.content.MetadataField;
|
import org.dspace.content.MetadataField;
|
||||||
import org.dspace.core.AbstractHibernateDSODAO;
|
import org.dspace.core.AbstractHibernateDSODAO;
|
||||||
@@ -65,7 +64,7 @@ public class EPersonDAOImpl extends AbstractHibernateDSODAO<EPerson> implements
|
|||||||
public List<EPerson> search(Context context, String query, List<MetadataField> queryFields,
|
public List<EPerson> search(Context context, String query, List<MetadataField> queryFields,
|
||||||
List<MetadataField> sortFields, int offset, int limit) throws SQLException {
|
List<MetadataField> sortFields, int offset, int limit) throws SQLException {
|
||||||
String queryString = "SELECT " + EPerson.class.getSimpleName()
|
String queryString = "SELECT " + EPerson.class.getSimpleName()
|
||||||
.toLowerCase() + " FROM EPerson as " + EPerson.class
|
.toLowerCase() + " FROM EPerson as " + EPerson.class
|
||||||
.getSimpleName().toLowerCase() + " ";
|
.getSimpleName().toLowerCase() + " ";
|
||||||
if (query != null) {
|
if (query != null) {
|
||||||
query = "%" + query.toLowerCase() + "%";
|
query = "%" + query.toLowerCase() + "%";
|
||||||
@@ -84,7 +83,7 @@ public class EPersonDAOImpl extends AbstractHibernateDSODAO<EPerson> implements
|
|||||||
@Override
|
@Override
|
||||||
public int searchResultCount(Context context, String query, List<MetadataField> queryFields) throws SQLException {
|
public int searchResultCount(Context context, String query, List<MetadataField> queryFields) throws SQLException {
|
||||||
String queryString = "SELECT count(*) FROM EPerson as " + EPerson.class.getSimpleName().toLowerCase();
|
String queryString = "SELECT count(*) FROM EPerson as " + EPerson.class.getSimpleName().toLowerCase();
|
||||||
Query hibernateQuery = getSearchQuery(context, queryString, query, queryFields, ListUtils.EMPTY_LIST, null);
|
Query hibernateQuery = getSearchQuery(context, queryString, query, queryFields, Collections.EMPTY_LIST, null);
|
||||||
|
|
||||||
return count(hibernateQuery);
|
return count(hibernateQuery);
|
||||||
}
|
}
|
||||||
@@ -93,17 +92,18 @@ public class EPersonDAOImpl extends AbstractHibernateDSODAO<EPerson> implements
|
|||||||
public List<EPerson> findAll(Context context, MetadataField metadataSortField, String sortField, int pageSize,
|
public List<EPerson> findAll(Context context, MetadataField metadataSortField, String sortField, int pageSize,
|
||||||
int offset) throws SQLException {
|
int offset) throws SQLException {
|
||||||
String queryString = "SELECT " + EPerson.class.getSimpleName()
|
String queryString = "SELECT " + EPerson.class.getSimpleName()
|
||||||
.toLowerCase() + " FROM EPerson as " + EPerson.class
|
.toLowerCase() + " FROM EPerson as " + EPerson.class
|
||||||
.getSimpleName().toLowerCase();
|
.getSimpleName().toLowerCase();
|
||||||
|
|
||||||
List<MetadataField> sortFields = ListUtils.EMPTY_LIST;
|
List<MetadataField> sortFields = Collections.EMPTY_LIST;
|
||||||
|
|
||||||
if (metadataSortField != null) {
|
if (metadataSortField != null) {
|
||||||
sortFields = Collections.singletonList(metadataSortField);
|
sortFields = Collections.singletonList(metadataSortField);
|
||||||
}
|
}
|
||||||
|
|
||||||
Query query = getSearchQuery(context, queryString, null, ListUtils.EMPTY_LIST, sortFields, sortField, pageSize,
|
Query query = getSearchQuery(context, queryString, null, Collections.EMPTY_LIST, sortFields, sortField,
|
||||||
offset);
|
pageSize,
|
||||||
|
offset);
|
||||||
return list(query);
|
return list(query);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -111,9 +111,9 @@ public class EPersonDAOImpl extends AbstractHibernateDSODAO<EPerson> implements
|
|||||||
@Override
|
@Override
|
||||||
public List<EPerson> findByGroups(Context context, Set<Group> groups) throws SQLException {
|
public List<EPerson> findByGroups(Context context, Set<Group> groups) throws SQLException {
|
||||||
Query query = createQuery(context,
|
Query query = createQuery(context,
|
||||||
"SELECT DISTINCT e FROM EPerson e " +
|
"SELECT DISTINCT e FROM EPerson e " +
|
||||||
"JOIN e.groups g " +
|
"JOIN e.groups g " +
|
||||||
"WHERE g.id IN (:idList) ");
|
"WHERE g.id IN (:idList) ");
|
||||||
|
|
||||||
List<UUID> idList = new ArrayList<>(groups.size());
|
List<UUID> idList = new ArrayList<>(groups.size());
|
||||||
for (Group group : groups) {
|
for (Group group : groups) {
|
||||||
@@ -163,7 +163,7 @@ public class EPersonDAOImpl extends AbstractHibernateDSODAO<EPerson> implements
|
|||||||
}
|
}
|
||||||
if (queryParam != null) {
|
if (queryParam != null) {
|
||||||
addMetadataValueWhereQuery(queryBuilder, queryFields, "like",
|
addMetadataValueWhereQuery(queryBuilder, queryFields, "like",
|
||||||
EPerson.class.getSimpleName().toLowerCase() + ".email like :queryParam");
|
EPerson.class.getSimpleName().toLowerCase() + ".email like :queryParam");
|
||||||
}
|
}
|
||||||
if (!CollectionUtils.isEmpty(sortFields)) {
|
if (!CollectionUtils.isEmpty(sortFields)) {
|
||||||
addMetadataSortQuery(queryBuilder, sortFields, Collections.singletonList(sortField));
|
addMetadataSortQuery(queryBuilder, sortFields, Collections.singletonList(sortField));
|
||||||
|
@@ -11,7 +11,7 @@ import java.sql.SQLException;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.dspace.content.DSpaceObject;
|
import org.dspace.content.DSpaceObject;
|
||||||
|
@@ -10,7 +10,8 @@ package org.dspace.importer.external.datamodel;
|
|||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
import org.apache.commons.collections.map.MultiValueMap;
|
import org.apache.commons.collections4.map.MultiValueMap;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a query to a source. Subclasses may enforce stricter typing or more verbose setting of parameters.
|
* Represents a query to a source. Subclasses may enforce stricter typing or more verbose setting of parameters.
|
||||||
|
@@ -16,7 +16,7 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.apache.commons.collections.MapUtils;
|
import org.apache.commons.collections4.MapUtils;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.dspace.authorize.AuthorizeException;
|
import org.dspace.authorize.AuthorizeException;
|
||||||
import org.dspace.checker.service.ChecksumHistoryService;
|
import org.dspace.checker.service.ChecksumHistoryService;
|
||||||
|
@@ -12,7 +12,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.dspace.authorize.AuthorizeException;
|
import org.dspace.authorize.AuthorizeException;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.core.Context;
|
import org.dspace.core.Context;
|
||||||
|
@@ -20,7 +20,7 @@ import java.util.ResourceBundle;
|
|||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import javax.mail.MessagingException;
|
import javax.mail.MessagingException;
|
||||||
|
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.dspace.authorize.AuthorizeException;
|
import org.dspace.authorize.AuthorizeException;
|
||||||
|
@@ -21,7 +21,7 @@ import java.util.UUID;
|
|||||||
import javax.mail.MessagingException;
|
import javax.mail.MessagingException;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.dspace.authorize.AuthorizeException;
|
import org.dspace.authorize.AuthorizeException;
|
||||||
import org.dspace.authorize.ResourcePolicy;
|
import org.dspace.authorize.ResourcePolicy;
|
||||||
|
@@ -12,7 +12,7 @@ import java.util.Collections;
|
|||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.dspace.authorize.AuthorizeException;
|
import org.dspace.authorize.AuthorizeException;
|
||||||
import org.dspace.core.Context;
|
import org.dspace.core.Context;
|
||||||
import org.dspace.eperson.EPerson;
|
import org.dspace.eperson.EPerson;
|
||||||
|
@@ -11,7 +11,7 @@ import java.sql.SQLException;
|
|||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.dspace.authorize.AuthorizeException;
|
import org.dspace.authorize.AuthorizeException;
|
||||||
import org.dspace.core.Context;
|
import org.dspace.core.Context;
|
||||||
import org.dspace.eperson.EPerson;
|
import org.dspace.eperson.EPerson;
|
||||||
|
@@ -15,7 +15,7 @@ import java.util.Iterator;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.dspace.authorize.AuthorizeException;
|
import org.dspace.authorize.AuthorizeException;
|
||||||
import org.dspace.core.Context;
|
import org.dspace.core.Context;
|
||||||
import org.dspace.eperson.EPerson;
|
import org.dspace.eperson.EPerson;
|
||||||
|
@@ -12,7 +12,7 @@ import java.util.Collections;
|
|||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.dspace.authorize.AuthorizeException;
|
import org.dspace.authorize.AuthorizeException;
|
||||||
import org.dspace.core.Context;
|
import org.dspace.core.Context;
|
||||||
import org.dspace.eperson.EPerson;
|
import org.dspace.eperson.EPerson;
|
||||||
|
@@ -18,10 +18,10 @@ import static org.junit.Assert.fail;
|
|||||||
|
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import mockit.NonStrictExpectations;
|
import mockit.NonStrictExpectations;
|
||||||
import org.apache.commons.collections.ListUtils;
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.dspace.AbstractUnitTest;
|
import org.dspace.AbstractUnitTest;
|
||||||
import org.dspace.authorize.AuthorizeException;
|
import org.dspace.authorize.AuthorizeException;
|
||||||
@@ -546,7 +546,7 @@ public class BitstreamFormatTest extends AbstractUnitTest {
|
|||||||
assertThat("setExtensions 4", bf.getExtensions().get(1), equalTo("2"));
|
assertThat("setExtensions 4", bf.getExtensions().get(1), equalTo("2"));
|
||||||
assertThat("setExtensions 5", bf.getExtensions().get(2), equalTo("3"));
|
assertThat("setExtensions 5", bf.getExtensions().get(2), equalTo("3"));
|
||||||
|
|
||||||
bf.setExtensions(ListUtils.EMPTY_LIST);
|
bf.setExtensions(Collections.EMPTY_LIST);
|
||||||
assertThat("setExtensions 6", bf.getExtensions(), notNullValue());
|
assertThat("setExtensions 6", bf.getExtensions(), notNullValue());
|
||||||
assertTrue("setExtensions 7", bf.getExtensions().size() == 0);
|
assertTrue("setExtensions 7", bf.getExtensions().size() == 0);
|
||||||
bf.setExtensions(backupExtensions);
|
bf.setExtensions(backupExtensions);
|
||||||
|
@@ -17,8 +17,12 @@ import static org.junit.Assert.assertThat;
|
|||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
import static org.junit.Assert.fail;
|
import static org.junit.Assert.fail;
|
||||||
|
|
||||||
import java.io.File;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.dspace.core.Constants;
|
||||||
|
import org.dspace.core.Context;
|
||||||
|
import mockit.NonStrictExpectations;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
|
import java.io.File;
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -27,13 +31,9 @@ import java.util.Iterator;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import mockit.NonStrictExpectations;
|
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.dspace.authorize.AuthorizeException;
|
import org.dspace.authorize.AuthorizeException;
|
||||||
import org.dspace.authorize.ResourcePolicy;
|
import org.dspace.authorize.ResourcePolicy;
|
||||||
import org.dspace.core.Constants;
|
|
||||||
import org.dspace.core.Context;
|
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
@@ -155,8 +155,8 @@
|
|||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-collections</groupId>
|
<groupId>org.apache.commons</groupId>
|
||||||
<artifactId>commons-collections</artifactId>
|
<artifactId>commons-collections4</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-configuration</groupId>
|
<groupId>commons-configuration</groupId>
|
||||||
|
11
pom.xml
11
pom.xml
@@ -1149,17 +1149,16 @@
|
|||||||
<artifactId>commons-codec</artifactId>
|
<artifactId>commons-codec</artifactId>
|
||||||
<version>1.10</version>
|
<version>1.10</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>commons-collections</groupId>
|
|
||||||
<artifactId>commons-collections</artifactId>
|
|
||||||
<version>3.2.2</version>
|
|
||||||
<!-- <version>3.1</version> xmlui - wing -->
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.commons</groupId>
|
<groupId>org.apache.commons</groupId>
|
||||||
<artifactId>commons-collections4</artifactId>
|
<artifactId>commons-collections4</artifactId>
|
||||||
<version>4.1</version>
|
<version>4.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-collections</groupId>
|
||||||
|
<artifactId>commons-collections</artifactId>
|
||||||
|
<version>3.2.2</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-configuration</groupId>
|
<groupId>commons-configuration</groupId>
|
||||||
<artifactId>commons-configuration</artifactId>
|
<artifactId>commons-configuration</artifactId>
|
||||||
|
Reference in New Issue
Block a user