From 01bffc0761e9544ca7fba8acb98e82bad7917c65 Mon Sep 17 00:00:00 2001 From: nwoodward Date: Thu, 19 Jan 2023 14:07:28 -0600 Subject: [PATCH 1/7] removed CachingService that was removed from DSpace in https://github.com/DSpace/DSpace/pull/8146 --- src/test/java/org/dspace/TestDSpaceServicesFactory.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/test/java/org/dspace/TestDSpaceServicesFactory.java b/src/test/java/org/dspace/TestDSpaceServicesFactory.java index 8e74a449..c250ba2b 100644 --- a/src/test/java/org/dspace/TestDSpaceServicesFactory.java +++ b/src/test/java/org/dspace/TestDSpaceServicesFactory.java @@ -8,7 +8,6 @@ package org.dspace; import org.dspace.kernel.ServiceManager; -import org.dspace.services.CachingService; import org.dspace.services.ConfigurationService; import org.dspace.services.EmailService; import org.dspace.services.EventService; @@ -26,11 +25,6 @@ public class TestDSpaceServicesFactory extends DSpaceServicesFactory { public static final String DSPACE_SERVICES_FACTORY = "dSpaceServicesFactory"; - @Override - public CachingService getCachingService() { - throw new UnsupportedOperationException(); - } - @Override public ConfigurationService getConfigurationService() { return new DSpace().getConfigurationService(); From 420d7903d7e8517e755853b4d9c1441cef2648fe Mon Sep 17 00:00:00 2001 From: nwoodward Date: Thu, 19 Jan 2023 15:11:19 -0600 Subject: [PATCH 2/7] replace log4j --- pom.xml | 21 ++++++++++++++++++- .../ctask/replicate/AbstractPackagerTask.java | 5 +++-- .../replicate/BagItReplicateConsumer.java | 5 +++-- .../ctask/replicate/BagItRestoreFromAIP.java | 5 +++-- .../replicate/FilteredFileTaskQueue.java | 5 +++-- .../replicate/METSReplicateConsumer.java | 5 +++-- .../ctask/replicate/METSRestoreFromAIP.java | 5 +++-- .../ctask/replicate/MoveToTrashSingleAIP.java | 5 +++-- .../ctask/replicate/ReplicaManager.java | 5 +++-- .../replicate/checkm/TransmitManifest.java | 5 +++-- .../java/org/dspace/pack/mets/METSPacker.java | 5 +++-- 11 files changed, 50 insertions(+), 21 deletions(-) diff --git a/pom.xml b/pom.xml index 8c94e8bb..4fcf9bdf 100644 --- a/pom.xml +++ b/pom.xml @@ -36,7 +36,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 1.4.1 + 3.1.0 enforce-java @@ -66,6 +66,21 @@ + + enforce-banned-dependencies + + enforce + + + + + + log4j:log4j + + + + + @@ -247,6 +262,10 @@ org.slf4j slf4j-log4j12 + + log4j + log4j + diff --git a/src/main/java/org/dspace/ctask/replicate/AbstractPackagerTask.java b/src/main/java/org/dspace/ctask/replicate/AbstractPackagerTask.java index f045f0a0..8a385a91 100644 --- a/src/main/java/org/dspace/ctask/replicate/AbstractPackagerTask.java +++ b/src/main/java/org/dspace/ctask/replicate/AbstractPackagerTask.java @@ -9,7 +9,8 @@ import java.util.List; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.dspace.content.packager.PackageParameters; import org.dspace.curate.AbstractCurationTask; @@ -34,7 +35,7 @@ public abstract class AbstractPackagerTask extends AbstractCurationTask // Name of useCollectionTemplate option configurable in curation task configuration file private final String useCollectionTemplate = "useCollectionTemplate"; - private static Logger log = Logger.getLogger(AbstractPackagerTask.class); + private static Logger log = LogManager.getLogger(); /** * Loads pre-configured PackageParameters settings from a given Module diff --git a/src/main/java/org/dspace/ctask/replicate/BagItReplicateConsumer.java b/src/main/java/org/dspace/ctask/replicate/BagItReplicateConsumer.java index f9e6b05e..3acaa063 100644 --- a/src/main/java/org/dspace/ctask/replicate/BagItReplicateConsumer.java +++ b/src/main/java/org/dspace/ctask/replicate/BagItReplicateConsumer.java @@ -26,7 +26,8 @@ import java.util.Map; import java.util.Set; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.dspace.authorize.AuthorizeException; import org.dspace.content.Collection; import org.dspace.content.Community; @@ -62,7 +63,7 @@ */ public class BagItReplicateConsumer implements Consumer { - private Logger log = Logger.getLogger(BagItReplicateConsumer.class); + private Logger log = LogManager.getLogger(); private ConfigurationService configurationService = DSpaceServicesFactory.getInstance().getConfigurationService(); private PluginService pluginService = CoreServiceFactory.getInstance().getPluginService(); diff --git a/src/main/java/org/dspace/ctask/replicate/BagItRestoreFromAIP.java b/src/main/java/org/dspace/ctask/replicate/BagItRestoreFromAIP.java index ac0bb7cc..aca07487 100644 --- a/src/main/java/org/dspace/ctask/replicate/BagItRestoreFromAIP.java +++ b/src/main/java/org/dspace/ctask/replicate/BagItRestoreFromAIP.java @@ -19,7 +19,8 @@ import java.util.List; import java.util.Properties; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.dspace.authorize.AuthorizeException; import org.dspace.content.Collection; import org.dspace.content.Community; @@ -57,7 +58,7 @@ @Mutative public class BagItRestoreFromAIP extends AbstractCurationTask { - private static Logger log = Logger.getLogger(BagItRestoreFromAIP.class); + private static Logger log = LogManager.getLogger(); private String archFmt; // Group where all AIPs are stored diff --git a/src/main/java/org/dspace/ctask/replicate/FilteredFileTaskQueue.java b/src/main/java/org/dspace/ctask/replicate/FilteredFileTaskQueue.java index 836fc3ac..b0809e66 100644 --- a/src/main/java/org/dspace/ctask/replicate/FilteredFileTaskQueue.java +++ b/src/main/java/org/dspace/ctask/replicate/FilteredFileTaskQueue.java @@ -13,7 +13,8 @@ import java.util.List; import java.util.Set; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.dspace.curate.FileTaskQueue; import org.dspace.curate.TaskQueueEntry; @@ -41,7 +42,7 @@ */ public class FilteredFileTaskQueue extends FileTaskQueue { - private static Logger log = Logger.getLogger(FilteredFileTaskQueue.class); + private static Logger log = LogManager.getLogger(); /** diff --git a/src/main/java/org/dspace/ctask/replicate/METSReplicateConsumer.java b/src/main/java/org/dspace/ctask/replicate/METSReplicateConsumer.java index 6a8f8fd6..302fb3b0 100644 --- a/src/main/java/org/dspace/ctask/replicate/METSReplicateConsumer.java +++ b/src/main/java/org/dspace/ctask/replicate/METSReplicateConsumer.java @@ -27,7 +27,8 @@ import java.util.Map; import java.util.Set; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.dspace.authorize.AuthorizeException; import org.dspace.content.Collection; import org.dspace.content.Community; @@ -82,7 +83,7 @@ */ public class METSReplicateConsumer implements Consumer { - private Logger log = Logger.getLogger(METSReplicateConsumer.class); + private Logger log = LogManager.getLogger(); private ConfigurationService configurationService = DSpaceServicesFactory.getInstance().getConfigurationService(); private PluginService pluginService = CoreServiceFactory.getInstance().getPluginService(); diff --git a/src/main/java/org/dspace/ctask/replicate/METSRestoreFromAIP.java b/src/main/java/org/dspace/ctask/replicate/METSRestoreFromAIP.java index 6a3be480..0bc7ded8 100644 --- a/src/main/java/org/dspace/ctask/replicate/METSRestoreFromAIP.java +++ b/src/main/java/org/dspace/ctask/replicate/METSRestoreFromAIP.java @@ -12,7 +12,8 @@ import java.sql.SQLException; import java.util.List; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.dspace.authorize.AuthorizeException; import org.dspace.content.DSpaceObject; import org.dspace.content.packager.PackageParameters; @@ -33,7 +34,7 @@ @Mutative public class METSRestoreFromAIP extends AbstractPackagerTask { - private Logger log = Logger.getLogger(METSRestoreFromAIP.class); + private Logger log = LogManager.getLogger(); private String archFmt; diff --git a/src/main/java/org/dspace/ctask/replicate/MoveToTrashSingleAIP.java b/src/main/java/org/dspace/ctask/replicate/MoveToTrashSingleAIP.java index 87828440..231c8b05 100644 --- a/src/main/java/org/dspace/ctask/replicate/MoveToTrashSingleAIP.java +++ b/src/main/java/org/dspace/ctask/replicate/MoveToTrashSingleAIP.java @@ -11,7 +11,8 @@ import java.io.IOException; import java.sql.SQLException; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.dspace.content.DSpaceObject; import org.dspace.core.Context; import org.dspace.curate.AbstractCurationTask; @@ -43,7 +44,7 @@ public class MoveToTrashSingleAIP extends AbstractCurationTask private String archFmt; - private static Logger log = Logger.getLogger(MoveToTrashSingleAIP.class); + private static Logger log = LogManager.getLogger(); @Override public void init(Curator curator, String taskId) throws IOException { diff --git a/src/main/java/org/dspace/ctask/replicate/ReplicaManager.java b/src/main/java/org/dspace/ctask/replicate/ReplicaManager.java index 216c3519..e7ae72b8 100644 --- a/src/main/java/org/dspace/ctask/replicate/ReplicaManager.java +++ b/src/main/java/org/dspace/ctask/replicate/ReplicaManager.java @@ -16,7 +16,8 @@ import java.io.IOException; import java.sql.SQLException; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.dspace.content.DSpaceObject; import org.dspace.core.Constants; import org.dspace.core.Context; @@ -40,7 +41,7 @@ public class ReplicaManager { private PluginService pluginService = CoreServiceFactory.getInstance().getPluginService(); private HandleService handleService = HandleServiceFactory.getInstance().getHandleService(); - private Logger log = Logger.getLogger(ReplicaManager.class); + private Logger log = LogManager.getLogger(); // singleton instance private static ReplicaManager instance = null; // the replica provider diff --git a/src/main/java/org/dspace/ctask/replicate/checkm/TransmitManifest.java b/src/main/java/org/dspace/ctask/replicate/checkm/TransmitManifest.java index b3b04d6b..3c06df24 100644 --- a/src/main/java/org/dspace/ctask/replicate/checkm/TransmitManifest.java +++ b/src/main/java/org/dspace/ctask/replicate/checkm/TransmitManifest.java @@ -17,7 +17,8 @@ import java.util.Iterator; import java.util.List; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.dspace.content.Bitstream; import org.dspace.content.Bundle; import org.dspace.content.Collection; @@ -61,7 +62,7 @@ public class TransmitManifest extends AbstractCurationTask { // Group where all Manifests will be stored private String manifestGroupName; - private static Logger log = Logger.getLogger(TransmitManifest.class); + private static Logger log = LogManager.getLogger(); private CommunityService communityService = ContentServiceFactory.getInstance().getCommunityService(); private ItemService itemService = ContentServiceFactory.getInstance().getItemService(); diff --git a/src/main/java/org/dspace/pack/mets/METSPacker.java b/src/main/java/org/dspace/pack/mets/METSPacker.java index 1c3358b8..c56229d3 100644 --- a/src/main/java/org/dspace/pack/mets/METSPacker.java +++ b/src/main/java/org/dspace/pack/mets/METSPacker.java @@ -15,7 +15,8 @@ import java.util.Iterator; import java.util.List; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.dspace.authorize.AuthorizeException; import org.dspace.content.Bitstream; import org.dspace.content.Bundle; @@ -50,7 +51,7 @@ public class METSPacker implements Packer private CommunityService communityService = ContentServiceFactory.getInstance().getCommunityService(); private ItemService itemService = ContentServiceFactory.getInstance().getItemService(); - private Logger log = Logger.getLogger(METSPacker.class); + private Logger log = LogManager.getLogger(); /** The context to use */ private Context context; From b7b98093e1e558bcaef2f01ebe693159e0638cae Mon Sep 17 00:00:00 2001 From: nwoodward Date: Thu, 19 Jan 2023 15:18:17 -0600 Subject: [PATCH 3/7] updated version to match most recent version of DSpace --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4fcf9bdf..772b113c 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ Replication Task Suite: A DSpace add-on providing Curation Tasks that perform replication (backup and restore) of DSpace content to other locations or services. https://wiki.lyrasis.org/display/DSPACE/ReplicationTaskSuite - 7.3-SNAPSHOT + 7.4-SNAPSHOT LYRASIS From 062882aec2bc4a10f20514f7307f1acb573f9499 Mon Sep 17 00:00:00 2001 From: nwoodward Date: Thu, 19 Jan 2023 16:05:21 -0600 Subject: [PATCH 4/7] added new curation tasks --- config/modules/curate.cfg | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/modules/curate.cfg b/config/modules/curate.cfg index 5b698ce0..5cb8c63d 100644 --- a/config/modules/curate.cfg +++ b/config/modules/curate.cfg @@ -14,6 +14,8 @@ plugin.named.org.dspace.curate.CurationTask = org.dspace.ctask.general.RequiredM #plugin.named.org.dspace.curate.CurationTask = org.dspace.ctask.general.ClamScan = vscan #plugin.named.org.dspace.curate.CurationTask = org.dspace.ctask.general.MicrosoftTranslator = translate plugin.named.org.dspace.curate.CurationTask = org.dspace.ctask.general.MetadataValueLinkChecker = checklinks +plugin.named.org.dspace.curate.CurationTask = org.dspace.ctask.general.RegisterDOI = registerdoi +#plugin.named.org.dspace.curate.CurationTask = org.dspace.ctask.general.CitationPage = citationpage plugin.named.org.dspace.curate.CurationTask = org.dspace.ctask.replicate.EstimateAIPSize = estaipsize plugin.named.org.dspace.curate.CurationTask = org.dspace.ctask.replicate.ReadOdometer = readodometer plugin.named.org.dspace.curate.CurationTask = org.dspace.ctask.replicate.TransmitAIP = transmitaip From 444621bf5e6ad2313e6363c9f5e191498957804d Mon Sep 17 00:00:00 2001 From: nwoodward Date: Fri, 20 Jan 2023 11:19:01 -0600 Subject: [PATCH 5/7] remove newline --- config/modules/curate.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/modules/curate.cfg b/config/modules/curate.cfg index 5cb8c63d..c6cf63fc 100644 --- a/config/modules/curate.cfg +++ b/config/modules/curate.cfg @@ -54,4 +54,4 @@ plugin.single.org.dspace.curate.TaskQueue = org.dspace.curate.FileTaskQueue curate.taskqueue.dir = ${dspace.dir}/ctqueues # (optional) directory location of scripted (non-java) tasks -# curate.script.dir = ${dspace.dir}/ctscripts +# curate.script.dir = ${dspace.dir}/ctscripts \ No newline at end of file From bfed5f0df434cb4adecf49eaa592b54defd3ddc5 Mon Sep 17 00:00:00 2001 From: Michael Ritter Date: Tue, 24 Oct 2023 13:41:38 -0600 Subject: [PATCH 6/7] Dspace 7.6 Updates (#1) * Remove SupervisorService * Remove SupervisedItemService, add SubscribeService * Add log4j dependencies for compilation + testing * Fix typo --- pom.xml | 11 +++++++++++ .../java/org/dspace/TestContentServiceFactory.java | 10 +++++----- .../java/org/dspace/TestEPersonServiceFactory.java | 5 ----- .../java/org/dspace/pack/bagit/BagItPackerTest.java | 2 +- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/pom.xml b/pom.xml index 772b113c..9e895966 100644 --- a/pom.xml +++ b/pom.xml @@ -307,6 +307,17 @@ + + org.apache.logging.log4j + log4j-api + 2.20.0 + + + org.apache.logging.log4j + log4j-core + 2.20.0 + test + diff --git a/src/test/java/org/dspace/TestContentServiceFactory.java b/src/test/java/org/dspace/TestContentServiceFactory.java index 6d2cdfb0..1c6d46a8 100644 --- a/src/test/java/org/dspace/TestContentServiceFactory.java +++ b/src/test/java/org/dspace/TestContentServiceFactory.java @@ -31,8 +31,8 @@ import org.dspace.content.service.RelationshipService; import org.dspace.content.service.RelationshipTypeService; import org.dspace.content.service.SiteService; -import org.dspace.content.service.SupervisedItemService; import org.dspace.content.service.WorkspaceItemService; +import org.dspace.eperson.service.SubscribeService; /** * A {@link ContentServiceFactory} which returns mock services @@ -119,13 +119,13 @@ public InstallItemService getInstallItemService() { } @Override - public SupervisedItemService getSupervisedItemService() { - throw new UnsupportedOperationException(); + public SiteService getSiteService() { + return siteService; } @Override - public SiteService getSiteService() { - return siteService; + public SubscribeService getSubscribeService() { + throw new UnsupportedOperationException(); } @Override diff --git a/src/test/java/org/dspace/TestEPersonServiceFactory.java b/src/test/java/org/dspace/TestEPersonServiceFactory.java index 27e6e46b..399e7660 100644 --- a/src/test/java/org/dspace/TestEPersonServiceFactory.java +++ b/src/test/java/org/dspace/TestEPersonServiceFactory.java @@ -15,7 +15,6 @@ import org.dspace.eperson.service.GroupService; import org.dspace.eperson.service.RegistrationDataService; import org.dspace.eperson.service.SubscribeService; -import org.dspace.eperson.service.SupervisorService; /** * {@link EPersonServiceFactory} for testing @@ -52,8 +51,4 @@ public SubscribeService getSubscribeService() { throw new UnsupportedOperationException(); } - @Override - public SupervisorService getSupervisorService() { - throw new UnsupportedOperationException(); - } } diff --git a/src/test/java/org/dspace/pack/bagit/BagItPackerTest.java b/src/test/java/org/dspace/pack/bagit/BagItPackerTest.java index ad248da0..2b94f306 100644 --- a/src/test/java/org/dspace/pack/bagit/BagItPackerTest.java +++ b/src/test/java/org/dspace/pack/bagit/BagItPackerTest.java @@ -42,7 +42,7 @@ /** * Base class for all BagIt packing/unpacking tests. This performs initial setup so that the DSpaceKernel is not null - * and so that some of the that are used through static contexts or have static initializers (e.g. + * and so that classes used through static contexts or have static initializers (e.g. * {@link org.dspace.services.factory.DSpaceServicesFactory}, {@link org.dspace.core.Context}) can initialize and * retrieve any classes which are necessary for basic operations. * From ca87bc830122827fc4c1456b0bb0fccc248fd084 Mon Sep 17 00:00:00 2001 From: nwoodward Date: Fri, 27 Oct 2023 13:16:21 -0500 Subject: [PATCH 7/7] updated pom for release --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9e895966..90d6a47a 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ Replication Task Suite: A DSpace add-on providing Curation Tasks that perform replication (backup and restore) of DSpace content to other locations or services. https://wiki.lyrasis.org/display/DSPACE/ReplicationTaskSuite - 7.4-SNAPSHOT + 7.6-SNAPSHOT LYRASIS