From c43948bf3d190d68e2c2840c5beee9268764ad2a Mon Sep 17 00:00:00 2001 From: "Mark H. Wood" Date: Tue, 23 Apr 2024 13:33:01 -0400 Subject: [PATCH 01/96] Separate task-list building from execution. The old code would curate the object once for each task, meaning that all but one task would be executed N times up to the length of the list. --- .../curate/XmlWorkflowCuratorServiceImpl.java | 29 ++++++++++--------- .../java/org/dspace/curate/package-info.java | 12 ++++++++ 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/curate/XmlWorkflowCuratorServiceImpl.java b/dspace-api/src/main/java/org/dspace/curate/XmlWorkflowCuratorServiceImpl.java index 00e91ee1fb40..ec32ff92f9a2 100644 --- a/dspace-api/src/main/java/org/dspace/curate/XmlWorkflowCuratorServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/curate/XmlWorkflowCuratorServiceImpl.java @@ -140,13 +140,14 @@ public boolean curate(Curator curator, Context c, XmlWorkflowItem wfi) item.setOwningCollection(wfi.getCollection()); for (Task task : step.tasks) { curator.addTask(task.name); - // Check whether the task is configured to be queued rather than automatically run - if (StringUtils.isNotEmpty(step.queue)) { - // queue attribute has been set in the FlowStep configuration: add task to configured queue - curator.queue(c, item.getID().toString(), step.queue); - } else { - // Task is configured to be run automatically - curator.curate(c, item); + } + + if (StringUtils.isNotEmpty(step.queue)) { // Step's tasks are to be queued. + curator.queue(c, item.getID().toString(), step.queue); + } else { // Step's tasks are to be run now. + curator.curate(c, item); + + for (Task task : step.tasks) { int status = curator.getStatus(task.name); String result = curator.getResult(task.name); String action = "none"; @@ -183,14 +184,14 @@ public boolean curate(Curator curator, Context c, XmlWorkflowItem wfi) } } curator.clear(); - } - // Record any reporting done by the tasks. - if (reporter.length() > 0) { - LOG.info("Curation tasks over item {} for step {} report:%n{}", - () -> wfi.getItem().getID(), - () -> step.step, - () -> reporter.toString()); + // Record any reporting done by the tasks. + if (reporter.length() > 0) { + LOG.info("Curation tasks over item {} for step {} report:\n{}", + () -> wfi.getItem().getID(), + () -> step.step, + () -> reporter.toString()); + } } } return true; diff --git a/dspace-api/src/main/java/org/dspace/curate/package-info.java b/dspace-api/src/main/java/org/dspace/curate/package-info.java index 492642f60c57..1168bbd283d2 100644 --- a/dspace-api/src/main/java/org/dspace/curate/package-info.java +++ b/dspace-api/src/main/java/org/dspace/curate/package-info.java @@ -20,6 +20,8 @@ * * *

Curation requests may be run immediately or queued for batch processing. + * See {@link TaskQueue} and its relatives, {@link Curation} and its relatives + * for more on queued curation. * *

Tasks may also be attached to a workflow step, so that a set of tasks is * applied to each uninstalled Item which passes through that step. See @@ -27,5 +29,15 @@ * *

A task may return to the Curator a status code, a final status message, * and an optional report character stream. + * + *

The {@link Reporter} classes absorb strings of text and preserve it in + * various ways. A Reporter is a simple {@link Appendable} and makes no + * assumptions about e.g. whether a string represents a complete line. If you + * want your report formatted, insert appropriate newlines and other whitespace + * as needed. Your tasks can emit marked-up text if you wish, but the stock + * Reporter implementations make no attempt to render it. + * + *

Tasks may be annotated to inform the Curator of special properties. See + * {@link Distributive}, {@link Mutative}, {@link Suspendable} etc. */ package org.dspace.curate; From 6a8c76bbe1e7149785c17c7a7249e319199c3e0a Mon Sep 17 00:00:00 2001 From: Mikhail Schastlivtsev Date: Wed, 15 May 2024 10:08:46 +0300 Subject: [PATCH 02/96] add missing wosPublisherContrib key-ref in wos-integration.xml (#9579) --- dspace/config/spring/api/wos-integration.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/dspace/config/spring/api/wos-integration.xml b/dspace/config/spring/api/wos-integration.xml index 17bd53c04a4d..ba90363a2e60 100644 --- a/dspace/config/spring/api/wos-integration.xml +++ b/dspace/config/spring/api/wos-integration.xml @@ -35,6 +35,7 @@ + From d923432dd7d0f8a581ff04e6ecfb045f46cdfaf0 Mon Sep 17 00:00:00 2001 From: Mattia Vianelli Date: Wed, 5 Jun 2024 16:45:58 +0200 Subject: [PATCH 03/96] DURACOM-265 Property to enable or disable the cclicense required validation --- dspace/config/dspace.cfg | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dspace/config/dspace.cfg b/dspace/config/dspace.cfg index 43f12d557f68..37e10c094839 100644 --- a/dspace/config/dspace.cfg +++ b/dspace/config/dspace.cfg @@ -996,6 +996,11 @@ metadata.hide.person.email = true # dspace-angular environment configuration property submission.typeBind.field #submit.type-bind.field = dc.type +# Wheter or not we REQUIRE that the cclicense is provided +# during the cclicense step in the submission process +# Defaults to false; If you set to 'true', submitter needs to provide cclicense +#cc.license.required = true + #### Creative Commons settings ###### # The url to the web service API From 90f4cabdedc4ba35e385f11d95c860cf021c34c7 Mon Sep 17 00:00:00 2001 From: Mattia Vianelli Date: Wed, 5 Jun 2024 16:46:50 +0200 Subject: [PATCH 04/96] DURACOM-265 provided bean for cclicense validation in dspace-addon-validation --- .../spring/spring-dspace-addon-validation-services.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dspace-server-webapp/src/main/resources/spring/spring-dspace-addon-validation-services.xml b/dspace-server-webapp/src/main/resources/spring/spring-dspace-addon-validation-services.xml index 013b406c1af9..50204bf5c4fb 100644 --- a/dspace-server-webapp/src/main/resources/spring/spring-dspace-addon-validation-services.xml +++ b/dspace-server-webapp/src/main/resources/spring/spring-dspace-addon-validation-services.xml @@ -27,6 +27,11 @@ + + + + + From 355cd4c614776720ff6d54dc686db047b3cc33b6 Mon Sep 17 00:00:00 2001 From: Mattia Vianelli Date: Wed, 5 Jun 2024 16:47:58 +0200 Subject: [PATCH 05/96] DURACOM-265 provided CclicenseValidator class --- .../step/validation/CclicenseValidator.java | 133 ++++++++++++++++++ 1 file changed, 133 insertions(+) create mode 100644 dspace-server-webapp/src/main/java/org/dspace/app/rest/submit/step/validation/CclicenseValidator.java diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/submit/step/validation/CclicenseValidator.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/submit/step/validation/CclicenseValidator.java new file mode 100644 index 000000000000..2fea5ed2d303 --- /dev/null +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/submit/step/validation/CclicenseValidator.java @@ -0,0 +1,133 @@ +/** + * 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.rest.submit.step.validation; + +import org.dspace.app.rest.model.ErrorRest; +import org.dspace.app.rest.submit.SubmissionService; +import org.dspace.app.util.DCInputsReaderException; +import org.dspace.app.util.SubmissionStepConfig; +import org.dspace.content.InProgressSubmission; +import org.dspace.content.Item; +import org.dspace.content.service.ItemService; +import org.dspace.license.CreativeCommonsServiceImpl; +import org.dspace.services.ConfigurationService; +import org.springframework.beans.factory.annotation.Autowired; + +import javax.inject.Inject; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +import static org.dspace.app.rest.repository.WorkspaceItemRestRepository.OPERATION_PATH_SECTIONS; + + +/** + * This class validates that the Creative Commons License has been granted for the + * in-progress submission. + * + * @author Mattia Vianelli (Mattia.Vianelli@4science.com) + */ +public class CclicenseValidator extends AbstractValidation { + + /** + * Construct a Creative Commons License configuration. + * @param configurationService DSpace configuration provided by the DI container. + */ + @Inject + public CclicenseValidator(ConfigurationService configurationService) { + this.configurationService = configurationService; + } + + private final ConfigurationService configurationService; + + @Autowired + private ItemService itemService; + + @Autowired + private CreativeCommonsServiceImpl creativeCommonsService; + + public static final String ERROR_VALIDATION_CCLICENSEREQUIRED = "error.validation.cclicense.required"; + + private String name; + + private Boolean required; + + /** + * Validate the license of the item. + * @param item The item whose cclicense is to be validated. + * @param config The configuration for the submission step for cclicense. + * @return A list of validation errors. + */ + private List validateLicense(Item item, SubmissionStepConfig config) { + List errors = new ArrayList<>(); + + String licenseURI = creativeCommonsService.getLicenseURI(item); + if (licenseURI == null || licenseURI.isBlank()) { + addError(errors, ERROR_VALIDATION_CCLICENSEREQUIRED, "/" + OPERATION_PATH_SECTIONS + "/" + config.getId()); + } + + return errors; + } + + public ItemService getItemService() { + return itemService; + } + + public void setItemService(ItemService itemService) { + this.itemService = itemService; + } + + /** + * Check if at least one Creative Commons License is required when submitting a new Item. + * @return true if a Creative Commons License is required setting true for the property cc.license.required. + */ + public Boolean isRequired() { + if (required == null) { + return configurationService.getBooleanProperty("cc.license.required", false); + } + return required; + } + + /** + * Set whether at least one Creative Commons License is required when submitting a new Item. + * @param required true if a Creative Commons License is required. + */ + public void setRequired(Boolean required) { + this.required = required; + } + + @Override + public String getName() { + return name; + } + + /** + * Perform validation on the item and config(ccLicense). + * @param obj The submission to be validated. + * @param config The configuration for the submission step for cclicense. + * @return A list of validation errors. + * @throws SQLException If there is a problem accessing the database. + */ + + @Override + public List validate(SubmissionService submissionService, InProgressSubmission obj, SubmissionStepConfig config) throws DCInputsReaderException, SQLException { + List errors = new ArrayList<>(); + + + if (this.isRequired() && obj != null && obj.getItem() != null) { + errors.addAll(validateLicense(obj.getItem(), config)); + } + + return errors; + } + + public void setName(String name) { + this.name = name; + } + +} From bffa457e1617443cd8f33ef46a0bea777c764edf Mon Sep 17 00:00:00 2001 From: Mattia Vianelli Date: Wed, 5 Jun 2024 16:48:31 +0200 Subject: [PATCH 06/96] DURACOM-265 provided test case for cclicense validation --- .../rest/WorkspaceItemRestRepositoryIT.java | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/WorkspaceItemRestRepositoryIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/WorkspaceItemRestRepositoryIT.java index 542688ea2396..ecc2311eb387 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/WorkspaceItemRestRepositoryIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/WorkspaceItemRestRepositoryIT.java @@ -9785,4 +9785,47 @@ public void patchReplaceProvidingWrongPrimaryTest() throws Exception { .andExpect(status().isOk()) .andExpect(jsonPath("$.sections.upload.primary", is(idFirstPdf.get()))); } + + @Test + public void createWorkspaceWithoutCclicense_CclicenseRequired() throws Exception { + context.turnOffAuthorisationSystem(); + + //1. A community-collection structure with one parent community with sub-community and one collection. + parentCommunity = CommunityBuilder.createCommunity(context) + .withName("Parent Community") + .build(); + Community child1 = CommunityBuilder.createSubCommunity(context, parentCommunity) + .withName("Sub Community") + .build(); + Collection col1 = CollectionBuilder.createCollection(context, child1) + .withName("Collection 1") + .withSubmitterGroup(eperson) + .build(); + + String authToken = getAuthToken(eperson.getEmail(), password); + + //disable file upload mandatory + configurationService.setProperty("webui.submit.upload.required", false); + configurationService.setProperty("cc.license.required", true); + + context.restoreAuthSystemState(); + + AtomicReference idRef = new AtomicReference<>(); + try { + // create an empty workspaceitem explicitly in the col1, check validation on creation + getClient(authToken).perform(post("/api/submission/workspaceitems") + .param("owningCollection", col1.getID().toString()) + .contentType(org.springframework.http.MediaType.APPLICATION_JSON)) + .andExpect(status().isCreated()) + // cclicense is required + .andExpect(jsonPath("$.errors[?(@.message=='error.validation.cclicense.required')]", + contains( + hasJsonPath("$.paths", contains( + hasJsonPath("$", Matchers.is("/sections/cclicense")) + ))))) + .andDo(result -> idRef.set(read(result.getResponse().getContentAsString(), "$.id"))); + } finally { + WorkspaceItemBuilder.deleteWorkspaceItem(idRef.get()); + } + } } From b0c0bf8b419b39127fe6a8f4db5bfa39a4418a81 Mon Sep 17 00:00:00 2001 From: Mattia Vianelli Date: Wed, 5 Jun 2024 17:13:04 +0200 Subject: [PATCH 07/96] DURACOM-265 checkstyle fix --- .../step/validation/CclicenseValidator.java | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/submit/step/validation/CclicenseValidator.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/submit/step/validation/CclicenseValidator.java index 2fea5ed2d303..def59ea105c7 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/submit/step/validation/CclicenseValidator.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/submit/step/validation/CclicenseValidator.java @@ -7,6 +7,13 @@ */ package org.dspace.app.rest.submit.step.validation; +import static org.dspace.app.rest.repository.WorkspaceItemRestRepository.OPERATION_PATH_SECTIONS; + +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; +import javax.inject.Inject; + import org.dspace.app.rest.model.ErrorRest; import org.dspace.app.rest.submit.SubmissionService; import org.dspace.app.util.DCInputsReaderException; @@ -18,14 +25,6 @@ import org.dspace.services.ConfigurationService; import org.springframework.beans.factory.annotation.Autowired; -import javax.inject.Inject; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.List; - -import static org.dspace.app.rest.repository.WorkspaceItemRestRepository.OPERATION_PATH_SECTIONS; - - /** * This class validates that the Creative Commons License has been granted for the * in-progress submission. @@ -115,7 +114,10 @@ public String getName() { */ @Override - public List validate(SubmissionService submissionService, InProgressSubmission obj, SubmissionStepConfig config) throws DCInputsReaderException, SQLException { + public List validate(SubmissionService submissionService, + InProgressSubmission obj, + SubmissionStepConfig config) + throws DCInputsReaderException, SQLException { List errors = new ArrayList<>(); From a9e120f3d434ece061dcaf7371822b9201eac655 Mon Sep 17 00:00:00 2001 From: Andrew Date: Mon, 17 Jun 2024 13:02:33 +0200 Subject: [PATCH 08/96] feat: new parameter "fromdate" to evaluate items only from certain date --- .../app/mediafilter/MediaFilterScript.java | 15 +++++++++++++-- .../MediaFilterScriptConfiguration.java | 2 ++ .../mediafilter/MediaFilterServiceImpl.java | 18 ++++++++++++++++++ .../service/MediaFilterService.java | 3 +++ 4 files changed, 36 insertions(+), 2 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/app/mediafilter/MediaFilterScript.java b/dspace-api/src/main/java/org/dspace/app/mediafilter/MediaFilterScript.java index 5fbbebbb28cc..71c0d6e14ddb 100644 --- a/dspace-api/src/main/java/org/dspace/app/mediafilter/MediaFilterScript.java +++ b/dspace-api/src/main/java/org/dspace/app/mediafilter/MediaFilterScript.java @@ -7,6 +7,7 @@ */ package org.dspace.app.mediafilter; +import java.time.LocalDate; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -37,8 +38,9 @@ * MFM: -v verbose outputs all extracted text to STDOUT; -f force forces all * bitstreams to be processed, even if they have been before; -n noindex does not * recreate index after processing bitstreams; -i [identifier] limits processing - * scope to a community, collection or item; and -m [max] limits processing to a - * maximum number of items. + * scope to a community, collection or item; -m [max] limits processing to a + * maximum number of items; -fd [fromdate] takes only items starting from this date, + * filtering by last_modified in the item table. */ public class MediaFilterScript extends DSpaceRunnable { @@ -60,6 +62,7 @@ public class MediaFilterScript extends DSpaceRunnable> filterFormats = new HashMap<>(); + private LocalDate fromDate = null; public MediaFilterScriptConfiguration getScriptConfiguration() { return new DSpace().getServiceManager() @@ -112,6 +115,10 @@ public void setup() throws ParseException { skipIds = commandLine.getOptionValues('s'); } + if (commandLine.hasOption('f')) { + fromDate = LocalDate.parse(commandLine.getOptionValue('f')); + } + } @@ -215,6 +222,10 @@ public void internalRun() throws Exception { mediaFilterService.setSkipList(Arrays.asList(skipIds)); } + if (fromDate != null) { + mediaFilterService.setFromDate(fromDate); + } + Context c = null; try { diff --git a/dspace-api/src/main/java/org/dspace/app/mediafilter/MediaFilterScriptConfiguration.java b/dspace-api/src/main/java/org/dspace/app/mediafilter/MediaFilterScriptConfiguration.java index 7465fa6e1279..9f62f19e8367 100644 --- a/dspace-api/src/main/java/org/dspace/app/mediafilter/MediaFilterScriptConfiguration.java +++ b/dspace-api/src/main/java/org/dspace/app/mediafilter/MediaFilterScriptConfiguration.java @@ -52,6 +52,8 @@ public Options getOptions() { .build(); options.addOption(pluginOption); + options.addOption("fd", "fromdate", true, "Process only item from specified last modified date"); + Option skipOption = Option.builder("s") .longOpt("skip") .hasArg() diff --git a/dspace-api/src/main/java/org/dspace/app/mediafilter/MediaFilterServiceImpl.java b/dspace-api/src/main/java/org/dspace/app/mediafilter/MediaFilterServiceImpl.java index a6ba9fde88d9..512b8f803b9b 100644 --- a/dspace-api/src/main/java/org/dspace/app/mediafilter/MediaFilterServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/app/mediafilter/MediaFilterServiceImpl.java @@ -9,8 +9,11 @@ import java.io.InputStream; import java.sql.SQLException; +import java.time.LocalDate; +import java.time.ZoneId; import java.util.ArrayList; import java.util.Collections; +import java.util.Date; import java.util.HashMap; import java.util.Iterator; import java.util.List; @@ -93,6 +96,7 @@ public class MediaFilterServiceImpl implements MediaFilterService, InitializingB protected boolean isVerbose = false; protected boolean isQuiet = false; protected boolean isForce = false; // default to not forced + protected LocalDate fromDate = null; protected MediaFilterServiceImpl() { @@ -120,6 +124,15 @@ public void applyFiltersAllItems(Context context) throws Exception { for (Community topLevelCommunity : topLevelCommunities) { applyFiltersCommunity(context, topLevelCommunity); } + } else if (fromDate != null) { + Iterator itemIterator = + itemService.findByLastModifiedSince( + context, + Date.from(fromDate.atStartOfDay(ZoneId.systemDefault()).toInstant()) + ); + while (itemIterator.hasNext() && processed < max2Process) { + applyFiltersItem(context, itemIterator.next()); + } } else { //otherwise, just find every item and process Iterator itemIterator = itemService.findAll(context); @@ -588,4 +601,9 @@ public void setFilterFormats(Map> filterFormats) { public void setLogHandler(DSpaceRunnableHandler handler) { this.handler = handler; } + + @Override + public void setFromDate(LocalDate fromDate) { + this.fromDate = fromDate; + } } diff --git a/dspace-api/src/main/java/org/dspace/app/mediafilter/service/MediaFilterService.java b/dspace-api/src/main/java/org/dspace/app/mediafilter/service/MediaFilterService.java index bc92ff521098..30e6dba42f08 100644 --- a/dspace-api/src/main/java/org/dspace/app/mediafilter/service/MediaFilterService.java +++ b/dspace-api/src/main/java/org/dspace/app/mediafilter/service/MediaFilterService.java @@ -8,6 +8,7 @@ package org.dspace.app.mediafilter.service; import java.sql.SQLException; +import java.time.LocalDate; import java.util.List; import java.util.Map; @@ -149,4 +150,6 @@ public void updatePoliciesOfDerivativeBitstreams(Context context, Item item, Bit * @param handler */ public void setLogHandler(DSpaceRunnableHandler handler); + + public void setFromDate(LocalDate fromDate); } From cde892c8c7e1df8fff70a4cbfc693f378c2065d2 Mon Sep 17 00:00:00 2001 From: Mikhail Schastlivtsev Date: Mon, 17 Jun 2024 14:06:53 +0300 Subject: [PATCH 09/96] add missing publisher metadatum in test (#9579) --- .../org/dspace/app/rest/WOSImportMetadataSourceServiceIT.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/WOSImportMetadataSourceServiceIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/WOSImportMetadataSourceServiceIT.java index f1d3f5303ec0..9f68d79c2036 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/WOSImportMetadataSourceServiceIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/WOSImportMetadataSourceServiceIT.java @@ -136,6 +136,7 @@ private ArrayList getRecords() { MetadatumDTO subject15 = createMetadatumDTO("dc", "subject", null, "Coding concepts"); MetadatumDTO subject16 = createMetadatumDTO("dc", "subject", null, "Lesson design"); MetadatumDTO subject17 = createMetadatumDTO("dc", "subject", null, "Social Sciences"); + MetadatumDTO publisher = createMetadatumDTO("dc", "publisher", null, "SPRINGER"); MetadatumDTO other = createMetadatumDTO("dc", "identifier", "other", "WOS:000805105200003"); metadatums.add(edition); metadatums.add(date); @@ -166,6 +167,7 @@ private ArrayList getRecords() { metadatums.add(subject15); metadatums.add(subject16); metadatums.add(subject17); + metadatums.add(publisher); metadatums.add(other); ImportRecord firstrRecord = new ImportRecord(metadatums); @@ -205,6 +207,7 @@ private ArrayList getRecords() { MetadatumDTO subject26 = createMetadatumDTO("dc", "subject", null, "Social Sciences"); MetadatumDTO subject27 = createMetadatumDTO("dc", "subject", null, "Science & Technology"); MetadatumDTO subject28 = createMetadatumDTO("dc", "subject", null, "Life Sciences & Biomedicine"); + MetadatumDTO publisher2 = createMetadatumDTO("dc", "publisher", null, "NATURE PORTFOLIO"); MetadatumDTO other2 = createMetadatumDTO("dc", "identifier", "other", "WOS:000805100600001"); MetadatumDTO rid = createMetadatumDTO("person", "identifier", "rid", "C-6334-2011"); MetadatumDTO rid2 = createMetadatumDTO("person", "identifier", "rid", "B-1251-2008"); @@ -236,6 +239,7 @@ private ArrayList getRecords() { metadatums2.add(subject26); metadatums2.add(subject27); metadatums2.add(subject28); + metadatums2.add(publisher2); metadatums2.add(other2); metadatums2.add(rid); metadatums2.add(rid2); From 2f6b7f3ee4b0c40d215730dd2e86f4492a455e77 Mon Sep 17 00:00:00 2001 From: Andrew Date: Mon, 17 Jun 2024 13:57:39 +0200 Subject: [PATCH 10/96] refactor: changed short parameter fd to d --- .../main/java/org/dspace/app/mediafilter/MediaFilterScript.java | 2 +- .../dspace/app/mediafilter/MediaFilterScriptConfiguration.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/app/mediafilter/MediaFilterScript.java b/dspace-api/src/main/java/org/dspace/app/mediafilter/MediaFilterScript.java index 71c0d6e14ddb..e76feada0339 100644 --- a/dspace-api/src/main/java/org/dspace/app/mediafilter/MediaFilterScript.java +++ b/dspace-api/src/main/java/org/dspace/app/mediafilter/MediaFilterScript.java @@ -115,7 +115,7 @@ public void setup() throws ParseException { skipIds = commandLine.getOptionValues('s'); } - if (commandLine.hasOption('f')) { + if (commandLine.hasOption('d')) { fromDate = LocalDate.parse(commandLine.getOptionValue('f')); } diff --git a/dspace-api/src/main/java/org/dspace/app/mediafilter/MediaFilterScriptConfiguration.java b/dspace-api/src/main/java/org/dspace/app/mediafilter/MediaFilterScriptConfiguration.java index 9f62f19e8367..c9f61292d617 100644 --- a/dspace-api/src/main/java/org/dspace/app/mediafilter/MediaFilterScriptConfiguration.java +++ b/dspace-api/src/main/java/org/dspace/app/mediafilter/MediaFilterScriptConfiguration.java @@ -52,7 +52,7 @@ public Options getOptions() { .build(); options.addOption(pluginOption); - options.addOption("fd", "fromdate", true, "Process only item from specified last modified date"); + options.addOption("d", "fromdate", true, "Process only item from specified last modified date"); Option skipOption = Option.builder("s") .longOpt("skip") From 3fd88b867eb9bbd8b3621904ecac5b845fc7346e Mon Sep 17 00:00:00 2001 From: Andrew Date: Mon, 17 Jun 2024 16:39:02 +0200 Subject: [PATCH 11/96] refactor: changed short parameter fd to d --- .../main/java/org/dspace/app/mediafilter/MediaFilterScript.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dspace-api/src/main/java/org/dspace/app/mediafilter/MediaFilterScript.java b/dspace-api/src/main/java/org/dspace/app/mediafilter/MediaFilterScript.java index e76feada0339..7f022f38b318 100644 --- a/dspace-api/src/main/java/org/dspace/app/mediafilter/MediaFilterScript.java +++ b/dspace-api/src/main/java/org/dspace/app/mediafilter/MediaFilterScript.java @@ -116,7 +116,7 @@ public void setup() throws ParseException { } if (commandLine.hasOption('d')) { - fromDate = LocalDate.parse(commandLine.getOptionValue('f')); + fromDate = LocalDate.parse(commandLine.getOptionValue('d')); } From c5d08f037cb56111b8ef047279f323c06b11a864 Mon Sep 17 00:00:00 2001 From: Kristof De Langhe Date: Tue, 18 Jun 2024 13:52:38 +0200 Subject: [PATCH 12/96] 115693: data-cite xsl targetting dc.identifier.uri fixes doi registration error --- .../main/java/org/dspace/identifier/DOIIdentifierProvider.java | 1 + dspace/config/crosswalks/DIM2DataCite.xsl | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/dspace-api/src/main/java/org/dspace/identifier/DOIIdentifierProvider.java b/dspace-api/src/main/java/org/dspace/identifier/DOIIdentifierProvider.java index ae31e54f7e96..aff4666fff4b 100644 --- a/dspace-api/src/main/java/org/dspace/identifier/DOIIdentifierProvider.java +++ b/dspace-api/src/main/java/org/dspace/identifier/DOIIdentifierProvider.java @@ -70,6 +70,7 @@ public class DOIIdentifierProvider extends FilteredIdentifierProvider { static final char SLASH = '/'; // Metadata field name elements + // Warning: If this metadata field is changed for whatever reason, DIM2DataCite.xsl's template needs to reflect this // TODO: move these to MetadataSchema or some such? public static final String MD_SCHEMA = "dc"; public static final String DOI_ELEMENT = "identifier"; diff --git a/dspace/config/crosswalks/DIM2DataCite.xsl b/dspace/config/crosswalks/DIM2DataCite.xsl index a97d127694ef..d57996e6d8cf 100644 --- a/dspace/config/crosswalks/DIM2DataCite.xsl +++ b/dspace/config/crosswalks/DIM2DataCite.xsl @@ -333,7 +333,8 @@ company as well. We have to ensure to use URIs of our prefix as primary identifiers only. --> - + + From edfb8920ccd315f8166193cdfb42bb34fd71cae8 Mon Sep 17 00:00:00 2001 From: Mattia Vianelli Date: Mon, 24 Jun 2024 18:40:18 +0200 Subject: [PATCH 13/96] DURACOM-265 Code improvement after review --- .../step/validation/CclicenseValidator.java | 25 ++++--------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/submit/step/validation/CclicenseValidator.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/submit/step/validation/CclicenseValidator.java index def59ea105c7..d0cfd14ec8c5 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/submit/step/validation/CclicenseValidator.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/submit/step/validation/CclicenseValidator.java @@ -54,8 +54,6 @@ public CclicenseValidator(ConfigurationService configurationService) { private String name; - private Boolean required; - /** * Validate the license of the item. * @param item The item whose cclicense is to be validated. @@ -63,7 +61,7 @@ public CclicenseValidator(ConfigurationService configurationService) { * @return A list of validation errors. */ private List validateLicense(Item item, SubmissionStepConfig config) { - List errors = new ArrayList<>(); + List errors = new ArrayList<>(1); String licenseURI = creativeCommonsService.getLicenseURI(item); if (licenseURI == null || licenseURI.isBlank()) { @@ -86,18 +84,7 @@ public void setItemService(ItemService itemService) { * @return true if a Creative Commons License is required setting true for the property cc.license.required. */ public Boolean isRequired() { - if (required == null) { - return configurationService.getBooleanProperty("cc.license.required", false); - } - return required; - } - - /** - * Set whether at least one Creative Commons License is required when submitting a new Item. - * @param required true if a Creative Commons License is required. - */ - public void setRequired(Boolean required) { - this.required = required; + return configurationService.getBooleanProperty("cc.license.required", false); } @Override @@ -118,14 +105,12 @@ public List validate(SubmissionService submissionService, InProgressSubmission obj, SubmissionStepConfig config) throws DCInputsReaderException, SQLException { - List errors = new ArrayList<>(); - if (this.isRequired() && obj != null && obj.getItem() != null) { - errors.addAll(validateLicense(obj.getItem(), config)); + return validateLicense(obj.getItem(), config); + } else { + return List.of(); } - - return errors; } public void setName(String name) { From 021e42434731e505245b3aa149eaf59a5fbccb94 Mon Sep 17 00:00:00 2001 From: Kristof De Langhe Date: Thu, 27 Jun 2024 10:59:36 +0200 Subject: [PATCH 14/96] 115693: DataCiteConnector fallback for blank metadata doi --- .../main/java/org/dspace/identifier/doi/DataCiteConnector.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dspace-api/src/main/java/org/dspace/identifier/doi/DataCiteConnector.java b/dspace-api/src/main/java/org/dspace/identifier/doi/DataCiteConnector.java index 931f1538583e..0fbac1a9f52b 100644 --- a/dspace-api/src/main/java/org/dspace/identifier/doi/DataCiteConnector.java +++ b/dspace-api/src/main/java/org/dspace/identifier/doi/DataCiteConnector.java @@ -15,6 +15,7 @@ import java.util.Iterator; import java.util.Map; +import org.apache.commons.lang.StringUtils; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.StatusLine; @@ -410,7 +411,7 @@ public void reserveDOI(Context context, DSpaceObject dso, String doi) } String metadataDOI = extractDOI(root); - if (null == metadataDOI) { + if (StringUtils.isBlank(metadataDOI)) { // The DOI will be saved as metadata of dso after successful // registration. To register a doi it has to be part of the metadata // sent to DataCite. So we add it to the XML we'll send to DataCite From 428489ca5258ea7ac6942a722621e22c3371bfcf Mon Sep 17 00:00:00 2001 From: Sascha Szott Date: Wed, 3 Jul 2024 13:23:32 +0200 Subject: [PATCH 15/96] update eperson's attributes right after successful login --- .../authenticate/LDAPAuthentication.java | 69 +++++++++++-------- 1 file changed, 42 insertions(+), 27 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/authenticate/LDAPAuthentication.java b/dspace-api/src/main/java/org/dspace/authenticate/LDAPAuthentication.java index b791df15b5c0..c6df4b30faad 100644 --- a/dspace-api/src/main/java/org/dspace/authenticate/LDAPAuthentication.java +++ b/dspace-api/src/main/java/org/dspace/authenticate/LDAPAuthentication.java @@ -68,12 +68,8 @@ * @author Ivan Masár * @author Michael Plate */ -public class LDAPAuthentication - implements AuthenticationMethod { +public class LDAPAuthentication implements AuthenticationMethod { - /** - * log4j category - */ private static final Logger log = org.apache.logging.log4j.LogManager.getLogger(LDAPAuthentication.class); @@ -130,7 +126,7 @@ public boolean allowSetPassword(Context context, return false; } - /* + /** * This is an explicit method. */ @Override @@ -138,7 +134,7 @@ public boolean isImplicit() { return false; } - /* + /** * Add authenticated users to the group defined in dspace.cfg by * the login.specialgroup key. */ @@ -177,7 +173,7 @@ public List getSpecialGroups(Context context, HttpServletRequest request) return Collections.EMPTY_LIST; } - /* + /** * Authenticate the given credentials. * This is the heart of the authentication method: test the * credentials for authenticity, and if accepted, attempt to match @@ -250,7 +246,7 @@ public int authenticate(Context context, } // Check a DN was found - if ((dn == null) || (dn.trim().equals(""))) { + if (StringUtils.isBlank(dn)) { log.info(LogHelper .getHeader(context, "failed_login", "no DN found for user " + netid)); return BAD_CREDENTIALS; @@ -269,6 +265,18 @@ public int authenticate(Context context, context.setCurrentUser(eperson); request.setAttribute(LDAP_AUTHENTICATED, true); + // update eperson's attributes + context.turnOffAuthorisationSystem(); + setEpersonAttributes(context, eperson, ldap, Optional.empty()); + try { + ePersonService.update(context, eperson); + context.dispatchEvents(); + } catch (AuthorizeException e) { + log.warn("update of eperson " + eperson.getID() + " failed", e); + } finally { + context.restoreAuthSystemState(); + } + // assign user to groups based on ldap dn assignGroups(dn, ldap.ldapGroup, context); @@ -313,14 +321,13 @@ public int authenticate(Context context, log.info(LogHelper.getHeader(context, "type=ldap-login", "type=ldap_but_already_email")); context.turnOffAuthorisationSystem(); - eperson.setNetid(netid.toLowerCase()); + setEpersonAttributes(context, eperson, ldap, Optional.of(netid)); ePersonService.update(context, eperson); context.dispatchEvents(); context.restoreAuthSystemState(); context.setCurrentUser(eperson); request.setAttribute(LDAP_AUTHENTICATED, true); - // assign user to groups based on ldap dn assignGroups(dn, ldap.ldapGroup, context); @@ -331,20 +338,7 @@ public int authenticate(Context context, try { context.turnOffAuthorisationSystem(); eperson = ePersonService.create(context); - if (StringUtils.isNotEmpty(email)) { - eperson.setEmail(email); - } - if (StringUtils.isNotEmpty(ldap.ldapGivenName)) { - eperson.setFirstName(context, ldap.ldapGivenName); - } - if (StringUtils.isNotEmpty(ldap.ldapSurname)) { - eperson.setLastName(context, ldap.ldapSurname); - } - if (StringUtils.isNotEmpty(ldap.ldapPhone)) { - ePersonService.setMetadataSingleValue(context, eperson, - MD_PHONE, ldap.ldapPhone, null); - } - eperson.setNetid(netid.toLowerCase()); + setEpersonAttributes(context, eperson, ldap, Optional.of(netid)); eperson.setCanLogIn(true); authenticationService.initEPerson(context, request, eperson); ePersonService.update(context, eperson); @@ -382,6 +376,27 @@ public int authenticate(Context context, return BAD_ARGS; } + /** + * Update eperson's attributes + */ + private void setEpersonAttributes(Context context, EPerson eperson, SpeakerToLDAP ldap, Optional netid) throws SQLException { + if (StringUtils.isNotEmpty(ldap.ldapEmail)) { + eperson.setEmail(ldap.ldapEmail); + } + if (StringUtils.isNotEmpty(ldap.ldapGivenName)) { + eperson.setFirstName(context, ldap.ldapGivenName); + } + if (StringUtils.isNotEmpty(ldap.ldapSurname)) { + eperson.setLastName(context, ldap.ldapSurname); + } + if (StringUtils.isNotEmpty(ldap.ldapPhone)) { + ePersonService.setMetadataSingleValue(context, eperson, MD_PHONE, ldap.ldapPhone, null); + } + if (netid.isPresent()) { + eperson.setNetid(netid.get().toLowerCase()); + } + } + /** * Internal class to manage LDAP query and results, mainly * because there are multiple values to return. @@ -671,7 +686,7 @@ protected boolean ldapAuthenticate(String netid, String password, } } - /* + /** * Returns the URL of an external login page which is not applicable for this authn method. * * Note: Prior to DSpace 7, this method return the page of login servlet. @@ -699,7 +714,7 @@ public String getName() { return "ldap"; } - /* + /** * Add authenticated users to the group defined in dspace.cfg by * the authentication-ldap.login.groupmap.* key. * From c5ad32a9b3ece7e64043f9f39d22b594e913737f Mon Sep 17 00:00:00 2001 From: Sascha Szott Date: Wed, 3 Jul 2024 13:36:45 +0200 Subject: [PATCH 16/96] add missing import --- .../main/java/org/dspace/authenticate/LDAPAuthentication.java | 1 + 1 file changed, 1 insertion(+) diff --git a/dspace-api/src/main/java/org/dspace/authenticate/LDAPAuthentication.java b/dspace-api/src/main/java/org/dspace/authenticate/LDAPAuthentication.java index c6df4b30faad..9ca5245c54ba 100644 --- a/dspace-api/src/main/java/org/dspace/authenticate/LDAPAuthentication.java +++ b/dspace-api/src/main/java/org/dspace/authenticate/LDAPAuthentication.java @@ -17,6 +17,7 @@ import java.util.Hashtable; import java.util.Iterator; import java.util.List; +import java.util.Optional; import javax.naming.NamingEnumeration; import javax.naming.NamingException; import javax.naming.directory.Attribute; From aaa74b88c99af8ece67d43fa412a39a7406fe10c Mon Sep 17 00:00:00 2001 From: Sascha Szott Date: Wed, 3 Jul 2024 13:54:53 +0200 Subject: [PATCH 17/96] fix Checkstyle violations --- .../org/dspace/authenticate/LDAPAuthentication.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/authenticate/LDAPAuthentication.java b/dspace-api/src/main/java/org/dspace/authenticate/LDAPAuthentication.java index 9ca5245c54ba..4f2c5cc3d02c 100644 --- a/dspace-api/src/main/java/org/dspace/authenticate/LDAPAuthentication.java +++ b/dspace-api/src/main/java/org/dspace/authenticate/LDAPAuthentication.java @@ -184,7 +184,7 @@ public List getSpecialGroups(Context context, HttpServletRequest request) * @param context * DSpace context, will be modified (ePerson set) upon success. * - * @param username + * @param netid * Username (or email address) when method is explicit. Use null for * implicit method. * @@ -322,7 +322,7 @@ public int authenticate(Context context, log.info(LogHelper.getHeader(context, "type=ldap-login", "type=ldap_but_already_email")); context.turnOffAuthorisationSystem(); - setEpersonAttributes(context, eperson, ldap, Optional.of(netid)); + setEpersonAttributes(context, eperson, ldap, Optional.of(netid)); ePersonService.update(context, eperson); context.dispatchEvents(); context.restoreAuthSystemState(); @@ -380,7 +380,9 @@ public int authenticate(Context context, /** * Update eperson's attributes */ - private void setEpersonAttributes(Context context, EPerson eperson, SpeakerToLDAP ldap, Optional netid) throws SQLException { + private void setEpersonAttributes(Context context, EPerson eperson, SpeakerToLDAP ldap, Optional netid) + throws SQLException { + if (StringUtils.isNotEmpty(ldap.ldapEmail)) { eperson.setEmail(ldap.ldapEmail); } @@ -389,7 +391,7 @@ private void setEpersonAttributes(Context context, EPerson eperson, SpeakerToLDA } if (StringUtils.isNotEmpty(ldap.ldapSurname)) { eperson.setLastName(context, ldap.ldapSurname); - } + } if (StringUtils.isNotEmpty(ldap.ldapPhone)) { ePersonService.setMetadataSingleValue(context, eperson, MD_PHONE, ldap.ldapPhone, null); } From 076f1f233ea0eef1a37ed4087f34008d1e92e40a Mon Sep 17 00:00:00 2001 From: Sascha Szott Date: Mon, 8 Jul 2024 19:26:11 +0200 Subject: [PATCH 18/96] change order of name parts: familyName, givenName --- .../external/crossref/CrossRefAuthorMetadataProcessor.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/importer/external/crossref/CrossRefAuthorMetadataProcessor.java b/dspace-api/src/main/java/org/dspace/importer/external/crossref/CrossRefAuthorMetadataProcessor.java index abf84f52d058..b9b384f8ed77 100644 --- a/dspace-api/src/main/java/org/dspace/importer/external/crossref/CrossRefAuthorMetadataProcessor.java +++ b/dspace-api/src/main/java/org/dspace/importer/external/crossref/CrossRefAuthorMetadataProcessor.java @@ -42,8 +42,8 @@ public Collection processMetadata(String json) { JsonNode author = authors.next(); String givenName = author.at("/given").textValue(); String familyName = author.at("/family").textValue(); - if (StringUtils.isNoneBlank(givenName) && StringUtils.isNoneBlank(familyName)) { - values.add(givenName + " " + familyName); + if (StringUtils.isNotBlank(givenName) && StringUtils.isNotBlank(familyName)) { + values.add(familyName.trim() + ", " + givenName.trim()); } } return values; @@ -64,4 +64,4 @@ public void setPathToArray(String pathToArray) { this.pathToArray = pathToArray; } -} \ No newline at end of file +} From 1712b9f07875c67141b67da96fa93f0deaff4090 Mon Sep 17 00:00:00 2001 From: Sascha Szott Date: Tue, 9 Jul 2024 10:53:23 +0200 Subject: [PATCH 19/96] fix broken unit tests --- .../app/rest/CrossRefImportMetadataSourceServiceIT.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/CrossRefImportMetadataSourceServiceIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/CrossRefImportMetadataSourceServiceIT.java index 863fd1f753d1..37bd3a90eeda 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/CrossRefImportMetadataSourceServiceIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/CrossRefImportMetadataSourceServiceIT.java @@ -162,7 +162,7 @@ private ArrayList getRecords() { MetadatumDTO title = createMetadatumDTO("dc", "title", null, "State of Awareness of Freshers’ Groups Chortkiv State" + " Medical College of Prevention of Iodine Deficiency Diseases"); - MetadatumDTO author = createMetadatumDTO("dc", "contributor", "author", "L.V. Senyuk"); + MetadatumDTO author = createMetadatumDTO("dc", "contributor", "author", "Senyuk, L.V."); MetadatumDTO type = createMetadatumDTO("dc", "type", null, "journal-article"); MetadatumDTO date = createMetadatumDTO("dc", "date", "issued", "2016-05-19"); MetadatumDTO ispartof = createMetadatumDTO("dc", "relation", "ispartof", @@ -191,7 +191,7 @@ private ArrayList getRecords() { List metadatums2 = new ArrayList(); MetadatumDTO title2 = createMetadatumDTO("dc", "title", null, "Ischemic Heart Disease and Role of Nurse of Cardiology Department"); - MetadatumDTO author2 = createMetadatumDTO("dc", "contributor", "author", "K. І. Kozak"); + MetadatumDTO author2 = createMetadatumDTO("dc", "contributor", "author", "Kozak, K. І."); MetadatumDTO type2 = createMetadatumDTO("dc", "type", null, "journal-article"); MetadatumDTO date2 = createMetadatumDTO("dc", "date", "issued", "2016-05-19"); MetadatumDTO ispartof2 = createMetadatumDTO("dc", "relation", "ispartof", From 9e11e1f9ae69f19e506618d1d0b1fec0059ba165 Mon Sep 17 00:00:00 2001 From: Kristof De Langhe Date: Fri, 19 Jul 2024 13:42:09 +0200 Subject: [PATCH 20/96] 115693: Pass doi metadatafield with xsl parameters --- .../identifier/DOIIdentifierProvider.java | 1 - .../identifier/doi/DataCiteConnector.java | 8 ++++++ dspace/config/crosswalks/DIM2DataCite.xsl | 25 +++++++++++-------- 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/identifier/DOIIdentifierProvider.java b/dspace-api/src/main/java/org/dspace/identifier/DOIIdentifierProvider.java index aff4666fff4b..ae31e54f7e96 100644 --- a/dspace-api/src/main/java/org/dspace/identifier/DOIIdentifierProvider.java +++ b/dspace-api/src/main/java/org/dspace/identifier/DOIIdentifierProvider.java @@ -70,7 +70,6 @@ public class DOIIdentifierProvider extends FilteredIdentifierProvider { static final char SLASH = '/'; // Metadata field name elements - // Warning: If this metadata field is changed for whatever reason, DIM2DataCite.xsl's template needs to reflect this // TODO: move these to MetadataSchema or some such? public static final String MD_SCHEMA = "dc"; public static final String DOI_ELEMENT = "identifier"; diff --git a/dspace-api/src/main/java/org/dspace/identifier/doi/DataCiteConnector.java b/dspace-api/src/main/java/org/dspace/identifier/doi/DataCiteConnector.java index 0fbac1a9f52b..b4cdac96303a 100644 --- a/dspace-api/src/main/java/org/dspace/identifier/doi/DataCiteConnector.java +++ b/dspace-api/src/main/java/org/dspace/identifier/doi/DataCiteConnector.java @@ -7,6 +7,10 @@ */ package org.dspace.identifier.doi; +import static org.dspace.identifier.DOIIdentifierProvider.DOI_ELEMENT; +import static org.dspace.identifier.DOIIdentifierProvider.DOI_QUALIFIER; +import static org.dspace.identifier.DOIIdentifierProvider.MD_SCHEMA; + import java.io.ByteArrayInputStream; import java.io.IOException; import java.net.URISyntaxException; @@ -384,6 +388,10 @@ public void reserveDOI(Context context, DSpaceObject dso, String doi) parameters.put("hostinginstitution", configurationService.getProperty(CFG_HOSTINGINSTITUTION)); } + parameters.put("mdSchema", MD_SCHEMA); + parameters.put("mdElement", DOI_ELEMENT); + // Pass an empty string for qualifier if the metadata field doesn't have any + parameters.put("mdQualifier", DOI_QUALIFIER); Element root = null; try { diff --git a/dspace/config/crosswalks/DIM2DataCite.xsl b/dspace/config/crosswalks/DIM2DataCite.xsl index d57996e6d8cf..d4d8cbe6417a 100644 --- a/dspace/config/crosswalks/DIM2DataCite.xsl +++ b/dspace/config/crosswalks/DIM2DataCite.xsl @@ -36,6 +36,10 @@ + + dc + identifier + uri @@ -333,16 +337,17 @@ company as well. We have to ensure to use URIs of our prefix as primary identifiers only. --> - - - - - - - - - - + + + + + + + + + + + From fa0fb14a185ba8a9c593a3653df302f0446a397c Mon Sep 17 00:00:00 2001 From: Sascha Szott Date: Fri, 2 Aug 2024 14:12:53 +0200 Subject: [PATCH 21/96] fix invalid usage of == operator --- .../src/main/java/org/dspace/content/ItemServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dspace-api/src/main/java/org/dspace/content/ItemServiceImpl.java b/dspace-api/src/main/java/org/dspace/content/ItemServiceImpl.java index 70bdf4b7d950..cceb954ebe2f 100644 --- a/dspace-api/src/main/java/org/dspace/content/ItemServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/content/ItemServiceImpl.java @@ -1799,7 +1799,7 @@ protected void moveSingleMetadataValue(Context context, Item dso, int place, Met //Retrieve the applicable relationship Relationship rs = relationshipService.find(context, ((RelationshipMetadataValue) rr).getRelationshipId()); - if (rs.getLeftItem() == dso) { + if (rs.getLeftItem().equals(dso)) { rs.setLeftPlace(place); } else { rs.setRightPlace(place); From 80de8f6fb567ceb4497596fa714f2b357f1b8b26 Mon Sep 17 00:00:00 2001 From: Sascha Szott Date: Fri, 2 Aug 2024 17:44:35 +0200 Subject: [PATCH 22/96] use equals instead of == --- .../src/main/java/org/dspace/content/EntityServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/content/EntityServiceImpl.java b/dspace-api/src/main/java/org/dspace/content/EntityServiceImpl.java index 9b28203827e0..e83178667840 100644 --- a/dspace-api/src/main/java/org/dspace/content/EntityServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/content/EntityServiceImpl.java @@ -60,7 +60,7 @@ public List getLeftRelations(Context context, Entity entity) { List fullList = entity.getRelationships(); List listToReturn = new LinkedList<>(); for (Relationship relationship : fullList) { - if (relationship.getLeftItem().getID() == entity.getItem().getID()) { + if (relationship.getLeftItem().getID().equals(entity.getItem().getID())) { listToReturn.add(relationship); } } @@ -72,7 +72,7 @@ public List getRightRelations(Context context, Entity entity) { List fullList = entity.getRelationships(); List listToReturn = new LinkedList<>(); for (Relationship relationship : fullList) { - if (relationship.getRightItem().getID() == entity.getItem().getID()) { + if (relationship.getRightItem().getID().equals(entity.getItem().getID())) { listToReturn.add(relationship); } } From 5e3552ee3885049df34c3fcaf49bfe3028c5dbd0 Mon Sep 17 00:00:00 2001 From: Sascha Szott Date: Fri, 2 Aug 2024 17:47:07 +0200 Subject: [PATCH 23/96] use equals instead of == --- .../java/org/dspace/authorize/ResourcePolicyServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dspace-api/src/main/java/org/dspace/authorize/ResourcePolicyServiceImpl.java b/dspace-api/src/main/java/org/dspace/authorize/ResourcePolicyServiceImpl.java index 7b93b912378e..86998a2196e7 100644 --- a/dspace-api/src/main/java/org/dspace/authorize/ResourcePolicyServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/authorize/ResourcePolicyServiceImpl.java @@ -417,7 +417,7 @@ public boolean isMyResourcePolicy(Context context, EPerson eperson, Integer id) ResourcePolicy resourcePolicy = resourcePolicyDAO.findOneById(context, id); Group group = resourcePolicy.getGroup(); - if (resourcePolicy.getEPerson() != null && resourcePolicy.getEPerson().getID() == eperson.getID()) { + if (resourcePolicy.getEPerson() != null && resourcePolicy.getEPerson().getID().equals(eperson.getID())) { isMy = true; } else if (group != null && groupService.isMember(context, eperson, group)) { isMy = true; From d2ef7b01ef1a5d769d764b708be393dbb481fb65 Mon Sep 17 00:00:00 2001 From: Sascha Szott Date: Fri, 2 Aug 2024 17:48:28 +0200 Subject: [PATCH 24/96] use equals instead of == --- .../src/main/java/org/dspace/eperson/GroupServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/eperson/GroupServiceImpl.java b/dspace-api/src/main/java/org/dspace/eperson/GroupServiceImpl.java index 730053e42ce2..3fb20e2f1e6f 100644 --- a/dspace-api/src/main/java/org/dspace/eperson/GroupServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/eperson/GroupServiceImpl.java @@ -147,7 +147,7 @@ public void addMember(Context context, Group group, EPerson e) { public void addMember(Context context, Group groupParent, Group groupChild) throws SQLException { // don't add if it's already a member // and don't add itself - if (groupParent.contains(groupChild) || groupParent.getID() == groupChild.getID()) { + if (groupParent.contains(groupChild) || groupParent.getID().equals(groupChild.getID())) { return; } @@ -178,7 +178,7 @@ public void removeMember(Context context, Group group, EPerson ePerson) throws S Role role = stepByName.getRole(); for (CollectionRole collectionRole : collectionRoles) { if (StringUtils.equals(collectionRole.getRoleId(), role.getId()) - && claimedTask.getWorkflowItem().getCollection() == collectionRole.getCollection()) { + && claimedTask.getWorkflowItem().getCollection().equals(collectionRole.getCollection())) { // Count number of EPersons who are *direct* members of this group int totalDirectEPersons = ePersonService.countByGroups(context, Set.of(group)); // Count number of Groups which have this groupParent as a direct parent From a13cc82d405c5aefe00c7bb86d89c7dc8073a39b Mon Sep 17 00:00:00 2001 From: Sascha Szott Date: Fri, 2 Aug 2024 17:49:14 +0200 Subject: [PATCH 25/96] use equals instead of == --- .../submit/factory/impl/ItemMetadataValueAddPatchOperation.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/submit/factory/impl/ItemMetadataValueAddPatchOperation.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/submit/factory/impl/ItemMetadataValueAddPatchOperation.java index 54dfa6b02c04..8ab9bb451647 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/submit/factory/impl/ItemMetadataValueAddPatchOperation.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/submit/factory/impl/ItemMetadataValueAddPatchOperation.java @@ -214,7 +214,7 @@ private Integer getRelId(String authority) { private void updateRelationshipPlace(Context context, Item dso, int place, Relationship rs) { try { - if (rs.getLeftItem() == dso) { + if (rs.getLeftItem().equals(dso)) { rs.setLeftPlace(place); } else { rs.setRightPlace(place); From 2b698eff609d510c487ad2331d4e11cd28f64e9a Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Sun, 4 Aug 2024 10:56:32 +0200 Subject: [PATCH 26/96] README.md: v8 is the current release, not v7 --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index af9158eff361..2305643fd8e1 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ ## Overview -DSpace open source software is a turnkey repository application used by more than +DSpace open-source software is a turnkey repository application used by more than 2,000 organizations and institutions worldwide to provide durable access to digital resources. For more information, visit http://www.dspace.org/ @@ -20,7 +20,7 @@ DSpace consists of both a Java-based backend and an Angular-based frontend. * The REST Contract is at https://github.com/DSpace/RestContract * Frontend (https://github.com/DSpace/dspace-angular/) is the User Interface built on the REST API -Prior versions of DSpace (v6.x and below) used two different UIs (XMLUI and JSPUI). Those UIs are no longer supported in v7 (and above). +Prior versions of DSpace (v6.x and below) used two different UIs (XMLUI and JSPUI). Those UIs are no longer supported in v7 and above. * A maintenance branch for older versions is still available, see `dspace-6_x` for 6.x maintenance. ## Downloads @@ -33,18 +33,18 @@ Prior versions of DSpace (v6.x and below) used two different UIs (XMLUI and JSPU Documentation for each release may be viewed online or downloaded via our [Documentation Wiki](https://wiki.lyrasis.org/display/DSDOC/). The latest DSpace Installation instructions are available at: -https://wiki.lyrasis.org/display/DSDOC7x/Installing+DSpace +https://wiki.lyrasis.org/display/DSDOC8x/Installing+DSpace Please be aware that, as a Java web application, DSpace requires a database (PostgreSQL) 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. -## Running DSpace 7 in Docker +## Running DSpace 8 in Docker NOTE: At this time, we do not have production-ready Docker images for DSpace. That said, we do have quick-start Docker Compose scripts for development or testing purposes. -See [Running DSpace 7 with Docker Compose](dspace/src/main/docker-compose/README.md) +See [Running DSpace 8 with Docker Compose](dspace/src/main/docker-compose/README.md) ## Contributing @@ -64,7 +64,7 @@ Great Q&A is also available under the [DSpace tag on Stackoverflow](http://stack Additional support options are at https://wiki.lyrasis.org/display/DSPACE/Support DSpace also has an active service provider network. If you'd rather hire a service provider to -install, upgrade, customize or host DSpace, then we recommend getting in touch with one of our +install, upgrade, customize, or host DSpace, then we recommend getting in touch with one of our [Registered Service Providers](http://www.dspace.org/service-providers). ## Issue Tracker @@ -112,7 +112,7 @@ run automatically by [GitHub Actions](https://github.com/DSpace/DSpace/actions?q ``` * How to run only tests of a specific DSpace module ``` - # Before you can run only one module's tests, other modules may need installing into your ~/.m2 + # Before you can run only one module's tests, other modules may need to be installed into your ~/.m2 cd [dspace-src] mvn clean install From 671234b08f909810d798dd950f87d1818b098363 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Sun, 4 Aug 2024 11:04:12 +0200 Subject: [PATCH 27/96] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2305643fd8e1..1d93abe49948 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ ## Overview -DSpace open-source software is a turnkey repository application used by more than +DSpace open source software is a turnkey repository application used by more than 2,000 organizations and institutions worldwide to provide durable access to digital resources. For more information, visit http://www.dspace.org/ From dbf33f2113e0bcbd0891fa098ccf5de9c83d6688 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Mon, 5 Aug 2024 22:05:13 +0200 Subject: [PATCH 28/96] Fix typos discovered by codespell --- .../status/service/AccessStatusService.java | 2 +- .../org/dspace/app/bulkedit/DSpaceCSV.java | 2 +- .../dspace/app/bulkedit/MetadataImport.java | 6 +-- .../app/itemexport/ItemExportServiceImpl.java | 2 +- .../itemexport/service/ItemExportService.java | 10 ++-- .../app/itemimport/ItemImportServiceImpl.java | 2 +- .../itemimport/service/ItemImportService.java | 2 +- .../dspace/app/itemupdate/ItemArchive.java | 2 +- .../itemupdate/ThumbnailBitstreamFilter.java | 2 +- .../dspace/app/ldn/action/LDNEmailAction.java | 2 +- .../app/ldn/model/NotifyRequestStatus.java | 2 +- .../dspace/app/ldn/model/RequestStatus.java | 2 +- .../ldn/processor/LDNMetadataProcessor.java | 2 +- .../ImageMagickThumbnailFilter.java | 2 +- .../org/dspace/app/sherpa/SHERPAService.java | 6 +-- .../app/sherpa/cache/SherpaCacheLogger.java | 2 +- .../sherpa/submit/SHERPASubmitService.java | 2 +- .../dspace/app/sitemap/GenerateSitemaps.java | 2 +- .../org/dspace/app/statistics/HTMLReport.java | 2 +- .../dspace/app/statistics/LogAnalyser.java | 2 +- .../app/statistics/ReportGenerator.java | 6 +-- .../app/statistics/StatisticsLoader.java | 2 +- .../app/suggestion/SuggestionService.java | 2 +- .../org/dspace/app/util/AuthorizeUtil.java | 2 +- .../org/dspace/app/util/IndexVersion.java | 2 +- .../dspace/app/util/InitializeEntities.java | 2 +- .../dspace/app/util/RegexPatternUtils.java | 2 +- .../app/util/SubmissionConfigReader.java | 4 +- .../org/dspace/app/util/SyndicationFeed.java | 2 +- .../main/java/org/dspace/app/util/Util.java | 4 +- .../app/util/service/OpenSearchService.java | 4 +- .../authenticate/OidcAuthenticationBean.java | 4 +- .../authenticate/OrcidAuthenticationBean.java | 4 +- .../authenticate/PasswordAuthentication.java | 2 +- .../authenticate/ShibAuthentication.java | 16 +++---- .../java/org/dspace/authorize/PolicySet.java | 2 +- .../authorize/RegexPasswordValidator.java | 2 +- .../authorize/service/AuthorizeService.java | 6 +-- .../java/org/dspace/browse/BrowseIndex.java | 4 +- .../java/org/dspace/browse/CrossLinks.java | 2 +- .../checker/LimitedCountDispatcher.java | 2 +- .../main/java/org/dspace/content/Bundle.java | 2 +- .../java/org/dspace/content/Collection.java | 2 +- .../java/org/dspace/content/DCPersonName.java | 2 +- .../content/DSpaceObjectServiceImpl.java | 2 +- .../org/dspace/content/ItemServiceImpl.java | 2 +- .../content/MetadataValueServiceImpl.java | 2 +- .../org/dspace/content/RelationshipType.java | 2 +- .../org/dspace/content/authority/Choice.java | 2 +- .../content/authority/ChoiceAuthority.java | 2 +- .../authority/ChoiceAuthorityServiceImpl.java | 2 +- .../content/authority/DCInputAuthority.java | 2 +- .../content/authority/SolrAuthority.java | 2 +- .../service/ChoiceAuthorityService.java | 2 +- .../service/MetadataAuthorityService.java | 2 +- .../crosswalk/DIMDisseminationCrosswalk.java | 2 +- .../content/crosswalk/IngestionCrosswalk.java | 2 +- .../crosswalk/MODSDisseminationCrosswalk.java | 2 +- .../crosswalk/OREIngestionCrosswalk.java | 2 +- .../content/crosswalk/QDCCrosswalk.java | 2 +- ...ubscriptionDsoMetadataForEmailCompose.java | 8 ++-- .../dspace/content/dto/MetadataValueDTO.java | 4 +- .../org/dspace/content/logic/FilterUtils.java | 2 +- .../content/packager/DSpaceAIPIngester.java | 2 +- .../dspace/content/packager/PDFPackager.java | 2 +- .../content/packager/PackageDisseminator.java | 2 +- .../content/packager/PackageIngester.java | 2 +- .../content/service/CommunityService.java | 2 +- .../content/service/FeedbackService.java | 2 +- .../content/service/RelationshipService.java | 2 +- .../dspace/content/virtual/Concatenate.java | 8 ++-- .../org/dspace/core/AbstractHibernateDAO.java | 2 +- .../main/java/org/dspace/core/Context.java | 2 +- .../org/dspace/core/HibernateProxyHelper.java | 2 +- .../main/java/org/dspace/core/LogHelper.java | 2 +- .../src/main/java/org/dspace/core/Utils.java | 2 +- .../WithdrawnCorrectionType.java | 2 +- .../ctask/general/BasicLinkChecker.java | 2 +- .../dspace/ctask/general/CitationPage.java | 6 +-- .../java/org/dspace/curate/ScriptedTask.java | 2 +- .../dspace/discovery/IndexClientOptions.java | 2 +- .../org/dspace/discovery/IndexingService.java | 2 +- .../org/dspace/discovery/SearchUtils.java | 2 +- .../org/dspace/discovery/SolrServiceImpl.java | 4 +- ...lrServiceMetadataBrowseIndexingPlugin.java | 4 +- .../configuration/DiscoverySearchFilter.java | 2 +- .../main/java/org/dspace/eperson/EPerson.java | 2 +- .../org/dspace/eperson/EPersonConsumer.java | 2 +- .../dspace/eperson/EPersonServiceImpl.java | 6 +-- .../src/main/java/org/dspace/event/Event.java | 2 +- .../org/dspace/event/EventServiceImpl.java | 4 +- .../dspace/event/service/EventService.java | 2 +- .../impl/SHERPAv2JournalISSNDataProvider.java | 2 +- .../external/service/ExternalDataService.java | 2 +- .../google/GoogleAsyncEventListener.java | 4 +- .../org/dspace/handle/HandleServiceImpl.java | 2 +- .../handle/hdlresolver/HdlResolverDTO.java | 2 +- .../org/dspace/harvest/HarvestThread.java | 4 +- .../identifier/DOIIdentifierProvider.java | 12 ++--- .../VersionedDOIIdentifierProvider.java | 9 ++-- .../VersionedHandleIdentifierProvider.java | 8 ++-- ...dentifierProviderWithCanonicalHandles.java | 22 ++++----- .../doi/DOIIdentifierException.java | 2 +- .../dspace/identifier/doi/DOIOrganiser.java | 2 +- .../identifier/doi/DataCiteConnector.java | 6 +-- ...rallelImportMetadataSourceServiceImpl.java | 2 +- ...taCiteImportMetadataSourceServiceImpl.java | 2 +- .../EpoImportMetadataSourceServiceImpl.java | 2 +- .../ArrayElementAttributeProcessor.java | 2 +- .../EnhancedSimpleMetadataContributor.java | 6 +-- .../contributor/MatrixElementProcessor.java | 2 +- .../SimpleJsonPathMetadataContributor.java | 2 +- .../SimpleMetadataContributor.java | 2 +- .../AbstractPlainMetadataSource.java | 4 +- .../dspace/orcid/client/OrcidClientImpl.java | 2 +- .../factory/OrcidCommonObjectFactory.java | 2 +- .../model/factory/impl/OrcidWorkFactory.java | 2 +- .../dspace/orcid/script/OrcidBulkPush.java | 4 +- .../service/OrcidSynchronizationService.java | 2 +- .../service/ResearcherProfileService.java | 2 +- .../qaevent/script/OpenaireEventsImport.java | 4 +- ...enaireEventsImportScriptConfiguration.java | 2 +- .../main/java/org/dspace/rdf/RDFConsumer.java | 2 +- .../src/main/java/org/dspace/rdf/RDFUtil.java | 4 +- .../src/main/java/org/dspace/rdf/RDFizer.java | 10 ++-- .../java/org/dspace/rdf/conversion/DMRM.java | 2 +- .../rdf/conversion/MetadataRDFMapping.java | 6 +-- .../dspace/rdf/negotiation/MediaRange.java | 12 ++--- .../dspace/rdf/negotiation/Negotiator.java | 2 +- .../configuration/ScriptConfiguration.java | 2 +- .../statistics/AnonymizeStatistics.java | 2 +- .../statistics/SolrLoggerServiceImpl.java | 8 ++-- .../statistics/content/DatasetGenerator.java | 2 +- .../content/StatisticsDataVisits.java | 2 +- .../FailedOpenURLTrackerServiceImpl.java | 2 +- .../service/FailedOpenURLTrackerService.java | 2 +- .../bitstore/BitstreamStorageServiceImpl.java | 4 +- .../storage/bitstore/S3BitStoreService.java | 2 +- .../service/BitstreamStorageService.java | 2 +- .../dspace/storage/rdbms/PostgresUtils.java | 2 +- .../dspace/storage/rdbms/RegistryUpdater.java | 2 +- .../rdbms/migration/MigrationUtils.java | 2 +- ...Drop_constraint_for_DSpace_1_4_schema.java | 2 +- ...Drop_constraint_for_DSpace_1_6_schema.java | 2 +- ...adata_For_All_Objects_drop_constraint.java | 2 +- ...26__DS_2188_Remove_DBMS_Browse_Tables.java | 2 +- ...__CollectionCommunity_Metadata_Handle.java | 2 +- .../dspace/util/MultiFormatDateParser.java | 2 +- .../org/dspace/util/SolrImportExport.java | 2 +- .../util/SolrUpgradePre6xStatistics.java | 12 ++--- .../versioning/AbstractVersionProvider.java | 4 +- .../DefaultItemVersionProvider.java | 6 +-- .../versioning/VersioningServiceImpl.java | 2 +- .../WorkflowRequirementsServiceImpl.java | 2 +- .../xmlworkflow/XmlWorkflowServiceImpl.java | 2 +- .../migration/RestartWorkflow.java | 2 +- .../xmlworkflow/state/actions/Action.java | 2 +- .../userassignment/UserSelectionAction.java | 2 +- .../dspace/AbstractDSpaceIntegrationTest.java | 2 +- .../BulkAccessControlIT.java | 12 ++--- .../app/csv/CSVMetadataImportReferenceIT.java | 2 +- .../dspace/app/mediafilter/MediaFilterIT.java | 4 +- .../org/dspace/app/packager/PackagerIT.java | 2 +- .../RequestItemEmailNotifierTest.java | 4 +- .../dspace/app/sherpa/MockSHERPAService.java | 4 +- .../util/GoogleBitstreamComparatorTest.java | 4 +- .../dspace/authority/AuthorityValueTest.java | 2 +- .../dspace/content/BitstreamFormatTest.java | 4 +- .../org/dspace/content/CollectionTest.java | 2 +- .../org/dspace/content/CommunityTest.java | 2 +- .../content/DuplicateDetectionTest.java | 2 +- .../content/EntityTypeServiceImplTest.java | 2 +- .../dspace/content/ITCommunityCollection.java | 2 +- .../dspace/content/ItemComparatorTest.java | 2 +- .../RelationshipServiceImplPlaceTest.java | 2 +- .../content/dao/RelationshipDAOImplIT.java | 4 +- .../dao/RelationshipTypeDAOImplIT.java | 4 +- .../dspace/content/packager/ITDSpaceAIP.java | 2 +- .../content/packager/PackageUtilsTest.java | 2 +- .../content/virtual/ConcatenateTest.java | 10 ++-- .../discovery/FullTextContentStreamsTest.java | 2 +- .../dspace/eperson/EPersonInWorkflowIT.java | 4 +- .../identifier/DOIIdentifierProviderTest.java | 10 ++-- .../org/dspace/matcher/QAEventMatcher.java | 2 +- .../export/ITRetryFailedOpenUrlTracker.java | 2 +- .../app/iiif/service/utils/IIIFUtils.java | 4 +- .../impl/AbstractQueryResolverTest.java | 2 +- .../rdf/providing/DataProviderServlet.java | 2 +- .../rest/DiscoverableEndpointsService.java | 2 +- .../authorization/AuthorizationRestUtil.java | 2 +- .../SubmissionDefinitionConverter.java | 2 +- .../HdlResolverRestController.java | 2 +- .../app/rest/model/ParameterValueRest.java | 2 +- .../rest/model/query/RestSearchOperator.java | 8 ++-- .../app/rest/model/step/DataIdentifiers.java | 2 +- .../model/wrapper/SubmissionCCLicenseUrl.java | 2 +- .../AuthorizationRestRepository.java | 4 +- .../rest/repository/DSpaceRestRepository.java | 2 +- .../HarvestedCollectionRestRepository.java | 2 +- .../repository/IdentifierRestRepository.java | 2 +- .../SubscriptionRestRepository.java | 2 +- ...SourceEntryArchivedItemUriListHandler.java | 2 +- ...ExternalSourceEntryItemUriListHandler.java | 2 +- .../service/UriListHandlerService.java | 2 +- .../StatelessAuthenticationFilter.java | 2 +- .../submit/PatchConfigurationService.java | 2 +- .../app/rest/utils/RestRepositoryUtils.java | 2 +- .../rest/AuthenticationRestControllerIT.java | 2 +- .../rest/AuthorizationRestRepositoryIT.java | 48 +++++++++---------- .../app/rest/BrowsesResourceControllerIT.java | 10 ++-- .../BundleUploadBitstreamControllerIT.java | 2 +- .../app/rest/DiscoveryRestControllerIT.java | 6 +-- .../app/rest/DuplicateDetectionRestIT.java | 6 +-- .../dspace/app/rest/ItemRestRepositoryIT.java | 10 ++-- .../org/dspace/app/rest/LoginAsEPersonIT.java | 4 +- .../rest/RelationshipRestRepositoryIT.java | 2 +- .../app/rest/StatisticsRestRepositoryIT.java | 4 +- .../app/rest/SubmissionFormsControllerIT.java | 6 +-- .../app/rest/TaskRestRepositoriesIT.java | 8 ++-- .../rest/WorkspaceItemRestRepositoryIT.java | 4 +- .../rest/converter/ConverterServiceIT.java | 2 +- .../dspace/app/rest/matcher/HalMatcher.java | 2 +- .../matcher/SubmissionFormFieldMatcher.java | 2 +- .../controller/LinksetRestControllerIT.java | 2 +- .../config/DSpaceConfigurationService.java | 2 +- .../KernelStartupCallbackService.java | 2 +- .../java/org/dspace/services/model/Event.java | 2 +- .../utils/servicemanager/ProviderStack.java | 2 +- .../DSpaceConfigurationServiceTest.java | 2 +- .../org/dspace/sword/CollectionDepositor.java | 2 +- .../java/org/dspace/sword/ItemDepositor.java | 2 +- .../org/dspace/sword/SWORDMETSIngester.java | 2 +- .../main/java/org/purl/sword/atom/Entry.java | 2 +- .../org/purl/sword/base/DepositResponse.java | 4 +- .../java/org/purl/sword/base/HttpHeaders.java | 2 +- .../org/purl/sword/base/ServiceDocument.java | 2 +- .../java/org/purl/sword/base/XmlElement.java | 2 +- .../purl/sword/client/PropertiesDialog.java | 2 +- .../org/purl/sword/client/ServicePanel.java | 2 +- .../dspace/sword2/BinaryContentIngester.java | 4 +- .../org/dspace/sword2/DSpaceSwordAPI.java | 2 +- .../dspace/sword2/SimpleDCEntryIngester.java | 4 +- .../sword2/SimpleZipContentIngester.java | 4 +- .../sword2/SwordMETSContentIngester.java | 6 +-- .../org/dspace/sword2/SwordUrlManager.java | 2 +- .../dspace/sword2/WorkflowManagerDefault.java | 2 +- .../sword2/WorkflowManagerUnrestricted.java | 2 +- .../crosswalks/google-metadata.properties | 2 +- dspace/config/dspace.cfg | 12 ++--- dspace/config/emails/request_item.granted | 2 +- dspace/config/emails/request_item.rejected | 2 +- dspace/config/modules/actuator.cfg | 2 +- dspace/config/modules/assetstore.cfg | 2 +- .../modules/authentication-shibboleth.cfg | 4 +- dspace/config/modules/external-providers.cfg | 8 ++-- dspace/config/modules/ldn.cfg | 2 +- dspace/config/modules/oai.cfg | 4 +- dspace/config/modules/rdf.cfg | 4 +- .../modules/rdf/metadata-rdf-schema.ttl | 2 +- dspace/config/modules/swordv2-server.cfg | 2 +- dspace/config/spiders/domains/example | 2 +- dspace/config/spiders/iplists.com-misc.txt | 2 +- .../org/dspace/app/ServerBootApplication.java | 2 +- 263 files changed, 443 insertions(+), 442 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/access/status/service/AccessStatusService.java b/dspace-api/src/main/java/org/dspace/access/status/service/AccessStatusService.java index 2ed47bde4cd2..e86c5a69f4cf 100644 --- a/dspace-api/src/main/java/org/dspace/access/status/service/AccessStatusService.java +++ b/dspace-api/src/main/java/org/dspace/access/status/service/AccessStatusService.java @@ -18,7 +18,7 @@ * Configuration properties: (with examples) * {@code * # values for the forever embargo date threshold - * # This threshold date is used in the default access status helper to dermine if an item is + * # This threshold date is used in the default access status helper to determine if an item is * # restricted or embargoed based on the start date of the primary (or first) file policies. * # In this case, if the policy start date is inferior to the threshold date, the status will * # be embargo, else it will be restricted. diff --git a/dspace-api/src/main/java/org/dspace/app/bulkedit/DSpaceCSV.java b/dspace-api/src/main/java/org/dspace/app/bulkedit/DSpaceCSV.java index 3533a2397b3d..ecd6a24287d1 100644 --- a/dspace-api/src/main/java/org/dspace/app/bulkedit/DSpaceCSV.java +++ b/dspace-api/src/main/java/org/dspace/app/bulkedit/DSpaceCSV.java @@ -475,7 +475,7 @@ public final void addItem(Item i) throws Exception { key = key + "." + metadataField.getQualifier(); } - // Add the language if there is one (schema.element.qualifier[langauge]) + // Add the language if there is one (schema.element.qualifier[language]) //if ((value.language != null) && (!"".equals(value.language))) if (value.getLanguage() != null) { key = key + "[" + value.getLanguage() + "]"; diff --git a/dspace-api/src/main/java/org/dspace/app/bulkedit/MetadataImport.java b/dspace-api/src/main/java/org/dspace/app/bulkedit/MetadataImport.java index e8cf42b47c1b..988768864ed4 100644 --- a/dspace-api/src/main/java/org/dspace/app/bulkedit/MetadataImport.java +++ b/dspace-api/src/main/java/org/dspace/app/bulkedit/MetadataImport.java @@ -253,7 +253,7 @@ public void internalRun() throws Exception { displayChanges(changes, true); } - // Finsh off and tidy up + // Finish off and tidy up c.restoreAuthSystemState(); c.complete(); } catch (Exception e) { @@ -1653,7 +1653,7 @@ private void validateExpressedRelations(Context c) throws MetadataImportExceptio .getLabel(); } else { // Target item may be archived; check there. - // Add to errors if Realtionship.type cannot be derived + // Add to errors if Relationship.type cannot be derived Item targetItem = null; if (itemService.find(c, UUID.fromString(targetUUID)) != null) { targetItem = itemService.find(c, UUID.fromString(targetUUID)); @@ -1698,7 +1698,7 @@ private void validateExpressedRelations(Context c) throws MetadataImportExceptio validateTypesByTypeByTypeName(c, targetType, originType, typeName, originRow); } else { // Origin item may be archived; check there. - // Add to errors if Realtionship.type cannot be derived. + // Add to errors if Relationship.type cannot be derived. Item originItem = null; if (itemService.find(c, UUID.fromString(targetUUID)) != null) { DSpaceCSVLine dSpaceCSVLine = this.csv.getCSVLines() diff --git a/dspace-api/src/main/java/org/dspace/app/itemexport/ItemExportServiceImpl.java b/dspace-api/src/main/java/org/dspace/app/itemexport/ItemExportServiceImpl.java index 9eaabc20e862..0ae2283d35be 100644 --- a/dspace-api/src/main/java/org/dspace/app/itemexport/ItemExportServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/app/itemexport/ItemExportServiceImpl.java @@ -725,7 +725,7 @@ public void run() { try { emailErrorMessage(eperson, e1.getMessage()); } catch (Exception e) { - // wont throw here + // won't throw here } throw new IllegalStateException(e1); } finally { diff --git a/dspace-api/src/main/java/org/dspace/app/itemexport/service/ItemExportService.java b/dspace-api/src/main/java/org/dspace/app/itemexport/service/ItemExportService.java index cc53d952e79b..c28ec70d6fe9 100644 --- a/dspace-api/src/main/java/org/dspace/app/itemexport/service/ItemExportService.java +++ b/dspace-api/src/main/java/org/dspace/app/itemexport/service/ItemExportService.java @@ -69,7 +69,7 @@ public void exportAsZip(Context context, Iterator items, boolean excludeBitstreams) throws Exception; /** - * Convenience methot to create export a single Community, Collection, or + * Convenience method to create export a single Community, Collection, or * Item * * @param dso - the dspace object to export @@ -93,7 +93,7 @@ public void createDownloadableExport(List dsObjects, Context context, boolean migrate) throws Exception; /** - * Convenience methot to create export a single Community, Collection, or + * Convenience method to create export a single Community, Collection, or * Item * * @param dso - the dspace object to export @@ -156,7 +156,7 @@ public String getExportDownloadDirectory(EPerson ePerson) public String getExportWorkDirectory() throws Exception; /** - * Used to read the export archived. Inteded for download. + * Used to read the export archived. Intended for download. * * @param fileName the name of the file to download * @param eperson the eperson requesting the download @@ -233,7 +233,7 @@ public List getExportsAvailable(EPerson eperson) /** * Since the archive is created in a new thread we are unable to communicate - * with calling method about success or failure. We accomplis this + * with calling method about success or failure. We accomplish this * communication with email instead. Send a success email once the export * archive is complete and ready for download * @@ -248,7 +248,7 @@ public void emailSuccessMessage(Context context, EPerson eperson, /** * Since the archive is created in a new thread we are unable to communicate - * with calling method about success or failure. We accomplis this + * with calling method about success or failure. We accomplish this * communication with email instead. Send an error email if the export * archive fails * diff --git a/dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java b/dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java index 087a33026151..01859c4f6b8a 100644 --- a/dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java @@ -2210,7 +2210,7 @@ public void run() { emailErrorMessage(eperson, exceptionString); throw new Exception(e.getMessage()); } catch (Exception e2) { - // wont throw here + // won't throw here } } finally { // Make sure the database connection gets closed in all conditions. diff --git a/dspace-api/src/main/java/org/dspace/app/itemimport/service/ItemImportService.java b/dspace-api/src/main/java/org/dspace/app/itemimport/service/ItemImportService.java index 90cb6f9b803a..738991a839cd 100644 --- a/dspace-api/src/main/java/org/dspace/app/itemimport/service/ItemImportService.java +++ b/dspace-api/src/main/java/org/dspace/app/itemimport/service/ItemImportService.java @@ -121,7 +121,7 @@ public void emailSuccessMessage(Context context, EPerson eperson, /** * If a batch import is done in a new thread we are unable to communicate - * with calling method about success or failure. We accomplis this + * with calling method about success or failure. We accomplish this * communication with email instead. Send an error email if the batch * import fails * diff --git a/dspace-api/src/main/java/org/dspace/app/itemupdate/ItemArchive.java b/dspace-api/src/main/java/org/dspace/app/itemupdate/ItemArchive.java index 26de45caf77e..a3dead0574f9 100644 --- a/dspace-api/src/main/java/org/dspace/app/itemupdate/ItemArchive.java +++ b/dspace-api/src/main/java/org/dspace/app/itemupdate/ItemArchive.java @@ -217,7 +217,7 @@ private Item itemFromHandleInput(Context context) throws SQLException, Exception { DtoMetadata dtom = getMetadataField("dc.identifier.uri"); if (dtom == null) { - throw new Exception("No dc.identier.uri field found for handle"); + throw new Exception("No dc.identifier.uri field found for handle"); } this.addUndoMetadataField(dtom); //seed the undo list with the uri diff --git a/dspace-api/src/main/java/org/dspace/app/itemupdate/ThumbnailBitstreamFilter.java b/dspace-api/src/main/java/org/dspace/app/itemupdate/ThumbnailBitstreamFilter.java index 2a8f9ac20028..b6000778877c 100644 --- a/dspace-api/src/main/java/org/dspace/app/itemupdate/ThumbnailBitstreamFilter.java +++ b/dspace-api/src/main/java/org/dspace/app/itemupdate/ThumbnailBitstreamFilter.java @@ -10,7 +10,7 @@ import java.util.Properties; /** - * Bitstream filter targetting the THUMBNAIL bundle + * Bitstream filter targeting the THUMBNAIL bundle */ public class ThumbnailBitstreamFilter extends BitstreamFilterByBundleName { diff --git a/dspace-api/src/main/java/org/dspace/app/ldn/action/LDNEmailAction.java b/dspace-api/src/main/java/org/dspace/app/ldn/action/LDNEmailAction.java index b87001f81500..32b115bd07f6 100644 --- a/dspace-api/src/main/java/org/dspace/app/ldn/action/LDNEmailAction.java +++ b/dspace-api/src/main/java/org/dspace/app/ldn/action/LDNEmailAction.java @@ -27,7 +27,7 @@ import org.springframework.beans.factory.annotation.Autowired; /** - * Action to send email to receipients provided in actionSendFilter. The email + * Action to send email to recipients provided in actionSendFilter. The email * body will be result of templating actionSendFilter. */ public class LDNEmailAction implements LDNAction { diff --git a/dspace-api/src/main/java/org/dspace/app/ldn/model/NotifyRequestStatus.java b/dspace-api/src/main/java/org/dspace/app/ldn/model/NotifyRequestStatus.java index 0302b528aa8d..8333eae91024 100644 --- a/dspace-api/src/main/java/org/dspace/app/ldn/model/NotifyRequestStatus.java +++ b/dspace-api/src/main/java/org/dspace/app/ldn/model/NotifyRequestStatus.java @@ -25,7 +25,7 @@ * "Offer", "coar-notify:IngestAction" * "Offer", "coar-notify:ReviewAction" * - * and their acknownledgements - if any + * and their acknowledgements - if any * * @author Francesco Bacchelli (francesco.bacchelli at 4science dot it) */ diff --git a/dspace-api/src/main/java/org/dspace/app/ldn/model/RequestStatus.java b/dspace-api/src/main/java/org/dspace/app/ldn/model/RequestStatus.java index d19369830787..e33bc3eeb7d5 100644 --- a/dspace-api/src/main/java/org/dspace/app/ldn/model/RequestStatus.java +++ b/dspace-api/src/main/java/org/dspace/app/ldn/model/RequestStatus.java @@ -8,7 +8,7 @@ package org.dspace.app.ldn.model; /** - * Informations about the Offer and Acknowledgements targeting a specified Item + * Information about the Offer and Acknowledgements targeting a specified Item * * @author Francesco Bacchelli (francesco.bacchelli at 4science.com) */ diff --git a/dspace-api/src/main/java/org/dspace/app/ldn/processor/LDNMetadataProcessor.java b/dspace-api/src/main/java/org/dspace/app/ldn/processor/LDNMetadataProcessor.java index 43c50173ee61..9782e2504588 100644 --- a/dspace-api/src/main/java/org/dspace/app/ldn/processor/LDNMetadataProcessor.java +++ b/dspace-api/src/main/java/org/dspace/app/ldn/processor/LDNMetadataProcessor.java @@ -152,7 +152,7 @@ public void setActions(List actions) { } /** - * Lookup associated item to the notification context. If UUID in URL, lookup bu + * Lookup associated item to the notification context. If UUID in URL, lookup by * UUID, else lookup by handle. * * @param context current context diff --git a/dspace-api/src/main/java/org/dspace/app/mediafilter/ImageMagickThumbnailFilter.java b/dspace-api/src/main/java/org/dspace/app/mediafilter/ImageMagickThumbnailFilter.java index 408982d157e5..8ed67f4df4a0 100644 --- a/dspace-api/src/main/java/org/dspace/app/mediafilter/ImageMagickThumbnailFilter.java +++ b/dspace-api/src/main/java/org/dspace/app/mediafilter/ImageMagickThumbnailFilter.java @@ -148,7 +148,7 @@ public File getImageFile(File f, boolean verbose) // the thumbnail because the CropBox is generally used to define the // area displayed when a user opens the PDF on a screen, whereas the // MediaBox is used for print. Not all PDFs set these correctly, so - // we can use ImageMagick's default behavior unless we see an explit + // we can use ImageMagick's default behavior unless we see an explicit // CropBox. Note: we don't need to do anything special to detect if // the CropBox is missing or empty because pdfbox will set it to the // same size as the MediaBox if it doesn't exist. Also note that we diff --git a/dspace-api/src/main/java/org/dspace/app/sherpa/SHERPAService.java b/dspace-api/src/main/java/org/dspace/app/sherpa/SHERPAService.java index 9ee5ca55cc6d..943df5f2a0e8 100644 --- a/dspace-api/src/main/java/org/dspace/app/sherpa/SHERPAService.java +++ b/dspace-api/src/main/java/org/dspace/app/sherpa/SHERPAService.java @@ -78,7 +78,7 @@ public SHERPAService() { @SuppressWarnings("unused") @PostConstruct private void init() { - // Get endoint and API key from configuration + // Get endpoint and API key from configuration endpoint = configurationService.getProperty("sherpa.romeo.url", "https://v2.sherpa.ac.uk/cgi/retrieve"); apiKey = configurationService.getProperty("sherpa.romeo.apikey"); @@ -156,7 +156,7 @@ public SHERPAPublisherResponse performPublisherRequest(String type, String field // If the response body is valid, pass to SHERPAResponse for parsing as JSON if (null != responseBody) { - log.debug("Non-null SHERPA resonse received for query of " + value); + log.debug("Non-null SHERPA response received for query of " + value); InputStream content = null; try { content = responseBody.getContent(); @@ -259,7 +259,7 @@ public SHERPAResponse performRequest(String type, String field, String predicate // If the response body is valid, pass to SHERPAResponse for parsing as JSON if (null != responseBody) { - log.debug("Non-null SHERPA resonse received for query of " + value); + log.debug("Non-null SHERPA response received for query of " + value); InputStream content = null; try { content = responseBody.getContent(); diff --git a/dspace-api/src/main/java/org/dspace/app/sherpa/cache/SherpaCacheLogger.java b/dspace-api/src/main/java/org/dspace/app/sherpa/cache/SherpaCacheLogger.java index e84fb7775ae2..5bdf1efa2632 100644 --- a/dspace-api/src/main/java/org/dspace/app/sherpa/cache/SherpaCacheLogger.java +++ b/dspace-api/src/main/java/org/dspace/app/sherpa/cache/SherpaCacheLogger.java @@ -13,7 +13,7 @@ import org.ehcache.event.CacheEventListener; /** - * This is a EHCache listner responsible for logging sherpa cache events. It is + * This is a EHCache listener responsible for logging sherpa cache events. It is * bound to the sherpa cache via the dspace/config/ehcache.xml file. We need a * dedicated Logger for each cache as the CacheEvent doesn't include details * about where the event occur diff --git a/dspace-api/src/main/java/org/dspace/app/sherpa/submit/SHERPASubmitService.java b/dspace-api/src/main/java/org/dspace/app/sherpa/submit/SHERPASubmitService.java index b795c8a2b2d2..cb913a9f261e 100644 --- a/dspace-api/src/main/java/org/dspace/app/sherpa/submit/SHERPASubmitService.java +++ b/dspace-api/src/main/java/org/dspace/app/sherpa/submit/SHERPASubmitService.java @@ -47,7 +47,7 @@ public void setConfiguration(SHERPASubmitConfigurationService configuration) { } /** - * Setter for SHERPA service, reponsible for actual HTTP API calls + * Setter for SHERPA service, responsible for actual HTTP API calls * @see "dspace-dspace-addon-sherpa-configuration-services.xml" * @param sherpaService */ diff --git a/dspace-api/src/main/java/org/dspace/app/sitemap/GenerateSitemaps.java b/dspace-api/src/main/java/org/dspace/app/sitemap/GenerateSitemaps.java index 90962d12aa75..2464221d2df2 100644 --- a/dspace-api/src/main/java/org/dspace/app/sitemap/GenerateSitemaps.java +++ b/dspace-api/src/main/java/org/dspace/app/sitemap/GenerateSitemaps.java @@ -141,7 +141,7 @@ public static void generateSitemapsScheduled() throws IOException, SQLException public static void deleteSitemaps() throws IOException { File outputDir = new File(configurationService.getProperty("sitemap.dir")); if (!outputDir.exists() && !outputDir.isDirectory()) { - log.error("Unable to delete sitemaps directory, doesn't exist or isn't a directort"); + log.error("Unable to delete sitemaps directory, doesn't exist or isn't a directory"); } else { FileUtils.deleteDirectory(outputDir); } diff --git a/dspace-api/src/main/java/org/dspace/app/statistics/HTMLReport.java b/dspace-api/src/main/java/org/dspace/app/statistics/HTMLReport.java index 3d76ecaecfdc..9e27ffdd9334 100644 --- a/dspace-api/src/main/java/org/dspace/app/statistics/HTMLReport.java +++ b/dspace-api/src/main/java/org/dspace/app/statistics/HTMLReport.java @@ -451,7 +451,7 @@ public String footer() { } /** - * Clean Stirngs for display in HTML + * Clean Strings for display in HTML * * @param s The String to clean * @return The cleaned String diff --git a/dspace-api/src/main/java/org/dspace/app/statistics/LogAnalyser.java b/dspace-api/src/main/java/org/dspace/app/statistics/LogAnalyser.java index 2e4ed69b268e..982c339963d2 100644 --- a/dspace-api/src/main/java/org/dspace/app/statistics/LogAnalyser.java +++ b/dspace-api/src/main/java/org/dspace/app/statistics/LogAnalyser.java @@ -481,7 +481,7 @@ public static String processLogs(Context context, String myLogDir, // of the log file are sequential, but can we assume the files are // provided in a data sequence? for (i = 0; i < logFiles.length; i++) { - // check to see if this file is a log file agains the global regex + // check to see if this file is a log file against the global regex Matcher matchRegex = logRegex.matcher(logFiles[i].getName()); if (matchRegex.matches()) { // if it is a log file, open it up and lets have a look at the diff --git a/dspace-api/src/main/java/org/dspace/app/statistics/ReportGenerator.java b/dspace-api/src/main/java/org/dspace/app/statistics/ReportGenerator.java index c5fe0072f514..5b526773d48a 100644 --- a/dspace-api/src/main/java/org/dspace/app/statistics/ReportGenerator.java +++ b/dspace-api/src/main/java/org/dspace/app/statistics/ReportGenerator.java @@ -352,7 +352,7 @@ public static void processReport(Context context, Report report, report.setEndDate(endDate); report.setMainTitle(name, serverName); - // define our standard variables for re-use + // define our standard variables for reuse // FIXME: we probably don't need these once we've finished re-factoring Iterator keys = null; int i = 0; @@ -518,7 +518,7 @@ public static void processReport(Context context, Report report, /** * a standard stats block preparation method for use when an aggregator - * has to be put out in its entirity. This method will not be able to + * has to be put out in its entirety. This method will not be able to * deal with complex cases, although it will perform sorting by value and * translations as per the map file if requested * @@ -783,7 +783,7 @@ public static String getItemInfo(Context context, String handle) return null; } - // build the referece + // build the reference // FIXME: here we have blurred the line between content and presentation // and it should probably be un-blurred List title = itemService.getMetadata(item, MetadataSchemaEnum.DC.getName(), diff --git a/dspace-api/src/main/java/org/dspace/app/statistics/StatisticsLoader.java b/dspace-api/src/main/java/org/dspace/app/statistics/StatisticsLoader.java index cc8a7024f1b2..23dbe19b61a6 100644 --- a/dspace-api/src/main/java/org/dspace/app/statistics/StatisticsLoader.java +++ b/dspace-api/src/main/java/org/dspace/app/statistics/StatisticsLoader.java @@ -291,7 +291,7 @@ private static synchronized void loadFileList(File[] fileList) { * by the formatter provided, then we return null. * * @param thisFile file - * @param thisPattern patter + * @param thisPattern pattern * @param sdf date format * @return StatsFile */ diff --git a/dspace-api/src/main/java/org/dspace/app/suggestion/SuggestionService.java b/dspace-api/src/main/java/org/dspace/app/suggestion/SuggestionService.java index 41d33026ed0f..e8a883026174 100644 --- a/dspace-api/src/main/java/org/dspace/app/suggestion/SuggestionService.java +++ b/dspace-api/src/main/java/org/dspace/app/suggestion/SuggestionService.java @@ -22,7 +22,7 @@ public interface SuggestionService { /** find a {@link SuggestionTarget } by source name and suggestion id */ public SuggestionTarget find(Context context, String source, UUID id); - /** count all suggetion targets by suggestion source */ + /** count all suggestion targets by suggestion source */ public long countAll(Context context, String source); /** find all suggestion targets by source (paged) */ diff --git a/dspace-api/src/main/java/org/dspace/app/util/AuthorizeUtil.java b/dspace-api/src/main/java/org/dspace/app/util/AuthorizeUtil.java index 6400820546ce..ed59f4b24f05 100644 --- a/dspace-api/src/main/java/org/dspace/app/util/AuthorizeUtil.java +++ b/dspace-api/src/main/java/org/dspace/app/util/AuthorizeUtil.java @@ -624,7 +624,7 @@ public static boolean authorizeNewAccountRegistration(Context context, HttpServl throws SQLException { if (DSpaceServicesFactory.getInstance().getConfigurationService() .getBooleanProperty("user.registration", true)) { - // This allowSetPassword is currently the only mthod that would return true only when it's + // This allowSetPassword is currently the only method that would return true only when it's // actually expected to be returning true. // For example the LDAP canSelfRegister will return true due to auto-register, while that // does not imply a new user can register explicitly diff --git a/dspace-api/src/main/java/org/dspace/app/util/IndexVersion.java b/dspace-api/src/main/java/org/dspace/app/util/IndexVersion.java index 7bdaa95b5c02..86349547959e 100644 --- a/dspace-api/src/main/java/org/dspace/app/util/IndexVersion.java +++ b/dspace-api/src/main/java/org/dspace/app/util/IndexVersion.java @@ -62,7 +62,7 @@ public static void main(String[] argv) // First argument is the Index path. Determine its version String indexVersion = getIndexVersion(argv[0]); - // Second argumet is an optional version number to compare to + // Second argument is an optional version number to compare to String compareToVersion = argv.length > 1 ? argv[1] : null; // If indexVersion comes back as null, then it is not a valid index directory. diff --git a/dspace-api/src/main/java/org/dspace/app/util/InitializeEntities.java b/dspace-api/src/main/java/org/dspace/app/util/InitializeEntities.java index 0a072a9819eb..e8c5d93181e9 100644 --- a/dspace-api/src/main/java/org/dspace/app/util/InitializeEntities.java +++ b/dspace-api/src/main/java/org/dspace/app/util/InitializeEntities.java @@ -74,7 +74,7 @@ public static void main(String[] argv) throws SQLException, AuthorizeException, private static void checkHelpEntered(Options options, CommandLine line) { if (line.hasOption("h")) { HelpFormatter formatter = new HelpFormatter(); - formatter.printHelp("Intialize Entities", options); + formatter.printHelp("Initialize Entities", options); System.exit(0); } } diff --git a/dspace-api/src/main/java/org/dspace/app/util/RegexPatternUtils.java b/dspace-api/src/main/java/org/dspace/app/util/RegexPatternUtils.java index 578e57fb0909..17d94027af08 100644 --- a/dspace-api/src/main/java/org/dspace/app/util/RegexPatternUtils.java +++ b/dspace-api/src/main/java/org/dspace/app/util/RegexPatternUtils.java @@ -36,7 +36,7 @@ public class RegexPatternUtils { * Computes a pattern starting from a regex definition with flags that * uses the standard format: /{regex}/{flags} (ECMAScript format). * This method can transform an ECMAScript regex into a java {@code Pattern} object - * wich can be used to validate strings. + * which can be used to validate strings. *
* If regex is null, empty or blank a null {@code Pattern} will be retrieved * If it's a valid regex, then a non-null {@code Pattern} will be retrieved, diff --git a/dspace-api/src/main/java/org/dspace/app/util/SubmissionConfigReader.java b/dspace-api/src/main/java/org/dspace/app/util/SubmissionConfigReader.java index 78be2bd4a41b..0f8f7456801f 100644 --- a/dspace-api/src/main/java/org/dspace/app/util/SubmissionConfigReader.java +++ b/dspace-api/src/main/java/org/dspace/app/util/SubmissionConfigReader.java @@ -158,7 +158,7 @@ public void reload() throws SubmissionConfigReaderException { *

  • Hashmap of Collection to Submission definition mappings - * defines which Submission process a particular collection uses *
  • Hashmap of all Submission definitions. List of all valid - * Submision Processes by name. + * Submission Processes by name. * */ private void buildInputs(String fileName) throws SubmissionConfigReaderException { @@ -358,7 +358,7 @@ public SubmissionStepConfig getStepConfig(String stepID) throws SubmissionConfigReaderException { // We should already have the step definitions loaded if (stepDefns != null) { - // retreive step info + // retrieve step info Map stepInfo = stepDefns.get(stepID); if (stepInfo != null) { diff --git a/dspace-api/src/main/java/org/dspace/app/util/SyndicationFeed.java b/dspace-api/src/main/java/org/dspace/app/util/SyndicationFeed.java index 654036963572..b4ba69ffa285 100644 --- a/dspace-api/src/main/java/org/dspace/app/util/SyndicationFeed.java +++ b/dspace-api/src/main/java/org/dspace/app/util/SyndicationFeed.java @@ -523,7 +523,7 @@ protected String urlOfBitstream(HttpServletRequest request, Bitstream logo) { */ protected String resolveURL(HttpServletRequest request, DSpaceObject dso) { // If no object given then just link to the whole repository, - // since no offical handle exists so we have to use local resolution. + // since no official handle exists so we have to use local resolution. if (dso == null) { if (baseURL == null) { if (request == null) { diff --git a/dspace-api/src/main/java/org/dspace/app/util/Util.java b/dspace-api/src/main/java/org/dspace/app/util/Util.java index a084e60b634e..3a0c368880e4 100644 --- a/dspace-api/src/main/java/org/dspace/app/util/Util.java +++ b/dspace-api/src/main/java/org/dspace/app/util/Util.java @@ -179,7 +179,7 @@ public static String encodeBitstreamName(String stringIn) throws java.io.Unsuppo * @return the file size as a String */ public static String formatFileSize(double in) { - // Work out the size of the file, and format appropriatly + // Work out the size of the file, and format appropriately // FIXME: When full i18n support is available, use the user's Locale // rather than the default Locale. NumberFormat nf = NumberFormat.getNumberInstance(Locale.getDefault()); @@ -238,7 +238,7 @@ public static UUID getUUIDParameter(HttpServletRequest request, String param) { } catch (Exception e) { // at least log this error to make debugging easier // do not silently return null only. - log.warn("Unable to recoginze UUID from String \"" + log.warn("Unable to recognize UUID from String \"" + val + "\". Will return null.", e); // Problem with parameter return null; diff --git a/dspace-api/src/main/java/org/dspace/app/util/service/OpenSearchService.java b/dspace-api/src/main/java/org/dspace/app/util/service/OpenSearchService.java index 03f41e535c53..cf62bca30e2a 100644 --- a/dspace-api/src/main/java/org/dspace/app/util/service/OpenSearchService.java +++ b/dspace-api/src/main/java/org/dspace/app/util/service/OpenSearchService.java @@ -85,7 +85,7 @@ public interface OpenSearchService { * @param start - start result index * @param pageSize - page size * @param scope - search scope, null or the community/collection - * @param results the retreived DSpace objects satisfying search + * @param results the retrieved DSpace objects satisfying search * @param labels labels to apply - format specific * @return formatted search results * @throws IOException if IO error @@ -105,7 +105,7 @@ public String getResultsString(Context context, String format, String query, int * @param start - start result index * @param pageSize - page size * @param scope - search scope, null or the community/collection - * @param results the retreived DSpace objects satisfying search + * @param results the retrieved DSpace objects satisfying search * @param labels labels to apply - format specific * @return formatted search results * @throws IOException if IO error diff --git a/dspace-api/src/main/java/org/dspace/authenticate/OidcAuthenticationBean.java b/dspace-api/src/main/java/org/dspace/authenticate/OidcAuthenticationBean.java index 61cbca1e5ed7..44c9fb7dc872 100644 --- a/dspace-api/src/main/java/org/dspace/authenticate/OidcAuthenticationBean.java +++ b/dspace-api/src/main/java/org/dspace/authenticate/OidcAuthenticationBean.java @@ -235,7 +235,7 @@ private OidcTokenResponseDTO getOidcAccessToken(String code) { try { return oidcClient.getAccessToken(code); } catch (Exception ex) { - LOGGER.error("An error occurs retriving the OIDC access_token", ex); + LOGGER.error("An error occurs retrieving the OIDC access_token", ex); return null; } } @@ -244,7 +244,7 @@ private Map getOidcUserInfo(String accessToken) { try { return oidcClient.getUserInfo(accessToken); } catch (Exception ex) { - LOGGER.error("An error occurs retriving the OIDC user info", ex); + LOGGER.error("An error occurs retrieving the OIDC user info", ex); return Map.of(); } } diff --git a/dspace-api/src/main/java/org/dspace/authenticate/OrcidAuthenticationBean.java b/dspace-api/src/main/java/org/dspace/authenticate/OrcidAuthenticationBean.java index 590bbf6cf0ef..ee30338a8f2e 100644 --- a/dspace-api/src/main/java/org/dspace/authenticate/OrcidAuthenticationBean.java +++ b/dspace-api/src/main/java/org/dspace/authenticate/OrcidAuthenticationBean.java @@ -282,7 +282,7 @@ private Person getPersonFromOrcid(OrcidTokenResponseDTO token) { try { return orcidClient.getPerson(token.getAccessToken(), token.getOrcid()); } catch (Exception ex) { - LOGGER.error("An error occurs retriving the ORCID record with id {}", + LOGGER.error("An error occurs retrieving the ORCID record with id {}", token.getOrcid(), ex); return null; } @@ -320,7 +320,7 @@ private OrcidTokenResponseDTO getOrcidAccessToken(String code) { try { return orcidClient.getAccessToken(code); } catch (Exception ex) { - LOGGER.error("An error occurs retriving the ORCID access_token", ex); + LOGGER.error("An error occurs retrieving the ORCID access_token", ex); return null; } } diff --git a/dspace-api/src/main/java/org/dspace/authenticate/PasswordAuthentication.java b/dspace-api/src/main/java/org/dspace/authenticate/PasswordAuthentication.java index 8e030305c957..f66d0730e918 100644 --- a/dspace-api/src/main/java/org/dspace/authenticate/PasswordAuthentication.java +++ b/dspace-api/src/main/java/org/dspace/authenticate/PasswordAuthentication.java @@ -82,7 +82,7 @@ public boolean canSelfRegister(Context context, // No conditions set, so must be able to self register return true; } else { - // Itterate through all domains + // Iterate through all domains String check; email = email.trim().toLowerCase(); for (int i = 0; i < domains.length; i++) { diff --git a/dspace-api/src/main/java/org/dspace/authenticate/ShibAuthentication.java b/dspace-api/src/main/java/org/dspace/authenticate/ShibAuthentication.java index 24d8266012d4..2f117e6944a0 100644 --- a/dspace-api/src/main/java/org/dspace/authenticate/ShibAuthentication.java +++ b/dspace-api/src/main/java/org/dspace/authenticate/ShibAuthentication.java @@ -287,7 +287,7 @@ public int authenticate(Context context, String username, String password, @Override public List getSpecialGroups(Context context, HttpServletRequest request) { try { - // User has not successfuly authenticated via shibboleth. + // User has not successfully authenticated via shibboleth. if (request == null || context.getCurrentUser() == null) { return Collections.EMPTY_LIST; @@ -309,7 +309,7 @@ public List getSpecialGroups(Context context, HttpServletRequest request) if (ignoreScope && ignoreValue) { throw new IllegalStateException( "Both config parameters for ignoring an roll attributes scope and value are turned on, this is " + - "not a permissable configuration. (Note: ignore-scope defaults to true) The configuration " + + "not a permissible configuration. (Note: ignore-scope defaults to true) The configuration " + "parameters are: 'authentication.shib.role-header.ignore-scope' and 'authentication.shib" + ".role-header.ignore-value'"); } @@ -391,7 +391,7 @@ public List getSpecialGroups(Context context, HttpServletRequest request) return new ArrayList<>(groups); } 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 special groups this user may belong too because of an exception.", t); return Collections.EMPTY_LIST; } } @@ -546,7 +546,7 @@ public static boolean isEnabled() { /** * Identify an existing EPerson based upon the shibboleth attributes provided on - * the request object. There are three cases where this can occurr, each as + * the request object. There are three cases where this can occur, each as * a fallback for the previous method. * * 1) NetID from Shibboleth Header (best) @@ -671,7 +671,7 @@ protected EPerson findEPerson(Context context, HttpServletRequest request) throw if (!foundNetID && !foundEmail && !foundRemoteUser) { log.error( "Shibboleth authentication was not able to find a NetId, Email, or Tomcat Remote user for which to " + - "indentify a user from."); + "identify a user from."); } @@ -931,7 +931,7 @@ protected int swordCompatibility(Context context, String username, String passwo "compatibility mode."); return SUCCESS; } else { - // Passsword failure + // Password failure log.error( "Shibboleth-based password authentication failed for user " + username + " because a bad password was" + " supplied."); @@ -944,7 +944,7 @@ protected int swordCompatibility(Context context, String username, String passwo /** * Initialize Shibboleth Authentication. * - * During initalization the mapping of additional eperson metadata will be loaded from the DSpace.cfg + * During initialization the mapping of additional eperson metadata will be loaded from the DSpace.cfg * and cached. While loading the metadata mapping this method will check the EPerson object to see * if it supports the metadata field. If the field is not supported and autocreate is turned on then * the field will be automatically created. @@ -985,7 +985,7 @@ protected synchronized void initialize(Context context) throws SQLException { String[] metadataParts = metadataString.split("=>"); if (metadataParts.length != 2) { - log.error("Unable to parse metadat mapping string: '" + metadataString + "'"); + log.error("Unable to parse metadata mapping string: '" + metadataString + "'"); continue; } diff --git a/dspace-api/src/main/java/org/dspace/authorize/PolicySet.java b/dspace-api/src/main/java/org/dspace/authorize/PolicySet.java index e22b8e9df026..23806b35dd7c 100644 --- a/dspace-api/src/main/java/org/dspace/authorize/PolicySet.java +++ b/dspace-api/src/main/java/org/dspace/authorize/PolicySet.java @@ -137,7 +137,7 @@ public static void setPolicies(Context c, int containerType, * otherwise add to existing policies * @param clearOnly if non-null, only process bitstreams whose names contain filter * @param name policy name - * @param description policy descrption + * @param description policy description * @param startDate policy start date * @param endDate policy end date * @throws SQLException if database error diff --git a/dspace-api/src/main/java/org/dspace/authorize/RegexPasswordValidator.java b/dspace-api/src/main/java/org/dspace/authorize/RegexPasswordValidator.java index d12c3ba91929..2cefec35b348 100644 --- a/dspace-api/src/main/java/org/dspace/authorize/RegexPasswordValidator.java +++ b/dspace-api/src/main/java/org/dspace/authorize/RegexPasswordValidator.java @@ -17,7 +17,7 @@ /** * Implementation of {@link PasswordValidatorService} that verifies if the given - * passowrd matches the configured pattern. + * password matches the configured pattern. * * @author Luca Giamminonni (luca.giamminonni at 4science.it) */ diff --git a/dspace-api/src/main/java/org/dspace/authorize/service/AuthorizeService.java b/dspace-api/src/main/java/org/dspace/authorize/service/AuthorizeService.java index e0a94833d76c..9fb2e6d4a17a 100644 --- a/dspace-api/src/main/java/org/dspace/authorize/service/AuthorizeService.java +++ b/dspace-api/src/main/java/org/dspace/authorize/service/AuthorizeService.java @@ -133,7 +133,7 @@ public void authorizeAction(Context c, EPerson e, DSpaceObject o, int action, bo public boolean authorizeActionBoolean(Context c, DSpaceObject o, int a, boolean useInheritance) throws SQLException; /** - * same authorize with a specif eperson (not the current user), returns boolean for those who don't want to deal + * same authorize with a specific eperson (not the current user), returns boolean for those who don't want to deal * with * catching exceptions. * @@ -235,7 +235,7 @@ public boolean authorizeActionBoolean(Context c, EPerson e, DSpaceObject o, int * @param o DSpaceObject to add policy to * @param actionID ID of action from org.dspace.core.Constants * @param e eperson who can perform the action - * @param type policy type, deafult types are declared in the ResourcePolicy class + * @param type policy type, default types are declared in the ResourcePolicy class * @throws SQLException if database error * @throws AuthorizeException if current user in context is not authorized to add policies */ @@ -261,7 +261,7 @@ public void addPolicy(Context c, DSpaceObject o, int actionID, EPerson e, String * @param o object to add policy for * @param actionID ID of action from org.dspace.core.Constants * @param g group to add policy for - * @param type policy type, deafult types are declared in the ResourcePolicy class + * @param type policy type, default types are declared in the ResourcePolicy class * @throws SQLException if there's a database problem * @throws AuthorizeException if the current user is not authorized to add this policy */ diff --git a/dspace-api/src/main/java/org/dspace/browse/BrowseIndex.java b/dspace-api/src/main/java/org/dspace/browse/BrowseIndex.java index 6c38c8dd664b..0eddfcac9194 100644 --- a/dspace-api/src/main/java/org/dspace/browse/BrowseIndex.java +++ b/dspace-api/src/main/java/org/dspace/browse/BrowseIndex.java @@ -195,7 +195,7 @@ private BrowseIndex(String definition, int number) } } - // for backward compatability we ignore the keywords + // for backward compatibility we ignore the keywords // single and full here if (!sortName.equalsIgnoreCase("single") && !sortName.equalsIgnoreCase("full") @@ -597,7 +597,7 @@ public boolean isDate() { /** * Is the browse index of display type single? * - * @return true if singe, false if not + * @return true if single, false if not */ public boolean isMetadataIndex() { return displayType != null && displayType.startsWith("metadata"); diff --git a/dspace-api/src/main/java/org/dspace/browse/CrossLinks.java b/dspace-api/src/main/java/org/dspace/browse/CrossLinks.java index ec4cb199ea1d..f78070d4f625 100644 --- a/dspace-api/src/main/java/org/dspace/browse/CrossLinks.java +++ b/dspace-api/src/main/java/org/dspace/browse/CrossLinks.java @@ -100,7 +100,7 @@ public String findLinkType(String metadata) { // Resolve wildcards properly, eg. dc.subject.other matches a configuration for dc.subject.* for (String key : links.keySet()) { if (null != key && key.endsWith(".*")) { - // A substring of length-1, also substracting the wildcard should work as a "startsWith" + // A substring of length-1, also subtracting the wildcard should work as a "startsWith" // check for the field eg. dc.subject.* -> dc.subject is the start of dc.subject.other if (null != metadata && metadata.startsWith(key.substring(0, key.length() - 1 - ".*".length()))) { return links.get(key); diff --git a/dspace-api/src/main/java/org/dspace/checker/LimitedCountDispatcher.java b/dspace-api/src/main/java/org/dspace/checker/LimitedCountDispatcher.java index 93ce634a0541..36fcefd47b3e 100644 --- a/dspace-api/src/main/java/org/dspace/checker/LimitedCountDispatcher.java +++ b/dspace-api/src/main/java/org/dspace/checker/LimitedCountDispatcher.java @@ -60,7 +60,7 @@ public LimitedCountDispatcher(BitstreamDispatcher del) { } /** - * Retreives the next bitstream to be checked. + * Retrieves the next bitstream to be checked. * * @return the bitstream * @throws SQLException if database error diff --git a/dspace-api/src/main/java/org/dspace/content/Bundle.java b/dspace-api/src/main/java/org/dspace/content/Bundle.java index b6fd269f8fc4..b619d5cd069e 100644 --- a/dspace-api/src/main/java/org/dspace/content/Bundle.java +++ b/dspace-api/src/main/java/org/dspace/content/Bundle.java @@ -131,7 +131,7 @@ public void unsetPrimaryBitstreamID() { /** * Get a copy of the bitstream list of this bundle - * Note that this is a copy and if you wish to manipulate the bistream list, you should use + * Note that this is a copy and if you wish to manipulate the bitstream list, you should use * {@ref Bundle.addBitstream}, {@ref Bundle.removeBitstream} or {@ref Bundle.clearBitstreams} * * @return the bitstreams diff --git a/dspace-api/src/main/java/org/dspace/content/Collection.java b/dspace-api/src/main/java/org/dspace/content/Collection.java index 33692d04b3d1..8c27c5a4ae1c 100644 --- a/dspace-api/src/main/java/org/dspace/content/Collection.java +++ b/dspace-api/src/main/java/org/dspace/content/Collection.java @@ -155,7 +155,7 @@ public Group getSubmitters() { /** * Set the default group of submitters * - * Package protected in order to preven unauthorized calls to this method + * Package protected in order to prevent unauthorized calls to this method * * @param submitters the group of submitters */ diff --git a/dspace-api/src/main/java/org/dspace/content/DCPersonName.java b/dspace-api/src/main/java/org/dspace/content/DCPersonName.java index cb9b5346ff69..e51882f82ede 100644 --- a/dspace-api/src/main/java/org/dspace/content/DCPersonName.java +++ b/dspace-api/src/main/java/org/dspace/content/DCPersonName.java @@ -44,7 +44,7 @@ public DCPersonName() { * @param rawValue the value entry from the database */ public DCPersonName(String rawValue) { - // Null by default (representing noone) + // Null by default (representing no one) lastName = null; firstNames = null; diff --git a/dspace-api/src/main/java/org/dspace/content/DSpaceObjectServiceImpl.java b/dspace-api/src/main/java/org/dspace/content/DSpaceObjectServiceImpl.java index c104833fe362..eee858fbc3e2 100644 --- a/dspace-api/src/main/java/org/dspace/content/DSpaceObjectServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/content/DSpaceObjectServiceImpl.java @@ -323,7 +323,7 @@ public List addMetadata(Context context, T dso, MetadataField met } } metadataValue.setValue(String.valueOf(dcvalue)); - //An update here isn't needed, this is persited upon the merge of the owning object + //An update here isn't needed, this is persisted upon the merge of the owning object // metadataValueService.update(context, metadataValue); dso.addDetails(metadataField.toString()); } diff --git a/dspace-api/src/main/java/org/dspace/content/ItemServiceImpl.java b/dspace-api/src/main/java/org/dspace/content/ItemServiceImpl.java index cceb954ebe2f..dc7820b669be 100644 --- a/dspace-api/src/main/java/org/dspace/content/ItemServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/content/ItemServiceImpl.java @@ -1005,7 +1005,7 @@ public void adjustBundleBitstreamPolicies(Context context, Item item, Collection throws SQLException, AuthorizeException { // Bundles should inherit from DEFAULT_ITEM_READ so that if the item is readable, the files // can be listed (even if they are themselves not readable as per DEFAULT_BITSTREAM_READ or other - // policies or embargos applied + // policies or embargoes applied List defaultCollectionBundlePolicies = authorizeService .getPoliciesActionFilter(context, collection, Constants.DEFAULT_ITEM_READ); // Bitstreams should inherit from DEFAULT_BITSTREAM_READ diff --git a/dspace-api/src/main/java/org/dspace/content/MetadataValueServiceImpl.java b/dspace-api/src/main/java/org/dspace/content/MetadataValueServiceImpl.java index 0c34c04f3051..97f0c2ccf4ca 100644 --- a/dspace-api/src/main/java/org/dspace/content/MetadataValueServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/content/MetadataValueServiceImpl.java @@ -52,7 +52,7 @@ public MetadataValue create(Context context, DSpaceObject dso, MetadataField met metadataValue.setMetadataField(metadataField); metadataValue.setDSpaceObject(dso); dso.addMetadata(metadataValue); -//An update here isn't needed, this is persited upon the merge of the owning object +//An update here isn't needed, this is persisted upon the merge of the owning object // metadataValueDAO.save(context, metadataValue); metadataValue = metadataValueDAO.create(context, metadataValue); log.info(LogHelper.getHeader(context, "add_metadatavalue", diff --git a/dspace-api/src/main/java/org/dspace/content/RelationshipType.java b/dspace-api/src/main/java/org/dspace/content/RelationshipType.java index ba5f0531e97e..bcabc98cff34 100644 --- a/dspace-api/src/main/java/org/dspace/content/RelationshipType.java +++ b/dspace-api/src/main/java/org/dspace/content/RelationshipType.java @@ -98,7 +98,7 @@ public class RelationshipType implements ReloadableEntity { private Integer rightMinCardinality; /** - * Tha maximum amount of relations for the rightItem that can be present at all times + * The maximum amount of relations for the rightItem that can be present at all times */ @Column(name = "right_max_cardinality") private Integer rightMaxCardinality; diff --git a/dspace-api/src/main/java/org/dspace/content/authority/Choice.java b/dspace-api/src/main/java/org/dspace/content/authority/Choice.java index 6d73bdb5eadb..9f6bff03bcbe 100644 --- a/dspace-api/src/main/java/org/dspace/content/authority/Choice.java +++ b/dspace-api/src/main/java/org/dspace/content/authority/Choice.java @@ -77,7 +77,7 @@ public Choice(String authority, String label, String value, Map /** * Constructor for common need of Hierarchical authorities that want to - * explicitely set the selectable flag + * explicitly set the selectable flag * * @param authority the authority key * @param value the text value to store in the metadata diff --git a/dspace-api/src/main/java/org/dspace/content/authority/ChoiceAuthority.java b/dspace-api/src/main/java/org/dspace/content/authority/ChoiceAuthority.java index 750e761f3d39..fddd85cea399 100644 --- a/dspace-api/src/main/java/org/dspace/content/authority/ChoiceAuthority.java +++ b/dspace-api/src/main/java/org/dspace/content/authority/ChoiceAuthority.java @@ -131,7 +131,7 @@ default Integer getPreloadLevel() { * Build the preferred choice associated with the authKey. The default * implementation delegate the creato to the {@link #getLabel(String, String)} * {@link #getValue(String, String)} and {@link #getExtra(String, String)} - * methods but can be directly overriden for better efficiency or special + * methods but can be directly overridden for better efficiency or special * scenario * * @param authKey authority key known to this authority. diff --git a/dspace-api/src/main/java/org/dspace/content/authority/ChoiceAuthorityServiceImpl.java b/dspace-api/src/main/java/org/dspace/content/authority/ChoiceAuthorityServiceImpl.java index f4d1f02710e1..f4201c1e28aa 100644 --- a/dspace-api/src/main/java/org/dspace/content/authority/ChoiceAuthorityServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/content/authority/ChoiceAuthorityServiceImpl.java @@ -42,7 +42,7 @@ * Broker for ChoiceAuthority plugins, and for other information configured * about the choice aspect of authority control for a metadata field. * - * Configuration keys, per metadata field (e.g. "dc.contributer.author") + * Configuration keys, per metadata field (e.g. "dc.contributor.author") * * {@code * # names the ChoiceAuthority plugin called for this field diff --git a/dspace-api/src/main/java/org/dspace/content/authority/DCInputAuthority.java b/dspace-api/src/main/java/org/dspace/content/authority/DCInputAuthority.java index 902bded33ef7..17548d808bad 100644 --- a/dspace-api/src/main/java/org/dspace/content/authority/DCInputAuthority.java +++ b/dspace-api/src/main/java/org/dspace/content/authority/DCInputAuthority.java @@ -30,7 +30,7 @@ * configurable submission. * * Configuration: - * This MUST be configured aas a self-named plugin, e.g.: + * This MUST be configured as a self-named plugin, e.g.: * {@code * plugin.selfnamed.org.dspace.content.authority.ChoiceAuthority = \ * org.dspace.content.authority.DCInputAuthority diff --git a/dspace-api/src/main/java/org/dspace/content/authority/SolrAuthority.java b/dspace-api/src/main/java/org/dspace/content/authority/SolrAuthority.java index 123626cd0965..a8631ba1f067 100644 --- a/dspace-api/src/main/java/org/dspace/content/authority/SolrAuthority.java +++ b/dspace-api/src/main/java/org/dspace/content/authority/SolrAuthority.java @@ -76,7 +76,7 @@ public Choices getMatches(String text, int start, int limit, String locale, Integer.parseInt(locale); locale = null; } catch (NumberFormatException e) { - //Everything is allright + //Everything is alright } if (locale != null && !"".equals(locale)) { localSearchField = searchField + "_" + locale; diff --git a/dspace-api/src/main/java/org/dspace/content/authority/service/ChoiceAuthorityService.java b/dspace-api/src/main/java/org/dspace/content/authority/service/ChoiceAuthorityService.java index 94e5ca57a028..f7325744c46a 100644 --- a/dspace-api/src/main/java/org/dspace/content/authority/service/ChoiceAuthorityService.java +++ b/dspace-api/src/main/java/org/dspace/content/authority/service/ChoiceAuthorityService.java @@ -22,7 +22,7 @@ * Broker for ChoiceAuthority plugins, and for other information configured * about the choice aspect of authority control for a metadata field. * - * Configuration keys, per metadata field (e.g. "dc.contributer.author") + * Configuration keys, per metadata field (e.g. "dc.contributor.author") * {@code * # names the ChoiceAuthority plugin called for this field * choices.plugin. = name-of-plugin diff --git a/dspace-api/src/main/java/org/dspace/content/authority/service/MetadataAuthorityService.java b/dspace-api/src/main/java/org/dspace/content/authority/service/MetadataAuthorityService.java index 2ba6791de59c..e40bb978d6fe 100644 --- a/dspace-api/src/main/java/org/dspace/content/authority/service/MetadataAuthorityService.java +++ b/dspace-api/src/main/java/org/dspace/content/authority/service/MetadataAuthorityService.java @@ -14,7 +14,7 @@ /** * Broker for metadata authority settings configured for each metadata field. * - * Configuration keys, per metadata field (e.g. "dc.contributer.author") + * Configuration keys, per metadata field (e.g. "dc.contributor.author") * * # is field authority controlled (i.e. store authority, confidence values)? * {@code authority.controlled. = true} diff --git a/dspace-api/src/main/java/org/dspace/content/crosswalk/DIMDisseminationCrosswalk.java b/dspace-api/src/main/java/org/dspace/content/crosswalk/DIMDisseminationCrosswalk.java index 4365d9a48533..76738118f6be 100644 --- a/dspace-api/src/main/java/org/dspace/content/crosswalk/DIMDisseminationCrosswalk.java +++ b/dspace-api/src/main/java/org/dspace/content/crosswalk/DIMDisseminationCrosswalk.java @@ -36,7 +36,7 @@ */ public class DIMDisseminationCrosswalk implements DisseminationCrosswalk { - // Non-existant XSD schema + // Non-existent XSD schema public static final String DIM_XSD = "null"; // Namespaces diff --git a/dspace-api/src/main/java/org/dspace/content/crosswalk/IngestionCrosswalk.java b/dspace-api/src/main/java/org/dspace/content/crosswalk/IngestionCrosswalk.java index bb73c83c459e..a8d983697271 100644 --- a/dspace-api/src/main/java/org/dspace/content/crosswalk/IngestionCrosswalk.java +++ b/dspace-api/src/main/java/org/dspace/content/crosswalk/IngestionCrosswalk.java @@ -37,7 +37,7 @@ public interface IngestionCrosswalk { * internal representations. This version accepts metadata as a * List of JDOM XML elements. It interprets the * contents of each element and adds the appropriate values to the - * DSpace Object's internal metadata represenation. + * DSpace Object's internal metadata representation. *

    * Note that this method may be called several times for the same target * Item, if the metadata comes as several lists of elements, so it should diff --git a/dspace-api/src/main/java/org/dspace/content/crosswalk/MODSDisseminationCrosswalk.java b/dspace-api/src/main/java/org/dspace/content/crosswalk/MODSDisseminationCrosswalk.java index 1e63be5ba1b9..6315f73a7c4a 100644 --- a/dspace-api/src/main/java/org/dspace/content/crosswalk/MODSDisseminationCrosswalk.java +++ b/dspace-api/src/main/java/org/dspace/content/crosswalk/MODSDisseminationCrosswalk.java @@ -202,7 +202,7 @@ public static modsTriple create(String qdc, String xml, String xpath) { * e.g. dc.contributor.author * * 2. XML fragment is prototype of metadata element, with empty or "%s" - * placeholders for value(s). NOTE: Leave the %s's in becaue + * placeholders for value(s). NOTE: Leave the %s's in because * it's much easier then to see if something is broken. * * 3. XPath expression listing point(s) in the above XML where diff --git a/dspace-api/src/main/java/org/dspace/content/crosswalk/OREIngestionCrosswalk.java b/dspace-api/src/main/java/org/dspace/content/crosswalk/OREIngestionCrosswalk.java index f756aae22577..aa9096517b30 100644 --- a/dspace-api/src/main/java/org/dspace/content/crosswalk/OREIngestionCrosswalk.java +++ b/dspace-api/src/main/java/org/dspace/content/crosswalk/OREIngestionCrosswalk.java @@ -173,7 +173,7 @@ public void ingest(Context context, DSpaceObject dso, Element root, boolean crea try { // Make sure the url string escapes all the oddball characters String processedURL = encodeForURL(href); - // Generate a requeset for the aggregated resource + // Generate a request for the aggregated resource ARurl = new URL(processedURL); in = ARurl.openStream(); } catch (FileNotFoundException fe) { diff --git a/dspace-api/src/main/java/org/dspace/content/crosswalk/QDCCrosswalk.java b/dspace-api/src/main/java/org/dspace/content/crosswalk/QDCCrosswalk.java index 2fdbaaad003e..fa582fd62f50 100644 --- a/dspace-api/src/main/java/org/dspace/content/crosswalk/QDCCrosswalk.java +++ b/dspace-api/src/main/java/org/dspace/content/crosswalk/QDCCrosswalk.java @@ -113,7 +113,7 @@ public class QDCCrosswalk extends SelfNamedPlugin private static final Namespace DCTERMS_NS = Namespace.getNamespace("dcterms", "http://purl.org/dc/terms/"); - // sentinal: done init? + // sentinel: done init? private boolean inited = false; // my plugin name diff --git a/dspace-api/src/main/java/org/dspace/content/crosswalk/SubscriptionDsoMetadataForEmailCompose.java b/dspace-api/src/main/java/org/dspace/content/crosswalk/SubscriptionDsoMetadataForEmailCompose.java index ad92018b2220..29baa980fc8b 100644 --- a/dspace-api/src/main/java/org/dspace/content/crosswalk/SubscriptionDsoMetadataForEmailCompose.java +++ b/dspace-api/src/main/java/org/dspace/content/crosswalk/SubscriptionDsoMetadataForEmailCompose.java @@ -47,12 +47,12 @@ public void disseminate(Context context, DSpaceObject dso, OutputStream out) thr Item item = (Item) dso; PrintStream printStream = new PrintStream(out); for (String actualMetadata : metadata) { - String[] splitted = actualMetadata.split("\\."); + String[] split = actualMetadata.split("\\."); String qualifier = null; - if (splitted.length == 3) { - qualifier = splitted[2]; + if (split.length == 3) { + qualifier = split[2]; } - var metadataValue = itemService.getMetadataFirstValue(item, splitted[0], splitted[1], qualifier, ANY); + var metadataValue = itemService.getMetadataFirstValue(item, split[0], split[1], qualifier, ANY); printStream.print(metadataValue + " "); } String itemURL = HandleServiceFactory.getInstance() diff --git a/dspace-api/src/main/java/org/dspace/content/dto/MetadataValueDTO.java b/dspace-api/src/main/java/org/dspace/content/dto/MetadataValueDTO.java index 8b538db3ff55..952aa799d2d1 100644 --- a/dspace-api/src/main/java/org/dspace/content/dto/MetadataValueDTO.java +++ b/dspace-api/src/main/java/org/dspace/content/dto/MetadataValueDTO.java @@ -52,7 +52,7 @@ public MetadataValueDTO() { * @param schema The schema to be assigned to this MetadataValueDTO object * @param element The element to be assigned to this MetadataValueDTO object * @param qualifier The qualifier to be assigned to this MetadataValueDTO object - * @param language The language to be assigend to this MetadataValueDTO object + * @param language The language to be assigned to this MetadataValueDTO object * @param value The value to be assigned to this MetadataValueDTO object * @param authority The authority to be assigned to this MetadataValueDTO object * @param confidence The confidence to be assigned to this MetadataValueDTO object @@ -73,7 +73,7 @@ public MetadataValueDTO(String schema, String element, String qualifier, String * @param schema The schema to be assigned to this MetadataValueDTO object * @param element The element to be assigned to this MetadataValueDTO object * @param qualifier The qualifier to be assigned to this MetadataValueDTO object - * @param language The language to be assigend to this MetadataValueDTO object + * @param language The language to be assigned to this MetadataValueDTO object * @param value The value to be assigned to this MetadataValueDTO object */ public MetadataValueDTO(String schema, String element, String qualifier, String language, String value) { diff --git a/dspace-api/src/main/java/org/dspace/content/logic/FilterUtils.java b/dspace-api/src/main/java/org/dspace/content/logic/FilterUtils.java index a878d69e6ed8..96ec82726775 100644 --- a/dspace-api/src/main/java/org/dspace/content/logic/FilterUtils.java +++ b/dspace-api/src/main/java/org/dspace/content/logic/FilterUtils.java @@ -74,7 +74,7 @@ public static Map, Filter> getIdentifierFilters(bool Map, Filter> filters = new HashMap<>(); // Put DOI 'can we create DOI on install / workspace?' filter Filter filter = FilterUtils.getFilterFromConfiguration("identifiers.submission.filter." + configurationSuffix); - // A null filter should be handled safely by the identifier provier (default, or "always true") + // A null filter should be handled safely by the identifier provider (default, or "always true") filters.put(DOI.class, filter); // This won't have an affect until handle providers implement filtering, but is an example of // how the filters can be used for other types diff --git a/dspace-api/src/main/java/org/dspace/content/packager/DSpaceAIPIngester.java b/dspace-api/src/main/java/org/dspace/content/packager/DSpaceAIPIngester.java index e7be7ab51190..e231c30809b0 100644 --- a/dspace-api/src/main/java/org/dspace/content/packager/DSpaceAIPIngester.java +++ b/dspace-api/src/main/java/org/dspace/content/packager/DSpaceAIPIngester.java @@ -139,7 +139,7 @@ public void crosswalkObjectDmd(Context context, DSpaceObject dso, } } - // MODS is acceptable otehrwise.. + // MODS is acceptable otherwise.. if (found == -1) { for (int i = 0; i < dmds.length; ++i) { //NOTE: METS standard actually says this should be MODS (all uppercase). But, diff --git a/dspace-api/src/main/java/org/dspace/content/packager/PDFPackager.java b/dspace-api/src/main/java/org/dspace/content/packager/PDFPackager.java index 6c7baad45497..c9105f8afe14 100644 --- a/dspace-api/src/main/java/org/dspace/content/packager/PDFPackager.java +++ b/dspace-api/src/main/java/org/dspace/content/packager/PDFPackager.java @@ -360,7 +360,7 @@ private void crosswalkPDF(Context context, Item item, InputStream metadata) * CreationDate -> date.created * ModDate -> date.created * Creator -> description.provenance (application that created orig) - * Producer -> description.provenance (convertor to pdf) + * Producer -> description.provenance (converter to pdf) * Subject -> description.abstract * Keywords -> subject.other * date is java.util.Calendar diff --git a/dspace-api/src/main/java/org/dspace/content/packager/PackageDisseminator.java b/dspace-api/src/main/java/org/dspace/content/packager/PackageDisseminator.java index c5ebffc9f887..6c82c639a02f 100644 --- a/dspace-api/src/main/java/org/dspace/content/packager/PackageDisseminator.java +++ b/dspace-api/src/main/java/org/dspace/content/packager/PackageDisseminator.java @@ -38,7 +38,7 @@ * format output by disseminate may be affected by * parameters, it is given to the getMIMEType method as well. * The parameters list is a generalized mechanism to pass parameters - * from the package requestor to the packager, since different packagers will + * from the package requester to the packager, since different packagers will * understand different sets of parameters. * * @author Larry Stone diff --git a/dspace-api/src/main/java/org/dspace/content/packager/PackageIngester.java b/dspace-api/src/main/java/org/dspace/content/packager/PackageIngester.java index 9b1d9f4f4980..c28bd98e1844 100644 --- a/dspace-api/src/main/java/org/dspace/content/packager/PackageIngester.java +++ b/dspace-api/src/main/java/org/dspace/content/packager/PackageIngester.java @@ -34,7 +34,7 @@ * The ingest methods are also given an attribute-value * list of "parameters" which may modify their actions. * The parameters list is a generalized mechanism to pass parameters - * from the requestor to the packager, since different packagers will + * from the requester to the packager, since different packagers will * understand different sets of parameters. * * @author Larry Stone diff --git a/dspace-api/src/main/java/org/dspace/content/service/CommunityService.java b/dspace-api/src/main/java/org/dspace/content/service/CommunityService.java index 163baedf5ff2..5734d5a9d9ab 100644 --- a/dspace-api/src/main/java/org/dspace/content/service/CommunityService.java +++ b/dspace-api/src/main/java/org/dspace/content/service/CommunityService.java @@ -181,7 +181,7 @@ public Bitstream setLogo(Context context, Community community, InputStream is) t /** - * Add an exisiting collection to the community + * Add an existing collection to the community * * @param context context * @param community community diff --git a/dspace-api/src/main/java/org/dspace/content/service/FeedbackService.java b/dspace-api/src/main/java/org/dspace/content/service/FeedbackService.java index 7eac0ee61dc2..68bb0b15585a 100644 --- a/dspace-api/src/main/java/org/dspace/content/service/FeedbackService.java +++ b/dspace-api/src/main/java/org/dspace/content/service/FeedbackService.java @@ -20,7 +20,7 @@ public interface FeedbackService { /** - * This method sends the feeback email to the recipient passed as parameter + * This method sends the feedback email to the recipient passed as parameter * @param context current DSpace application context * @param request current servlet request * @param recipientEmail recipient to which mail is sent diff --git a/dspace-api/src/main/java/org/dspace/content/service/RelationshipService.java b/dspace-api/src/main/java/org/dspace/content/service/RelationshipService.java index 719f966e4622..f32e965c6273 100644 --- a/dspace-api/src/main/java/org/dspace/content/service/RelationshipService.java +++ b/dspace-api/src/main/java/org/dspace/content/service/RelationshipService.java @@ -282,7 +282,7 @@ public List findByLatestItemAndRelationshipType( List findByRelationshipType(Context context, RelationshipType relationshipType) throws SQLException; /** - * This method returns a list of Relationship objets for which the relationshipType property is equal to the given + * This method returns a list of Relationship objects for which the relationshipType property is equal to the given * RelationshipType object * NOTE: tilted relationships are NEVER excluded when fetching one relationship type * @param context The relevant DSpace context diff --git a/dspace-api/src/main/java/org/dspace/content/virtual/Concatenate.java b/dspace-api/src/main/java/org/dspace/content/virtual/Concatenate.java index b788cbf9fc17..0bc7e3cd2a39 100644 --- a/dspace-api/src/main/java/org/dspace/content/virtual/Concatenate.java +++ b/dspace-api/src/main/java/org/dspace/content/virtual/Concatenate.java @@ -62,16 +62,16 @@ public void setFields(List fields) { } /** - * Generic getter for the seperator - * @return the seperator to be used by this bean + * Generic getter for the separator + * @return the separator to be used by this bean */ public String getSeparator() { return separator; } /** - * Generic setter for the seperator property - * @param separator The String seperator value to which this seperator value will be set to + * Generic setter for the separator property + * @param separator The String separator value to which this separator value will be set to */ public void setSeparator(String separator) { this.separator = separator; diff --git a/dspace-api/src/main/java/org/dspace/core/AbstractHibernateDAO.java b/dspace-api/src/main/java/org/dspace/core/AbstractHibernateDAO.java index 3658a3c92305..b6db81662f0e 100644 --- a/dspace-api/src/main/java/org/dspace/core/AbstractHibernateDAO.java +++ b/dspace-api/src/main/java/org/dspace/core/AbstractHibernateDAO.java @@ -346,7 +346,7 @@ public int count(Context context, CriteriaQuery criteriaQuery, CriteriaBuilder c /** * This method will return the count of items for this query as an integer - * This query needs to already be in a formate that'll return one record that contains the amount + * This query needs to already be in a format that'll return one record that contains the amount * * @param query * The query for which the amount of results will be returned. diff --git a/dspace-api/src/main/java/org/dspace/core/Context.java b/dspace-api/src/main/java/org/dspace/core/Context.java index 02a3fee09f8a..877b7a00554f 100644 --- a/dspace-api/src/main/java/org/dspace/core/Context.java +++ b/dspace-api/src/main/java/org/dspace/core/Context.java @@ -713,7 +713,7 @@ public Set getSpecialGroupUuids() { public void switchContextUser(EPerson newUser) { if (currentUserPreviousState != null) { throw new IllegalStateException( - "A previous user is already set, you can only switch back and foreward one time"); + "A previous user is already set, you can only switch back and forward one time"); } currentUserPreviousState = currentUser; diff --git a/dspace-api/src/main/java/org/dspace/core/HibernateProxyHelper.java b/dspace-api/src/main/java/org/dspace/core/HibernateProxyHelper.java index 22f91a48aa7f..f9bdd1c01424 100644 --- a/dspace-api/src/main/java/org/dspace/core/HibernateProxyHelper.java +++ b/dspace-api/src/main/java/org/dspace/core/HibernateProxyHelper.java @@ -34,6 +34,6 @@ public static Class getClassWithoutInitializingProxy(Object object) { } private HibernateProxyHelper() { - //cant instantiate + //can't instantiate } } diff --git a/dspace-api/src/main/java/org/dspace/core/LogHelper.java b/dspace-api/src/main/java/org/dspace/core/LogHelper.java index 00cc0f27664b..5c3f345dfb89 100644 --- a/dspace-api/src/main/java/org/dspace/core/LogHelper.java +++ b/dspace-api/src/main/java/org/dspace/core/LogHelper.java @@ -50,7 +50,7 @@ public static String getHeader(Context context, String action, StringBuilder result = new StringBuilder(); - // Escape everthing but the extra context info because for some crazy reason two fields + // Escape everything but the extra context info because for some crazy reason two fields // are generated inside this entry one for the session id, and another for the ip // address. Everything else should be escaped. result.append(escapeLogField(email)).append(":").append(contextExtraInfo).append(":") diff --git a/dspace-api/src/main/java/org/dspace/core/Utils.java b/dspace-api/src/main/java/org/dspace/core/Utils.java index ea9ed57eca04..b5423decf2f0 100644 --- a/dspace-api/src/main/java/org/dspace/core/Utils.java +++ b/dspace-api/src/main/java/org/dspace/core/Utils.java @@ -95,7 +95,7 @@ public final class Utils { private static final SimpleDateFormat outFmtSecond = new SimpleDateFormat("yyyy'-'MM'-'dd'T'HH':'mm':'ssZ"); - // output format with millsecond precision + // output format with millisecond precision private static final SimpleDateFormat outFmtMillisec = new SimpleDateFormat("yyyy'-'MM'-'dd'T'HH':'mm':'ss.SSSZ"); diff --git a/dspace-api/src/main/java/org/dspace/correctiontype/WithdrawnCorrectionType.java b/dspace-api/src/main/java/org/dspace/correctiontype/WithdrawnCorrectionType.java index edf71ed8151f..e3d074b1d337 100644 --- a/dspace-api/src/main/java/org/dspace/correctiontype/WithdrawnCorrectionType.java +++ b/dspace-api/src/main/java/org/dspace/correctiontype/WithdrawnCorrectionType.java @@ -32,7 +32,7 @@ /** * Implementation class for {@link CorrectionType} - * that will withdrawn target item if it archived and wasn't withdrawn alredy. + * that will withdrawn target item if it archived and wasn't withdrawn already. * * @author Mykhaylo Boychuk (mykhaylo.boychuk at 4science.com) */ diff --git a/dspace-api/src/main/java/org/dspace/ctask/general/BasicLinkChecker.java b/dspace-api/src/main/java/org/dspace/ctask/general/BasicLinkChecker.java index fbc6eebdb5b8..756d65a0ad09 100644 --- a/dspace-api/src/main/java/org/dspace/ctask/general/BasicLinkChecker.java +++ b/dspace-api/src/main/java/org/dspace/ctask/general/BasicLinkChecker.java @@ -145,7 +145,7 @@ protected int getResponseStatus(String url) { } /** - * Internal utitity method to get a description of the handle + * Internal utility method to get a description of the handle * * @param item The item to get a description of * @return The handle, or in workflow diff --git a/dspace-api/src/main/java/org/dspace/ctask/general/CitationPage.java b/dspace-api/src/main/java/org/dspace/ctask/general/CitationPage.java index fa630029b890..2455ca09530f 100644 --- a/dspace-api/src/main/java/org/dspace/ctask/general/CitationPage.java +++ b/dspace-api/src/main/java/org/dspace/ctask/general/CitationPage.java @@ -114,7 +114,7 @@ protected void performItem(Item item) throws SQLException { // don't inherit now otherwise they will be copied over the moved bitstreams resourcePolicyService.removeAllPolicies(Curator.curationContext(), dBundle); } catch (AuthorizeException e) { - log.error("User not authroized to create bundle on item \"{}\": {}", + log.error("User not authorized to create bundle on item \"{}\": {}", item::getName, e::getMessage); return; } @@ -144,7 +144,7 @@ protected void performItem(Item item) throws SQLException { // don't inherit now otherwise they will be copied over the moved bitstreams resourcePolicyService.removeAllPolicies(Curator.curationContext(), pBundle); } catch (AuthorizeException e) { - log.error("User not authroized to create bundle on item \"" + log.error("User not authorized to create bundle on item \"" + item.getName() + "\": " + e.getMessage()); } bundles = itemService.getBundles(item, "ORIGINAL"); @@ -173,7 +173,7 @@ protected void performItem(Item item) throws SQLException { InputStream citedInputStream = new ByteArrayInputStream( citationDocument.makeCitedDocument(Curator.curationContext(), bitstream).getLeft()); - //Add the cited document to the approiate bundle + //Add the cited document to the appropriate bundle this.addCitedPageToItem(citedInputStream, bundle, pBundle, dBundle, item, bitstream); // now set the policies of the preservation and display bundle diff --git a/dspace-api/src/main/java/org/dspace/curate/ScriptedTask.java b/dspace-api/src/main/java/org/dspace/curate/ScriptedTask.java index 7f63cb76dd90..8d8ab491d2de 100644 --- a/dspace-api/src/main/java/org/dspace/curate/ScriptedTask.java +++ b/dspace-api/src/main/java/org/dspace/curate/ScriptedTask.java @@ -16,7 +16,7 @@ * ScriptedTask describes a rather generic ability to perform an operation * upon a DSpace object. It's semantics are identical to the CurationTask interface, * but is designed to be implemented in scripting languages, rather than - * Java. For this reason, the 'perform' methods are renamed to accomodate + * Java. For this reason, the 'perform' methods are renamed to accommodate * languages (like Ruby) that lack method overloading. * * @author richardrodgers diff --git a/dspace-api/src/main/java/org/dspace/discovery/IndexClientOptions.java b/dspace-api/src/main/java/org/dspace/discovery/IndexClientOptions.java index 0de5b22d0655..b3f72cb772dc 100644 --- a/dspace-api/src/main/java/org/dspace/discovery/IndexClientOptions.java +++ b/dspace-api/src/main/java/org/dspace/discovery/IndexClientOptions.java @@ -94,7 +94,7 @@ protected static Options constructOptions() { options.addOption("b", "build", false, "(re)build index, wiping out current one if it exists"); options.addOption("s", "spellchecker", false, "Rebuild the spellchecker, can be combined with -b and -f."); options.addOption("f", "force", false, - "if updating existing index, force each handle to be reindexed even if uptodate"); + "if updating existing index, force each handle to be reindexed even if up-to-date"); options.addOption("h", "help", false, "print this help message"); return options; } diff --git a/dspace-api/src/main/java/org/dspace/discovery/IndexingService.java b/dspace-api/src/main/java/org/dspace/discovery/IndexingService.java index 2ef5affa47b7..6a80d5282001 100644 --- a/dspace-api/src/main/java/org/dspace/discovery/IndexingService.java +++ b/dspace-api/src/main/java/org/dspace/discovery/IndexingService.java @@ -79,7 +79,7 @@ void reIndexContent(Context context, IndexableObject dso) /** * Atomically update the index of a single field for an object * @param context The DSpace context - * @param uniqueIndexId The unqiue index ID of the object to update the index for + * @param uniqueIndexId The unique index ID of the object to update the index for * @param field The field to update * @param fieldModifier The modifiers for the field to update. More information on how to atomically update a solr * field using a field modifier can be found here: https://yonik.com/solr/atomic-updates/ diff --git a/dspace-api/src/main/java/org/dspace/discovery/SearchUtils.java b/dspace-api/src/main/java/org/dspace/discovery/SearchUtils.java index 60bf52836bef..e94b1f2fb71b 100644 --- a/dspace-api/src/main/java/org/dspace/discovery/SearchUtils.java +++ b/dspace-api/src/main/java/org/dspace/discovery/SearchUtils.java @@ -88,7 +88,7 @@ public static DiscoveryConfiguration getDiscoveryConfiguration() { /** * Retrieves the Discovery Configuration with a null prefix for a DSpace object. * @param context - * the dabase context + * the database context * @param dso * the DSpace object * @return the Discovery Configuration for the specified DSpace object diff --git a/dspace-api/src/main/java/org/dspace/discovery/SolrServiceImpl.java b/dspace-api/src/main/java/org/dspace/discovery/SolrServiceImpl.java index a0c1188d7132..67891f122b25 100644 --- a/dspace-api/src/main/java/org/dspace/discovery/SolrServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/discovery/SolrServiceImpl.java @@ -1230,7 +1230,7 @@ public List search(Context context, String query, String orderf } catch (IOException | SQLException | SolrServerException e) { // Any acception that we get ignore it. // We do NOT want any crashed to shown by the user - log.error(LogHelper.getHeader(context, "Error while quering solr", "Query: " + query), e); + log.error(LogHelper.getHeader(context, "Error while querying solr", "Query: " + query), e); return new ArrayList<>(0); } } @@ -1359,7 +1359,7 @@ public String toSortFieldIndex(String metadataField, String type) { * Gets the solr field that contains the facet value split on each word break to the end, so can be searched * on each word in the value, see {@link org.dspace.discovery.indexobject.ItemIndexFactoryImpl * #saveFacetPrefixParts(SolrInputDocument, DiscoverySearchFilter, String, String)} - * Ony applicable to facets of type {@link DiscoveryConfigurationParameters.TYPE_TEXT}, otherwise uses the regular + * Only applicable to facets of type {@link DiscoveryConfigurationParameters.TYPE_TEXT}, otherwise uses the regular * facet filter field */ protected String transformPrefixFacetField(DiscoverFacetField facetFieldConfig, String field, diff --git a/dspace-api/src/main/java/org/dspace/discovery/SolrServiceMetadataBrowseIndexingPlugin.java b/dspace-api/src/main/java/org/dspace/discovery/SolrServiceMetadataBrowseIndexingPlugin.java index 746a0cb83214..dda041c7b850 100644 --- a/dspace-api/src/main/java/org/dspace/discovery/SolrServiceMetadataBrowseIndexingPlugin.java +++ b/dspace-api/src/main/java/org/dspace/discovery/SolrServiceMetadataBrowseIndexingPlugin.java @@ -79,7 +79,7 @@ public void additionalIndex(Context context, IndexableObject indexableObject, So // Faceting for metadata browsing. It is different than search facet // because if there are authority with variants support we want all the // variants to go in the facet... they are sorted by count so just the - // prefered label is relevant + // preferred label is relevant for (BrowseIndex bi : bis) { log.debug("Indexing for item " + item.getID() + ", for index: " + bi.getTableName()); @@ -280,7 +280,7 @@ public void additionalIndex(Context context, IndexableObject indexableObject, So } } - // Add sorting options as configurated for the browse system + // Add sorting options as configured for the browse system try { for (SortOption so : SortOption.getSortOptions()) { List dcvalue = itemService.getMetadataByMetadataString(item, so.getMetadata()); diff --git a/dspace-api/src/main/java/org/dspace/discovery/configuration/DiscoverySearchFilter.java b/dspace-api/src/main/java/org/dspace/discovery/configuration/DiscoverySearchFilter.java index ac64573c5d05..8767ea83da06 100644 --- a/dspace-api/src/main/java/org/dspace/discovery/configuration/DiscoverySearchFilter.java +++ b/dspace-api/src/main/java/org/dspace/discovery/configuration/DiscoverySearchFilter.java @@ -57,7 +57,7 @@ public String getType() { * For the DiscoverySearchFilter only the TYPE_TEXT, TYPE_DATE and TYPE_HIERARCHICAL are allowed * * @param type The type for this DiscoverySearchFilter - * @throws DiscoveryConfigurationException If none of the types match, this error will be thrown indiciating this + * @throws DiscoveryConfigurationException If none of the types match, this error will be thrown indicating this */ public void setType(String type) throws DiscoveryConfigurationException { if (type.equalsIgnoreCase(DiscoveryConfigurationParameters.TYPE_TEXT)) { diff --git a/dspace-api/src/main/java/org/dspace/eperson/EPerson.java b/dspace-api/src/main/java/org/dspace/eperson/EPerson.java index 996fc96e3aa8..f79efebf5ffc 100644 --- a/dspace-api/src/main/java/org/dspace/eperson/EPerson.java +++ b/dspace-api/src/main/java/org/dspace/eperson/EPerson.java @@ -174,7 +174,7 @@ public String getLanguage() { /** * Set the EPerson's language. Value is expected to be a Unix/POSIX * Locale specification of the form {language} or {language}_{territory}, - * e.g. "en", "en_US", "pt_BR" (the latter is Brazilian Portugese). + * e.g. "en", "en_US", "pt_BR" (the latter is Brazilian Portuguese). * * @param context The relevant DSpace Context. * @param language language code diff --git a/dspace-api/src/main/java/org/dspace/eperson/EPersonConsumer.java b/dspace-api/src/main/java/org/dspace/eperson/EPersonConsumer.java index 8679d74b2421..8970bb2849d9 100644 --- a/dspace-api/src/main/java/org/dspace/eperson/EPersonConsumer.java +++ b/dspace-api/src/main/java/org/dspace/eperson/EPersonConsumer.java @@ -47,7 +47,7 @@ public class EPersonConsumer implements Consumer { = DSpaceServicesFactory.getInstance().getConfigurationService(); /** - * Initalise the consumer + * Initialise the consumer * * @throws Exception if error */ diff --git a/dspace-api/src/main/java/org/dspace/eperson/EPersonServiceImpl.java b/dspace-api/src/main/java/org/dspace/eperson/EPersonServiceImpl.java index b9ac740685bd..40e0859be17d 100644 --- a/dspace-api/src/main/java/org/dspace/eperson/EPersonServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/eperson/EPersonServiceImpl.java @@ -343,11 +343,11 @@ public void delete(Context context, EPerson ePerson) throws SQLException, Author try { delete(context, ePerson, true); } catch (AuthorizeException ex) { - log.error("This AuthorizeException: " + ex + " occured while deleting Eperson with the ID: " + + log.error("This AuthorizeException: " + ex + " occurred while deleting Eperson with the ID: " + ePerson.getID()); throw new AuthorizeException(ex); } catch (IOException ex) { - log.error("This IOException: " + ex + " occured while deleting Eperson with the ID: " + ePerson.getID()); + log.error("This IOException: " + ex + " occurred while deleting Eperson with the ID: " + ePerson.getID()); throw new AuthorizeException(ex); } catch (EPersonDeletionException e) { throw new IllegalStateException(e); @@ -451,7 +451,7 @@ public void delete(Context context, EPerson ePerson, boolean cascade) ePerson, task.getStepID()); } catch (WorkflowConfigurationException ex) { log.error("This WorkflowConfigurationException: " + ex + - " occured while deleting Eperson with the ID: " + ePerson.getID()); + " occurred while deleting Eperson with the ID: " + ePerson.getID()); throw new AuthorizeException(new EPersonDeletionException(Collections .singletonList(tableName))); } diff --git a/dspace-api/src/main/java/org/dspace/event/Event.java b/dspace-api/src/main/java/org/dspace/event/Event.java index a673cd985274..1f90381d00aa 100644 --- a/dspace-api/src/main/java/org/dspace/event/Event.java +++ b/dspace-api/src/main/java/org/dspace/event/Event.java @@ -193,7 +193,7 @@ public class Event implements Serializable { * Contains all identifiers of the DSpaceObject that was changed (added, * modified, deleted, ...). * - * All events gets fired when a context that contains events gets commited. + * All events gets fired when a context that contains events gets committed. * When the delete event is fired, a deleted DSpaceObject is already gone. * This array contains all identifiers of the object, not only the handle * as the detail field does. The field may be an empty array if no diff --git a/dspace-api/src/main/java/org/dspace/event/EventServiceImpl.java b/dspace-api/src/main/java/org/dspace/event/EventServiceImpl.java index 1afc0a22f5f0..575c42250b52 100644 --- a/dspace-api/src/main/java/org/dspace/event/EventServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/event/EventServiceImpl.java @@ -107,7 +107,7 @@ public Dispatcher getDispatcher(String name) { try { return (Dispatcher) dispatcherPool.borrowObject(name); } catch (Exception e) { - throw new IllegalStateException("Unable to aquire dispatcher named " + name, e); + throw new IllegalStateException("Unable to acquire dispatcher named " + name, e); } } @@ -153,7 +153,7 @@ protected class DispatcherPoolFactory implements KeyedPooledObjectFactory dispatchers = new HashMap(); public DispatcherPoolFactory() { diff --git a/dspace-api/src/main/java/org/dspace/event/service/EventService.java b/dspace-api/src/main/java/org/dspace/event/service/EventService.java index 5c032c3f74f7..d8b26e891beb 100644 --- a/dspace-api/src/main/java/org/dspace/event/service/EventService.java +++ b/dspace-api/src/main/java/org/dspace/event/service/EventService.java @@ -27,7 +27,7 @@ public interface EventService { * if one exists. * * @param name dispatcher name - * @return chached instance of dispatcher + * @return cached instance of dispatcher */ public Dispatcher getDispatcher(String name); diff --git a/dspace-api/src/main/java/org/dspace/external/provider/impl/SHERPAv2JournalISSNDataProvider.java b/dspace-api/src/main/java/org/dspace/external/provider/impl/SHERPAv2JournalISSNDataProvider.java index 9e61b9ac2ac0..11d8f692af19 100644 --- a/dspace-api/src/main/java/org/dspace/external/provider/impl/SHERPAv2JournalISSNDataProvider.java +++ b/dspace-api/src/main/java/org/dspace/external/provider/impl/SHERPAv2JournalISSNDataProvider.java @@ -26,7 +26,7 @@ /** * This class is the implementation of the ExternalDataProvider interface that will deal with SherpaJournal External - * data lookups based on ISSN (to match functinoality offered by legacy SHERPASubmitService for policy lookups + * data lookups based on ISSN (to match functionality offered by legacy SHERPASubmitService for policy lookups * at the time of submission). * This provider is a refactored version of SherpaJournalDataPublisher, rewritten to work with SHERPA v2 API * diff --git a/dspace-api/src/main/java/org/dspace/external/service/ExternalDataService.java b/dspace-api/src/main/java/org/dspace/external/service/ExternalDataService.java index 53423395e3fa..4c75a778d1fe 100644 --- a/dspace-api/src/main/java/org/dspace/external/service/ExternalDataService.java +++ b/dspace-api/src/main/java/org/dspace/external/service/ExternalDataService.java @@ -58,7 +58,7 @@ public interface ExternalDataService { public List searchExternalDataObjects(String source, String query, int start, int limit); /** - * This method wil return the total amount of results that will be found for the given query in the given source + * This method will return the total amount of results that will be found for the given query in the given source * @param source The source in which the query will happen to return the number of results * @param query The query to be ran in this source to retrieve the total amount of results * @return The total amount of results that can be returned for this query in the given source diff --git a/dspace-api/src/main/java/org/dspace/google/GoogleAsyncEventListener.java b/dspace-api/src/main/java/org/dspace/google/GoogleAsyncEventListener.java index 68c492d1a9a0..f5b27fcbd496 100644 --- a/dspace-api/src/main/java/org/dspace/google/GoogleAsyncEventListener.java +++ b/dspace-api/src/main/java/org/dspace/google/GoogleAsyncEventListener.java @@ -37,7 +37,7 @@ /** * Notifies Google Analytics of Bitstream VIEW events. These events are stored in memory and then - * asynchronously processed by a single seperate thread. + * asynchronously processed by a single separate thread. * * @author April Herron * @author Luca Giamminonni @@ -142,7 +142,7 @@ private GoogleAnalyticsEvent createGoogleAnalyticsEvent(UsageEvent usageEvent) { /** * Client ID, should uniquely identify the user or device. If we have an * X-CORRELATION-ID header or a session ID for the user, then lets use it, - * othwerwise generate a UUID. + * otherwise generate a UUID. */ private String getClientId(UsageEvent usageEvent) { if (usageEvent.getRequest().getHeader("X-CORRELATION-ID") != null) { diff --git a/dspace-api/src/main/java/org/dspace/handle/HandleServiceImpl.java b/dspace-api/src/main/java/org/dspace/handle/HandleServiceImpl.java index aa730fe2b115..5f511875d174 100644 --- a/dspace-api/src/main/java/org/dspace/handle/HandleServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/handle/HandleServiceImpl.java @@ -312,7 +312,7 @@ public void modifyHandleDSpaceObject(Context context, String handle, DSpaceObjec Handle dbHandle = findHandleInternal(context, handle); if (dbHandle != null) { // Check if we have to remove the handle from the current handle list - // or if object is alreday deleted. + // or if object is already deleted. if (dbHandle.getDSpaceObject() != null) { // Remove the old handle from the current handle list dbHandle.getDSpaceObject().getHandles().remove(dbHandle); diff --git a/dspace-api/src/main/java/org/dspace/handle/hdlresolver/HdlResolverDTO.java b/dspace-api/src/main/java/org/dspace/handle/hdlresolver/HdlResolverDTO.java index fe50bba813d6..1973b92522e5 100644 --- a/dspace-api/src/main/java/org/dspace/handle/hdlresolver/HdlResolverDTO.java +++ b/dspace-api/src/main/java/org/dspace/handle/hdlresolver/HdlResolverDTO.java @@ -57,7 +57,7 @@ public HdlResolverDTO(final String requestURL, final String resolverSubPath) { } /** - * Returns the splitted String of the resource-path + * Returns the split String of the resource-path * * @return */ diff --git a/dspace-api/src/main/java/org/dspace/harvest/HarvestThread.java b/dspace-api/src/main/java/org/dspace/harvest/HarvestThread.java index 52498558d49a..5947953ef50d 100644 --- a/dspace-api/src/main/java/org/dspace/harvest/HarvestThread.java +++ b/dspace-api/src/main/java/org/dspace/harvest/HarvestThread.java @@ -58,12 +58,12 @@ private void runHarvest() { } catch (RuntimeException e) { log.error("Runtime exception in thread: " + this.toString()); log.error(e.getMessage() + " " + e.getCause()); - hc.setHarvestMessage("Runtime error occured while generating an OAI response"); + hc.setHarvestMessage("Runtime error occurred while generating an OAI response"); hc.setHarvestStatus(HarvestedCollection.STATUS_UNKNOWN_ERROR); } catch (Exception ex) { log.error("General exception in thread: " + this.toString()); log.error(ex.getMessage() + " " + ex.getCause()); - hc.setHarvestMessage("Error occured while generating an OAI response"); + hc.setHarvestMessage("Error occurred while generating an OAI response"); hc.setHarvestStatus(HarvestedCollection.STATUS_UNKNOWN_ERROR); } finally { try { diff --git a/dspace-api/src/main/java/org/dspace/identifier/DOIIdentifierProvider.java b/dspace-api/src/main/java/org/dspace/identifier/DOIIdentifierProvider.java index ae31e54f7e96..29c6a5bb8f6a 100644 --- a/dspace-api/src/main/java/org/dspace/identifier/DOIIdentifierProvider.java +++ b/dspace-api/src/main/java/org/dspace/identifier/DOIIdentifierProvider.java @@ -286,8 +286,8 @@ public void register(Context context, DSpaceObject dso, String identifier, Filte try { doiRow = loadOrCreateDOI(context, dso, doi, filter); } catch (SQLException ex) { - log.error("Error in databse connection: {}", ex::getMessage); - throw new RuntimeException("Error in database conncetion.", ex); + log.error("Error in database connection: {}", ex::getMessage); + throw new RuntimeException("Error in database connection.", ex); } if (DELETED.equals(doiRow.getStatus()) || @@ -473,7 +473,7 @@ public void registerOnline(Context context, DSpaceObject dso, String identifier, /** * Update metadata for a registered object - * If the DOI for hte item already exists, *always* skip the filter since it should only be used for + * If the DOI for the item already exists, *always* skip the filter since it should only be used for * allowing / disallowing reservation and registration, not metadata updates or deletions * * @param context - DSpace context @@ -525,7 +525,7 @@ public void updateMetadata(Context context, DSpaceObject dso, String identifier) /** * Update metadata for a registered object in the DOI Connector to update the agency records - * If the DOI for hte item already exists, *always* skip the filter since it should only be used for + * If the DOI for the item already exists, *always* skip the filter since it should only be used for * allowing / disallowing reservation and registration, not metadata updates or deletions * * @param context - DSpace context @@ -611,7 +611,7 @@ public String mint(Context context, DSpaceObject dso, Filter filter) throws Iden try { doi = getDOIByObject(context, dso); } catch (SQLException e) { - log.error("Error while attemping to retrieve information about a DOI for {} with ID {}.", + log.error("Error while attempting to retrieve information about a DOI for {} with ID {}.", contentServiceFactory.getDSpaceObjectService(dso).getTypeText(dso), dso.getID()); throw new RuntimeException("Error while attempting to retrieve " + "information about a DOI for " + contentServiceFactory.getDSpaceObjectService(dso).getTypeText(dso) + @@ -709,7 +709,7 @@ public void delete(Context context, DSpaceObject dso) doi = getDOIByObject(context, dso); } } catch (SQLException ex) { - log.error("Error while attemping to retrieve information about a DOI for {} with ID {}.", + log.error("Error while attempting to retrieve information about a DOI for {} with ID {}.", contentServiceFactory.getDSpaceObjectService(dso).getTypeText(dso), dso.getID(), ex); throw new RuntimeException("Error while attempting to retrieve " + diff --git a/dspace-api/src/main/java/org/dspace/identifier/VersionedDOIIdentifierProvider.java b/dspace-api/src/main/java/org/dspace/identifier/VersionedDOIIdentifierProvider.java index e5a90907c7b6..b970c9f06c48 100644 --- a/dspace-api/src/main/java/org/dspace/identifier/VersionedDOIIdentifierProvider.java +++ b/dspace-api/src/main/java/org/dspace/identifier/VersionedDOIIdentifierProvider.java @@ -137,8 +137,9 @@ public String mint(Context context, DSpaceObject dso, Filter filter) loadOrCreateDOI(context, dso, versionedDOI, filter); } catch (SQLException ex) { log.error( - "A problem with the database connection occurd while processing DOI " + versionedDOI + ".", ex); - throw new RuntimeException("A problem with the database connection occured.", ex); + "A problem with the database connection occurred while processing DOI " + versionedDOI + ".", + ex); + throw new RuntimeException("A problem with the database connection occurred.", ex); } return versionedDOI; } @@ -350,14 +351,14 @@ void removePreviousVersionDOIsOutOfObject(Context c, Item item, String oldDoi) changed = true; } } - // reset the metadata if neccessary. + // reset the metadata if necessary. if (changed) { try { itemService.clearMetadata(c, item, MD_SCHEMA, DOI_ELEMENT, DOI_QUALIFIER, Item.ANY); itemService.addMetadata(c, item, MD_SCHEMA, DOI_ELEMENT, DOI_QUALIFIER, null, newIdentifiers); itemService.update(c, item); } catch (SQLException ex) { - throw new RuntimeException("A problem with the database connection occured.", ex); + throw new RuntimeException("A problem with the database connection occurred.", ex); } } } diff --git a/dspace-api/src/main/java/org/dspace/identifier/VersionedHandleIdentifierProvider.java b/dspace-api/src/main/java/org/dspace/identifier/VersionedHandleIdentifierProvider.java index 1678fb423a8f..4c8c785cbd4e 100644 --- a/dspace-api/src/main/java/org/dspace/identifier/VersionedHandleIdentifierProvider.java +++ b/dspace-api/src/main/java/org/dspace/identifier/VersionedHandleIdentifierProvider.java @@ -127,7 +127,7 @@ public void register(Context context, DSpaceObject dso, String identifier) try { versionNumber = Integer.valueOf(versionHandleMatcher.group(1)); } catch (NumberFormatException ex) { - throw new IllegalStateException("Cannot detect the interger value of a digit.", ex); + throw new IllegalStateException("Cannot detect the integer value of a digit.", ex); } // get history @@ -148,7 +148,7 @@ public void register(Context context, DSpaceObject dso, String identifier) try { versionHistoryService.getVersion(context, history, item); } catch (SQLException ex) { - throw new RuntimeException("Problem with the database connection occurd.", ex); + throw new RuntimeException("Problem with the database connection occurred.", ex); } // did we found a version? @@ -184,11 +184,11 @@ public void register(Context context, DSpaceObject dso, String identifier) } catch (SQLException | IOException ex) { throw new RuntimeException("Unable to restore a versioned " + "handle as there was a problem in creating a " - + "neccessary item version: ", ex); + + "necessary item version: ", ex); } catch (AuthorizeException ex) { throw new RuntimeException("Unable to restore a versioned " + "handle as the current user was not allowed to " - + "create a neccessary item version: ", ex); + + "create a necessary item version: ", ex); } return; } diff --git a/dspace-api/src/main/java/org/dspace/identifier/VersionedHandleIdentifierProviderWithCanonicalHandles.java b/dspace-api/src/main/java/org/dspace/identifier/VersionedHandleIdentifierProviderWithCanonicalHandles.java index 51458b4ad6e3..67278b4db814 100644 --- a/dspace-api/src/main/java/org/dspace/identifier/VersionedHandleIdentifierProviderWithCanonicalHandles.java +++ b/dspace-api/src/main/java/org/dspace/identifier/VersionedHandleIdentifierProviderWithCanonicalHandles.java @@ -99,7 +99,7 @@ public String register(Context context, DSpaceObject dso) { try { history = versionHistoryService.findByItem(context, item); } catch (SQLException ex) { - throw new RuntimeException("A problem with the database connection occured.", ex); + throw new RuntimeException("A problem with the database connection occurred.", ex); } if (history != null) { String canonical = getCanonical(context, item); @@ -108,7 +108,7 @@ public String register(Context context, DSpaceObject dso) { try { handleService.modifyHandleDSpaceObject(context, canonical, item); } catch (SQLException ex) { - throw new RuntimeException("A problem with the database connection occured.", ex); + throw new RuntimeException("A problem with the database connection occurred.", ex); } Version version; @@ -123,7 +123,7 @@ public String register(Context context, DSpaceObject dso) { previousItemHandle = handleService.findHandle(context, previous.getItem()); } } catch (SQLException ex) { - throw new RuntimeException("A problem with the database connection occured.", ex); + throw new RuntimeException("A problem with the database connection occurred.", ex); } // we have to ensure the previous item still has a handle @@ -131,8 +131,8 @@ public String register(Context context, DSpaceObject dso) { if (previous != null) { try { // If we have a reviewer they might not have the - // rights to edit the metadata of thes previous item. - // Temporarly grant them: + // rights to edit the metadata of the previous item. + // Temporarily grant them: context.turnOffAuthorisationSystem(); // Check if our previous item hasn't got a handle anymore. @@ -151,9 +151,9 @@ public String register(Context context, DSpaceObject dso) { // remove the canonical handle from the previous item's metadata modifyHandleMetadata(context, previous.getItem(), previousItemHandle); } catch (SQLException ex) { - throw new RuntimeException("A problem with the database connection occured.", ex); + throw new RuntimeException("A problem with the database connection occurred.", ex); } catch (AuthorizeException ex) { - // cannot occure, as the authorization system is turned of + // cannot occur, as the authorization system is turned of throw new IllegalStateException("Caught an " + "AuthorizeException while the " + "authorization system was turned off!", ex); @@ -166,7 +166,7 @@ public String register(Context context, DSpaceObject dso) { // remove all handles from metadata and add the canonical one. modifyHandleMetadata(context, item, getCanonical(id)); } catch (SQLException ex) { - throw new RuntimeException("A problem with the database connection occured.", ex); + throw new RuntimeException("A problem with the database connection occurred.", ex); } catch (AuthorizeException ex) { throw new RuntimeException("The current user is not authorized to change this item.", ex); } @@ -248,7 +248,7 @@ protected void restoreItAsVersion(Context context, DSpaceObject dso, String iden Version latest = versionHistoryService.getLatestVersion(context, history); - // if restoring the lastest version: needed to move the canonical + // if restoring the latest version: needed to move the canonical if (latest.getVersionNumber() < versionNumber) { handleService.modifyHandleDSpaceObject(context, canonical, dso); } @@ -362,7 +362,7 @@ public void delete(Context context, DSpaceObject dso) throws IdentifierException .getPrevious(context, history, versionHistoryService.getLatestVersion(context, history)) .getItem(); } catch (SQLException ex) { - throw new RuntimeException("A problem with our database connection occured.", ex); + throw new RuntimeException("A problem with our database connection occurred.", ex); } // Modify Canonical: 12345/100 will point to the new item @@ -428,7 +428,7 @@ protected String makeIdentifierBasedOnHistory(Context context, DSpaceObject dso, try { previous = versionHistoryService.getPrevious(context, history, version); } catch (SQLException ex) { - throw new RuntimeException("A problem with our database connection occured."); + throw new RuntimeException("A problem with our database connection occurred."); } String canonical = getCanonical(context, previous.getItem()); diff --git a/dspace-api/src/main/java/org/dspace/identifier/doi/DOIIdentifierException.java b/dspace-api/src/main/java/org/dspace/identifier/doi/DOIIdentifierException.java index 61f738d7cba2..5fc3384b7de0 100644 --- a/dspace-api/src/main/java/org/dspace/identifier/doi/DOIIdentifierException.java +++ b/dspace-api/src/main/java/org/dspace/identifier/doi/DOIIdentifierException.java @@ -113,7 +113,7 @@ public static String codeToString(int code) { case DOI_IS_DELETED: return "DELETED"; default: - return "UNKOWN"; + return "UNKNOWN"; } } diff --git a/dspace-api/src/main/java/org/dspace/identifier/doi/DOIOrganiser.java b/dspace-api/src/main/java/org/dspace/identifier/doi/DOIOrganiser.java index 78507a0edf13..b03af68b42ab 100644 --- a/dspace-api/src/main/java/org/dspace/identifier/doi/DOIOrganiser.java +++ b/dspace-api/src/main/java/org/dspace/identifier/doi/DOIOrganiser.java @@ -689,7 +689,7 @@ public DOI resolveToDOI(String identifier) DOI doiRow = null; String doi = null; - // detect it identifer is ItemID, handle or DOI. + // detect it identifier is ItemID, handle or DOI. // try to detect ItemID if (identifier .matches("[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[34][0-9a-fA-F]{3}-[89ab][0-9a-fA-F]{3}-[0-9a-fA-F]{12}")) { diff --git a/dspace-api/src/main/java/org/dspace/identifier/doi/DataCiteConnector.java b/dspace-api/src/main/java/org/dspace/identifier/doi/DataCiteConnector.java index 931f1538583e..47f738de1e63 100644 --- a/dspace-api/src/main/java/org/dspace/identifier/doi/DataCiteConnector.java +++ b/dspace-api/src/main/java/org/dspace/identifier/doi/DataCiteConnector.java @@ -391,7 +391,7 @@ public void reserveDOI(Context context, DSpaceObject dso, String doi) log.error("Caught an AuthorizeException while disseminating DSO" + " with type {} and ID {}. Giving up to reserve DOI {}.", dso.getType(), dso.getID(), doi, ae); - throw new DOIIdentifierException("AuthorizeException occured while " + throw new DOIIdentifierException("AuthorizeException occurred while " + "converting " + dSpaceObjectService.getTypeText(dso) + "/" + dso .getID() + " using crosswalk " + this.CROSSWALK_NAME + ".", ae, @@ -400,7 +400,7 @@ public void reserveDOI(Context context, DSpaceObject dso, String doi) log.error("Caught a CrosswalkException while reserving a DOI ({})" + " for DSO with type {} and ID {}. Won't reserve the doi.", doi, dso.getType(), dso.getID(), ce); - throw new DOIIdentifierException("CrosswalkException occured while " + throw new DOIIdentifierException("CrosswalkException occurred while " + "converting " + dSpaceObjectService.getTypeText(dso) + "/" + dso .getID() + " using crosswalk " + this.CROSSWALK_NAME + ".", ce, @@ -421,7 +421,7 @@ public void reserveDOI(Context context, DSpaceObject dso, String doi) + "crosswalk to generate the metadata used another DOI than " + "the DOI we're reserving. Cannot reserve DOI {} for {} {}.", doi, dSpaceObjectService.getTypeText(dso), dso.getID()); - throw new IllegalStateException("An internal error occured while " + throw new IllegalStateException("An internal error occurred while " + "generating the metadata. Unable to reserve doi, see logs " + "for further information."); } diff --git a/dspace-api/src/main/java/org/dspace/importer/external/MultipleParallelImportMetadataSourceServiceImpl.java b/dspace-api/src/main/java/org/dspace/importer/external/MultipleParallelImportMetadataSourceServiceImpl.java index 1bb7e9269596..a4033ee0c2d8 100644 --- a/dspace-api/src/main/java/org/dspace/importer/external/MultipleParallelImportMetadataSourceServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/importer/external/MultipleParallelImportMetadataSourceServiceImpl.java @@ -27,7 +27,7 @@ /** * Implements a data source for querying multiple external data sources in parallel * - * optional Affiliation informations are not part of the API request. + * optional Affiliation information are not part of the API request. * * @author Johanna Staudinger (johanna.staudinger@uni-bamberg.de) * diff --git a/dspace-api/src/main/java/org/dspace/importer/external/datacite/DataCiteImportMetadataSourceServiceImpl.java b/dspace-api/src/main/java/org/dspace/importer/external/datacite/DataCiteImportMetadataSourceServiceImpl.java index ad6e260bd0d5..e00b2e2cea8f 100644 --- a/dspace-api/src/main/java/org/dspace/importer/external/datacite/DataCiteImportMetadataSourceServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/importer/external/datacite/DataCiteImportMetadataSourceServiceImpl.java @@ -36,7 +36,7 @@ * Implements a data source for querying Datacite * Mainly copied from CrossRefImportMetadataSourceServiceImpl. * - * optional Affiliation informations are not part of the API request. + * optional Affiliation information are not part of the API request. * https://support.datacite.org/docs/can-i-see-more-detailed-affiliation-information-in-the-rest-api * * @author Pasquale Cavallo (pasquale.cavallo at 4science dot it) diff --git a/dspace-api/src/main/java/org/dspace/importer/external/epo/service/EpoImportMetadataSourceServiceImpl.java b/dspace-api/src/main/java/org/dspace/importer/external/epo/service/EpoImportMetadataSourceServiceImpl.java index fbae302bca6a..70f726c5f9e5 100644 --- a/dspace-api/src/main/java/org/dspace/importer/external/epo/service/EpoImportMetadataSourceServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/importer/external/epo/service/EpoImportMetadataSourceServiceImpl.java @@ -106,7 +106,7 @@ public String getConsumerKey() { } /** - * Set the costumer epo secret + * Set the customer epo secret * @param consumerSecret the customer epo secret */ public void setConsumerSecret(String consumerSecret) { diff --git a/dspace-api/src/main/java/org/dspace/importer/external/metadatamapping/contributor/ArrayElementAttributeProcessor.java b/dspace-api/src/main/java/org/dspace/importer/external/metadatamapping/contributor/ArrayElementAttributeProcessor.java index b938a290c297..7a74551d8064 100644 --- a/dspace-api/src/main/java/org/dspace/importer/external/metadatamapping/contributor/ArrayElementAttributeProcessor.java +++ b/dspace-api/src/main/java/org/dspace/importer/external/metadatamapping/contributor/ArrayElementAttributeProcessor.java @@ -20,7 +20,7 @@ /** * This Processor allows to extract attribute values of an array. - * For exaple to extract all values of secondAttribute, + * For example to extract all values of secondAttribute, * "array":[ * { * "firstAttribute":"first value", diff --git a/dspace-api/src/main/java/org/dspace/importer/external/metadatamapping/contributor/EnhancedSimpleMetadataContributor.java b/dspace-api/src/main/java/org/dspace/importer/external/metadatamapping/contributor/EnhancedSimpleMetadataContributor.java index b3953f60c577..7aaa5aa0b3ed 100644 --- a/dspace-api/src/main/java/org/dspace/importer/external/metadatamapping/contributor/EnhancedSimpleMetadataContributor.java +++ b/dspace-api/src/main/java/org/dspace/importer/external/metadatamapping/contributor/EnhancedSimpleMetadataContributor.java @@ -95,8 +95,8 @@ public Collection contributeMetadata(PlainMetadataSourceDto t) { values = new LinkedList<>(); for (PlainMetadataKeyValueItem metadatum : t.getMetadata()) { if (getKey().equals(metadatum.getKey())) { - String[] splitted = splitToRecord(metadatum.getValue()); - for (String value : splitted) { + String[] split = splitToRecord(metadatum.getValue()); + for (String value : split) { MetadatumDTO dcValue = new MetadatumDTO(); dcValue.setValue(value); dcValue.setElement(getField().getElement()); @@ -120,7 +120,7 @@ private String[] splitToRecord(String value) { com.opencsv.CSVReader csvReader = new CSVReaderBuilder(inputReader).withCSVParser(parser).build()) { rows = csvReader.readAll(); } catch (IOException | CsvException e) { - //fallback, use the inpu as value + //fallback, use the input as value return new String[] { value }; } //must be one row diff --git a/dspace-api/src/main/java/org/dspace/importer/external/metadatamapping/contributor/MatrixElementProcessor.java b/dspace-api/src/main/java/org/dspace/importer/external/metadatamapping/contributor/MatrixElementProcessor.java index c8e93971f480..e4d42d22924d 100644 --- a/dspace-api/src/main/java/org/dspace/importer/external/metadatamapping/contributor/MatrixElementProcessor.java +++ b/dspace-api/src/main/java/org/dspace/importer/external/metadatamapping/contributor/MatrixElementProcessor.java @@ -21,7 +21,7 @@ /** * This Processor allows to extract all values of a matrix. * Only need to configure the path to the matrix in "pathToMatrix" - * For exaple to extract all values + * For example to extract all values * "matrix": [ * [ * "first", diff --git a/dspace-api/src/main/java/org/dspace/importer/external/metadatamapping/contributor/SimpleJsonPathMetadataContributor.java b/dspace-api/src/main/java/org/dspace/importer/external/metadatamapping/contributor/SimpleJsonPathMetadataContributor.java index 590fc63283b9..03f3efced0be 100644 --- a/dspace-api/src/main/java/org/dspace/importer/external/metadatamapping/contributor/SimpleJsonPathMetadataContributor.java +++ b/dspace-api/src/main/java/org/dspace/importer/external/metadatamapping/contributor/SimpleJsonPathMetadataContributor.java @@ -45,7 +45,7 @@ public class SimpleJsonPathMetadataContributor implements MetadataContributorMetadataFieldConfig */ public SimpleJsonPathMetadataContributor(String query, MetadataFieldConfig field) { diff --git a/dspace-api/src/main/java/org/dspace/importer/external/metadatamapping/contributor/SimpleMetadataContributor.java b/dspace-api/src/main/java/org/dspace/importer/external/metadatamapping/contributor/SimpleMetadataContributor.java index 1b9007f23cbd..70c6e0f3855d 100644 --- a/dspace-api/src/main/java/org/dspace/importer/external/metadatamapping/contributor/SimpleMetadataContributor.java +++ b/dspace-api/src/main/java/org/dspace/importer/external/metadatamapping/contributor/SimpleMetadataContributor.java @@ -55,7 +55,7 @@ public void setMetadataFieldMapping( /** * Retrieve the metadata associated with the given object. * It match the key found in PlainMetadataSourceDto instance with the key passed to constructor. - * In case of success, new metadatum is constructer (using field elements and PlainMetadataSourceDto value) + * In case of success, new metadatum is constructor (using field elements and PlainMetadataSourceDto value) * and added to the list. * * @param t A class to retrieve metadata and key to match from. t and contained list "metadata" MUST be not null. diff --git a/dspace-api/src/main/java/org/dspace/importer/external/service/components/AbstractPlainMetadataSource.java b/dspace-api/src/main/java/org/dspace/importer/external/service/components/AbstractPlainMetadataSource.java index 5d83b9a7cce4..6e0a2d9f7a8a 100644 --- a/dspace-api/src/main/java/org/dspace/importer/external/service/components/AbstractPlainMetadataSource.java +++ b/dspace-api/src/main/java/org/dspace/importer/external/service/components/AbstractPlainMetadataSource.java @@ -23,8 +23,8 @@ /** * This class is an abstract implementation of {@link MetadataSource} useful in cases * of plain metadata sources. - * It provides the methot to mapping metadata to DSpace Format when source is a file - * whit a list of strings. + * It provides the method to mapping metadata to DSpace Format when source is a file + * with a list of strings. * * @author Pasquale Cavallo (pasquale.cavallo at 4science dot it) */ diff --git a/dspace-api/src/main/java/org/dspace/orcid/client/OrcidClientImpl.java b/dspace-api/src/main/java/org/dspace/orcid/client/OrcidClientImpl.java index 8356167692e3..2dc1d591fd58 100644 --- a/dspace-api/src/main/java/org/dspace/orcid/client/OrcidClientImpl.java +++ b/dspace-api/src/main/java/org/dspace/orcid/client/OrcidClientImpl.java @@ -261,7 +261,7 @@ private T executeAndParseJson(HttpUriRequest httpUriRequest, Class clazz) * OrcidClientException * @param clazz the class to be used for the content unmarshall * @return the response body - * @throws OrcidClientException if the incoming response is not successfull + * @throws OrcidClientException if the incoming response is not successful */ private T executeAndUnmarshall(HttpUriRequest httpUriRequest, boolean handleNotFoundAsNull, Class clazz) { diff --git a/dspace-api/src/main/java/org/dspace/orcid/model/factory/OrcidCommonObjectFactory.java b/dspace-api/src/main/java/org/dspace/orcid/model/factory/OrcidCommonObjectFactory.java index 4ca36c216919..9a821bef8dc7 100644 --- a/dspace-api/src/main/java/org/dspace/orcid/model/factory/OrcidCommonObjectFactory.java +++ b/dspace-api/src/main/java/org/dspace/orcid/model/factory/OrcidCommonObjectFactory.java @@ -35,7 +35,7 @@ public interface OrcidCommonObjectFactory { * represent a date with a supported format. * * @param metadataValue the metadata value - * @return the FuzzyDate istance, if any + * @return the FuzzyDate instance, if any */ public Optional createFuzzyDate(MetadataValue metadataValue); diff --git a/dspace-api/src/main/java/org/dspace/orcid/model/factory/impl/OrcidWorkFactory.java b/dspace-api/src/main/java/org/dspace/orcid/model/factory/impl/OrcidWorkFactory.java index 47619b3c1d63..7018c221ba00 100644 --- a/dspace-api/src/main/java/org/dspace/orcid/model/factory/impl/OrcidWorkFactory.java +++ b/dspace-api/src/main/java/org/dspace/orcid/model/factory/impl/OrcidWorkFactory.java @@ -205,7 +205,7 @@ private ExternalID getExternalId(String type, String value, Relationship relatio } /** - * Creates an instance of WorkType from the given item, taking the value fom the + * Creates an instance of WorkType from the given item, taking the value from the * configured metadata field (orcid.mapping.work.type). */ private WorkType getWorkType(Context context, Item item) { diff --git a/dspace-api/src/main/java/org/dspace/orcid/script/OrcidBulkPush.java b/dspace-api/src/main/java/org/dspace/orcid/script/OrcidBulkPush.java index 5914a2d8df1c..7dceb473cc51 100644 --- a/dspace-api/src/main/java/org/dspace/orcid/script/OrcidBulkPush.java +++ b/dspace-api/src/main/java/org/dspace/orcid/script/OrcidBulkPush.java @@ -105,7 +105,7 @@ public void internalRun() throws Exception { } /** - * Find all the Orcid Queue records that need to be synchronized and perfom the + * Find all the Orcid Queue records that need to be synchronized and perform the * synchronization. */ private void performBulkSynchronization() throws SQLException { @@ -130,7 +130,7 @@ private List findQueueRecordsToSynchronize() throws SQLException { } /** - * If the current script execution is configued to ignore the max attemps, + * If the current script execution is configured to ignore the max attempts, * returns all the ORCID Queue records, otherwise returns the ORCID Queue * records that has an attempts value less than the configured max attempts * value. diff --git a/dspace-api/src/main/java/org/dspace/orcid/service/OrcidSynchronizationService.java b/dspace-api/src/main/java/org/dspace/orcid/service/OrcidSynchronizationService.java index 575ce6811b24..914ed7172e2f 100644 --- a/dspace-api/src/main/java/org/dspace/orcid/service/OrcidSynchronizationService.java +++ b/dspace-api/src/main/java/org/dspace/orcid/service/OrcidSynchronizationService.java @@ -21,7 +21,7 @@ import org.dspace.profile.OrcidSynchronizationMode; /** - * Service that handle the the syncronization between a DSpace profile and the + * Service that handle the the synchronization between a DSpace profile and the * relative ORCID profile, if any. * * @author Luca Giamminonni (luca.giamminonni at 4science.it) diff --git a/dspace-api/src/main/java/org/dspace/profile/service/ResearcherProfileService.java b/dspace-api/src/main/java/org/dspace/profile/service/ResearcherProfileService.java index 9e52402f77e4..de01760f9f46 100644 --- a/dspace-api/src/main/java/org/dspace/profile/service/ResearcherProfileService.java +++ b/dspace-api/src/main/java/org/dspace/profile/service/ResearcherProfileService.java @@ -67,7 +67,7 @@ public ResearcherProfile createAndReturn(Context context, EPerson ePerson) /** * Changes the visibility of the given profile using the given new visible - * value. The visiblity controls whether the Profile is Anonymous READ or not. + * value. The visibility controls whether the Profile is Anonymous READ or not. * * @param context the relevant DSpace Context. * @param profile the researcher profile to update diff --git a/dspace-api/src/main/java/org/dspace/qaevent/script/OpenaireEventsImport.java b/dspace-api/src/main/java/org/dspace/qaevent/script/OpenaireEventsImport.java index cbaf80842232..48f83d413dbf 100644 --- a/dspace-api/src/main/java/org/dspace/qaevent/script/OpenaireEventsImport.java +++ b/dspace-api/src/main/java/org/dspace/qaevent/script/OpenaireEventsImport.java @@ -44,7 +44,7 @@ import org.dspace.utils.DSpace; /** - * Implementation of {@link DSpaceRunnable} to perfom a QAEvents import from a + * Implementation of {@link DSpaceRunnable} to perform a QAEvents import from a * json file. The JSON file contains an array of JSON Events, where each event * has the following structure. The message attribute follows the structure * documented at @@ -323,7 +323,7 @@ private List listEmailSubscriptions() { try { return brokerClient.listSubscriptions(openaireBrokerURL, email); } catch (Exception ex) { - throw new IllegalArgumentException("An error occurs retriving the subscriptions " + throw new IllegalArgumentException("An error occurs retrieving the subscriptions " + "from the OPENAIRE broker: " + getMessage(ex), ex); } } diff --git a/dspace-api/src/main/java/org/dspace/qaevent/script/OpenaireEventsImportScriptConfiguration.java b/dspace-api/src/main/java/org/dspace/qaevent/script/OpenaireEventsImportScriptConfiguration.java index 60001e73507d..63dcfae740a0 100644 --- a/dspace-api/src/main/java/org/dspace/qaevent/script/OpenaireEventsImportScriptConfiguration.java +++ b/dspace-api/src/main/java/org/dspace/qaevent/script/OpenaireEventsImportScriptConfiguration.java @@ -13,7 +13,7 @@ import org.dspace.scripts.configuration.ScriptConfiguration; /** - * Extension of {@link ScriptConfiguration} to perfom a QAEvents import from + * Extension of {@link ScriptConfiguration} to perform a QAEvents import from * file. * * @author Alessandro Martelli (alessandro.martelli at 4science.it) diff --git a/dspace-api/src/main/java/org/dspace/rdf/RDFConsumer.java b/dspace-api/src/main/java/org/dspace/rdf/RDFConsumer.java index 62208be6d9cc..8b43ad69d78c 100644 --- a/dspace-api/src/main/java/org/dspace/rdf/RDFConsumer.java +++ b/dspace-api/src/main/java/org/dspace/rdf/RDFConsumer.java @@ -241,7 +241,7 @@ public void consumeCommunityCollectionItem(Context ctx, Event event) throws SQLE } DSOIdentifier id = new DSOIdentifier(dso, ctx); - // If an item gets withdrawn, a MODIFIY event is fired. We have to + // If an item gets withdrawn, a MODIFY event is fired. We have to // delete the item from the triple store instead of converting it. // we don't have to take care for reinstantions of items as they can // be processed as normal modify events. diff --git a/dspace-api/src/main/java/org/dspace/rdf/RDFUtil.java b/dspace-api/src/main/java/org/dspace/rdf/RDFUtil.java index ef381febe701..7dea426228ce 100644 --- a/dspace-api/src/main/java/org/dspace/rdf/RDFUtil.java +++ b/dspace-api/src/main/java/org/dspace/rdf/RDFUtil.java @@ -90,7 +90,7 @@ private RDFUtil() { } /** * Loads converted data of a DSpaceObject identified by the URI provided - * as {@code identifier}. This method uses the RDFStorage configurated in + * as {@code identifier}. This method uses the RDFStorage configured in * the DSpace configuration. Close the model * ({@link com.hp.hpl.jena.rdf.model.Model#close() Model.close()}) as soon * as possible to free system resources. @@ -200,7 +200,7 @@ public static Model convert(Context context, DSpaceObject dso) if (!found) { log.warn("Configuration of DSpaceObjects of type " + Constants.typeText[dso.getType()] - + " prohibitted by configuration."); + + " prohibited by configuration."); return null; } } diff --git a/dspace-api/src/main/java/org/dspace/rdf/RDFizer.java b/dspace-api/src/main/java/org/dspace/rdf/RDFizer.java index 980aaa4b11fa..7f0358dfbedd 100644 --- a/dspace-api/src/main/java/org/dspace/rdf/RDFizer.java +++ b/dspace-api/src/main/java/org/dspace/rdf/RDFizer.java @@ -205,7 +205,7 @@ public void delete(DSpaceObject dso, boolean reset) } if (dso.getType() == Constants.SITE) { - // we don't need to iterate over all objects, use a shorctut: + // we don't need to iterate over all objects, use a shortcut: this.deleteAll(); } Callback callback = new Callback() { @@ -352,11 +352,11 @@ protected void dspaceDFS(DSpaceObject dso, Callback callback, boolean check, boo } markProcessed(dso); // this is useful to debug depth first search, but it is really noisy. - //log.debug("Procesing " + contentServiceFactory.getDSpaceObjectService(dso).getTypeText(dso) + " " + dso + //log.debug("Processing " + contentServiceFactory.getDSpaceObjectService(dso).getTypeText(dso) + " " + dso // .getID() + ":" + dso.getHandle() + "."); // if this method is used for conversion we should check if we have the - // permissions to read a DSO before converting all of it decendents + // permissions to read a DSO before converting all of it descendants // (e.g. check read permission on a community before converting all of // its subcommunties and collections). // just skip items with missing permissions and report them. @@ -700,11 +700,11 @@ protected Options createOptions() { options.addOption("o", "stdout", false, "Print all converted data to " + "stdout using turtle as serialization."); options.addOption("n", "dry-run", false, "Don't send any data or commands " + - "to the triplestore. Usefull for debugging or in conjunction " + + "to the triplestore. Useful for debugging or in conjunction " + "with --stdout."); options.addOption("c", "convert-all", false, "Convert all DSpace Objects" + " that are readable for an anonymous user. This may take a long time" + - "depending on the number of stored communties, collections and " + + "depending on the number of stored communities, collections and " + "items. Existing information in the triple store will be updated."); Option optIdentifiers = Option.builder("i") diff --git a/dspace-api/src/main/java/org/dspace/rdf/conversion/DMRM.java b/dspace-api/src/main/java/org/dspace/rdf/conversion/DMRM.java index f253e4025b6a..ca9583806114 100644 --- a/dspace-api/src/main/java/org/dspace/rdf/conversion/DMRM.java +++ b/dspace-api/src/main/java/org/dspace/rdf/conversion/DMRM.java @@ -88,7 +88,7 @@ public static String getURI() { public static final Resource DSpaceValue = m_model.createResource(NS + "DSpaceValue"); /** - *

    Specifies the RDF to generate for a specified matadata.

    + *

    Specifies the RDF to generate for a specified metadata.

    */ public static final Property creates = m_model.createProperty(NS + "creates"); diff --git a/dspace-api/src/main/java/org/dspace/rdf/conversion/MetadataRDFMapping.java b/dspace-api/src/main/java/org/dspace/rdf/conversion/MetadataRDFMapping.java index 5b801d699af8..4117f3549b48 100644 --- a/dspace-api/src/main/java/org/dspace/rdf/conversion/MetadataRDFMapping.java +++ b/dspace-api/src/main/java/org/dspace/rdf/conversion/MetadataRDFMapping.java @@ -159,7 +159,7 @@ public boolean fulfills(String value) { } public void convert(String value, String lang, String dsoIRI, Model m) { - log.debug("Using convertion for field " + name + " on value: " + value + log.debug("Using conversion for field " + name + " on value: " + value + " for " + dsoIRI + "."); // run over all results for (Iterator iter = this.results.iterator(); iter.hasNext(); ) { @@ -282,7 +282,7 @@ protected Property parsePredicate(Model m, Resource predicate, String dsoIRI, String uri = predicate.getURI(); if (uri == null) { log.debug("A result predicate is blank node, but not a " - + "ResourceGenerator. Ingoring this result."); + + "ResourceGenerator. Ignoring this result."); return null; } return m.createProperty(uri); @@ -447,7 +447,7 @@ protected String parseValueProcessor(Resource valueProcessor, String value) { if (!modifierNode.isResource()) { log.error("The modifier of a result is a Literal not an Resource! " - + "Ingoring this result."); + + "Ignoring this result."); return null; } Resource modifier = modifierNode.asResource(); diff --git a/dspace-api/src/main/java/org/dspace/rdf/negotiation/MediaRange.java b/dspace-api/src/main/java/org/dspace/rdf/negotiation/MediaRange.java index 6b2caa598dc7..f652838121a9 100644 --- a/dspace-api/src/main/java/org/dspace/rdf/negotiation/MediaRange.java +++ b/dspace-api/src/main/java/org/dspace/rdf/negotiation/MediaRange.java @@ -28,11 +28,11 @@ public class MediaRange { // SEPARATOR: ( ) < > @ , ; : \ " / [ ] ? = { } // the separators can be used in as class inside square brackets. To be able - // to negate the class, the spearators necessary square brackets are not + // to negate the class, the separators necessary square brackets are not // included in the string. public static final String separators = "()<>@,;:\\\\\"/\\[\\]?={} \\t"; - // TOKEN: ANY US ASCII except ctl an separtor + // TOKEN: ANY US ASCII except ctl an separator public static final String token = "[\\040-\\0176" + "&&[^" + separators + "]]+"; // "\" followed by any US ASCII character (octets 0 - 177) @@ -57,8 +57,8 @@ public class MediaRange { // group 5 contains the value of the last parameter before the quality parameter if any // group 6 contains the quality value if any // group 7 contains all parameters after the quality parameter if any - // group 8 contains the name of the last parameter after the quality paremeter if any - // group 9 contains the value of the laster parameter after the quality paremeter if any + // group 8 contains the name of the last parameter after the quality parameter if any + // group 9 contains the value of the laster parameter after the quality parameter if any public static final String mediaRangeRegex = "(?:(" + token + ")/(" + token + "?)" + "(" + nonQualityParam + "*)" + qualityParam + "?(" + nonQualityParam + "*))"; @@ -101,7 +101,7 @@ public MediaRange(String mediarange) throw new IllegalArgumentException("A media range's type cannot " + "be wildcarded if its subtype isn't as well."); } - // initalize with defualt value, parse later + // initialize with default value, parse later double qvalue = DEFAULT_QVALUE; // initialize empty lists, parse parameters later List parameterNames = new ArrayList<>(); @@ -142,7 +142,7 @@ public MediaRange(String mediarange) + unparsedParameters + "') of a previously parsed media " + "range!"); throw new IllegalStateException("Run into problems while parsing " - + "a substring of a previuosly succesfully parsed string."); + + "a substring of a previuosly successfully parsed string."); } while (m.find()) { if (!StringUtils.isEmpty(m.group(1))) { diff --git a/dspace-api/src/main/java/org/dspace/rdf/negotiation/Negotiator.java b/dspace-api/src/main/java/org/dspace/rdf/negotiation/Negotiator.java index 8d1105a5252b..07891b6d6d9f 100644 --- a/dspace-api/src/main/java/org/dspace/rdf/negotiation/Negotiator.java +++ b/dspace-api/src/main/java/org/dspace/rdf/negotiation/Negotiator.java @@ -25,7 +25,7 @@ */ public class Negotiator { - // Serialiazation codes + // Serialization codes public static final int UNSPECIFIED = -1; public static final int WILDCARD = 0; public static final int HTML = 1; diff --git a/dspace-api/src/main/java/org/dspace/scripts/configuration/ScriptConfiguration.java b/dspace-api/src/main/java/org/dspace/scripts/configuration/ScriptConfiguration.java index bbedab04e278..70debc172ae9 100644 --- a/dspace-api/src/main/java/org/dspace/scripts/configuration/ScriptConfiguration.java +++ b/dspace-api/src/main/java/org/dspace/scripts/configuration/ScriptConfiguration.java @@ -107,7 +107,7 @@ public boolean isAllowedToExecute(Context context, List findAll(Context context) throws SQLException { /** * Creates a new OpenURLTracker * @param context - * @return the creatred OpenURLTracker + * @return the created OpenURLTracker * @throws SQLException */ @Override diff --git a/dspace-api/src/main/java/org/dspace/statistics/export/service/FailedOpenURLTrackerService.java b/dspace-api/src/main/java/org/dspace/statistics/export/service/FailedOpenURLTrackerService.java index 9b482e3d5493..ed6f8bc3bf9e 100644 --- a/dspace-api/src/main/java/org/dspace/statistics/export/service/FailedOpenURLTrackerService.java +++ b/dspace-api/src/main/java/org/dspace/statistics/export/service/FailedOpenURLTrackerService.java @@ -37,7 +37,7 @@ public interface FailedOpenURLTrackerService { /** * Creates a new OpenURLTracker * @param context - * @return the creatred OpenURLTracker + * @return the created OpenURLTracker * @throws SQLException */ OpenURLTracker create(Context context) throws SQLException; diff --git a/dspace-api/src/main/java/org/dspace/storage/bitstore/BitstreamStorageServiceImpl.java b/dspace-api/src/main/java/org/dspace/storage/bitstore/BitstreamStorageServiceImpl.java index c89e5d7a54d1..290e480a93f2 100644 --- a/dspace-api/src/main/java/org/dspace/storage/bitstore/BitstreamStorageServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/storage/bitstore/BitstreamStorageServiceImpl.java @@ -148,7 +148,7 @@ public UUID store(Context context, Bitstream bitstream, InputStream is) throws S * @param assetstore The assetstore number for the bitstream to be * registered * @param bitstreamPath The relative path of the bitstream to be registered. - * The path is relative to the path of ths assetstore. + * The path is relative to the path of this assetstore. * @return The ID of the registered bitstream * @throws SQLException If a problem occurs accessing the RDBMS * @throws IOException if IO error @@ -224,7 +224,7 @@ public void cleanup(boolean deleteDbRecords, boolean verbose) throws SQLExceptio int cleanedBitstreamCount = 0; int deletedBitstreamCount = bitstreamService.countDeletedBitstreams(context); - System.out.println("Found " + deletedBitstreamCount + " deleted bistream to cleanup"); + System.out.println("Found " + deletedBitstreamCount + " deleted bitstream to cleanup"); try { context.turnOffAuthorisationSystem(); diff --git a/dspace-api/src/main/java/org/dspace/storage/bitstore/S3BitStoreService.java b/dspace-api/src/main/java/org/dspace/storage/bitstore/S3BitStoreService.java index 36456a8945ec..4d32b50d67d0 100644 --- a/dspace-api/src/main/java/org/dspace/storage/bitstore/S3BitStoreService.java +++ b/dspace-api/src/main/java/org/dspace/storage/bitstore/S3BitStoreService.java @@ -553,7 +553,7 @@ public static void main(String[] args) throws Exception { store.bucketName = DEFAULT_BUCKET_PREFIX + hostname + ".s3test"; store.s3Service.createBucket(store.bucketName); /* Broken in DSpace 6 TODO Refactor - // time everything, todo, swtich to caliper + // time everything, todo, switch to caliper long start = System.currentTimeMillis(); // Case 1: store a file String id = store.generateId(); diff --git a/dspace-api/src/main/java/org/dspace/storage/bitstore/service/BitstreamStorageService.java b/dspace-api/src/main/java/org/dspace/storage/bitstore/service/BitstreamStorageService.java index 8de082aeb733..8c3a67ee9a08 100644 --- a/dspace-api/src/main/java/org/dspace/storage/bitstore/service/BitstreamStorageService.java +++ b/dspace-api/src/main/java/org/dspace/storage/bitstore/service/BitstreamStorageService.java @@ -92,7 +92,7 @@ public interface BitstreamStorageService { * @param assetstore The assetstore number for the bitstream to be * registered * @param bitstreamPath The relative path of the bitstream to be registered. - * The path is relative to the path of ths assetstore. + * The path is relative to the path of this assetstore. * @return The ID of the registered bitstream * @throws SQLException If a problem occurs accessing the RDBMS * @throws IOException if IO error diff --git a/dspace-api/src/main/java/org/dspace/storage/rdbms/PostgresUtils.java b/dspace-api/src/main/java/org/dspace/storage/rdbms/PostgresUtils.java index 0d049bb6ac00..38bb6399833d 100644 --- a/dspace-api/src/main/java/org/dspace/storage/rdbms/PostgresUtils.java +++ b/dspace-api/src/main/java/org/dspace/storage/rdbms/PostgresUtils.java @@ -26,7 +26,7 @@ * @author Tim Donohue */ public class PostgresUtils { - // PostgreSQL pgcrypto extention name, and required versions of Postgres & pgcrypto + // PostgreSQL pgcrypto extension name, and required versions of Postgres & pgcrypto public static final String PGCRYPTO = "pgcrypto"; public static final Double PGCRYPTO_VERSION = 1.1; public static final Double POSTGRES_VERSION = 9.4; diff --git a/dspace-api/src/main/java/org/dspace/storage/rdbms/RegistryUpdater.java b/dspace-api/src/main/java/org/dspace/storage/rdbms/RegistryUpdater.java index 939bd4bdd39a..1419910d5206 100644 --- a/dspace-api/src/main/java/org/dspace/storage/rdbms/RegistryUpdater.java +++ b/dspace-api/src/main/java/org/dspace/storage/rdbms/RegistryUpdater.java @@ -86,7 +86,7 @@ private void updateRegistries() { context.restoreAuthSystemState(); // Commit changes and close context context.complete(); - log.info("All Bitstream Format Regitry and Metadata Registry updates were completed."); + log.info("All Bitstream Format Registry and Metadata Registry updates were completed."); } catch (IOException | SQLException | ParserConfigurationException | TransformerException | RegistryImportException | AuthorizeException | NonUniqueMetadataException diff --git a/dspace-api/src/main/java/org/dspace/storage/rdbms/migration/MigrationUtils.java b/dspace-api/src/main/java/org/dspace/storage/rdbms/migration/MigrationUtils.java index f0c4e4e17990..28df30d8702c 100644 --- a/dspace-api/src/main/java/org/dspace/storage/rdbms/migration/MigrationUtils.java +++ b/dspace-api/src/main/java/org/dspace/storage/rdbms/migration/MigrationUtils.java @@ -108,7 +108,7 @@ protected static Integer dropDBConstraint(Connection connection, String tableNam // As long as we have a constraint name, drop it if (constraintName != null && !constraintName.isEmpty()) { - // This drop constaint SQL should be the same in all databases + // This drop constraint SQL should be the same in all databases String dropConstraintSQL = "ALTER TABLE " + tableName + " DROP CONSTRAINT " + constraintName; if (cascade) { dropConstraintSQL += " CASCADE"; diff --git a/dspace-api/src/main/java/org/dspace/storage/rdbms/migration/V1_3_9__Drop_constraint_for_DSpace_1_4_schema.java b/dspace-api/src/main/java/org/dspace/storage/rdbms/migration/V1_3_9__Drop_constraint_for_DSpace_1_4_schema.java index 758e745ddc86..801e3faadb83 100644 --- a/dspace-api/src/main/java/org/dspace/storage/rdbms/migration/V1_3_9__Drop_constraint_for_DSpace_1_4_schema.java +++ b/dspace-api/src/main/java/org/dspace/storage/rdbms/migration/V1_3_9__Drop_constraint_for_DSpace_1_4_schema.java @@ -24,7 +24,7 @@ * since unit tests require H2 and the syntax for H2 is different from Postgres). *

    * NOTE: This migration class is very simple because it is meant to be used - * in conjuction with the corresponding SQL script: + * in conjunction with the corresponding SQL script: * ./etc/migrations/[db-type]/V1.4__Upgrade_to_DSpace_1.4_schema.sql *

    * Also note that this migration is "hackingly" versioned "1.3.9" as it needs to diff --git a/dspace-api/src/main/java/org/dspace/storage/rdbms/migration/V1_5_9__Drop_constraint_for_DSpace_1_6_schema.java b/dspace-api/src/main/java/org/dspace/storage/rdbms/migration/V1_5_9__Drop_constraint_for_DSpace_1_6_schema.java index 37100a17f926..2f24f4c25453 100644 --- a/dspace-api/src/main/java/org/dspace/storage/rdbms/migration/V1_5_9__Drop_constraint_for_DSpace_1_6_schema.java +++ b/dspace-api/src/main/java/org/dspace/storage/rdbms/migration/V1_5_9__Drop_constraint_for_DSpace_1_6_schema.java @@ -24,7 +24,7 @@ * since unit tests require H2 and the syntax for H2 is different from Postgres). *

    * NOTE: This migration class is very simple because it is meant to be used - * in conjuction with the corresponding SQL script: + * in conjunction with the corresponding SQL script: * ./etc/migrations/[db-type]/V1.6__Upgrade_to_DSpace_1.6_schema.sql *

    * Also note that this migration is "hackingly" versioned "1.5.9" as it needs to diff --git a/dspace-api/src/main/java/org/dspace/storage/rdbms/migration/V5_0_2014_09_25__DS_1582_Metadata_For_All_Objects_drop_constraint.java b/dspace-api/src/main/java/org/dspace/storage/rdbms/migration/V5_0_2014_09_25__DS_1582_Metadata_For_All_Objects_drop_constraint.java index 8e2be91127c8..337190ec390c 100644 --- a/dspace-api/src/main/java/org/dspace/storage/rdbms/migration/V5_0_2014_09_25__DS_1582_Metadata_For_All_Objects_drop_constraint.java +++ b/dspace-api/src/main/java/org/dspace/storage/rdbms/migration/V5_0_2014_09_25__DS_1582_Metadata_For_All_Objects_drop_constraint.java @@ -25,7 +25,7 @@ * since unit tests require H2 and the syntax for H2 is different from Postgres). *

    * NOTE: This migration class is very simple because it is meant to be used - * in conjuction with the corresponding SQL script: + * in conjunction with the corresponding SQL script: * ./etc/migrations/[db-type]/V5.0_2014_09_26__DS-1582_Metadata_For_All_Objects.sql *

    * Also note that this migration is dated as 2014_09_25 so that it will run diff --git a/dspace-api/src/main/java/org/dspace/storage/rdbms/migration/V6_0_2016_01_26__DS_2188_Remove_DBMS_Browse_Tables.java b/dspace-api/src/main/java/org/dspace/storage/rdbms/migration/V6_0_2016_01_26__DS_2188_Remove_DBMS_Browse_Tables.java index daf2269e922a..5893650a42fc 100644 --- a/dspace-api/src/main/java/org/dspace/storage/rdbms/migration/V6_0_2016_01_26__DS_2188_Remove_DBMS_Browse_Tables.java +++ b/dspace-api/src/main/java/org/dspace/storage/rdbms/migration/V6_0_2016_01_26__DS_2188_Remove_DBMS_Browse_Tables.java @@ -58,7 +58,7 @@ private void removeDBMSBrowseTables(Connection connection) // Keep looping (incrementing our index by 1) until we've hit three index // tables that have not been found. // We don't actually know how many index tables will be in each database, - // and there are no guarrantees it'll match the highest index of the site's + // and there are no guarantees it'll match the highest index of the site's // existing "webui.browse.index.#" settings. // Since that's the case, we'll just keep searching for index tables, // until we encounter a total of three that are not found. diff --git a/dspace-api/src/main/java/org/dspace/storage/rdbms/migration/V7_0_2020_10_31__CollectionCommunity_Metadata_Handle.java b/dspace-api/src/main/java/org/dspace/storage/rdbms/migration/V7_0_2020_10_31__CollectionCommunity_Metadata_Handle.java index 21ebcd5edd98..973134bfd1da 100644 --- a/dspace-api/src/main/java/org/dspace/storage/rdbms/migration/V7_0_2020_10_31__CollectionCommunity_Metadata_Handle.java +++ b/dspace-api/src/main/java/org/dspace/storage/rdbms/migration/V7_0_2020_10_31__CollectionCommunity_Metadata_Handle.java @@ -18,7 +18,7 @@ import org.flywaydb.core.api.migration.Context; /** - * Insert a 'dc.idendifier.uri' metadata record for each Community and Collection in the database. + * Insert a 'dc.identifier.uri' metadata record for each Community and Collection in the database. * The value is calculated concatenating the canonicalPrefix extracted from the configuration * (default is "http://hdl.handle.net/) and the object's handle suffix stored inside the handle table. * diff --git a/dspace-api/src/main/java/org/dspace/util/MultiFormatDateParser.java b/dspace-api/src/main/java/org/dspace/util/MultiFormatDateParser.java index 06b02910c99a..de3ef92619a0 100644 --- a/dspace-api/src/main/java/org/dspace/util/MultiFormatDateParser.java +++ b/dspace-api/src/main/java/org/dspace/util/MultiFormatDateParser.java @@ -70,7 +70,7 @@ public void setPatterns(Map patterns) { try { pattern = Pattern.compile(rule.getKey(), Pattern.CASE_INSENSITIVE); } catch (PatternSyntaxException ex) { - log.error("Skipping format with unparseable pattern '{}'", + log.error("Skipping format with unparsable pattern '{}'", rule::getKey); continue; } diff --git a/dspace-api/src/main/java/org/dspace/util/SolrImportExport.java b/dspace-api/src/main/java/org/dspace/util/SolrImportExport.java index b23e4396e27c..c132af1855d1 100644 --- a/dspace-api/src/main/java/org/dspace/util/SolrImportExport.java +++ b/dspace-api/src/main/java/org/dspace/util/SolrImportExport.java @@ -293,7 +293,7 @@ private static void reindex(String indexName, String exportDirName, boolean keep + ") but usable space in export directory is only " + FileUtils.byteCountToDisplaySize(usableExportSpace) + ". Not continuing with reindex, please use the " + DIRECTORY_OPTION - + " option to specify an alternative export directy with sufficient space."); + + " option to specify an alternative export directly with sufficient space."); return; } diff --git a/dspace-api/src/main/java/org/dspace/util/SolrUpgradePre6xStatistics.java b/dspace-api/src/main/java/org/dspace/util/SolrUpgradePre6xStatistics.java index 9342cb8b39e8..044d9792beac 100644 --- a/dspace-api/src/main/java/org/dspace/util/SolrUpgradePre6xStatistics.java +++ b/dspace-api/src/main/java/org/dspace/util/SolrUpgradePre6xStatistics.java @@ -78,7 +78,7 @@ public class SolrUpgradePre6xStatistics { private static final int NUMREC_DEFAULT = 100000; private static final int BATCH_DEFAULT = 10000; - //After processing each batch of updates to SOLR, evaulate if the hibernate cache needs to be cleared + //After processing each batch of updates to SOLR, evaluate if the hibernate cache needs to be cleared private static final int CACHE_LIMIT = 20000; private static final String INDEX_DEFAULT = "statistics"; @@ -112,7 +112,7 @@ private enum FIELD { //Logger private static final Logger log = LogManager.getLogger(); - //DSpace Servcies + //DSpace Services private ConfigurationService configurationService = DSpaceServicesFactory.getInstance().getConfigurationService(); protected CommunityService communityService = ContentServiceFactory.getInstance().getCommunityService(); protected CollectionService collectionService = ContentServiceFactory.getInstance().getCollectionService(); @@ -271,7 +271,7 @@ private static Options makeOptions() { options.addOption(HELP_OPTION, "help", false, "Get help on options for this command."); options.addOption(INDEX_NAME_OPTION, "index-name", true, "The names of the indexes to process. At least one is required (default=statistics)"); - options.addOption(NUMREC_OPTION, "num-rec", true, "Total number of records to update (defaut=100,000)."); + options.addOption(NUMREC_OPTION, "num-rec", true, "Total number of records to update (default=100,000)."); options.addOption(BATCH_OPTION, "batch-size", true, "Number of records to batch update to SOLR at one time (default=10,000)."); return options; @@ -327,7 +327,7 @@ public static void main(String[] args) throws ParseException { System.out.println(" * This process should be run iteratively over every statistics shard "); System.out.println(" * until there are no remaining records with legacy ids present."); System.out.println(" * This process can be run while the system is in use."); - System.out.println(" * It is likely to take 1 hour/1,000,000 legacy records to be udpated."); + System.out.println(" * It is likely to take 1 hour/1,000,000 legacy records to be updated."); System.out.println(" *"); System.out.println(" * This process will rewrite most solr statistics records and may temporarily double "); System.out.println( @@ -408,7 +408,7 @@ private long runReportQuery() throws SolrServerException, IOException { } else if (id == Constants.ITEM) { name = "Item " + s; } else if (id == Constants.BITSTREAM) { - name = "Bistream " + s; + name = "Bitstream " + s; } else { /* * In testing, I discovered some unexpected values in the scopeType field. It @@ -479,7 +479,7 @@ private int updateRecords(String query) throws SolrServerException, SQLException sQ.setRows(batchSize); // Ensure that items are grouped by id - // Sort by id fails due to presense of id and string fields. The ord function + // Sort by id fails due to presence of id and string fields. The ord function // seems to help sQ.addSort("type", SolrQuery.ORDER.desc); sQ.addSort("scopeType", SolrQuery.ORDER.desc); diff --git a/dspace-api/src/main/java/org/dspace/versioning/AbstractVersionProvider.java b/dspace-api/src/main/java/org/dspace/versioning/AbstractVersionProvider.java index 329332d31526..1dae5427f8d0 100644 --- a/dspace-api/src/main/java/org/dspace/versioning/AbstractVersionProvider.java +++ b/dspace-api/src/main/java/org/dspace/versioning/AbstractVersionProvider.java @@ -84,8 +84,8 @@ protected void createBundlesAndAddBitstreams(Context c, Item itemNew, Item nativ // DSpace knows several types of resource policies (see the class // org.dspace.authorize.ResourcePolicy): Submission, Workflow, Custom // and inherited. Submission, Workflow and Inherited policies will be - // set automatically as neccessary. We need to copy the custom policies - // only to preserve customly set policies and embargos (which are + // set automatically as necessary. We need to copy the custom policies + // only to preserve customly set policies and embargoes (which are // realized by custom policies with a start date). List bundlePolicies = authorizeService.findPoliciesByDSOAndType(c, nativeBundle, ResourcePolicy.TYPE_CUSTOM); diff --git a/dspace-api/src/main/java/org/dspace/versioning/DefaultItemVersionProvider.java b/dspace-api/src/main/java/org/dspace/versioning/DefaultItemVersionProvider.java index fa89b3441408..c41b985690d2 100644 --- a/dspace-api/src/main/java/org/dspace/versioning/DefaultItemVersionProvider.java +++ b/dspace-api/src/main/java/org/dspace/versioning/DefaultItemVersionProvider.java @@ -72,7 +72,7 @@ public void deleteVersionedItem(Context c, Version versionToDelete, VersionHisto if (versionHistoryService.isLastVersion(c, history, versionToDelete) && versioningService.getVersionsByHistory(c, history).size() > 1) { // if a new version gets archived, the old one is set to false. - // we need to do the oposite now, if the old version was previously + // we need to do the opposite now, if the old version was previously // unarchived. If the old version is still archived, the new // version is a WorkspaceItem or WorkflowItem we should skip this, // as unarchiving of previous versions is done only when a newer @@ -116,8 +116,8 @@ public Item updateItemState(Context c, Item itemNew, Item previousItem) { // DSpace knows several types of resource policies (see the class // org.dspace.authorize.ResourcePolicy): Submission, Workflow, Custom // and inherited. Submission, Workflow and Inherited policies will be - // set automatically as neccessary. We need to copy the custom policies - // only to preserve customly set policies and embargos (which are + // set automatically as necessary. We need to copy the custom policies + // only to preserve customly set policies and embargoes (which are // realized by custom policies with a start date). List policies = authorizeService.findPoliciesByDSOAndType(c, previousItem, ResourcePolicy.TYPE_CUSTOM); diff --git a/dspace-api/src/main/java/org/dspace/versioning/VersioningServiceImpl.java b/dspace-api/src/main/java/org/dspace/versioning/VersioningServiceImpl.java index ece536e81b26..b9c3a524a1bf 100644 --- a/dspace-api/src/main/java/org/dspace/versioning/VersioningServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/versioning/VersioningServiceImpl.java @@ -247,7 +247,7 @@ protected Version createVersion(Context c, VersionHistory vh, Item item, String protected int getNextVersionNumer(Context c, VersionHistory vh) throws SQLException { int next = versionDAO.getNextVersionNumber(c, vh); - // check if we have uncommited versions in DSpace's cache + // check if we have uncommitted versions in DSpace's cache if (versionHistoryService.getLatestVersion(c, vh) != null && versionHistoryService.getLatestVersion(c, vh).getVersionNumber() >= next) { next = versionHistoryService.getLatestVersion(c, vh).getVersionNumber() + 1; diff --git a/dspace-api/src/main/java/org/dspace/xmlworkflow/WorkflowRequirementsServiceImpl.java b/dspace-api/src/main/java/org/dspace/xmlworkflow/WorkflowRequirementsServiceImpl.java index aecdccd55af3..82296b38f1b7 100644 --- a/dspace-api/src/main/java/org/dspace/xmlworkflow/WorkflowRequirementsServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/xmlworkflow/WorkflowRequirementsServiceImpl.java @@ -31,7 +31,7 @@ import org.springframework.beans.factory.annotation.Autowired; /** - * A class that contains utililty methods related to the workflow + * A class that contains utility methods related to the workflow * The adding/removing from claimed users and ensuring that * if multiple users have to perform these steps that a count is kept * so that no more then the allowed user count are allowed to perform their actions diff --git a/dspace-api/src/main/java/org/dspace/xmlworkflow/XmlWorkflowServiceImpl.java b/dspace-api/src/main/java/org/dspace/xmlworkflow/XmlWorkflowServiceImpl.java index eb315020be2d..06ded267d18a 100644 --- a/dspace-api/src/main/java/org/dspace/xmlworkflow/XmlWorkflowServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/xmlworkflow/XmlWorkflowServiceImpl.java @@ -416,7 +416,7 @@ public WorkflowActionConfig processOutcome(Context c, EPerson user, Workflow wor || currentOutcome.getType() == ActionResult.TYPE.TYPE_SUBMISSION_PAGE) { //We either pressed the cancel button or got an order to return to the submission page, so don't return // an action - //By not returning an action we ensure ourselfs that we go back to the submission page + //By not returning an action we ensure ourselves that we go back to the submission page c.restoreAuthSystemState(); return null; } else if (currentOutcome.getType() == ActionResult.TYPE.TYPE_OUTCOME) { diff --git a/dspace-api/src/main/java/org/dspace/xmlworkflow/migration/RestartWorkflow.java b/dspace-api/src/main/java/org/dspace/xmlworkflow/migration/RestartWorkflow.java index 849010751831..c780d66a0c89 100644 --- a/dspace-api/src/main/java/org/dspace/xmlworkflow/migration/RestartWorkflow.java +++ b/dspace-api/src/main/java/org/dspace/xmlworkflow/migration/RestartWorkflow.java @@ -28,7 +28,7 @@ import org.dspace.workflow.factory.WorkflowServiceFactory; /** - * A utility class that will send all the worklfow items + * A utility class that will send all the workflow items * back to their submitters * * @author Bram De Schouwer (bram.deschouwer at dot com) diff --git a/dspace-api/src/main/java/org/dspace/xmlworkflow/state/actions/Action.java b/dspace-api/src/main/java/org/dspace/xmlworkflow/state/actions/Action.java index d70fd17a109a..f16ef419e726 100644 --- a/dspace-api/src/main/java/org/dspace/xmlworkflow/state/actions/Action.java +++ b/dspace-api/src/main/java/org/dspace/xmlworkflow/state/actions/Action.java @@ -229,7 +229,7 @@ protected List getAdvancedInfo() { * Adds info in the metadata field dc.description.provenance about item being approved containing in which step * it was approved, which user approved it and the time * - * @param c DSpace contect + * @param c DSpace contact * @param wfi Workflow item we're adding workflow accept provenance on */ public void addApprovedProvenance(Context c, XmlWorkflowItem wfi) throws SQLException, AuthorizeException { diff --git a/dspace-api/src/main/java/org/dspace/xmlworkflow/state/actions/userassignment/UserSelectionAction.java b/dspace-api/src/main/java/org/dspace/xmlworkflow/state/actions/userassignment/UserSelectionAction.java index 06db5137271b..f405242aab4a 100644 --- a/dspace-api/src/main/java/org/dspace/xmlworkflow/state/actions/userassignment/UserSelectionAction.java +++ b/dspace-api/src/main/java/org/dspace/xmlworkflow/state/actions/userassignment/UserSelectionAction.java @@ -88,7 +88,7 @@ public abstract boolean isValidUserSelection(Context context, XmlWorkflowItem wf throws WorkflowConfigurationException, SQLException; /** - * A boolean indicating wether or not the task pool is used for this type of user selection + * A boolean indicating whether or not the task pool is used for this type of user selection * * @return a boolean */ diff --git a/dspace-api/src/test/java/org/dspace/AbstractDSpaceIntegrationTest.java b/dspace-api/src/test/java/org/dspace/AbstractDSpaceIntegrationTest.java index 5a5ce8bf6d4c..821e22dcef25 100644 --- a/dspace-api/src/test/java/org/dspace/AbstractDSpaceIntegrationTest.java +++ b/dspace-api/src/test/java/org/dspace/AbstractDSpaceIntegrationTest.java @@ -60,7 +60,7 @@ protected AbstractDSpaceIntegrationTest() { } @BeforeClass public static void initTestEnvironment() { try { - //Stops System.exit(0) throws exception instead of exitting + //Stops System.exit(0) throws exception instead of exiting System.setSecurityManager(new NoExitSecurityManager()); //set a standard time zone for the tests diff --git a/dspace-api/src/test/java/org/dspace/app/bulkaccesscontrol/BulkAccessControlIT.java b/dspace-api/src/test/java/org/dspace/app/bulkaccesscontrol/BulkAccessControlIT.java index 73f02e40494c..c115c04f6c9d 100644 --- a/dspace-api/src/test/java/org/dspace/app/bulkaccesscontrol/BulkAccessControlIT.java +++ b/dspace-api/src/test/java/org/dspace/app/bulkaccesscontrol/BulkAccessControlIT.java @@ -943,7 +943,7 @@ public void performBulkAccessForSingleItemWithBitstreamConstraintsTest() throws Bitstream bitstreamOne; try (InputStream is = IOUtils.toInputStream(bitstreamOneContent, CharEncoding.UTF_8)) { bitstreamOne = BitstreamBuilder.createBitstream(context, bundle, is) - .withName("bistream one") + .withName("bitstream one") .build(); } @@ -951,7 +951,7 @@ public void performBulkAccessForSingleItemWithBitstreamConstraintsTest() throws Bitstream bitstreamTwo; try (InputStream is = IOUtils.toInputStream(bitstreamTwoContent, CharEncoding.UTF_8)) { bitstreamTwo = BitstreamBuilder.createBitstream(context, bundle, is) - .withName("bistream two") + .withName("bitstream two") .build(); } @@ -1188,7 +1188,7 @@ public void performBulkAccessWithReplaceModeAndEmptyAccessConditionsTest() throw String bitstreamContent = "Dummy content"; try (InputStream is = IOUtils.toInputStream(bitstreamContent, CharEncoding.UTF_8)) { BitstreamBuilder.createBitstream(context, bundle, is) - .withName("bistream") + .withName("bitstream") .build(); } } @@ -1297,7 +1297,7 @@ public void performBulkAccessWithAddModeTest() throws Exception { String bitstreamContent = "Dummy content"; try (InputStream is = IOUtils.toInputStream(bitstreamContent, CharEncoding.UTF_8)) { BitstreamBuilder.createBitstream(context, bundle, is) - .withName("bistream") + .withName("bitstream") .build(); } } @@ -1404,7 +1404,7 @@ public void performBulkAccessWithReplaceModeTest() throws Exception { String bitstreamContent = "Dummy content"; try (InputStream is = IOUtils.toInputStream(bitstreamContent, CharEncoding.UTF_8)) { BitstreamBuilder.createBitstream(context, bundle, is) - .withName("bistream") + .withName("bitstream") .build(); } } @@ -1753,7 +1753,7 @@ public void performBulkAccessWithReplaceModeOnItemsWithMultipleBundlesTest() thr try (InputStream is = IOUtils.toInputStream(bitstreamContent, CharEncoding.UTF_8)) { bitstreamOne = BitstreamBuilder.createBitstream(context, bundleOne, is) - .withName("bistream of bundle one") + .withName("bitstream of bundle one") .build(); } diff --git a/dspace-api/src/test/java/org/dspace/app/csv/CSVMetadataImportReferenceIT.java b/dspace-api/src/test/java/org/dspace/app/csv/CSVMetadataImportReferenceIT.java index aee4b4d267cc..4329092b98d6 100644 --- a/dspace-api/src/test/java/org/dspace/app/csv/CSVMetadataImportReferenceIT.java +++ b/dspace-api/src/test/java/org/dspace/app/csv/CSVMetadataImportReferenceIT.java @@ -721,7 +721,7 @@ public int performImportScript(String[] csv, boolean validateOnly) throws Except * * @param value the value of the dc.identifier.other to query for * - * @return first retrived UUID + * @return first retrieved UUID */ private UUID getUUIDByIdentifierOther(String value) throws Exception { ArrayList uuidList = new ArrayList<>(); diff --git a/dspace-api/src/test/java/org/dspace/app/mediafilter/MediaFilterIT.java b/dspace-api/src/test/java/org/dspace/app/mediafilter/MediaFilterIT.java index aef2476fdc45..938dc92de4b1 100644 --- a/dspace-api/src/test/java/org/dspace/app/mediafilter/MediaFilterIT.java +++ b/dspace-api/src/test/java/org/dspace/app/mediafilter/MediaFilterIT.java @@ -199,9 +199,9 @@ private void checkItemHasBeenProcessed(Item item) throws IOException, SQLExcepti List bitstreams = textBundles.get(0).getBitstreams(); assertTrue("The item " + item.getName() + " has NOT exactly 1 bitstream in the TEXT bundle", bitstreams.size() == 1); - assertTrue("The text bistream in the " + item.getName() + " is NOT named properly [" + expectedFileName + "]", + assertTrue("The text bitstream in the " + item.getName() + " is NOT named properly [" + expectedFileName + "]", StringUtils.equals(bitstreams.get(0).getName(), expectedFileName)); - assertTrue("The text bistream in the " + item.getName() + " doesn't contain the proper content [" + assertTrue("The text bitstream in the " + item.getName() + " doesn't contain the proper content [" + expectedContent + "]", StringUtils.contains(getContent(bitstreams.get(0)), expectedContent)); } diff --git a/dspace-api/src/test/java/org/dspace/app/packager/PackagerIT.java b/dspace-api/src/test/java/org/dspace/app/packager/PackagerIT.java index 2cddbb511f91..ab98a053e4d1 100644 --- a/dspace-api/src/test/java/org/dspace/app/packager/PackagerIT.java +++ b/dspace-api/src/test/java/org/dspace/app/packager/PackagerIT.java @@ -171,7 +171,7 @@ public void packagerUUIDAlreadyExistWithoutForceTest() throws Exception { } private String getID() throws IOException, MetadataValidationException { - //this method gets the UUID from the mets file thats stored in the attribute element + //this method gets the UUID from the mets file that's stored in the attribute element METSManifest manifest = null; ZipFile zip = new ZipFile(tempFile); ZipEntry manifestEntry = zip.getEntry(METSManifest.MANIFEST_FILE); diff --git a/dspace-api/src/test/java/org/dspace/app/requestitem/RequestItemEmailNotifierTest.java b/dspace-api/src/test/java/org/dspace/app/requestitem/RequestItemEmailNotifierTest.java index eb3bf68b8942..0868017ed944 100644 --- a/dspace-api/src/test/java/org/dspace/app/requestitem/RequestItemEmailNotifierTest.java +++ b/dspace-api/src/test/java/org/dspace/app/requestitem/RequestItemEmailNotifierTest.java @@ -161,7 +161,7 @@ public void testSendResponse() throws Exception { assertThat("To: should be an Internet address", myAddresses[0], instanceOf(InternetAddress.class)); String address = ((InternetAddress)myAddresses[0]).getAddress(); - assertEquals("To: address should match requestor.", + assertEquals("To: address should match requester.", ri.getReqEmail(), address); // Check the message body. @@ -246,7 +246,7 @@ public void testSendRejection() assertThat("To: should be an Internet address", myAddresses[0], instanceOf(InternetAddress.class)); String address = ((InternetAddress)myAddresses[0]).getAddress(); - assertEquals("To: address should match requestor.", + assertEquals("To: address should match requester.", ri.getReqEmail(), address); // Check the message body. diff --git a/dspace-api/src/test/java/org/dspace/app/sherpa/MockSHERPAService.java b/dspace-api/src/test/java/org/dspace/app/sherpa/MockSHERPAService.java index 239d2864bfb1..5c5e9f736436 100644 --- a/dspace-api/src/test/java/org/dspace/app/sherpa/MockSHERPAService.java +++ b/dspace-api/src/test/java/org/dspace/app/sherpa/MockSHERPAService.java @@ -43,7 +43,7 @@ public SHERPAResponse performRequest(String type, String field, String predicate "https://v2.sherpa.ac.uk/cgi/retrieve"); String apiKey = configurationService.getProperty("sherpa.romeo.apikey"); - // Rather than search, we will simply attempt to build the URI using the real pepare method + // Rather than search, we will simply attempt to build the URI using the real prepare method // so that any errors there are caught, and will return a valid response for The Lancet InputStream content = null; try { @@ -100,7 +100,7 @@ public SHERPAPublisherResponse performPublisherRequest(String type, String field "https://v2.sherpa.ac.uk/cgi/retrieve"); String apiKey = configurationService.getProperty("sherpa.romeo.apikey"); - // Rather than search, we will simply attempt to build the URI using the real pepare method + // Rather than search, we will simply attempt to build the URI using the real prepare method // so that any errors there are caught, and will return a valid response for The Lancet InputStream content = null; try { diff --git a/dspace-api/src/test/java/org/dspace/app/util/GoogleBitstreamComparatorTest.java b/dspace-api/src/test/java/org/dspace/app/util/GoogleBitstreamComparatorTest.java index 78142c925899..4058974d4136 100644 --- a/dspace-api/src/test/java/org/dspace/app/util/GoogleBitstreamComparatorTest.java +++ b/dspace-api/src/test/java/org/dspace/app/util/GoogleBitstreamComparatorTest.java @@ -368,8 +368,8 @@ public void testAddingNewFormat() { "bitstream2 has a type with a priority higher than bitstream1 (size is ignored) and should come second", "bitstream2", toSort.get(1).getName()); assertEquals( - "bitstream1 has a type with the lowest priority in this bundle eventhough it is the largest bitstream and" + - " should come last", + "bitstream1 has a type with the lowest priority in this bundle even though it is the largest bitstream" + + " and should come last", "bitstream1", toSort.get(2).getName()); } diff --git a/dspace-api/src/test/java/org/dspace/authority/AuthorityValueTest.java b/dspace-api/src/test/java/org/dspace/authority/AuthorityValueTest.java index 07c4b65f40f2..0857d07fde37 100644 --- a/dspace-api/src/test/java/org/dspace/authority/AuthorityValueTest.java +++ b/dspace-api/src/test/java/org/dspace/authority/AuthorityValueTest.java @@ -32,7 +32,7 @@ public void testStringToDate() { // Test an invalid date. actual = AuthorityValue.stringToDate("not a date"); - assertNull("Unparseable date should return null", actual); + assertNull("Unparsable date should return null", actual); // Test a date-time without zone or offset. expected = Date.from(LocalDateTime.of(1957, 01, 27, 01, 23, 45) diff --git a/dspace-api/src/test/java/org/dspace/content/BitstreamFormatTest.java b/dspace-api/src/test/java/org/dspace/content/BitstreamFormatTest.java index aa1952492b4a..1ddc8fb8ab55 100644 --- a/dspace-api/src/test/java/org/dspace/content/BitstreamFormatTest.java +++ b/dspace-api/src/test/java/org/dspace/content/BitstreamFormatTest.java @@ -35,7 +35,7 @@ import org.springframework.test.util.ReflectionTestUtils; /** - * This class tests BitstreamFormat. Due to it being tighly coupled with the + * This class tests BitstreamFormat. Due to it being tightly coupled with the * database, most of the methods use mock objects, which only proved a very * basic test level (ensure the method doesn't throw an exception). The real * testing of the class will be done in the Integration Tests. @@ -230,7 +230,7 @@ public void testCreateAdmin() throws SQLException, AuthorizeException { */ @Test(expected = AuthorizeException.class) public void testCreateNotAdmin() throws SQLException, AuthorizeException { - // Disalow full Admin perms + // Disallow full Admin perms when(authorizeServiceSpy.isAdmin(context)).thenReturn(false); bitstreamFormatService.create(context); diff --git a/dspace-api/src/test/java/org/dspace/content/CollectionTest.java b/dspace-api/src/test/java/org/dspace/content/CollectionTest.java index a177571ffa46..6e7290434566 100644 --- a/dspace-api/src/test/java/org/dspace/content/CollectionTest.java +++ b/dspace-api/src/test/java/org/dspace/content/CollectionTest.java @@ -435,7 +435,7 @@ public void testSetWorkflowGroup() throws SQLException, AuthorizeException { /** * Test of setWorkflowGroup method, of class Collection. - * The setWorkflowGroup ajust the policies for the basic Workflow. This test + * The setWorkflowGroup adjust the policies for the basic Workflow. This test * shall assure that now exception (e.g. ConcurrentModificationException is * thrown during these adjustments. */ diff --git a/dspace-api/src/test/java/org/dspace/content/CommunityTest.java b/dspace-api/src/test/java/org/dspace/content/CommunityTest.java index 939a7cc62088..7c0d1dc934f3 100644 --- a/dspace-api/src/test/java/org/dspace/content/CommunityTest.java +++ b/dspace-api/src/test/java/org/dspace/content/CommunityTest.java @@ -884,7 +884,7 @@ public void testDeleteHierachyAuth() throws Exception { context.turnOffAuthorisationSystem(); Community parent = communityService.create(null, context); - // Create a hierachy of sub-Communities and Collections and Items. + // Create a hierarchy of sub-Communities and Collections and Items. Community child = communityService.createSubcommunity(context, parent); Community grandchild = communityService.createSubcommunity(context, child); Collection childCol = collectionService.create(context, child); diff --git a/dspace-api/src/test/java/org/dspace/content/DuplicateDetectionTest.java b/dspace-api/src/test/java/org/dspace/content/DuplicateDetectionTest.java index 0b6c909f03e8..3ee25afe88c3 100644 --- a/dspace-api/src/test/java/org/dspace/content/DuplicateDetectionTest.java +++ b/dspace-api/src/test/java/org/dspace/content/DuplicateDetectionTest.java @@ -421,7 +421,7 @@ public void testSearchDuplicatesWithMultipleFields() throws Exception { assertEquals("Potential duplicates of item10 (title + author) should have size " + size, size, potentialDuplicates.size()); - // The only member should be item 11 since item 12 has a different author (but hte same title + // The only member should be item 11 since item 12 has a different author (but the same title assertEquals("Item 11 should be be the detected duplicate", item11.getID(), potentialDuplicates.get(0).getUuid()); diff --git a/dspace-api/src/test/java/org/dspace/content/EntityTypeServiceImplTest.java b/dspace-api/src/test/java/org/dspace/content/EntityTypeServiceImplTest.java index c54f0fc955b2..113721910379 100644 --- a/dspace-api/src/test/java/org/dspace/content/EntityTypeServiceImplTest.java +++ b/dspace-api/src/test/java/org/dspace/content/EntityTypeServiceImplTest.java @@ -122,7 +122,7 @@ public void testDelete() throws Exception { } /** - * Helper method that reutrns new EntityType + * Helper method that returns new EntityType * @return new EntityType */ public EntityType makeEntityType() { diff --git a/dspace-api/src/test/java/org/dspace/content/ITCommunityCollection.java b/dspace-api/src/test/java/org/dspace/content/ITCommunityCollection.java index 03d0391ab8b3..668944fc977b 100644 --- a/dspace-api/src/test/java/org/dspace/content/ITCommunityCollection.java +++ b/dspace-api/src/test/java/org/dspace/content/ITCommunityCollection.java @@ -200,7 +200,7 @@ public void testCommunityAdminDeletions() throws SQLException, AuthorizeExceptio groupService.addMember(context, adminGroup, commAdmin); groupService.update(context, adminGroup); - // Create a hierachy of sub-Communities and Collections and Items. + // Create a hierarchy of sub-Communities and Collections and Items. Community child = communityService.createSubcommunity(context, parentCom); Community child2 = communityService.createSubcommunity(context, parentCom); Community child3 = communityService.createSubcommunity(context, parentCom); diff --git a/dspace-api/src/test/java/org/dspace/content/ItemComparatorTest.java b/dspace-api/src/test/java/org/dspace/content/ItemComparatorTest.java index be670d9b5097..dc78008f3e41 100644 --- a/dspace-api/src/test/java/org/dspace/content/ItemComparatorTest.java +++ b/dspace-api/src/test/java/org/dspace/content/ItemComparatorTest.java @@ -135,7 +135,7 @@ public void testCompare() throws SQLException { int result; ItemComparator ic; - //one of the tiems has no value + //one of the items has no value ic = new ItemComparator("test", "one", Item.ANY, true); result = ic.compare(one, two); assertTrue("testCompare 0", result == 0); diff --git a/dspace-api/src/test/java/org/dspace/content/RelationshipServiceImplPlaceTest.java b/dspace-api/src/test/java/org/dspace/content/RelationshipServiceImplPlaceTest.java index 3e36f77c68b9..b33063a1fab7 100644 --- a/dspace-api/src/test/java/org/dspace/content/RelationshipServiceImplPlaceTest.java +++ b/dspace-api/src/test/java/org/dspace/content/RelationshipServiceImplPlaceTest.java @@ -429,7 +429,7 @@ public void AddAndRemoveMetadataAndRelationshipsTest() throws Exception { context.turnOffAuthorisationSystem(); - // Create a relationship with this item with a spcific place + // Create a relationship with this item with a specific place Relationship relationship = relationshipService.create(context, item, authorItem, isAuthorOfPublication, 1, -1); context.restoreAuthSystemState(); diff --git a/dspace-api/src/test/java/org/dspace/content/dao/RelationshipDAOImplIT.java b/dspace-api/src/test/java/org/dspace/content/dao/RelationshipDAOImplIT.java index 20710ab5f25b..8e48c7088463 100644 --- a/dspace-api/src/test/java/org/dspace/content/dao/RelationshipDAOImplIT.java +++ b/dspace-api/src/test/java/org/dspace/content/dao/RelationshipDAOImplIT.java @@ -72,7 +72,7 @@ public class RelationshipDAOImplIT extends AbstractIntegrationTest { protected EntityTypeService entityTypeService = ContentServiceFactory.getInstance().getEntityTypeService(); /** - * Initalize DSpace objects used for testing for each test + * Initialize DSpace objects used for testing for each test */ @Before @Override @@ -106,7 +106,7 @@ public void init() { } /** - * Delete all initalized DSpace objects after each test + * Delete all initialized DSpace objects after each test */ @After @Override diff --git a/dspace-api/src/test/java/org/dspace/content/dao/RelationshipTypeDAOImplIT.java b/dspace-api/src/test/java/org/dspace/content/dao/RelationshipTypeDAOImplIT.java index d76e5faa804a..315fabba9e88 100644 --- a/dspace-api/src/test/java/org/dspace/content/dao/RelationshipTypeDAOImplIT.java +++ b/dspace-api/src/test/java/org/dspace/content/dao/RelationshipTypeDAOImplIT.java @@ -68,7 +68,7 @@ public class RelationshipTypeDAOImplIT extends AbstractIntegrationTest { protected EntityTypeService entityTypeService = ContentServiceFactory.getInstance().getEntityTypeService(); /** - * Initalize DSpace objects used for testing for each test + * Initialize DSpace objects used for testing for each test */ @Before @Override @@ -101,7 +101,7 @@ public void init() { } /** - * Delete all initalized DSpace objects after each test + * Delete all initialized DSpace objects after each test */ @After @Override diff --git a/dspace-api/src/test/java/org/dspace/content/packager/ITDSpaceAIP.java b/dspace-api/src/test/java/org/dspace/content/packager/ITDSpaceAIP.java index c5a73ed539a7..b9cbc36f7111 100644 --- a/dspace-api/src/test/java/org/dspace/content/packager/ITDSpaceAIP.java +++ b/dspace-api/src/test/java/org/dspace/content/packager/ITDSpaceAIP.java @@ -146,7 +146,7 @@ public static void setUpClass() { InstallItemService installItemService = ContentServiceFactory.getInstance().getInstallItemService(); log.info("setUpClass() - CREATE TEST HIERARCHY"); - // Create a hierachy of sub-Communities and Collections and Items, + // Create a hierarchy of sub-Communities and Collections and Items, // which looks like this: // "Top Community" // - "Child Community" diff --git a/dspace-api/src/test/java/org/dspace/content/packager/PackageUtilsTest.java b/dspace-api/src/test/java/org/dspace/content/packager/PackageUtilsTest.java index ae6860012457..06020be51349 100644 --- a/dspace-api/src/test/java/org/dspace/content/packager/PackageUtilsTest.java +++ b/dspace-api/src/test/java/org/dspace/content/packager/PackageUtilsTest.java @@ -79,7 +79,7 @@ public static void setUpClass() { CollectionService collectionService = ContentServiceFactory.getInstance().getCollectionService(); log.info("setUpClass() - CREATE TEST HIERARCHY"); - // Create a hierachy of sub-Communities and Collections + // Create a hierarchy of sub-Communities and Collections // which looks like this: // "Top Community" // - "Child Community" diff --git a/dspace-api/src/test/java/org/dspace/content/virtual/ConcatenateTest.java b/dspace-api/src/test/java/org/dspace/content/virtual/ConcatenateTest.java index 52457a23d77d..f39f2d8fd998 100644 --- a/dspace-api/src/test/java/org/dspace/content/virtual/ConcatenateTest.java +++ b/dspace-api/src/test/java/org/dspace/content/virtual/ConcatenateTest.java @@ -61,11 +61,11 @@ public void testSetFields() { @Test public void testGetSeperator() { // Setup objects utilized in unit test - String seperator = ","; + String separator = ","; concatenate.setSeparator(","); - // The reported seperator should match our defined seperator - assertEquals("TestGetSeperator 0", seperator, concatenate.getSeparator()); + // The reported separator should match our defined separator + assertEquals("TestGetSeperator 0", separator, concatenate.getSeparator()); } @Test @@ -73,7 +73,7 @@ public void testSetSeperator() { // Setup objects utilized in unit test concatenate.setSeparator(","); - // The reported seperator should match our defined seperator + // The reported separator should match our defined separator assertEquals("TestSetSeperator 0", ",", concatenate.getSeparator()); } @@ -82,7 +82,7 @@ public void testSetUseForPlace() { // Setup objects utilized in unit test concatenate.setUseForPlace(true); - // The reported seperator should match our defined seperator + // The reported separator should match our defined separator assertEquals("TestSetUseForPlace 0", true, concatenate.getUseForPlace()); } diff --git a/dspace-api/src/test/java/org/dspace/discovery/FullTextContentStreamsTest.java b/dspace-api/src/test/java/org/dspace/discovery/FullTextContentStreamsTest.java index f2a759fa091e..ff4174d048be 100644 --- a/dspace-api/src/test/java/org/dspace/discovery/FullTextContentStreamsTest.java +++ b/dspace-api/src/test/java/org/dspace/discovery/FullTextContentStreamsTest.java @@ -193,7 +193,7 @@ public void testBitstreamThrowingExceptionShouldNotStopIndexing() throws Excepti content.contains("This is text 1")); assertFalse("The data should NOT contain data of the second bitstream that is corrupt", content.contains("This is text 2")); - assertTrue("The data should contain data of the third bistream that is not corrupt", + assertTrue("The data should contain data of the third bitstream that is not corrupt", content.contains("This is text 3")); assertTrue("The data should contain data on the exception that occurred", content.contains("java.io.IOException")); diff --git a/dspace-api/src/test/java/org/dspace/eperson/EPersonInWorkflowIT.java b/dspace-api/src/test/java/org/dspace/eperson/EPersonInWorkflowIT.java index 5d7ed53fa0b0..a9cc213ad9a3 100644 --- a/dspace-api/src/test/java/org/dspace/eperson/EPersonInWorkflowIT.java +++ b/dspace-api/src/test/java/org/dspace/eperson/EPersonInWorkflowIT.java @@ -347,7 +347,7 @@ public void testDeleteUserWhenOnlyUserInGroup4() throws Exception { * being no other members in step 3 * - approve it by user B * - delete user B - * - verify the delete suceeds + * - verify the delete succeeds * - verify that the item is archived */ context.turnOffAuthorisationSystem(); @@ -543,7 +543,7 @@ public void testDeleteUserWhenOnlyUserInGroup6() throws Exception { * task if they are the only member. This test also verifies the user can be removed from a step with no tasks * even if they are the only member. This test also verifies that after the task has been passed and the user has * been removed from the workflow, the EPerson can be removed. This test also verifies that an item is correctly - * arhived if the last step has no members left. + * archived if the last step has no members left. * * @throws Exception */ diff --git a/dspace-api/src/test/java/org/dspace/identifier/DOIIdentifierProviderTest.java b/dspace-api/src/test/java/org/dspace/identifier/DOIIdentifierProviderTest.java index 09387acd3ee3..734713b92c02 100644 --- a/dspace-api/src/test/java/org/dspace/identifier/DOIIdentifierProviderTest.java +++ b/dspace-api/src/test/java/org/dspace/identifier/DOIIdentifierProviderTest.java @@ -566,7 +566,7 @@ public void testMint_DOI_withNonMatchingFilter() /** * Test minting a DOI with a filter that always returns true and therefore allows the DOI to be minted - * (this should have hte same results as base testMint_DOI, but here we use an explicit filter rather than null) + * (this should have the same results as base testMint_DOI, but here we use an explicit filter rather than null) */ @Test public void testMint_DOI_withMatchingFilter() @@ -617,7 +617,7 @@ public void testReserve_DOI() DOI doiRow = doiService.findByDoi(context, doi.substring(DOI.SCHEME.length())); assumeNotNull(doiRow); - assertTrue("Reservation of DOI did not set the corret DOI status.", + assertTrue("Reservation of DOI did not set the correct DOI status.", DOIIdentifierProvider.TO_BE_RESERVED.equals(doiRow.getStatus())); } @@ -633,7 +633,7 @@ public void testRegister_unreserved_DOI() DOI doiRow = doiService.findByDoi(context, doi.substring(DOI.SCHEME.length())); assumeNotNull(doiRow); - assertTrue("Registration of DOI did not set the corret DOI status.", + assertTrue("Registration of DOI did not set the correct DOI status.", DOIIdentifierProvider.TO_BE_REGISTERED.equals(doiRow.getStatus())); } @@ -649,7 +649,7 @@ public void testRegister_reserved_DOI() DOI doiRow = doiService.findByDoi(context, doi.substring(DOI.SCHEME.length())); assumeNotNull(doiRow); - assertTrue("Registration of DOI did not set the corret DOI status.", + assertTrue("Registration of DOI did not set the correct DOI status.", DOIIdentifierProvider.TO_BE_REGISTERED.equals(doiRow.getStatus())); } @@ -672,7 +672,7 @@ public void testCreate_and_Register_DOI() DOI doiRow = doiService.findByDoi(context, doi.substring(DOI.SCHEME.length())); assertNotNull("Created DOI was not stored in database.", doiRow); - assertTrue("Registration of DOI did not set the corret DOI status.", + assertTrue("Registration of DOI did not set the correct DOI status.", DOIIdentifierProvider.TO_BE_REGISTERED.equals(doiRow.getStatus())); } diff --git a/dspace-api/src/test/java/org/dspace/matcher/QAEventMatcher.java b/dspace-api/src/test/java/org/dspace/matcher/QAEventMatcher.java index 52f3704a74b7..61affd0ec87d 100644 --- a/dspace-api/src/test/java/org/dspace/matcher/QAEventMatcher.java +++ b/dspace-api/src/test/java/org/dspace/matcher/QAEventMatcher.java @@ -74,7 +74,7 @@ private QAEventMatcher(Matcher eventIdMatcher, Matcher originalI * @param message the message to match * @param topic the topic to match * @param trust the trust to match - * @return the matcher istance + * @return the matcher instance */ public static QAEventMatcher pendingOpenaireEventWith(String originalId, Item target, String title, String message, String topic, Double trust) { diff --git a/dspace-api/src/test/java/org/dspace/statistics/export/ITRetryFailedOpenUrlTracker.java b/dspace-api/src/test/java/org/dspace/statistics/export/ITRetryFailedOpenUrlTracker.java index 7a9d031a0a60..054b612d6372 100644 --- a/dspace-api/src/test/java/org/dspace/statistics/export/ITRetryFailedOpenUrlTracker.java +++ b/dspace-api/src/test/java/org/dspace/statistics/export/ITRetryFailedOpenUrlTracker.java @@ -100,7 +100,7 @@ public void testAddNewFailedUrl() throws Exception { } /** - * Test to check that all logged failed urls are reprocessed succesfully and removed from the db + * Test to check that all logged failed urls are reprocessed successfully and removed from the db * * @throws Exception */ diff --git a/dspace-iiif/src/main/java/org/dspace/app/iiif/service/utils/IIIFUtils.java b/dspace-iiif/src/main/java/org/dspace/app/iiif/service/utils/IIIFUtils.java index 782a5a985292..1a1005993ec2 100644 --- a/dspace-iiif/src/main/java/org/dspace/app/iiif/service/utils/IIIFUtils.java +++ b/dspace-iiif/src/main/java/org/dspace/app/iiif/service/utils/IIIFUtils.java @@ -175,7 +175,7 @@ public boolean isSearchable(Item item) { } /** - * Retrives a bitstream based on its position in the IIIF bundle. + * Retrieves a bitstream based on its position in the IIIF bundle. * * @param context DSpace Context * @param item DSpace Item @@ -361,7 +361,7 @@ private String getToCBundleLabel(Bundle bundle) { * * @param item the dspace item * @param defaultHint the default hint to apply if nothing else is defined at - * the item leve + * the item level * @return the iiif viewing hint for the item */ public String getIIIFViewingHint(Item item, String defaultHint) { diff --git a/dspace-oai/src/test/java/org/dspace/xoai/tests/unit/services/impl/AbstractQueryResolverTest.java b/dspace-oai/src/test/java/org/dspace/xoai/tests/unit/services/impl/AbstractQueryResolverTest.java index 53fc6434490c..b1ae4d209f58 100644 --- a/dspace-oai/src/test/java/org/dspace/xoai/tests/unit/services/impl/AbstractQueryResolverTest.java +++ b/dspace-oai/src/test/java/org/dspace/xoai/tests/unit/services/impl/AbstractQueryResolverTest.java @@ -38,7 +38,7 @@ public void setUp() { @After public void tearDown() { - //Nullify all resoruces so that JUnit cleans them up + //Nullify all resources so that JUnit cleans them up applicationContext = null; handleResolver = null; collectionsService = null; diff --git a/dspace-rdf/src/main/java/org/dspace/rdf/providing/DataProviderServlet.java b/dspace-rdf/src/main/java/org/dspace/rdf/providing/DataProviderServlet.java index 2ebcf5836c8f..7344b2c74eb3 100644 --- a/dspace-rdf/src/main/java/org/dspace/rdf/providing/DataProviderServlet.java +++ b/dspace-rdf/src/main/java/org/dspace/rdf/providing/DataProviderServlet.java @@ -159,7 +159,7 @@ protected void serveNamedGraph(String uri, String lang, String contentType, } protected String detectContentType(HttpServletRequest request, String lang) { - // It is usefull to be able to overwrite the content type, to see the + // It is useful to be able to overwrite the content type, to see the // request result directly in the browser. If a parameter "text" is part // of the request, we send the result with the content type "text/plain". if (request.getParameter("text") != null) { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/DiscoverableEndpointsService.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/DiscoverableEndpointsService.java index 1853285d717f..aa22603387cc 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/DiscoverableEndpointsService.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/DiscoverableEndpointsService.java @@ -84,7 +84,7 @@ public List getDiscoverableEndpoints() { private boolean isLinkValid(Object controller, String href) { // FIXME we need to implement a check to be sure that there are no other - // controller with an highter precedence mapped on the same URL (this + // controller with an higher precedence mapped on the same URL (this // could be used to override default implementation) return true; } diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/authorization/AuthorizationRestUtil.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/authorization/AuthorizationRestUtil.java index c3249be01165..d2cf2fe364da 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/authorization/AuthorizationRestUtil.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/authorization/AuthorizationRestUtil.java @@ -143,7 +143,7 @@ private String[] splitIdParts(String id) { objId = idParts[2]; } else { throw new IllegalArgumentException( - "the authoization id is invalid, it must have the form " + + "the authorization id is invalid, it must have the form " + "[eperson-uuid_]feature-id_object-type_object-id"); } return new String[] { eperson, feature, objType, objId }; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/converter/SubmissionDefinitionConverter.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/converter/SubmissionDefinitionConverter.java index 8e4fd247874c..0717f9b30975 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/converter/SubmissionDefinitionConverter.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/converter/SubmissionDefinitionConverter.java @@ -70,7 +70,7 @@ public SubmissionDefinitionRest convert(SubmissionConfig obj, Projection project } } catch (ClassNotFoundException e) { throw new IllegalStateException( - "The submission configration is invalid the processing class for the step " + step.getId() + "The submission configuration is invalid the processing class for the step " + step.getId() + " is not found", e); } diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/hdlresolver/HdlResolverRestController.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/hdlresolver/HdlResolverRestController.java index 3fe897e0e5e1..5d87dc520579 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/hdlresolver/HdlResolverRestController.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/hdlresolver/HdlResolverRestController.java @@ -63,7 +63,7 @@ public ResponseEntity handleController(HttpServletRequest request, @Path request, Optional.ofNullable(request.getRequestURI().split(LISTHANDLES)) .filter(split -> split.length > 1) - .map(splitted -> splitted[1]) + .map(split -> split[1]) .orElse(null) ); } else if (LISTPREFIXES.contains(hdlService)) { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ParameterValueRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ParameterValueRest.java index 6c236fa1769f..72bfeb8a830a 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ParameterValueRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ParameterValueRest.java @@ -10,7 +10,7 @@ import org.apache.commons.lang3.StringUtils; /** - * This class serves as a REST representation for a paramater with a value given to the script + * This class serves as a REST representation for a parameter with a value given to the script */ public class ParameterValueRest { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/query/RestSearchOperator.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/query/RestSearchOperator.java index ae8713bc69e2..9dba4021b463 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/query/RestSearchOperator.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/query/RestSearchOperator.java @@ -23,18 +23,18 @@ public enum RestSearchOperator { /** - * The notcontains operator can be used by adding a - (minus) infront of the search query + * The notcontains operator can be used by adding a - (minus) in front of the search query * and a * at the end * It then becomes -VALUE* to call for a search on the notcontains operator for VALUE */ NOTCONTAINS("-(.+)\\*", "notcontains"), /** - * The notauthority operator can be used by adding a -id: infront of the search query + * The notauthority operator can be used by adding a -id: in front of the search query * It then becomes -id:VALUE to call for a search on the notauthority operator for VALUE */ NOTAUTHORITY("-id:(.+)", "notauthority"), /** - * The notequals operator can be used by adding a - infront of the search query + * The notequals operator can be used by adding a - in front of the search query * It then becomes -VALUE to call for a search on the notequals operator for VALUE */ NOTEQUALS("-(.+)", "notequals"), @@ -44,7 +44,7 @@ public enum RestSearchOperator { */ CONTAINS("(.+)\\*", "contains"), /** - * The authority operator can be used by adding an id: infront of the search query + * The authority operator can be used by adding an id: in front of the search query * It then becomes id:VALUE to call for a search on the authority operator for VALUE */ AUTHORITY("id:(.+)", "authority"), diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/step/DataIdentifiers.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/step/DataIdentifiers.java index 01e0eabdd380..f0eeaf2c222d 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/step/DataIdentifiers.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/step/DataIdentifiers.java @@ -20,7 +20,7 @@ public class DataIdentifiers implements SectionData { // Map of identifier types and values List identifiers; - // Types to display, a hint for te UI + // Types to display, a hint for the UI List displayTypes; public DataIdentifiers() { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/wrapper/SubmissionCCLicenseUrl.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/wrapper/SubmissionCCLicenseUrl.java index 68ff1166b452..9024779b0376 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/wrapper/SubmissionCCLicenseUrl.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/wrapper/SubmissionCCLicenseUrl.java @@ -16,7 +16,7 @@ public class SubmissionCCLicenseUrl { /** - * The url for ths object + * The url for this object */ private String url; /** diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/AuthorizationRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/AuthorizationRestRepository.java index 8d4d44f8282f..371733003dac 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/AuthorizationRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/AuthorizationRestRepository.java @@ -87,7 +87,7 @@ public AuthorizationRest findOne(Context context, String id) { try { object = authorizationRestUtil.getObject(context, id); } catch (IllegalArgumentException e) { - log.warn("Object informations not found in the specified id {}", id, e); + log.warn("Object information not found in the specified id {}", id, e); return null; } @@ -104,7 +104,7 @@ public AuthorizationRest findOne(Context context, String id) { try { user = authorizationRestUtil.getEperson(context, id); } catch (IllegalArgumentException e) { - log.warn("Invalid eperson informations in the specified id {}", id, e); + log.warn("Invalid eperson information in the specified id {}", id, e); return null; } EPerson currUser = context.getCurrentUser(); diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/DSpaceRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/DSpaceRestRepository.java index 74beeb3dac84..296c4322a3fc 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/DSpaceRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/DSpaceRestRepository.java @@ -157,7 +157,7 @@ public Optional findById(ID id) { @Override /** * Return true if an object exist for the specified ID. The default implementation is inefficient as it retrieves - * the actual object to state that it exists. This could lead to retrieve and inizialize lot of linked objects + * the actual object to state that it exists. This could lead to retrieve and initialize lot of linked objects */ public boolean existsById(ID id) { return findById(id).isPresent(); diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/HarvestedCollectionRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/HarvestedCollectionRestRepository.java index 07a7d678854a..7794e1fc9193 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/HarvestedCollectionRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/HarvestedCollectionRestRepository.java @@ -148,7 +148,7 @@ private void updateCollectionHarvestSettings(Context context, HarvestedCollectio /** * Function used to verify that the harvest settings work - * @param harvestedCollectionRest A object containg the harvest settings to be tested + * @param harvestedCollectionRest A object containing the harvest settings to be tested * @return */ private List testHarvestSettings(HarvestedCollectionRest harvestedCollectionRest) { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/IdentifierRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/IdentifierRestRepository.java index 7e8e8e2d8917..bbc79cbf426d 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/IdentifierRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/IdentifierRestRepository.java @@ -67,7 +67,7 @@ /** * Item REST Repository and Controller for persistent identifiers. * The controller annotation and endpoint registration allows the "find DSO by identifier" method which was - * previously implmented in org.dspace.app.rest.IdentifierRestController + * previously implemented in org.dspace.app.rest.IdentifierRestController * * @author Kim Shepherd */ diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubscriptionRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubscriptionRestRepository.java index e7e6f61077eb..37d16414b286 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubscriptionRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubscriptionRestRepository.java @@ -154,7 +154,7 @@ protected SubscriptionRest createAndReturn(Context context) throws SQLException, String dsoId = req.getParameter("resource"); if (StringUtils.isBlank(dsoId) || StringUtils.isBlank(epersonId)) { - throw new UnprocessableEntityException("Both eperson than DSpaceObject uuids must be provieded!"); + throw new UnprocessableEntityException("Both eperson than DSpaceObject uuids must be provided!"); } try { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/handler/ExternalSourceEntryArchivedItemUriListHandler.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/handler/ExternalSourceEntryArchivedItemUriListHandler.java index ea9618bb8b44..8cbbd99ba65d 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/handler/ExternalSourceEntryArchivedItemUriListHandler.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/handler/ExternalSourceEntryArchivedItemUriListHandler.java @@ -73,7 +73,7 @@ public Item handle(Context context, HttpServletRequest request, List uri WorkspaceItem workspaceItem = super.createWorkspaceItem(context, request, uriList); return installItemService.installItem(context, workspaceItem); } catch (AuthorizeException | SQLException e) { - log.error("An error occured when trying to create item in collection with uuid: " + owningCollectionUuid, + log.error("An error occurred when trying to create item in collection with uuid: " + owningCollectionUuid, e); throw e; } diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/handler/ExternalSourceEntryItemUriListHandler.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/handler/ExternalSourceEntryItemUriListHandler.java index a1051b0f6743..172411f6ac27 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/handler/ExternalSourceEntryItemUriListHandler.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/handler/ExternalSourceEntryItemUriListHandler.java @@ -106,7 +106,7 @@ public WorkspaceItem createWorkspaceItem(Context context, HttpServletRequest req Collection collection = collectionService.find(context, UUID.fromString(owningCollectionUuid)); return externalDataService.createWorkspaceItemFromExternalDataObject(context, dataObject, collection); } catch (AuthorizeException | SQLException e) { - log.error("An error occured when trying to create item in collection with uuid: " + owningCollectionUuid, + log.error("An error occurred when trying to create item in collection with uuid: " + owningCollectionUuid, e); throw e; } diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/handler/service/UriListHandlerService.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/handler/service/UriListHandlerService.java index fa63baf2d682..c9603386cc38 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/handler/service/UriListHandlerService.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/handler/service/UriListHandlerService.java @@ -42,7 +42,7 @@ public class UriListHandlerService { * @param context The relevant DSpace context * @param request The current active Request * @param uriList The list of Strings representing the UriList to be handled - * @param clazz The class to be hadled + * @param clazz The class to be handled * @param The class to be returned, same as the class parameter above * @return The object that was handled through this method */ diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/security/StatelessAuthenticationFilter.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/security/StatelessAuthenticationFilter.java index c328928afafb..6e151654b524 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/security/StatelessAuthenticationFilter.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/security/StatelessAuthenticationFilter.java @@ -107,7 +107,7 @@ protected void doFilterInternal(HttpServletRequest req, /** * This method returns an Authentication object - * This Authentication object will be attempted to be for the eperson with the uuid in the parameter. Incase + * This Authentication object will be attempted to be for the eperson with the uuid in the parameter. In case * this is able to be done properly, we'll be returning the EPerson Authentication. * If the Authentication object returned is not null, we'll be logged in as this EPerson given through from the * request. diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/submit/PatchConfigurationService.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/submit/PatchConfigurationService.java index 186ebd65235c..58e1fbe428de 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/submit/PatchConfigurationService.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/submit/PatchConfigurationService.java @@ -12,7 +12,7 @@ import org.dspace.app.rest.submit.factory.impl.PatchOperation; /** - * Class to mantain mapping configuration for PATCH operation needed by the Submission process + * Class to maintain mapping configuration for PATCH operation needed by the Submission process * * @author Luigi Andrea Pascarelli (luigiandrea.pascarelli at 4science.it) */ diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/utils/RestRepositoryUtils.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/utils/RestRepositoryUtils.java index 69a9cc11e0ea..12869a563878 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/utils/RestRepositoryUtils.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/utils/RestRepositoryUtils.java @@ -105,7 +105,7 @@ public List listSearchMethods(DSpaceRestRepository repository) { */ public Method getSearchMethod(String searchMethodName, DSpaceRestRepository repository) { Method searchMethod = null; - // DSpaceRestRepository is possibly enhanced with a Spring AOP proxy. Therefor use ClassUtils to determine + // DSpaceRestRepository is possibly enhanced with a Spring AOP proxy. Therefore use ClassUtils to determine // the underlying implementation class. Method[] methods = ClassUtils.getUserClass(repository.getClass()).getMethods(); for (Method method : methods) { diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/AuthenticationRestControllerIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/AuthenticationRestControllerIT.java index 9edb0a2a9f40..a95ae38618d7 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/AuthenticationRestControllerIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/AuthenticationRestControllerIT.java @@ -943,7 +943,7 @@ public void testLoginAgainAfterLogout() throws Exception { //request a new token token = getAuthToken(eperson.getEmail(), password); - //Check if we succesfully authenticated again + //Check if we successfully authenticated again getClient(token).perform(get("/api/authn/status")) .andExpect(status().isOk()) .andExpect(jsonPath("$.okay", is(true))) diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/AuthorizationRestRepositoryIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/AuthorizationRestRepositoryIT.java index 2efa565b5981..3f139caae777 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/AuthorizationRestRepositoryIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/AuthorizationRestRepositoryIT.java @@ -547,7 +547,7 @@ public void findByObjectTest() throws Exception { .andExpect(jsonPath("$.page.size", is(20))) .andExpect(jsonPath("$.page.totalElements", greaterThanOrEqualTo(2))); - // verify that it works for administators inspecting other users - by using the eperson parameter + // verify that it works for administrators inspecting other users - by using the eperson parameter getClient(adminToken).perform(get("/api/authz/authorizations/search/object") .param("projection", "full") .param("uri", siteUri) @@ -589,7 +589,7 @@ public void findByObjectTest() throws Exception { .andExpect(jsonPath("$.page.size", is(20))) .andExpect(jsonPath("$.page.totalElements", greaterThanOrEqualTo(2))); - // verify that it works for administators inspecting other users - by assuming login + // verify that it works for administrators inspecting other users - by assuming login getClient(adminToken).perform(get("/api/authz/authorizations/search/object") .param("projection", "full") .param("uri", siteUri) @@ -726,7 +726,7 @@ public void findByNotExistingObjectTest() throws Exception { .andExpect(jsonPath("$.page.size", is(20))) .andExpect(jsonPath("$.page.totalElements", is(0))); - // verify that it works for administators inspecting other users - by using the eperson parameter + // verify that it works for administrators inspecting other users - by using the eperson parameter getClient(adminToken).perform(get("/api/authz/authorizations/search/object") .param("uri", wrongSiteUri) .param("eperson", eperson.getID().toString())) @@ -737,7 +737,7 @@ public void findByNotExistingObjectTest() throws Exception { .andExpect(jsonPath("$.page.size", is(20))) .andExpect(jsonPath("$.page.totalElements", is(0))); - // verify that it works for administators inspecting other users - by assuming login + // verify that it works for administrators inspecting other users - by assuming login getClient(adminToken).perform(get("/api/authz/authorizations/search/object") .param("uri", wrongSiteUri) .header("X-On-Behalf-Of", eperson.getID())) @@ -803,14 +803,14 @@ public void findByObjectBadRequestTest() throws Exception { .param("uri", invalidUri)) .andExpect(status().isBadRequest()); - // verify that it works for administators inspecting other users with an invalid or missing uri - by + // verify that it works for administrators inspecting other users with an invalid or missing uri - by // using the eperson parameter getClient(adminToken).perform(get("/api/authz/authorizations/search/object") .param("uri", invalidUri) .param("eperson", eperson.getID().toString())) .andExpect(status().isBadRequest()); - // verify that it works for administators inspecting other users with an invalid or missing uri - by + // verify that it works for administrators inspecting other users with an invalid or missing uri - by // assuming login getClient(adminToken).perform(get("/api/authz/authorizations/search/object") .param("uri", invalidUri) @@ -1081,7 +1081,7 @@ public void findByObjectAndFeatureTest() throws Exception { ) ))); - // verify that it works for administators inspecting other users - by using the eperson parameter + // verify that it works for administrators inspecting other users - by using the eperson parameter getClient(adminToken).perform(get("/api/authz/authorizations/search/object") .param("uri", comUri) .param("projection", "level") @@ -1103,7 +1103,7 @@ public void findByObjectAndFeatureTest() throws Exception { ) ))); - // verify that it works for administators inspecting other users - by assuming login + // verify that it works for administrators inspecting other users - by assuming login getClient(adminToken).perform(get("/api/authz/authorizations/search/object") .param("uri", comUri) .param("projection", "level") @@ -1187,14 +1187,14 @@ public void findByObjectAndFeatureNotGrantedTest() throws Exception { .param("feature", trueForAdmins.getName())) .andExpect(jsonPath("$.page.totalElements", is(0))); - // verify that it works for administators inspecting other users - by using the eperson parameter + // verify that it works for administrators inspecting other users - by using the eperson parameter getClient(adminToken).perform(get("/api/authz/authorizations/search/object") .param("uri", siteUri) .param("feature", trueForAdmins.getName()) .param("eperson", eperson.getID().toString())) .andExpect(jsonPath("$.page.totalElements", is(0))); - // verify that it works for administators inspecting other users - by assuming login + // verify that it works for administrators inspecting other users - by assuming login getClient(adminToken).perform(get("/api/authz/authorizations/search/object") .param("uri", siteUri) .param("feature", trueForAdmins.getName()) @@ -1277,7 +1277,7 @@ public void findByNotExistingObjectAndFeatureTest() throws Exception { .param("feature", "not-existing-feature")) .andExpect(jsonPath("$.page.totalElements", is(0))); - // verify that it works for administators inspecting other users - by using the eperson parameter + // verify that it works for administrators inspecting other users - by using the eperson parameter getClient(adminToken).perform(get("/api/authz/authorizations/search/object") .param("uri", wrongSiteUri) .param("feature", alwaysTrue.getName()) @@ -1290,7 +1290,7 @@ public void findByNotExistingObjectAndFeatureTest() throws Exception { .param("eperson", eperson.getID().toString())) .andExpect(jsonPath("$.page.totalElements", is(0))); - // verify that it works for administators inspecting other users - by assuming login + // verify that it works for administrators inspecting other users - by assuming login getClient(adminToken).perform(get("/api/authz/authorizations/search/object") .param("uri", wrongSiteUri) .param("feature", alwaysTrue.getName()) @@ -1366,7 +1366,7 @@ public void findByObjectAndFeatureBadRequestTest() throws Exception { .param("feature", alwaysTrue.getName())) .andExpect(status().isBadRequest()); - // verify that it works for administators inspecting other users with an invalid or missing uri - by + // verify that it works for administrators inspecting other users with an invalid or missing uri - by // using the eperson parameter getClient(adminToken).perform(get("/api/authz/authorizations/search/object") .param("uri", invalidUri) @@ -1374,7 +1374,7 @@ public void findByObjectAndFeatureBadRequestTest() throws Exception { .param("eperson", eperson.getID().toString())) .andExpect(status().isBadRequest()); - // verify that it works for administators inspecting other users with an invalid or missing uri - by + // verify that it works for administrators inspecting other users with an invalid or missing uri - by // assuming login getClient(adminToken).perform(get("/api/authz/authorizations/search/object") .param("uri", invalidUri) @@ -1777,7 +1777,7 @@ public void findByMultipleObjectsAndFeaturesTest() throws Exception { ) ))); - // verify that it works for administators inspecting other users - by using the eperson parameter + // verify that it works for administrators inspecting other users - by using the eperson parameter getClient(adminToken).perform(baseFeatureRequest.get() .param("eperson", eperson.getID().toString())) .andExpect(status().isOk()) @@ -1825,7 +1825,7 @@ public void findByMultipleObjectsAndFeaturesTest() throws Exception { ) ))); - // verify that it works for administators inspecting other users - by assuming login + // verify that it works for administrators inspecting other users - by assuming login getClient(adminToken).perform(baseFeatureRequest.get() .header("X-On-Behalf-Of", eperson.getID())) .andExpect(status().isOk()) @@ -2029,7 +2029,7 @@ public void findByMultipleObjectsAndFeaturesPaginationTest() throws Exception { ) ))); - // verify that it works for administators inspecting other users - by using the eperson parameter + // verify that it works for administrators inspecting other users - by using the eperson parameter getClient(adminToken).perform(baseFeatureRequest.get() .param("eperson", eperson.getID().toString())) .andExpect(status().isOk()) @@ -2052,7 +2052,7 @@ public void findByMultipleObjectsAndFeaturesPaginationTest() throws Exception { ) ))); - // verify that it works for administators inspecting other users - by assuming login + // verify that it works for administrators inspecting other users - by assuming login getClient(adminToken).perform(baseFeatureRequest.get() .header("X-On-Behalf-Of", eperson.getID())) .andExpect(status().isOk()) @@ -2160,7 +2160,7 @@ public void findByMultipleObjectsAndFeatureNotGrantedTest() throws Exception { .param("feature", trueForAdmins.getName())) .andExpect(jsonPath("$.page.totalElements", is(0))); - // verify that it works for administators inspecting other users - by using the eperson parameter + // verify that it works for administrators inspecting other users - by using the eperson parameter getClient(adminToken).perform(get("/api/authz/authorizations/search/objects") .param("type", "core.items") .param("uuid", itemId) @@ -2170,7 +2170,7 @@ public void findByMultipleObjectsAndFeatureNotGrantedTest() throws Exception { .param("eperson", eperson.getID().toString())) .andExpect(jsonPath("$.page.totalElements", is(0))); - // verify that it works for administators inspecting other users - by assuming login + // verify that it works for administrators inspecting other users - by assuming login getClient(adminToken).perform(get("/api/authz/authorizations/search/objects") .param("type", "core.items") .param("uuid", itemId) @@ -2272,7 +2272,7 @@ public void findByNotExistingMultipleObjectsAndFeatureTest() throws Exception { .param("feature", "not-existing-feature")) .andExpect(jsonPath("$.page.totalElements", is(0))); - // verify that it works for administators inspecting other users - by using the eperson parameter + // verify that it works for administrators inspecting other users - by using the eperson parameter getClient(adminToken).perform(get("/api/authz/authorizations/search/objects") .param("type", "core.sites") .param("uuid", wrongSiteId) @@ -2289,7 +2289,7 @@ public void findByNotExistingMultipleObjectsAndFeatureTest() throws Exception { .param("eperson", eperson.getID().toString())) .andExpect(jsonPath("$.page.totalElements", is(0))); - // verify that it works for administators inspecting other users - by assuming login + // verify that it works for administrators inspecting other users - by assuming login getClient(adminToken).perform(get("/api/authz/authorizations/search/objects") .param("type", "core.sites") .param("uuid", wrongSiteId) @@ -2385,7 +2385,7 @@ public void findByMultipleObjectsAndFeatureBadRequestTest() throws Exception { .param("feature", alwaysTrue.getName())) .andExpect(status().isBadRequest()); - // verify that it works for administators inspecting other users with an invalid or missing uri - by + // verify that it works for administrators inspecting other users with an invalid or missing uri - by // using the eperson parameter getClient(adminToken).perform(get("/api/authz/authorizations/search/objects") .param("type", "core.items") @@ -2397,7 +2397,7 @@ public void findByMultipleObjectsAndFeatureBadRequestTest() throws Exception { .param("eperson", eperson.getID().toString())) .andExpect(status().isBadRequest()); - // verify that it works for administators inspecting other users with an invalid or missing uri - by + // verify that it works for administrators inspecting other users with an invalid or missing uri - by // assuming login getClient(adminToken).perform(get("/api/authz/authorizations/search/objects") .param("type", "core.items") diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/BrowsesResourceControllerIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/BrowsesResourceControllerIT.java index 75df0feb34a3..8f28c5061011 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/BrowsesResourceControllerIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/BrowsesResourceControllerIT.java @@ -1456,7 +1456,7 @@ public void testBrowseByEntriesStartsWith() throws Exception { .andExpect(jsonPath("$._embedded.entries", contains(BrowseEntryResourceMatcher.matchBrowseEntry("Turing, Alan Mathison", 1) ))) - //Verify that the startsWith paramater is included in the links + //Verify that the startsWith parameter is included in the links .andExpect(jsonPath("$._links.self.href", containsString("?startsWith=T"))); //** WHEN ** @@ -1479,7 +1479,7 @@ public void testBrowseByEntriesStartsWith() throws Exception { .andExpect(jsonPath("$._embedded.entries", contains(BrowseEntryResourceMatcher.matchBrowseEntry("Computing", 3) ))) - //Verify that the startsWith paramater is included in the links + //Verify that the startsWith parameter is included in the links .andExpect(jsonPath("$._links.self.href", containsString("?startsWith=C"))); }; @@ -1581,7 +1581,7 @@ public void testBrowseByEntriesStartsWithAndDiacritics() throws Exception { contains(BrowseEntryResourceMatcher.matchBrowseEntry("Ögren, Name", 1), BrowseEntryResourceMatcher.matchBrowseEntry("Ortiz, Nombre", 1) ))) - //Verify that the startsWith paramater is included in the links + //Verify that the startsWith parameter is included in the links .andExpect(jsonPath("$._links.self.href", containsString("?startsWith=Ó"))); @@ -1608,7 +1608,7 @@ public void testBrowseByEntriesStartsWithAndDiacritics() throws Exception { BrowseEntryResourceMatcher.matchBrowseEntry("Teléfono", 1), BrowseEntryResourceMatcher.matchBrowseEntry("Televisor", 1) ))) - //Verify that the startsWith paramater is included in the links + //Verify that the startsWith parameter is included in the links .andExpect(jsonPath("$._links.self.href", containsString("?startsWith=Tele"))); //** WHEN ** @@ -1631,7 +1631,7 @@ public void testBrowseByEntriesStartsWithAndDiacritics() throws Exception { .andExpect(jsonPath("$._embedded.entries", contains(BrowseEntryResourceMatcher.matchBrowseEntry("Guion", 1) ))) - //Verify that the startsWith paramater is included in the links + //Verify that the startsWith parameter is included in the links .andExpect(jsonPath("$._links.self.href", containsString("?startsWith=Guión"))); }; diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/BundleUploadBitstreamControllerIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/BundleUploadBitstreamControllerIT.java index f80b194ca6ec..9f1a232121ae 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/BundleUploadBitstreamControllerIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/BundleUploadBitstreamControllerIT.java @@ -387,7 +387,7 @@ public void uploadBitstreamMinimalProperties() throws Exception { BitstreamMatcher.matchBitstreamEntry(UUID.fromString(bitstreamId), file.getSize())))); } - // TODO This test doesn't work either as it seems that only the first file is ever transfered into the request + // TODO This test doesn't work either as it seems that only the first file is ever transferred into the request // Thus we cannot check for this and we have no way of knowing how many files we gave to the request @Test @Ignore diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/DiscoveryRestControllerIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/DiscoveryRestControllerIT.java index a9ab4f0b57a4..72e0021bde66 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/DiscoveryRestControllerIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/DiscoveryRestControllerIT.java @@ -920,8 +920,8 @@ public void discoverFacetsDateTest() throws Exception { is(PageMatcher.pageEntry(0, 20)))) //The date values need to be as specified below .andExpect(jsonPath("$._embedded.values", containsInAnyOrder( - //We'll always get atleast two intervals with the items specified above, so we ask to match - // twice atleast + //We'll always get at least two intervals with the items specified above, so we ask to match + // twice at least FacetValueMatcher.entryDateIssued(), FacetValueMatcher.entryDateIssued() ))) @@ -6713,7 +6713,7 @@ public void discoverSearchObjectsSupervisionConfigurationTest() throws Exception SupervisionOrderBuilder.createSupervisionOrder(context, wfItem1Admin.getItem(), groupA).build(); SupervisionOrderBuilder.createSupervisionOrder(context, wfItem1Admin.getItem(), groupB).build(); - // 6. a pool taks in the second step of the workflow + // 6. a pool task in the second step of the workflow ClaimedTask cTask2 = ClaimedTaskBuilder.createClaimedTask(context, col2, admin).withTitle("Pool Step2 Item") .withIssueDate("2010-11-04") .build(); diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/DuplicateDetectionRestIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/DuplicateDetectionRestIT.java index f53f440fd154..067fd65d57c4 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/DuplicateDetectionRestIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/DuplicateDetectionRestIT.java @@ -307,7 +307,7 @@ public void submissionSectionDataTest() throws Exception { public void submissionSectionWorkspaceItemVisibilityTest() throws Exception { // Test publication context.turnOffAuthorisationSystem(); - // Create a new collection with handle that maps to teh test-duplicate-detection submission config + // Create a new collection with handle that maps to the test-duplicate-detection submission config col = CollectionBuilder.createCollection(context, parentCommunity, "123456789/test-duplicate-detection") .withName("Test Collection with Duplicate Detection") .withWorkflowGroup(1, admin) @@ -354,7 +354,7 @@ public void submissionSectionWorkspaceItemVisibilityTest() throws Exception { /** * If there is a potential duplicate that is also in workflow, it will - * ONLY be shown if the current user is in a worflow group for step 1, 2, or 3, or is an admin, or otherwise + * ONLY be shown if the current user is in a workflow group for step 1, 2, or 3, or is an admin, or otherwise * has READ permission * * @throws Exception @@ -363,7 +363,7 @@ public void submissionSectionWorkspaceItemVisibilityTest() throws Exception { public void submissionSectionWorkflowItemVisibilityTest() throws Exception { context.turnOffAuthorisationSystem(); - // Create a new collection with handle that maps to teh test-duplicate-detection submission config + // Create a new collection with handle that maps to the test-duplicate-detection submission config parentCommunity = CommunityBuilder.createCommunity(context).withName("Parent Community").build(); Collection workflowCol = CollectionBuilder.createCollection(context, parentCommunity) .withName("Test Collection with Duplicate Detection") diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/ItemRestRepositoryIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/ItemRestRepositoryIT.java index bde12228e84f..b2bfd048520c 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/ItemRestRepositoryIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/ItemRestRepositoryIT.java @@ -1382,7 +1382,7 @@ public void deleteOneArchivedTestAsSystemAdmin() throws Exception { getClient().perform(get("/api/core/items/" + publicItem.getID())) .andExpect(status().isOk()); - // Check publicItem bitstream creation (shuold be stored in bundle) + // Check publicItem bitstream creation (should be stored in bundle) getClient().perform(get("/api/core/items/" + publicItem.getID() + "/bundles")) .andExpect(status().isOk()) .andExpect(content().contentType(contentType)) @@ -1453,7 +1453,7 @@ public void deleteOneArchivedTestAsCollectionAdmin() throws Exception { getClient().perform(get("/api/core/items/" + publicItem.getID())) .andExpect(status().isOk()); - // Check publicItem bitstream creation (shuold be stored in bundle) + // Check publicItem bitstream creation (should be stored in bundle) getClient().perform(get("/api/core/items/" + publicItem.getID() + "/bundles")) .andExpect(status().isOk()) .andExpect(content().contentType(contentType)) @@ -1831,7 +1831,7 @@ public void undiscoverableAccessTest() throws Exception { ))); - //Admin users are allowed to acceess undiscoverable items + //Admin users are allowed to access undiscoverable items String token1 = getAuthToken(admin.getEmail(), password); getClient(token1).perform(get("/api/core/items/" + unDiscoverableYetAccessibleItem1.getID())) .andExpect(status().isOk()) @@ -4165,7 +4165,7 @@ public void findWithdrawnItemTest() throws Exception { .andExpect(jsonPath("$", CollectionMatcher.matchCollectionEntryFullProjection( col1.getName(), col1.getID(), col1.getHandle()))); - // try to spoof information as a logged in eperson using embedding, verify that no embedds are included + // try to spoof information as a logged in eperson using embedding, verify that no embeds are included getClient(tokenEperson).perform(get("/api/core/items/" + item.getID()) .param("projection", "full")) .andExpect(status().isOk()) @@ -4198,7 +4198,7 @@ public void findWithdrawnItemTest() throws Exception { getClient(tokenEperson).perform(get("/api/core/items/" + item.getID() + "/owningCollection")) .andExpect(status().isForbidden()); - // try to spoof information as anonymous user using embedding, verify that no embedds are included + // try to spoof information as anonymous user using embedding, verify that no embeds are included getClient().perform(get("/api/core/items/" + item.getID()) .param("projection", "full")) .andExpect(status().isOk()) diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/LoginAsEPersonIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/LoginAsEPersonIT.java index 60d0e1a2a56d..1f9b2909b7a6 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/LoginAsEPersonIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/LoginAsEPersonIT.java @@ -214,7 +214,7 @@ public void createEmptyWorkspaceItemLoginOnBehalfOfCheckSubmitterTest() throws E /** * Test claiming of a pool task with the LoginOnBehalfOf header. Thus checking that an admin can impersonate * an eperson to claim a pooltask and checking later on that the owner of this claimedTask is indeed - * the reviwer + * the reviewer * * @throws Exception */ @@ -334,7 +334,7 @@ public void deleteOneArchivedLoginOnBehalfOfNonAdminForbiddenTest() throws Excep getClient().perform(get("/api/core/items/" + publicItem.getID())) .andExpect(status().isOk()); - // Check publicItem bitstream creation (shuold be stored in bundle) + // Check publicItem bitstream creation (should be stored in bundle) getClient().perform(get("/api/core/items/" + publicItem.getID() + "/bundles")) .andExpect(status().isOk()) .andExpect(content().contentType(contentType)) diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/RelationshipRestRepositoryIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/RelationshipRestRepositoryIT.java index 1bf4e2f41202..ee4ab9bf6d80 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/RelationshipRestRepositoryIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/RelationshipRestRepositoryIT.java @@ -2304,7 +2304,7 @@ public void findRelationshipByLabelTest() throws Exception { ; // Perform a GET request to the searchByLabel endpoint, asking for Relationships of type isOrgUnitOfPerson - // We do not specificy a DSO param, which means ALL relationships of type isOrgUnitOfPerson should be returned + // We do not specify a DSO param, which means ALL relationships of type isOrgUnitOfPerson should be returned // Which is what we're checking for, both the first relationship and the one with a different author // should be returned getClient().perform(get("/api/core/relationships/search/byLabel") diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/StatisticsRestRepositoryIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/StatisticsRestRepositoryIT.java index 84491fbbaa02..44fc024ce1bc 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/StatisticsRestRepositoryIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/StatisticsRestRepositoryIT.java @@ -193,7 +193,7 @@ public void usagereport_onlyAdminReadRights() throws Exception { public void usagereport_onlyAdminReadRights_unvalidToken() throws Exception { // ** WHEN ** authorizeService.removeAllPolicies(context, itemNotVisitedWithBitstreams); - // We request a dso's TotalVisits usage stat report with unvalid token + // We request a dso's TotalVisits usage stat report with invalid token getClient("unvalidToken").perform( get("/api/statistics/usagereports/" + itemNotVisitedWithBitstreams.getID() + "_" + TOTAL_VISITS_REPORT_ID)) // ** THEN ** @@ -1135,7 +1135,7 @@ public void usagereportSearch_onlyAdminReadRights() throws Exception { public void usagereportSearch_onlyAdminReadRights_unvalidToken() throws Exception { // ** WHEN ** authorizeService.removeAllPolicies(context, itemNotVisitedWithBitstreams); - // We request a dso's TotalVisits usage stat report with unvalid token + // We request a dso's TotalVisits usage stat report with invalid token getClient("unvalidToken") .perform(get("/api/statistics/usagereports/search/object?uri=http://localhost:8080/server/api/core" + "/items/" + itemNotVisitedWithBitstreams.getID())) diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/SubmissionFormsControllerIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/SubmissionFormsControllerIT.java index 006c22dae113..b3d136007609 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/SubmissionFormsControllerIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/SubmissionFormsControllerIT.java @@ -398,7 +398,7 @@ public void languageSupportTest() throws Exception { + " (ad esempio, se è un set di dati o un'immagine) selezionare (N/A)", null, "dc.language.iso", "common_iso_languages")))); - // user select ukranian language + // user select ukrainian language getClient(tokenEperson).perform(get("/api/config/submissionforms/languagetest").locale(uk)) .andExpect(status().isOk()) .andExpect(content().contentType(contentType)) @@ -478,7 +478,7 @@ public void preferLanguageTest() throws Exception { + " (ad esempio, se è un set di dati o un'immagine) selezionare (N/A)", null, "dc.language.iso", "common_iso_languages")))); - // user with ukranian prefer language + // user with ukrainian prefer language getClient(tokenEpersonUK).perform(get("/api/config/submissionforms/languagetest")) .andExpect(status().isOk()) .andExpect(content().contentType(contentType)) @@ -528,7 +528,7 @@ public void userChoiceAnotherLanguageTest() throws Exception { String tokenEpersonUK = getAuthToken(epersonUK.getEmail(), password); - // user prefer ukranian but choice italian language + // user prefer ukrainian but choice italian language getClient(tokenEpersonUK).perform(get("/api/config/submissionforms/languagetest").locale(it)) .andExpect(status().isOk()) .andExpect(content().contentType(contentType)) diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/TaskRestRepositoriesIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/TaskRestRepositoriesIT.java index d017703d6267..5185bc732c96 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/TaskRestRepositoriesIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/TaskRestRepositoriesIT.java @@ -290,7 +290,7 @@ public void findByUserTest() throws Exception { Collection col1 = CollectionBuilder.createCollection(context, parentCommunity).withName("Collection 1") .withWorkflowGroup(1, reviewer1, reviewer2).build(); - // reviewer2 and admin are only in the wf of one colletion + // reviewer2 and admin are only in the wf of one collection Collection col2 = CollectionBuilder.createCollection(context, child1).withName("Collection 2") .withWorkflowGroup(1, reviewer1, admin).build(); @@ -434,7 +434,7 @@ public void findByUserForbiddenTest() throws Exception { Collection col1 = CollectionBuilder.createCollection(context, parentCommunity).withName("Collection 1") .withWorkflowGroup(1, reviewer1, reviewer2).build(); - // reviewer2 and admin are only in the wf of one colletion + // reviewer2 and admin are only in the wf of one collection Collection col2 = CollectionBuilder.createCollection(context, child1).withName("Collection 2") .withWorkflowGroup(1, reviewer1, admin).build(); @@ -471,7 +471,7 @@ public void findByUserForbiddenTest() throws Exception { context.restoreAuthSystemState(); String authReviewer1 = getAuthToken(reviewer1.getEmail(), password); - // reviewer1 tries to get the pooltask of reviewer2 and viceversa + // reviewer1 tries to get the pooltask of reviewer2 and vice-versa getClient(authReviewer1).perform(get("/api/workflow/pooltasks/search/findByUser") .param("uuid", reviewer2.getID().toString())) .andExpect(status().isForbidden()); @@ -2320,7 +2320,7 @@ public void defaultWorkflowTest_UntilEditStep_NonValidOption() throws Exception // try non valid option (submit_edit_metadata), default wf step 2 (edit step) getClient(reviewer2Token).perform(post("/api/workflow/claimedtasks/" + idRef.get()) .param("submit_non_valid_option", "true") - .param("reason", "I need to test an unvalid option") + .param("reason", "I need to test an invalid option") .contentType(MediaType.APPLICATION_FORM_URLENCODED)) .andExpect(status().isUnprocessableEntity()); diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/WorkspaceItemRestRepositoryIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/WorkspaceItemRestRepositoryIT.java index 542688ea2396..58eba26336f8 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/WorkspaceItemRestRepositoryIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/WorkspaceItemRestRepositoryIT.java @@ -5633,7 +5633,7 @@ public void patchBitstreamWithAccessConditionOpenAccess() throws Exception { // auth String authToken = getAuthToken(eperson.getEmail(), password); - // perpare patch body + // prepare patch body Map value = new HashMap<>(); value.put("name", "openaccess"); List ops = new ArrayList<>(); @@ -8030,7 +8030,7 @@ public void verifyBitstreamPolicyNotDuplicatedTest() throws Exception { .contentType(textUriContentType)) .andExpect(status().isCreated()); - // Bistream access policies are as expected and there are no duplicates + // Bitstream access policies are as expected and there are no duplicates getClient(adminToken) .perform(get("/api/authz/resourcepolicies/search/resource") .param("uuid", bitstream.getID().toString())) diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/converter/ConverterServiceIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/converter/ConverterServiceIT.java index d9bcf60468cb..4c432ddf6342 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/converter/ConverterServiceIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/converter/ConverterServiceIT.java @@ -113,7 +113,7 @@ public void toRestWrongReturnType() { /** * When calling {@code toRest} with the default projection, the converter should run and no changes should be made. * This converter.toRest will now also check permissions through the PreAuthorize annotation on the - * Repository's findOne method. Therefor a repository has been added for this MockObjectRest namely + * Repository's findOne method. Therefore a repository has been added for this MockObjectRest namely * {@link org.dspace.app.rest.repository.MockObjectRestRepository} and added PreAuthorize annotations * on the methods of this Repository */ diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/matcher/HalMatcher.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/matcher/HalMatcher.java index 4c73ee1af01b..dee47877b27e 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/matcher/HalMatcher.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/matcher/HalMatcher.java @@ -43,7 +43,7 @@ public static Matcher matchNoEmbeds() { * a separate matcher. * * @param rels the names of the rels. If a given name ends with "[]", it is assumed to be a paged subresource - * and must therefore contain an embeded array with the same property name as the rel (without the []). + * and must therefore contain an embedded array with the same property name as the rel (without the []). */ public static Matcher matchEmbeds(String... rels) { if (rels.length == 0) { diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/matcher/SubmissionFormFieldMatcher.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/matcher/SubmissionFormFieldMatcher.java index 47f96fd13630..e17df53459eb 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/matcher/SubmissionFormFieldMatcher.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/matcher/SubmissionFormFieldMatcher.java @@ -39,7 +39,7 @@ private SubmissionFormFieldMatcher() { * @param typeBind * the expected type-bind field(s) * @param mandatoryMessage - * the expected mandatoryMessage, can be null. If not empty the fiedl is expected to be flagged as + * the expected mandatoryMessage, can be null. If not empty the field is expected to be flagged as * mandatory * @param repeatable * the expected repeatable flag diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/signposting/controller/LinksetRestControllerIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/signposting/controller/LinksetRestControllerIT.java index cf62d5ac0861..7fc4f82260be 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/signposting/controller/LinksetRestControllerIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/signposting/controller/LinksetRestControllerIT.java @@ -188,7 +188,7 @@ public void findOneItemJsonLinksetsWithType() throws Exception { @Test public void findOneItemJsonLinksetsWithLicence() throws Exception { - String licenceUrl = "https://exmple.com/licence"; + String licenceUrl = "https://example.com/licence"; String url = configurationService.getProperty("dspace.ui.url"); String signpostingUrl = configurationService.getProperty("signposting.path"); context.turnOffAuthorisationSystem(); diff --git a/dspace-services/src/main/java/org/dspace/servicemanager/config/DSpaceConfigurationService.java b/dspace-services/src/main/java/org/dspace/servicemanager/config/DSpaceConfigurationService.java index 777fcc8a5406..9789deb8451f 100644 --- a/dspace-services/src/main/java/org/dspace/servicemanager/config/DSpaceConfigurationService.java +++ b/dspace-services/src/main/java/org/dspace/servicemanager/config/DSpaceConfigurationService.java @@ -522,7 +522,7 @@ private void loadInitialConfig(String providedHome) { // NOTE: This MUST be added *after* the first call to getConfiguration(), as getReloadingController() is // not initialized until the configuration is first parsed/read. this.configurationBuilder.addEventListener(ConfigurationBuilderEvent.CONFIGURATION_REQUEST, - // Lamba which checks reloadable configurations for any updates. + // Lambda which checks reloadable configurations for any updates. // Auto-reloadable configs are ONLY those flagged config-reload="true" in the configuration definition (Event e) -> this.configurationBuilder.getReloadingController() .checkForReloading(null)); diff --git a/dspace-services/src/main/java/org/dspace/services/KernelStartupCallbackService.java b/dspace-services/src/main/java/org/dspace/services/KernelStartupCallbackService.java index 7b40e735c98c..d6c0a7010ba3 100644 --- a/dspace-services/src/main/java/org/dspace/services/KernelStartupCallbackService.java +++ b/dspace-services/src/main/java/org/dspace/services/KernelStartupCallbackService.java @@ -8,7 +8,7 @@ package org.dspace.services; /** - * Interface whos implementations will be called when the kernel startup is completed. + * Interface whose implementations will be called when the kernel startup is completed. * * @author kevinvandevelde at atmire.com */ diff --git a/dspace-services/src/main/java/org/dspace/services/model/Event.java b/dspace-services/src/main/java/org/dspace/services/model/Event.java index dbd06c7e80da..f16eefaa89be 100644 --- a/dspace-services/src/main/java/org/dspace/services/model/Event.java +++ b/dspace-services/src/main/java/org/dspace/services/model/Event.java @@ -161,7 +161,7 @@ public void setResourceReference(String resourceReference) { /** * Did this event modify something in the system? * - * @return true if this event modified soemthing in the system, false if it was read only + * @return true if this event modified something in the system, false if it was read only */ public boolean isModify() { return modify; diff --git a/dspace-services/src/main/java/org/dspace/utils/servicemanager/ProviderStack.java b/dspace-services/src/main/java/org/dspace/utils/servicemanager/ProviderStack.java index 69acee0496f2..47ab567a27c9 100644 --- a/dspace-services/src/main/java/org/dspace/utils/servicemanager/ProviderStack.java +++ b/dspace-services/src/main/java/org/dspace/utils/servicemanager/ProviderStack.java @@ -35,7 +35,7 @@ public final class ProviderStack { * Default empty constructor. *

    * This is mostly only useful if you are planning to add new - * providers later. You should probably use the other contructors. + * providers later. You should probably use the other constructors. */ public ProviderStack() { providers = Collections.synchronizedList(new ArrayList>()); diff --git a/dspace-services/src/test/java/org/dspace/servicemanager/config/DSpaceConfigurationServiceTest.java b/dspace-services/src/test/java/org/dspace/servicemanager/config/DSpaceConfigurationServiceTest.java index b56b990b5669..f15cae0ab48c 100644 --- a/dspace-services/src/test/java/org/dspace/servicemanager/config/DSpaceConfigurationServiceTest.java +++ b/dspace-services/src/test/java/org/dspace/servicemanager/config/DSpaceConfigurationServiceTest.java @@ -482,7 +482,7 @@ public void testReloadConfig() { DSpaceConfigurationService dscs = new DSpaceConfigurationService(); int size = dscs.getProperties().size(); - // Add two new Sytem properties + // Add two new System properties System.setProperty("Hello", "World"); System.setProperty("Tim", "Donohue"); diff --git a/dspace-sword/src/main/java/org/dspace/sword/CollectionDepositor.java b/dspace-sword/src/main/java/org/dspace/sword/CollectionDepositor.java index 3fe47cfaa62b..d4abaf6a0ae1 100644 --- a/dspace-sword/src/main/java/org/dspace/sword/CollectionDepositor.java +++ b/dspace-sword/src/main/java/org/dspace/sword/CollectionDepositor.java @@ -138,7 +138,7 @@ public DepositResult doDeposit(Deposit deposit) DepositResult result = si.ingest(swordService, deposit, collection); swordService.message("Archive ingest completed successfully"); - // if there's an item availalble, and we want to keep the original + // if there's an item available, and we want to keep the original // then do that try { if (swordConfig.isKeepOriginal()) { diff --git a/dspace-sword/src/main/java/org/dspace/sword/ItemDepositor.java b/dspace-sword/src/main/java/org/dspace/sword/ItemDepositor.java index bcde6c42f63d..666ac56006d9 100644 --- a/dspace-sword/src/main/java/org/dspace/sword/ItemDepositor.java +++ b/dspace-sword/src/main/java/org/dspace/sword/ItemDepositor.java @@ -101,7 +101,7 @@ public DepositResult doDeposit(Deposit deposit) DepositResult result = si.ingest(swordService, deposit, item); swordService.message("Archive ingest completed successfully"); - // if there's an item availalble, and we want to keep the original + // if there's an item available, and we want to keep the original // then do that try { if (swordConfig.isKeepOriginal()) { diff --git a/dspace-sword/src/main/java/org/dspace/sword/SWORDMETSIngester.java b/dspace-sword/src/main/java/org/dspace/sword/SWORDMETSIngester.java index d0cd9ee2ad17..b02728955ad6 100644 --- a/dspace-sword/src/main/java/org/dspace/sword/SWORDMETSIngester.java +++ b/dspace-sword/src/main/java/org/dspace/sword/SWORDMETSIngester.java @@ -126,7 +126,7 @@ public DepositResult ingest(SWORDService service, Deposit deposit, // get reference to item so that we can report on it Item installedItem = (Item) ingestedObject; - // update the item metadata to inclue the current time as + // update the item metadata to include the current time as // the updated date this.setUpdatedDate(context, installedItem); diff --git a/dspace-sword/src/main/java/org/purl/sword/atom/Entry.java b/dspace-sword/src/main/java/org/purl/sword/atom/Entry.java index 69997eee8aea..9b274306a3f7 100644 --- a/dspace-sword/src/main/java/org/purl/sword/atom/Entry.java +++ b/dspace-sword/src/main/java/org/purl/sword/atom/Entry.java @@ -162,7 +162,7 @@ public Entry() { } /** - * Create a new instance of the class an initalise it, setting the + * Create a new instance of the class an initialise it, setting the * element namespace and name. * * @param prefix The namespace prefix of the element diff --git a/dspace-sword/src/main/java/org/purl/sword/base/DepositResponse.java b/dspace-sword/src/main/java/org/purl/sword/base/DepositResponse.java index 453af3df354b..af62d9ed4ab1 100644 --- a/dspace-sword/src/main/java/org/purl/sword/base/DepositResponse.java +++ b/dspace-sword/src/main/java/org/purl/sword/base/DepositResponse.java @@ -173,7 +173,7 @@ public SwordValidationInfo unmarshall(String xml, Properties validationContext) } catch (ParsingException ex) { throw new UnmarshallException("Unable to parse the XML", ex); } catch (IOException ex) { - throw new UnmarshallException("Error acessing the file?", ex); + throw new UnmarshallException("Error accessing the file?", ex); } } @@ -205,7 +205,7 @@ public SwordValidationInfo unmarshallErrorDocument( } catch (ParsingException ex) { throw new UnmarshallException("Unable to parse the XML", ex); } catch (IOException ex) { - throw new UnmarshallException("Error acessing the file?", ex); + throw new UnmarshallException("Error accessing the file?", ex); } } diff --git a/dspace-sword/src/main/java/org/purl/sword/base/HttpHeaders.java b/dspace-sword/src/main/java/org/purl/sword/base/HttpHeaders.java index 44233138c744..79003701ff44 100644 --- a/dspace-sword/src/main/java/org/purl/sword/base/HttpHeaders.java +++ b/dspace-sword/src/main/java/org/purl/sword/base/HttpHeaders.java @@ -48,7 +48,7 @@ public interface HttpHeaders { public static final String X_NO_OP = "X-No-Op"; /** - * An HTTP Header label that the server should not epect, and thus + * An HTTP Header label that the server should not expect, and thus * created a corrupt header. */ public static final String X_CORRUPT = "X-wibble"; diff --git a/dspace-sword/src/main/java/org/purl/sword/base/ServiceDocument.java b/dspace-sword/src/main/java/org/purl/sword/base/ServiceDocument.java index b88787c8254d..aefc7a964db5 100644 --- a/dspace-sword/src/main/java/org/purl/sword/base/ServiceDocument.java +++ b/dspace-sword/src/main/java/org/purl/sword/base/ServiceDocument.java @@ -144,7 +144,7 @@ public SwordValidationInfo unmarshall(String xml, Properties validationPropertie } catch (ParsingException ex) { throw new UnmarshallException("Unable to parse the XML", ex); } catch (IOException ex) { - throw new UnmarshallException("Error acessing the file?", ex); + throw new UnmarshallException("Error accessing the file?", ex); } } diff --git a/dspace-sword/src/main/java/org/purl/sword/base/XmlElement.java b/dspace-sword/src/main/java/org/purl/sword/base/XmlElement.java index 80217738d203..d90b7b779fb8 100644 --- a/dspace-sword/src/main/java/org/purl/sword/base/XmlElement.java +++ b/dspace-sword/src/main/java/org/purl/sword/base/XmlElement.java @@ -71,7 +71,7 @@ public XmlElement(String prefix, String localName) { } /** - * Create a new insatnce. Set the prefix, local name and the namespace URI. + * Create a new instance. Set the prefix, local name and the namespace URI. * * @param prefix The prefix. * @param localName The element's local name. diff --git a/dspace-sword/src/main/java/org/purl/sword/client/PropertiesDialog.java b/dspace-sword/src/main/java/org/purl/sword/client/PropertiesDialog.java index 6d43cb68ef10..e91b5c39ef42 100644 --- a/dspace-sword/src/main/java/org/purl/sword/client/PropertiesDialog.java +++ b/dspace-sword/src/main/java/org/purl/sword/client/PropertiesDialog.java @@ -94,7 +94,7 @@ public int show() { null); // cancel any edit in the table. If there is a cell editing, the getEditingColumn will - // return a non-negative column number. This can be used to retreive the cell editor. + // return a non-negative column number. This can be used to retrieve the cell editor. // The code then gets the default editor and calls the stopCellEditing. If custom // editors are used, an additional check must be made to get the cell editor // for a specific cell. diff --git a/dspace-sword/src/main/java/org/purl/sword/client/ServicePanel.java b/dspace-sword/src/main/java/org/purl/sword/client/ServicePanel.java index bc3031c33354..d5b3158f1842 100644 --- a/dspace-sword/src/main/java/org/purl/sword/client/ServicePanel.java +++ b/dspace-sword/src/main/java/org/purl/sword/client/ServicePanel.java @@ -429,7 +429,7 @@ private void showService(Service service) { String maxSize = ""; // Commented out the following code as the client code is out of step with the - // Sword 'base' library and wont compile. - Robin Taylor. + // Sword 'base' library and won't compile. - Robin Taylor. //if ( service.maxUploadIsDefined() ) //{ // maxSize = "" + service.getMaxUploadSize() + "kB"; diff --git a/dspace-swordv2/src/main/java/org/dspace/sword2/BinaryContentIngester.java b/dspace-swordv2/src/main/java/org/dspace/sword2/BinaryContentIngester.java index f238ad87e748..992d671b7742 100644 --- a/dspace-swordv2/src/main/java/org/dspace/sword2/BinaryContentIngester.java +++ b/dspace-swordv2/src/main/java/org/dspace/sword2/BinaryContentIngester.java @@ -75,7 +75,7 @@ public DepositResult ingestToCollection(Context context, Deposit deposit, context, item, "dc", "description", null, null, "Zip file deposted by SWORD without accompanying metadata"); - // update the item metadata to inclue the current time as + // update the item metadata to include the current time as // the updated date this.setUpdatedDate(context, item, verboseDescription); @@ -139,7 +139,7 @@ public DepositResult ingestToItem(Context context, Deposit deposit, bs.setName(context, deposit.getFilename()); bitstreamService.update(context, bs); - // update the item metadata to inclue the current time as + // update the item metadata to include the current time as // the updated date this.setUpdatedDate(context, item, verboseDescription); diff --git a/dspace-swordv2/src/main/java/org/dspace/sword2/DSpaceSwordAPI.java b/dspace-swordv2/src/main/java/org/dspace/sword2/DSpaceSwordAPI.java index ce8fbc20ff56..f1eb2a7e0e10 100644 --- a/dspace-swordv2/src/main/java/org/dspace/sword2/DSpaceSwordAPI.java +++ b/dspace-swordv2/src/main/java/org/dspace/sword2/DSpaceSwordAPI.java @@ -247,7 +247,7 @@ public void storeOriginals(SwordConfigurationDSpace swordConfig, Context context, VerboseDescription verboseDescription, Deposit deposit, DepositResult result) throws DSpaceSwordException, SwordServerException { - // if there's an item availalble, and we want to keep the original + // if there's an item available, and we want to keep the original // then do that try { if (swordConfig.isKeepOriginal()) { diff --git a/dspace-swordv2/src/main/java/org/dspace/sword2/SimpleDCEntryIngester.java b/dspace-swordv2/src/main/java/org/dspace/sword2/SimpleDCEntryIngester.java index 60ddce0189ac..091d3447f1fd 100644 --- a/dspace-swordv2/src/main/java/org/dspace/sword2/SimpleDCEntryIngester.java +++ b/dspace-swordv2/src/main/java/org/dspace/sword2/SimpleDCEntryIngester.java @@ -90,7 +90,7 @@ public DepositResult ingestToItem(Context context, Deposit deposit, // add the metadata to the item this.addMetadataToItem(context, deposit, item); - // update the item metadata to inclue the current time as + // update the item metadata to include the current time as // the updated date this.setUpdatedDate(context, item, verboseDescription); @@ -237,7 +237,7 @@ public DepositResult ingestToCollection(Context context, Deposit deposit, // add the metadata to the item this.addMetadataToItem(context, deposit, item); - // update the item metadata to inclue the current time as + // update the item metadata to include the current time as // the updated date this.setUpdatedDate(context, item, verboseDescription); diff --git a/dspace-swordv2/src/main/java/org/dspace/sword2/SimpleZipContentIngester.java b/dspace-swordv2/src/main/java/org/dspace/sword2/SimpleZipContentIngester.java index bd8301617ba9..02b6a2fe4f4b 100644 --- a/dspace-swordv2/src/main/java/org/dspace/sword2/SimpleZipContentIngester.java +++ b/dspace-swordv2/src/main/java/org/dspace/sword2/SimpleZipContentIngester.java @@ -94,7 +94,7 @@ public DepositResult ingestToCollection(Context context, Deposit deposit, .addMetadata(context, item, "dc", "description", null, null, "Zip file deposted by SWORD without accompanying metadata"); - // update the item metadata to inclue the current time as + // update the item metadata to include the current time as // the updated date this.setUpdatedDate(context, item, verboseDescription); @@ -190,7 +190,7 @@ public DepositResult ingestToItem(Context context, Deposit deposit, List derivedResources = this .unzipToBundle(context, depositFile, original); - // update the item metadata to inclue the current time as + // update the item metadata to include the current time as // the updated date this.setUpdatedDate(context, item, verboseDescription); diff --git a/dspace-swordv2/src/main/java/org/dspace/sword2/SwordMETSContentIngester.java b/dspace-swordv2/src/main/java/org/dspace/sword2/SwordMETSContentIngester.java index a77caa655b5d..9efbb1f67075 100644 --- a/dspace-swordv2/src/main/java/org/dspace/sword2/SwordMETSContentIngester.java +++ b/dspace-swordv2/src/main/java/org/dspace/sword2/SwordMETSContentIngester.java @@ -60,7 +60,7 @@ public DepositResult ingestToCollection(Context context, Deposit deposit, throws DSpaceSwordException, SwordError, SwordAuthException, SwordServerException { try { - // if we are actuall given an item in the deposit result of a previous operation + // if we are actually given an item in the deposit result of a previous operation // then we do an ingestToItem if (result != null) { Item item = result.getItem(); @@ -140,7 +140,7 @@ public DepositResult ingestToCollection(Context context, Deposit deposit, // get reference to item so that we can report on it Item installedItem = (Item) ingestedObject; - // update the item metadata to inclue the current time as + // update the item metadata to include the current time as // the updated date this.setUpdatedDate(context, installedItem, verboseDescription); @@ -250,7 +250,7 @@ public DepositResult ingestToItem(Context context, Deposit deposit, // get reference to item so that we can report on it Item installedItem = (Item) ingestedObject; - // update the item metadata to inclue the current time as + // update the item metadata to include the current time as // the updated date this.setUpdatedDate(context, installedItem, verboseDescription); diff --git a/dspace-swordv2/src/main/java/org/dspace/sword2/SwordUrlManager.java b/dspace-swordv2/src/main/java/org/dspace/sword2/SwordUrlManager.java index eee3627c4045..950a9e8c63a0 100644 --- a/dspace-swordv2/src/main/java/org/dspace/sword2/SwordUrlManager.java +++ b/dspace-swordv2/src/main/java/org/dspace/sword2/SwordUrlManager.java @@ -133,7 +133,7 @@ public Item getItem(Context context, String location) String iid = location.substring(cBaseUrl.length()); if (iid.endsWith(".atom")) { - // this is the atom url, so we need to strip that to ge tthe item id + // this is the atom url, so we need to strip that to ge the item id iid = iid.substring(0, iid.length() - ".atom".length()); } else if (iid.endsWith(".rdf")) { // this is the rdf url so we need to strip that to get the item id diff --git a/dspace-swordv2/src/main/java/org/dspace/sword2/WorkflowManagerDefault.java b/dspace-swordv2/src/main/java/org/dspace/sword2/WorkflowManagerDefault.java index ea5a52091fc0..abebe9baebaa 100644 --- a/dspace-swordv2/src/main/java/org/dspace/sword2/WorkflowManagerDefault.java +++ b/dspace-swordv2/src/main/java/org/dspace/sword2/WorkflowManagerDefault.java @@ -264,7 +264,7 @@ public void resolveState(Context context, Deposit deposit, boolean containerOperation) throws DSpaceSwordException { // the containerOperation flag tells us whether this method was called by an operation which happened on the - // container. This workflow implementation only changes workflow states on contaner operations, not media + // container. This workflow implementation only changes workflow states on container operations, not media // resource operations, so we just bounce this right back. if (!containerOperation) { return; diff --git a/dspace-swordv2/src/main/java/org/dspace/sword2/WorkflowManagerUnrestricted.java b/dspace-swordv2/src/main/java/org/dspace/sword2/WorkflowManagerUnrestricted.java index 21f79c745003..18b6d495dbbc 100644 --- a/dspace-swordv2/src/main/java/org/dspace/sword2/WorkflowManagerUnrestricted.java +++ b/dspace-swordv2/src/main/java/org/dspace/sword2/WorkflowManagerUnrestricted.java @@ -150,7 +150,7 @@ public void resolveState(Context context, Deposit deposit, boolean containerOperation) throws DSpaceSwordException { // the containerOperation flag tells us whether this method was called by an operation which happened on the - // container. This workflow implementation only changes workflow states on contaner operations, not media + // container. This workflow implementation only changes workflow states on container operations, not media // resource operations, so we just bounce this right back. if (!containerOperation) { return; diff --git a/dspace/config/crosswalks/google-metadata.properties b/dspace/config/crosswalks/google-metadata.properties index 157ee9c0b13c..263ab3b18394 100644 --- a/dspace/config/crosswalks/google-metadata.properties +++ b/dspace/config/crosswalks/google-metadata.properties @@ -6,7 +6,7 @@ # Field Identifiers -# Pairs of field/value matches indended to uniquely identify an +# Pairs of field/value matches intended to uniquely identify an # item of a particular type for unique metadata field assignment, # e.g. a dissertation item that contains values for the # dissertation-specific metadata elements. diff --git a/dspace/config/dspace.cfg b/dspace/config/dspace.cfg index 7896560c12c8..55c472c68702 100644 --- a/dspace/config/dspace.cfg +++ b/dspace/config/dspace.cfg @@ -283,7 +283,7 @@ identifier.doi.namespaceseparator = dspace/ # this configuration file (see "Browse Configuration" section below). # # Discovery configurations may be used to modify which fields in DSpace are -# browseable/searchable or appear as filters/facets. These are configured in +# browsable/searchable or appear as filters/facets. These are configured in # the discovery.xml at: # [dspace]/config/spring/api/discovery.xml # @@ -317,7 +317,7 @@ handle.prefix = 123456789 handle.dir = ${dspace.dir}/handle-server # List any additional prefixes that need to be managed by this handle server -# (as for examle handle prefix coming from old dspace repository merged in +# (as for example handle prefix coming from old dspace repository merged in # that repository) # handle.additional.prefixes = prefix1[, prefix2] @@ -384,7 +384,7 @@ handle.dir = ${dspace.dir}/handle-server #core.authorization.item-admin.cc-license = true -#### Restricted item visibilty settings ### +#### Restricted item visibility settings ### # By default RSS feeds, OAI-PMH and subscription emails will include ALL items # regardless of permissions set on them. # @@ -519,7 +519,7 @@ filter.org.dspace.app.mediafilter.PDFBoxThumbnail.inputFormats = Adobe PDF # text ("filter-media -f" ) and then reindex your site ("index-discovery -b"). #textextractor.use-temp-file = false -# Custom settigns for ImageMagick Thumbnail Filters +# Custom settings for ImageMagick Thumbnail Filters # ImageMagick and GhostScript must be installed on the server, set the path to ImageMagick and GhostScript executable # http://www.imagemagick.org/ # http://www.ghostscript.com/ @@ -1505,8 +1505,8 @@ log.report.dir = ${dspace.dir}/log # If you would like to use Google Analytics to track general website statistics then # use the following parameter to provide your Analytics key. First sign up for an # account at http://analytics.google.com, then create an entry for your repository -# website. Analytics will give you a snipet of JavaScript code to place on your site, -# inside that snipet is your Google Analytics key usually found in this line: +# website. Analytics will give you a snippet of JavaScript code to place on your site, +# inside that snippet is your Google Analytics key usually found in this line: # _uacct = "UA-XXXXXXX-X" # Take this key (just the UA-XXXXXX-X part) and place it here in this parameter. # google.analytics.key=UA-XXXXXX-X diff --git a/dspace/config/emails/request_item.granted b/dspace/config/emails/request_item.granted index 37ee5c29bd0c..40710a3ce0ff 100644 --- a/dspace/config/emails/request_item.granted +++ b/dspace/config/emails/request_item.granted @@ -2,7 +2,7 @@ ## request is granted. ## ## Parameters: -## {0} name of the requestor +## {0} name of the requester ## {1} Handle URL of the requested Item ## {2} title of the requested Item ## {3} name of the grantor diff --git a/dspace/config/emails/request_item.rejected b/dspace/config/emails/request_item.rejected index c5a13860b648..74e7085f5e20 100644 --- a/dspace/config/emails/request_item.rejected +++ b/dspace/config/emails/request_item.rejected @@ -2,7 +2,7 @@ ## request is denied. ## ## Parameters: -## {0} name of the requestor +## {0} name of the requester ## {1} Handle URL of the requested Item ## {2} title of the requested Item ## {3} name of the grantor diff --git a/dspace/config/modules/actuator.cfg b/dspace/config/modules/actuator.cfg index a14a3f1cac1f..5aecd1a4b581 100644 --- a/dspace/config/modules/actuator.cfg +++ b/dspace/config/modules/actuator.cfg @@ -9,7 +9,7 @@ management.endpoint.health.show-details = when-authorized ## Configuration which users can see the health status details management.endpoint.health.roles = ADMIN -## Configuration to establis +## Configuration to establish management.endpoint.health.status.order= down, out-of-service, up-with-issues, up, unknown ## Configuration that enables only health and info endpoints management.endpoints.web.exposure.include=health,info diff --git a/dspace/config/modules/assetstore.cfg b/dspace/config/modules/assetstore.cfg index cbee6bd2c3a4..40e98340cb88 100644 --- a/dspace/config/modules/assetstore.cfg +++ b/dspace/config/modules/assetstore.cfg @@ -26,7 +26,7 @@ assetstore.index.primary = 0 # in your bitstore.xml # Enables or disables the store initialization during startup, without initialization the store won't work. -# if changed to true, a lazy initialization will be tried on next store usage, be careful an excecption could be thrown +# if changed to true, a lazy initialization will be tried on next store usage, be careful an exception could be thrown assetstore.s3.enabled = false # For using a relative path (xx/xx/xx/xxx...) set to true, default it false diff --git a/dspace/config/modules/authentication-shibboleth.cfg b/dspace/config/modules/authentication-shibboleth.cfg index 9258f9fdbd2e..22fd8bc054bf 100644 --- a/dspace/config/modules/authentication-shibboleth.cfg +++ b/dspace/config/modules/authentication-shibboleth.cfg @@ -32,7 +32,7 @@ # apache will allow access to any URL, and when the application wants to it # may initiate an authenticated session. The Lazy Session method is preferable # for most DSpace installations where you want public access to most of DSpace -# but restricted access to limitted areas - such as administration. +# but restricted access to limited areas - such as administration. # Whether to use lazy sessions or active sessions. authentication-shibboleth.lazysession = true @@ -126,7 +126,7 @@ authentication-shibboleth.sword.compatibility = false # students when submitting an ETD. # Metadata Headers -# Shibboleth-based headers for the first and last name attirbutes +# Shibboleth-based headers for the first and last name attributes authentication-shibboleth.firstname-header = SHIB-GIVENNAME authentication-shibboleth.lastname-header = SHIB-SURNAME diff --git a/dspace/config/modules/external-providers.cfg b/dspace/config/modules/external-providers.cfg index f210a0aa5163..f1ec32c91034 100644 --- a/dspace/config/modules/external-providers.cfg +++ b/dspace/config/modules/external-providers.cfg @@ -2,7 +2,7 @@ #------------- EXTERNAL PROVIDER CONFIGURATIONS ----------------# #---------------------------------------------------------------# # Configuration properties used solely by external providers # -# as Scopus, Pubmed, CiNii and ect. # +# as Scopus, Pubmed, CiNii and etc. # #---------------------------------------------------------------# @@ -38,9 +38,9 @@ epo.consumerSecretKey = # this URL will be used during authentication to get access token epo.authUrl = https://ops.epo.org/3.2/auth/accesstoken -# this URL is used to performe specific query by epo document id & epo document type +# this URL is used to perform a specific query by epo document id & epo document type epo.url = https://ops.epo.org/rest-services/published-data/publication/$(doctype)/$(id)/biblio -# this url will be used to performe basic searching +# this url will be used to perform basic searching epo.searchUrl = https://ops.epo.org/rest-services/published-data/search ################################################################# #---------------------- PubMed -----------------------------# @@ -75,7 +75,7 @@ scopus.instToken = #The view mode to be used for the scopus search endpoint. #For more details see https://dev.elsevier.com/documentation/ScopusSearchAPI.wadl # https://dev.elsevier.com/sc_search_views.html -# by default we use standart mode, to use complete mode this variable must be valued with 'COMPLETE' +# by default we use standard mode, to use complete mode this variable must be valued with 'COMPLETE' scopus.search-api.viewMode = ################################################################# #------------------- Web of Science (WOS) ----------------------# diff --git a/dspace/config/modules/ldn.cfg b/dspace/config/modules/ldn.cfg index 57f1c878ed35..cc1ab4fade4b 100644 --- a/dspace/config/modules/ldn.cfg +++ b/dspace/config/modules/ldn.cfg @@ -25,7 +25,7 @@ ldn.queue.timeout.checker.cron = 0 0 */1 * * ? # LDN Queue extractor elaborates LDN Message entities with max_attempts < than ldn.processor.max.attempts ldn.processor.max.attempts = 5 -# LDN Queue extractor sets LDN Message Entity queue_timeout property every time it tryies a new elaboration +# LDN Queue extractor sets LDN Message Entity queue_timeout property every time it tries a new elaboration # of the message. LDN Message with a future queue_timeout is not elaborated. This property is used to calculateas: # a new timeout, such as: new_timeout = now + ldn.processor.queue.msg.timeout (in minutes) ldn.processor.queue.msg.timeout = 60 diff --git a/dspace/config/modules/oai.cfg b/dspace/config/modules/oai.cfg index 98b10f59dee9..d56764444a1c 100644 --- a/dspace/config/modules/oai.cfg +++ b/dspace/config/modules/oai.cfg @@ -86,7 +86,7 @@ oai.harvester.autoStart=false #oai.harvester.timePadding = 120 # How frequently the harvest scheduler checks the remote provider for updates, -# measured in minutes. The default vaule is 12 hours (or 720 minutes) +# measured in minutes. The default value is 12 hours (or 720 minutes) #oai.harvester.harvestFrequency = 720 # The heartbeat is the frequency at which the harvest scheduler queries the local @@ -101,7 +101,7 @@ oai.harvester.autoStart=false # How many harvest process threads the scheduler can spool up at once. Default value is 3. #oai.harvester.maxThreads = 3 -# How much time passess before a harvest thread is terminated. The termination process +# How much time passes before a harvest thread is terminated. The termination process # waits for the current item to complete ingest and saves progress made up to that point. # Measured in hours. Default value is 24. #oai.harvester.threadTimeout = 24 diff --git a/dspace/config/modules/rdf.cfg b/dspace/config/modules/rdf.cfg index 4d4191c291d7..fd9570d37785 100644 --- a/dspace/config/modules/rdf.cfg +++ b/dspace/config/modules/rdf.cfg @@ -32,7 +32,7 @@ rdf.public.sparql.endpoint = http://localhost/fuseki/dspace/sparql -# Address of the endpoint for the SPARQL 1.1 Graph Store HTTP Protocoll +# Address of the endpoint for the SPARQL 1.1 Graph Store HTTP Protocol # This address is used to store data in the triple store. rdf.storage.graphstore.endpoint = http://localhost:3030/dspace/data # If the SPARQL 1.1. Graph Store HTTP Protocol endpoint requires @@ -44,7 +44,7 @@ rdf.storage.graphstore.authentication = no # Address DSpace should use to query the SPARQL endpoint, e.g. the # RDFStorageImpl uses this address to determine a list of all stored # graphs. The SPARQL endpoint can be read-only, all commands which change -# data will be performed using the SPARQL 1.1 Graph Store HTTP Protocoll. +# data will be performed using the SPARQL 1.1 Graph Store HTTP Protocol. # If this is empty the property "rdf.public.sparql.endpoint" will be used instead. rdf.storage.sparql.endpoint = # If the internal SPARQL endpoint requires authentication, please set diff --git a/dspace/config/modules/rdf/metadata-rdf-schema.ttl b/dspace/config/modules/rdf/metadata-rdf-schema.ttl index dd33c69d2cbe..78ba6a51bb94 100644 --- a/dspace/config/modules/rdf/metadata-rdf-schema.ttl +++ b/dspace/config/modules/rdf/metadata-rdf-schema.ttl @@ -74,7 +74,7 @@ :creates a rdf:Property ; rdfs:label "Result" ; - rdfs:comment "Specifies the RDF to generate for a specified matadata." ; + rdfs:comment "Specifies the RDF to generate for a specified metadata." ; rdfs:domain :DSpaceMetadataRDFMapping ; rdfs:range :Result ; . diff --git a/dspace/config/modules/swordv2-server.cfg b/dspace/config/modules/swordv2-server.cfg index ccb7760e6d02..5891f32726a6 100644 --- a/dspace/config/modules/swordv2-server.cfg +++ b/dspace/config/modules/swordv2-server.cfg @@ -122,7 +122,7 @@ swordv2-server.keep-original-package = true # if versions.keep is set to true. This will be used in the case # that individual files are updated or removed via SWORD. If # the entire Media Resource (files in the ORIGINAL bundle) is removed -# this will be backed up in its entirity in a bundle of its own +# this will be backed up in its entirety in a bundle of its own # # swordv2-server.bundle.deleted = DELETED diff --git a/dspace/config/spiders/domains/example b/dspace/config/spiders/domains/example index bf82d6d75ace..ba7d83aa9a72 100644 --- a/dspace/config/spiders/domains/example +++ b/dspace/config/spiders/domains/example @@ -1,4 +1,4 @@ -# example spider filder by domain regular expressions courtesy of OSU Libraries +# example spider filter by domain regular expressions courtesy of OSU Libraries # https://raw.github.com/osulibraries/DSpace/osukb/dspace/config/Spiders-DomainName.txt (.*)\.fastsearch\.net\. (.*)\.scoutjet\.com\. diff --git a/dspace/config/spiders/iplists.com-misc.txt b/dspace/config/spiders/iplists.com-misc.txt index bfb35bab8be7..a9a6270feee0 100644 --- a/dspace/config/spiders/iplists.com-misc.txt +++ b/dspace/config/spiders/iplists.com-misc.txt @@ -775,7 +775,7 @@ # UA "fscrawler/3.0 (www.e-dintorni.it;Windows NT 5.0)" 213.215.160.170 -# EDSA Phillipines +# EDSA Philippines 210.16.10.40 # eFamily diff --git a/dspace/modules/server-boot/src/main/java/org/dspace/app/ServerBootApplication.java b/dspace/modules/server-boot/src/main/java/org/dspace/app/ServerBootApplication.java index 5efa79a02aca..efc15ef55576 100644 --- a/dspace/modules/server-boot/src/main/java/org/dspace/app/ServerBootApplication.java +++ b/dspace/modules/server-boot/src/main/java/org/dspace/app/ServerBootApplication.java @@ -14,7 +14,7 @@ import org.springframework.boot.builder.SpringApplicationBuilder; /** - * Define the Spring Boot Application settings itself to be runned using an + * Define the Spring Boot Application settings itself to be run using an * embedded application server. * * @author Luca Giamminonni (luca.giamminonni at 4science.it) From 030682d709e52ef82706c17848168ac84778f492 Mon Sep 17 00:00:00 2001 From: Sascha Szott Date: Thu, 8 Aug 2024 14:14:42 +0200 Subject: [PATCH 29/96] remove obsolete message keys in Message.properties --- dspace-api/src/main/resources/Messages.properties | 5 ----- 1 file changed, 5 deletions(-) diff --git a/dspace-api/src/main/resources/Messages.properties b/dspace-api/src/main/resources/Messages.properties index efbbeedde053..6e5054cc7d69 100644 --- a/dspace-api/src/main/resources/Messages.properties +++ b/dspace-api/src/main/resources/Messages.properties @@ -101,7 +101,6 @@ org.dspace.checker.SimpleReporterImpl.source org.dspace.checker.SimpleReporterImpl.store-number = Store Number org.dspace.checker.SimpleReporterImpl.unchecked-bitstream-report = The following is a UN-CHECKED BITSTREAM REPORT report for org.dspace.content.untitled = Untitled -org.dspace.eperson.X509Authentication.title = Enter DSpace using Web Certificate org.dspace.eperson.Subscribe.authors = Authors: org.dspace.eperson.Subscribe.id = ID: org.dspace.eperson.Subscribe.new-items = New Items: @@ -109,10 +108,6 @@ org.dspace.eperson.Subscribe.title org.dspace.statistics.util.LocationUtils.unknown-continent = Unknown Continent org.dspace.statistics.util.LocationUtils.unknown-country = Unknown Country org.dspace.xmlworkflow.XMLWorkflowService.untitled = Untitled -# used by discovery (standard sort index _sort) -search.sort-by.dc.title_sort = Title -# used by discovery (date sort index _dt) -search.sort-by.dc.date.issued_dt = Issue Date org.dspace.app.requestitem.RequestItemHelpdeskStrategy.helpdeskname = Help Desk # User exposed REST API error messages From fab9c670a3f90976069b5bda5a0acb5c0ebd1f62 Mon Sep 17 00:00:00 2001 From: Sascha Szott Date: Thu, 8 Aug 2024 14:19:52 +0200 Subject: [PATCH 30/96] optimize order of messages keys --- dspace-api/src/main/resources/Messages.properties | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dspace-api/src/main/resources/Messages.properties b/dspace-api/src/main/resources/Messages.properties index 6e5054cc7d69..714ed25fd0ed 100644 --- a/dspace-api/src/main/resources/Messages.properties +++ b/dspace-api/src/main/resources/Messages.properties @@ -50,8 +50,6 @@ metadata.bitstream.iiif-virtual.mimetype = Mime Type metadata.bitstream.iiif-virtual.bytes = File size metadata.bitstream.iiif-virtual.checksum = Checksum -org.dspace.app.itemexport.no-result = The DSpaceObject that you specified has no items. -org.dspace.app.util.SyndicationFeed.no-description = No Description org.dspace.checker.ResultsLogger.bitstream-format = Bitstream format org.dspace.checker.ResultsLogger.bitstream-found = Bitstream found org.dspace.checker.ResultsLogger.bitstream-id = Bitstream ID @@ -100,6 +98,7 @@ org.dspace.checker.SimpleReporterImpl.size org.dspace.checker.SimpleReporterImpl.source = Source org.dspace.checker.SimpleReporterImpl.store-number = Store Number org.dspace.checker.SimpleReporterImpl.unchecked-bitstream-report = The following is a UN-CHECKED BITSTREAM REPORT report for + org.dspace.content.untitled = Untitled org.dspace.eperson.Subscribe.authors = Authors: org.dspace.eperson.Subscribe.id = ID: @@ -108,7 +107,10 @@ org.dspace.eperson.Subscribe.title org.dspace.statistics.util.LocationUtils.unknown-continent = Unknown Continent org.dspace.statistics.util.LocationUtils.unknown-country = Unknown Country org.dspace.xmlworkflow.XMLWorkflowService.untitled = Untitled + +org.dspace.app.itemexport.no-result = The DSpace object that you specified has no items. org.dspace.app.requestitem.RequestItemHelpdeskStrategy.helpdeskname = Help Desk +org.dspace.app.util.SyndicationFeed.no-description = No Description # User exposed REST API error messages org.dspace.app.rest.exception.RESTEmptyWorkflowGroupException.message = Refused to delete user {0} because it is the only member of the \ From 61048b9141d821a9084b11896ef2610dca0c1600 Mon Sep 17 00:00:00 2001 From: Sascha Szott Date: Thu, 8 Aug 2024 14:21:45 +0200 Subject: [PATCH 31/96] fix value of org.dspace.checker.SimpleReporterImpl.unchecked-bitstream-report --- dspace-api/src/main/resources/Messages.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dspace-api/src/main/resources/Messages.properties b/dspace-api/src/main/resources/Messages.properties index 714ed25fd0ed..3304e8ce8d71 100644 --- a/dspace-api/src/main/resources/Messages.properties +++ b/dspace-api/src/main/resources/Messages.properties @@ -97,7 +97,7 @@ org.dspace.checker.SimpleReporterImpl.result org.dspace.checker.SimpleReporterImpl.size = Size org.dspace.checker.SimpleReporterImpl.source = Source org.dspace.checker.SimpleReporterImpl.store-number = Store Number -org.dspace.checker.SimpleReporterImpl.unchecked-bitstream-report = The following is a UN-CHECKED BITSTREAM REPORT report for +org.dspace.checker.SimpleReporterImpl.unchecked-bitstream-report = The following is a UN-CHECKED BITSTREAM report for org.dspace.content.untitled = Untitled org.dspace.eperson.Subscribe.authors = Authors: From 077aed38dc55172ed70d8bfb9c44fd369d966a6d Mon Sep 17 00:00:00 2001 From: autavares-dev Date: Mon, 12 Aug 2024 15:08:26 -0300 Subject: [PATCH 32/96] Fix index-discovery process when using handle --- dspace-api/src/main/java/org/dspace/discovery/IndexClient.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dspace-api/src/main/java/org/dspace/discovery/IndexClient.java b/dspace-api/src/main/java/org/dspace/discovery/IndexClient.java index b70e9162f7a1..3479c25bf367 100644 --- a/dspace-api/src/main/java/org/dspace/discovery/IndexClient.java +++ b/dspace-api/src/main/java/org/dspace/discovery/IndexClient.java @@ -27,6 +27,7 @@ import org.dspace.content.Item; import org.dspace.content.factory.ContentServiceFactory; import org.dspace.content.service.ItemService; +import org.dspace.core.Constants; import org.dspace.core.Context; import org.dspace.discovery.indexobject.IndexableCollection; import org.dspace.discovery.indexobject.IndexableCommunity; @@ -109,7 +110,7 @@ public void internalRun() throws Exception { .getHandleService().resolveToObject(context, param); if (dso != null) { final IndexFactory indexableObjectService = IndexObjectFactoryFactory.getInstance(). - getIndexFactoryByType(String.valueOf(dso.getType())); + getIndexFactoryByType(Constants.typeText[dso.getType()]); indexableObject = indexableObjectService.findIndexableObject(context, dso.getID().toString()); } } From 3afaae74b09586e6206928b989e92402be0fec1a Mon Sep 17 00:00:00 2001 From: eskander Date: Wed, 21 Aug 2024 15:25:27 +0300 Subject: [PATCH 33/96] [DURACOM-222] Expose the item submitter over the REST --- .../org/dspace/app/rest/model/ItemRest.java | 6 ++ .../ItemSubmitterLinkRepository.java | 61 +++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ItemSubmitterLinkRepository.java diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ItemRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ItemRest.java index b2f540c0ac4a..b3ae373ceed8 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ItemRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ItemRest.java @@ -52,6 +52,10 @@ @LinkRest( name = ItemRest.THUMBNAIL, method = "getThumbnail" + ), + @LinkRest( + name = ItemRest.SUBMITTER, + method = "getItemSubmitter" ) }) public class ItemRest extends DSpaceObjectRest { @@ -69,6 +73,8 @@ public class ItemRest extends DSpaceObjectRest { public static final String TEMPLATE_ITEM_OF = "templateItemOf"; public static final String THUMBNAIL = "thumbnail"; + public static final String SUBMITTER = "submitter"; + private boolean inArchive = false; private boolean discoverable = false; private boolean withdrawn = false; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ItemSubmitterLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ItemSubmitterLinkRepository.java new file mode 100644 index 000000000000..a345f0abe788 --- /dev/null +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ItemSubmitterLinkRepository.java @@ -0,0 +1,61 @@ +/** + * 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.rest.repository; + +import java.sql.SQLException; +import java.util.UUID; +import javax.annotation.Nullable; + +import jakarta.servlet.http.HttpServletRequest; +import org.dspace.app.rest.model.EPersonRest; +import org.dspace.app.rest.model.ItemRest; +import org.dspace.app.rest.projection.Projection; +import org.dspace.content.Item; +import org.dspace.content.service.ItemService; +import org.dspace.core.Context; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Pageable; +import org.springframework.data.rest.webmvc.ResourceNotFoundException; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.stereotype.Component; + +/** + * Link repository for "submitter" subresource of an item. + */ +@Component(ItemRest.CATEGORY + "." + ItemRest.PLURAL_NAME + "." + ItemRest.SUBMITTER) +public class ItemSubmitterLinkRepository extends AbstractDSpaceRestRepository + implements LinkRestRepository { + + @Autowired + ItemService itemService; + + /** + * Retrieve the submitter for an item. + * + * @param request - The current request + * @param id - The item ID for which to retrieve the submitter + * @param optionalPageable - optional pageable object + * @param projection - the current projection + * @return the submitter for the item + */ + @PreAuthorize("hasPermission(#id, 'ITEM', 'READ')") + public EPersonRest getItemSubmitter(@Nullable HttpServletRequest request, UUID id, + @Nullable Pageable optionalPageable, Projection projection) { + try { + Context context = obtainContext(); + Item item = itemService.find(context, id); + if (item == null) { + throw new ResourceNotFoundException("No such item: " + id); + } + + return converter.toRest(item.getSubmitter(), projection); + } catch (SQLException e) { + throw new RuntimeException(e); + } + } +} \ No newline at end of file From 49e8653d038afac14a042257c702db17d26af074 Mon Sep 17 00:00:00 2001 From: eskander Date: Wed, 21 Aug 2024 16:29:35 +0300 Subject: [PATCH 34/96] [DURACOM-222] adding ITs --- .../dspace/app/rest/ItemRestRepositoryIT.java | 45 +++++++++++++++++++ .../dspace/app/rest/matcher/ItemMatcher.java | 6 ++- 2 files changed, 49 insertions(+), 2 deletions(-) diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/ItemRestRepositoryIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/ItemRestRepositoryIT.java index b2bfd048520c..8a629cd31cff 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/ItemRestRepositoryIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/ItemRestRepositoryIT.java @@ -4696,4 +4696,49 @@ public void findAccessStatusForItemTest() throws Exception { .andExpect(jsonPath("$.status", notNullValue())); } + @Test + public void findSubmitterTest() throws Exception { + context.turnOffAuthorisationSystem(); + + //** GIVEN ** + //1. A community-collection structure with one parent community with sub-community and two collections. + parentCommunity = CommunityBuilder.createCommunity(context) + .withName("Parent Community") + .build(); + Community child1 = CommunityBuilder.createSubCommunity(context, parentCommunity) + .withName("Sub Community") + .build(); + Collection col1 = CollectionBuilder.createCollection(context, child1).withName("Collection 1").build(); + + EPerson submitter = EPersonBuilder.createEPerson(context) + .withEmail("testone@mail.com") + .withPassword(password) + .withCanLogin(true) + .build(); + + context.setCurrentUser(submitter); + + //2. Three public items that are readable by Anonymous with different subjects + Item publicItem = ItemBuilder.createItem(context, col1) + .withTitle("Public item 1") + .withIssueDate("2017-10-17") + .withAuthor("Smith, Donald") + .withSubject("ExtraEntry") + .build(); + + context.restoreAuthSystemState(); + + String token = getAuthToken(admin.getEmail(), password); + + getClient(token).perform(get("/api/core/items/" + publicItem.getID()) + .param("projection", "full")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$", ItemMatcher.matchFullEmbeds())); + + getClient(token).perform(get("/api/core/items/" + publicItem.getID() + "/submitter")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.id", is(submitter.getID().toString()))) + .andExpect(jsonPath("$.email", is(submitter.getEmail()))); + } + } diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/matcher/ItemMatcher.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/matcher/ItemMatcher.java index 64905f90ea2d..44121b7e42d6 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/matcher/ItemMatcher.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/matcher/ItemMatcher.java @@ -58,7 +58,8 @@ public static Matcher matchFullEmbeds() { "version", "relationships[]", "templateItemOf", - "thumbnail" + "thumbnail", + "submitter" ); } @@ -76,7 +77,8 @@ public static Matcher matchLinks(UUID uuid) { "self", "version", "templateItemOf", - "thumbnail" + "thumbnail", + "submitter" ); } From 5c9af9764e2485b26398ec06446cb8f0edd9cab2 Mon Sep 17 00:00:00 2001 From: "Mark H. Wood" Date: Mon, 26 Aug 2024 15:02:31 -0400 Subject: [PATCH 35/96] Make statistics autocommit much more frequent. --- dspace/solr/statistics/conf/solrconfig.xml | 25 ++++++++++++++-------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/dspace/solr/statistics/conf/solrconfig.xml b/dspace/solr/statistics/conf/solrconfig.xml index 2b1cff45373d..c3f023ff2eee 100644 --- a/dspace/solr/statistics/conf/solrconfig.xml +++ b/dspace/solr/statistics/conf/solrconfig.xml @@ -32,14 +32,16 @@ - + 32 1000 ${solr.lock.type:native} - + false @@ -48,7 +50,7 @@ 10000 - ${solr.autoCommit.maxTime:900000} + ${solr.autoCommit.maxTime:10000} true @@ -62,14 +64,16 @@ ${solr.max.booleanClauses:1024} + unordered sets of *all* documents that match a + query. Caches results of 'fq' search param. --> - + 1000 - + - + uuid @@ -126,7 +132,8 @@ - + uid From 002e637d4fc69b31c2a2321230d96534e49ee33e Mon Sep 17 00:00:00 2001 From: Sascha Szott Date: Tue, 27 Aug 2024 10:33:01 +0200 Subject: [PATCH 36/96] fix failed first login attempt in HAL browser --- .../src/main/resources/static/login.html | 128 ++++++++++-------- 1 file changed, 68 insertions(+), 60 deletions(-) diff --git a/dspace-server-webapp/src/main/resources/static/login.html b/dspace-server-webapp/src/main/resources/static/login.html index 50d95b80472f..0597a66bfe96 100644 --- a/dspace-server-webapp/src/main/resources/static/login.html +++ b/dspace-server-webapp/src/main/resources/static/login.html @@ -32,7 +32,7 @@ border-radius: 5px; box-shadow: 0 1px 2px rgba(0, 0, 0, .05); } - .form-signin .form-signin-heading, .form-signin .checkbox { + .form-signin .form-signin-heading, .form-signin { margin-bottom: 10px; } .form-signin input[type="text"], .form-signin input[type="password"] { @@ -94,63 +94,71 @@

    Other login methods:

    "onclick" : function() { toastr.remove(); } } + // retrieves a valid CSRF token (please note that this method works both in DS 7 and DS 8) + // HTTP response code 403 is expected at this point (the response contains the DSPACE-XSRF-TOKEN header) + $.ajax({ + url : window.location.href.replace("login.html", "") + 'api/authn/login', + type : 'POST', + error : function(xhr) { + // Check for an update to the CSRF Token & save to a MyHalBrowserCsrfToken cookie (if found) + checkForUpdatedCSRFTokenInResponse(xhr); + } + }); + // When the login page loads, we do *two* AJAX requests. - // (1) Call GET /api/authn/status. This call has two purposes. First, it checks to see if you are logged in, - // (if not, WWW-Authenticate will return login options). Second, it retrieves the CSRF token, if a - // new one has been assigned (as a valid CSRF token is required for the POST call). + // (1) Call GET /api/authn/status. This call checks to see if you are logged in + // (if not, WWW-Authenticate will return login options). // (2) If that /api/authn/status call finds authentication data, call POST /api/authn/login. - // This scenario occurs when you login via an external authentication system (e.g. Shibboleth)... + // This scenario occurs when you log in via an external authentication system (e.g. Shibboleth) // in which case the main role of /api/authn/login is to simply ensure the "Authorization" header // is sent back to the client (based on your authentication data). $.ajax({ - url : window.location.href.replace("login.html", "") + 'api/authn/status', - type : 'GET', - success : function(result, status, xhr) { - // Check for an update to the CSRF Token & save to a MyHalBrowserCsrfToken cookie (if found) - checkForUpdatedCSRFTokenInResponse(xhr); + url : window.location.href.replace("login.html", "") + 'api/authn/status', + type : 'GET', + success : function(result, status, xhr) { - // Check for WWW-Authenticate header. If found, this means we are not yet authenticated, and - // therefore we need to display available authentication options. - var authenticate = xhr.getResponseHeader("WWW-Authenticate"); - if (authenticate !== null) { - var element = $('div.other-login-methods'); - var realms = authenticate.match(/(\w+ (\w+=((".*?")|[^,]*)(, )?)*)/g); - if (realms.length == 1){ - var loc = /location="([^,]*)"/.exec(authenticate); - if (loc !== null && loc.length === 2) { - document.location = loc[1]; - } - } else if (realms.length > 1){ - for (var i = 0; i < realms.length; i++){ - addLocationButton(realms[i], element); + // Check for WWW-Authenticate header. If found, this means we are not yet authenticated, and + // therefore we need to display available authentication options. + var authenticate = xhr.getResponseHeader("WWW-Authenticate"); + if (authenticate !== null && authenticate.contains('location=')) { + var element = $('div.other-login-methods'); + var realms = authenticate.match(/(\w+ (\w+=((".*?")|[^,]*)(, )?)*)/g); + if (realms.length === 1){ + var loc = /location="([^,]*)"/.exec(authenticate); + if (loc !== null && loc.length === 2) { + document.location = loc[1]; + } + } else if (realms.length > 1){ + for (var i = 0; i < realms.length; i++){ + addLocationButton(realms[i], element); + } } + } else { + // If Authentication data was found, do a POST /api/authn/login to ensure that data's JWT + // is sent back in the "Authorization" header. This simply completes an external authentication + // process (e.g. Shibboleth) + $.ajax({ + url : window.location.href.replace("login.html", "") + 'api/authn/login', + type : 'POST', + beforeSend: function (xhr) { + // If CSRF token found in cookie, send it back as X-XSRF-Token header + var csrfToken = getCSRFToken(); + if (csrfToken != null) { + xhr.setRequestHeader('X-XSRF-Token', csrfToken); + } + }, + success : successHandler, + error : function(xhr) { + // Check for an update to the CSRF Token & save to a MyHalBrowserCsrfToken cookie (if found) + checkForUpdatedCSRFTokenInResponse(xhr); + toastr.error('Failed to logged in. Please check for errors in Javascript console.', 'Login Failed'); + } + }); } - } else { - // If Authentication data was found, do a POST /api/authn/login to ensure that data's JWT - // is sent back in the "Authorization" header. This simply completes an external authentication - // process (e.g. Shibboleth) - $.ajax({ - url : window.location.href.replace("login.html", "") + 'api/authn/login', - type : 'POST', - beforeSend: function (xhr, settings) { - // If CSRF token found in cookie, send it back as X-XSRF-Token header - var csrfToken = getCSRFToken(); - if (csrfToken != null) { - xhr.setRequestHeader('X-XSRF-Token', csrfToken); - } - }, - success : successHandler, - error : function(xhr, textStatus, errorThrown) { - // Check for an update to the CSRF Token & save to a MyHalBrowserCsrfToken cookie (if found) - checkForUpdatedCSRFTokenInResponse(xhr); - toastr.error('Failed to logged in. Please check for errors in Javascript console.', 'Login Failed'); - } - }); + }, + error : function() { + toastr.error('Failed to connect with backend. Please check for errors in Javascript console.', 'Could Not Load'); } - }, - error : function(xhr, textStatus, errorThrown) { - toastr.error('Failed to connect with backend. Please check for errors in Javascript console.', 'Could Not Load'); - } }); function addLocationButton(realm, element){ @@ -166,22 +174,22 @@

    Other login methods:

    return string.charAt(0).toUpperCase() + string.slice(1); } - /** - * Check current response headers to see if the CSRF Token has changed. If a new value is found in headers, - * save the new value into our "MyHalBrowserCsrfToken" cookie. - **/ + /** + * Check current response headers to see if the CSRF Token has changed. If a new value is found in headers, + * save the new value into our "MyHalBrowserCsrfToken" cookie. + **/ function checkForUpdatedCSRFTokenInResponse(jqxhr) { // look for DSpace-XSRF-TOKEN header & save to our MyHalBrowserCsrfToken cookie (if found) var updatedCsrfToken = jqxhr.getResponseHeader('DSPACE-XSRF-TOKEN'); if (updatedCsrfToken != null) { - document.cookie = "MyHalBrowserCsrfToken=" + updatedCsrfToken; + document.cookie = "MyHalBrowserCsrfToken=" + updatedCsrfToken; } } - /** - * Get CSRF Token by parsing it out of the "MyHalBrowserCsrfToken" cookie. - * This cookie is set in login.html after a successful login occurs. - **/ + /** + * Get CSRF Token by parsing it out of the "MyHalBrowserCsrfToken" cookie. + * This cookie is set in login.html after a successful login occurs. + **/ function getCSRFToken() { var cookie = document.cookie.match('(^|;)\\s*' + 'MyHalBrowserCsrfToken' + '\\s*=\\s*([^;]+)'); if (cookie != null) { @@ -204,11 +212,11 @@

    Other login methods:

    user: $("#username").val(), password: $("#password").val() }, - beforeSend: function (xhr, settings) { + beforeSend: function (xhr) { // If CSRF token found in cookie, send it back as X-XSRF-Token header var csrfToken = getCSRFToken(); if (csrfToken != null) { - xhr.setRequestHeader('X-XSRF-Token', csrfToken); + xhr.setRequestHeader('X-XSRF-Token', csrfToken); } }, success : successHandler, From 546afb189e1df8bdfbc9948e790004baa81ec894 Mon Sep 17 00:00:00 2001 From: Sascha Szott Date: Thu, 29 Aug 2024 16:24:38 +0200 Subject: [PATCH 37/96] applied change suggested by reviewer: use String.prototype.includes --- dspace-server-webapp/src/main/resources/static/login.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dspace-server-webapp/src/main/resources/static/login.html b/dspace-server-webapp/src/main/resources/static/login.html index 0597a66bfe96..959190020a13 100644 --- a/dspace-server-webapp/src/main/resources/static/login.html +++ b/dspace-server-webapp/src/main/resources/static/login.html @@ -120,7 +120,7 @@

    Other login methods:

    // Check for WWW-Authenticate header. If found, this means we are not yet authenticated, and // therefore we need to display available authentication options. var authenticate = xhr.getResponseHeader("WWW-Authenticate"); - if (authenticate !== null && authenticate.contains('location=')) { + if (authenticate !== null && authenticate.includes('location=')) { var element = $('div.other-login-methods'); var realms = authenticate.match(/(\w+ (\w+=((".*?")|[^,]*)(, )?)*)/g); if (realms.length === 1){ From 875327927cba18ad2fd18e47fc6d9a858cb077ad Mon Sep 17 00:00:00 2001 From: eskander Date: Mon, 2 Sep 2024 11:20:04 +0300 Subject: [PATCH 38/96] [DURACOM-222] adding more ITs --- .../dspace/app/rest/ItemRestRepositoryIT.java | 77 ++++++++++++++++++- 1 file changed, 76 insertions(+), 1 deletion(-) diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/ItemRestRepositoryIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/ItemRestRepositoryIT.java index 8a629cd31cff..f105322a63fb 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/ItemRestRepositoryIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/ItemRestRepositoryIT.java @@ -4697,7 +4697,7 @@ public void findAccessStatusForItemTest() throws Exception { } @Test - public void findSubmitterTest() throws Exception { + public void findSubmitterByAdminTest() throws Exception { context.turnOffAuthorisationSystem(); //** GIVEN ** @@ -4741,4 +4741,79 @@ public void findSubmitterTest() throws Exception { .andExpect(jsonPath("$.email", is(submitter.getEmail()))); } + @Test + public void findSubmitterWithoutReadAccessTest() throws Exception { + context.turnOffAuthorisationSystem(); + + parentCommunity = CommunityBuilder.createCommunity(context) + .withName("Parent Community") + .build(); + + Collection col1 = CollectionBuilder.createCollection(context, parentCommunity).withName("Collection 1").build(); + + EPerson submitter = EPersonBuilder.createEPerson(context) + .withEmail("testone@mail.com") + .withPassword(password) + .withCanLogin(true) + .build(); + + context.setCurrentUser(submitter); + + Item publicItem = ItemBuilder.createItem(context, col1) + .withTitle("Public item 1") + .withIssueDate("2017-10-17") + .withAuthor("Smith, Donald") + .withSubject("ExtraEntry") + .build(); + + context.restoreAuthSystemState(); + + String token = getAuthToken(eperson.getEmail(), password); + + getClient(token).perform(get("/api/core/items/" + publicItem.getID()) + .param("projection", "full")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$", ItemMatcher.matchFullEmbeds())); + +// find submitter by user has no read access + getClient(token).perform(get("/api/core/items/" + publicItem.getID() + "/submitter")) + .andExpect(status().isNoContent()); + } + + @Test + public void findSubmitterByAnonymousTest() throws Exception { + context.turnOffAuthorisationSystem(); + + parentCommunity = CommunityBuilder.createCommunity(context) + .withName("Parent Community") + .build(); + + Collection col1 = CollectionBuilder.createCollection(context, parentCommunity).withName("Collection 1").build(); + + EPerson submitter = EPersonBuilder.createEPerson(context) + .withEmail("testone@mail.com") + .withPassword(password) + .withCanLogin(true) + .build(); + + context.setCurrentUser(submitter); + + Item publicItem = ItemBuilder.createItem(context, col1) + .withTitle("Public item 1") + .withIssueDate("2017-10-17") + .withAuthor("Smith, Donald") + .withSubject("ExtraEntry") + .build(); + + context.restoreAuthSystemState(); + + getClient().perform(get("/api/core/items/" + publicItem.getID()) + .param("projection", "full")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$", ItemMatcher.matchFullEmbeds())); + + getClient().perform(get("/api/core/items/" + publicItem.getID() + "/submitter")) + .andExpect(status().isNoContent()); + } + } From a898afd5acbd6dc51a88b837cab2a1c56cc33967 Mon Sep 17 00:00:00 2001 From: Kim Shepherd Date: Tue, 3 Sep 2024 17:13:01 +0200 Subject: [PATCH 39/96] Translate underscores to dashes in xml:lang attr for DIM2DataCite.xsl Modified the DataCite crosswalk to ensure that the xml:lang attribute translates any underscores in the value of @lang to dashes. This change aligns the attribute formatting with standard language code conventions. --- dspace/config/crosswalks/DIM2DataCite.xsl | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/dspace/config/crosswalks/DIM2DataCite.xsl b/dspace/config/crosswalks/DIM2DataCite.xsl index d4d8cbe6417a..935b3dc4038a 100644 --- a/dspace/config/crosswalks/DIM2DataCite.xsl +++ b/dspace/config/crosswalks/DIM2DataCite.xsl @@ -25,6 +25,10 @@ to register DOIs anymore. Please follow and reuse the examples included in this file. For more information on the DataCite Schema, see https://schema.datacite.org. --> + 10.5072/dspace- @@ -362,20 +366,20 @@ - + - + AlternativeTitle - - + Subtitle - + TranslatedTitle @@ -394,7 +398,7 @@ --> - + @@ -626,7 +630,7 @@ --> - + Abstract From 52702a23df37f087058c7837a2dfcbbcf4306382 Mon Sep 17 00:00:00 2001 From: Kim Shepherd Date: Tue, 25 Jun 2024 13:45:31 +0200 Subject: [PATCH 40/96] Fix request a copy link token generation Ensure DSpace URLs with extra segments are included fully in the generated link --- .../rest/repository/RequestItemRepository.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RequestItemRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RequestItemRepository.java index 6bfae8ed3515..1bb3ddbc9aed 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RequestItemRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RequestItemRepository.java @@ -21,6 +21,7 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import jakarta.servlet.http.HttpServletRequest; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.validator.routines.EmailValidator; import org.apache.http.client.utils.URIBuilder; import org.apache.logging.log4j.LogManager; @@ -287,19 +288,17 @@ public Class getDomainClass() { * Generate a link back to DSpace, to act on a request. * * @param token identifies the request. - * @return URL to the item request API, with the token as request parameter - * "token". + * @return URL to the item request API, with /request-a-copy/{token} as the last URL segments * @throws URISyntaxException passed through. * @throws MalformedURLException passed through. */ private String getLinkTokenEmail(String token) throws URISyntaxException, MalformedURLException { final String base = configurationService.getProperty("dspace.ui.url"); - - URI link = new URIBuilder(base) - .setPathSegments("request-a-copy", token) - .build(); - - return link.toURL().toExternalForm(); + URIBuilder uriBuilder = new URIBuilder(base); + // Add request-a-copy/token to the existing path (without breaking /sub/dir dspace URLs) + URI uri = uriBuilder.setPath(StringUtils.stripEnd(uriBuilder.getPath(), "") + + "/request-a-copy/" + token).build(); + return uri.toURL().toExternalForm(); } } From 3646a54df3d540e7dc7603cd7013961df8d9a404 Mon Sep 17 00:00:00 2001 From: Kim Shepherd Date: Tue, 25 Jun 2024 14:36:17 +0200 Subject: [PATCH 41/96] Make RequestItemRepository#getLinkTokenEmail public, write test --- .../repository/RequestItemRepository.java | 2 +- .../app/rest/RequestItemRepositoryIT.java | 29 +++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RequestItemRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RequestItemRepository.java index 1bb3ddbc9aed..0698567dcbc6 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RequestItemRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RequestItemRepository.java @@ -292,7 +292,7 @@ public Class getDomainClass() { * @throws URISyntaxException passed through. * @throws MalformedURLException passed through. */ - private String getLinkTokenEmail(String token) + public String getLinkTokenEmail(String token) throws URISyntaxException, MalformedURLException { final String base = configurationService.getProperty("dspace.ui.url"); URIBuilder uriBuilder = new URIBuilder(base); diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/RequestItemRepositoryIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/RequestItemRepositoryIT.java index ea61db514504..a43e458207cf 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/RequestItemRepositoryIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/RequestItemRepositoryIT.java @@ -28,6 +28,8 @@ import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; +import java.net.MalformedURLException; +import java.net.URISyntaxException; import java.sql.SQLException; import java.time.temporal.ChronoUnit; import java.util.Date; @@ -55,10 +57,12 @@ import org.dspace.content.Bitstream; import org.dspace.content.Collection; import org.dspace.content.Item; +import org.dspace.services.ConfigurationService; import org.hamcrest.Matchers; import org.junit.Before; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.ApplicationContext; /** * @@ -81,6 +85,12 @@ public class RequestItemRepositoryIT @Autowired(required = true) RequestItemService requestItemService; + @Autowired + ApplicationContext applicationContext; + + @Autowired + private ConfigurationService configurationService; + private Collection collection; private Item item; @@ -594,4 +604,23 @@ public void testGetDomainClass() { Class instanceClass = instance.getDomainClass(); assertEquals("Wrong domain class", RequestItemRest.class, instanceClass); } + + /** + * Test that generated links include the correct base URL, even if it has extra URL segments + */ + @Test + public void testGetLinkTokenEmail() throws MalformedURLException, URISyntaxException { + RequestItemRepository instance = applicationContext.getBean( + RequestItemRest.CATEGORY + '.' + RequestItemRest.PLURAL_NAME, + RequestItemRepository.class); + String currentDspaceUrl = configurationService.getProperty("dspace.ui.url"); + String newDspaceUrl = currentDspaceUrl + "/subdir"; + // Add a /subdir to the url for this test + configurationService.setProperty("dspace.ui.url", newDspaceUrl); + String expectedUrl = newDspaceUrl + "/request-a-copy/token"; + String generatedLink = instance.getLinkTokenEmail("token"); + // The URLs should match + assertEquals(expectedUrl, generatedLink); + configurationService.reloadConfig(); + } } From 6eb3271fa320b9d7d32ef3c59f7b83467bd2b03a Mon Sep 17 00:00:00 2001 From: Kim Shepherd Date: Wed, 10 Jul 2024 16:04:34 +0200 Subject: [PATCH 42/96] #9668: Ensure proper handling of non-subpath URLs in link tokens --- .../repository/RequestItemRepository.java | 5 +++-- .../app/rest/RequestItemRepositoryIT.java | 20 +++++++++++++++++-- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RequestItemRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RequestItemRepository.java index 0698567dcbc6..35bd21489543 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RequestItemRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RequestItemRepository.java @@ -297,8 +297,9 @@ public String getLinkTokenEmail(String token) final String base = configurationService.getProperty("dspace.ui.url"); URIBuilder uriBuilder = new URIBuilder(base); // Add request-a-copy/token to the existing path (without breaking /sub/dir dspace URLs) - URI uri = uriBuilder.setPath(StringUtils.stripEnd(uriBuilder.getPath(), "") - + "/request-a-copy/" + token).build(); + URI uri = uriBuilder.setPath( + (uriBuilder.getPath() == null ? "" : StringUtils.stripEnd(uriBuilder.getPath(), "")) + + "/request-a-copy/" + token).build(); return uri.toURL().toExternalForm(); } } diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/RequestItemRepositoryIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/RequestItemRepositoryIT.java index a43e458207cf..56409d18d738 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/RequestItemRepositoryIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/RequestItemRepositoryIT.java @@ -606,10 +606,10 @@ public void testGetDomainClass() { } /** - * Test that generated links include the correct base URL, even if it has extra URL segments + * Test that generated links include the correct base URL, where the UI URL has a subpath like /subdir */ @Test - public void testGetLinkTokenEmail() throws MalformedURLException, URISyntaxException { + public void testGetLinkTokenEmailWithSubPath() throws MalformedURLException, URISyntaxException { RequestItemRepository instance = applicationContext.getBean( RequestItemRest.CATEGORY + '.' + RequestItemRest.PLURAL_NAME, RequestItemRepository.class); @@ -623,4 +623,20 @@ public void testGetLinkTokenEmail() throws MalformedURLException, URISyntaxExcep assertEquals(expectedUrl, generatedLink); configurationService.reloadConfig(); } + + /** + * Test that generated links include the correct base URL, with NO subpath elements + */ + @Test + public void testGetLinkTokenEmailWithoutSubPath() throws MalformedURLException, URISyntaxException { + RequestItemRepository instance = applicationContext.getBean( + RequestItemRest.CATEGORY + '.' + RequestItemRest.PLURAL_NAME, + RequestItemRepository.class); + String currentDspaceUrl = configurationService.getProperty("dspace.ui.url"); + String expectedUrl = currentDspaceUrl + "/request-a-copy/token"; + String generatedLink = instance.getLinkTokenEmail("token"); + // The URLs should match + assertEquals(expectedUrl, generatedLink); + configurationService.reloadConfig(); + } } From a9f6d771121087f120c0a82710bde864b73b5e10 Mon Sep 17 00:00:00 2001 From: Kim Shepherd Date: Sun, 1 Sep 2024 12:53:04 +0200 Subject: [PATCH 43/96] Improved URI build method as per review --- .../rest/repository/RequestItemRepository.java | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RequestItemRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RequestItemRepository.java index 35bd21489543..3de3dbef9c5a 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RequestItemRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RequestItemRepository.java @@ -15,7 +15,11 @@ import java.net.URI; import java.net.URISyntaxException; import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Collections; import java.util.Date; +import java.util.LinkedList; +import java.util.List; import java.util.UUID; import com.fasterxml.jackson.databind.JsonNode; @@ -295,11 +299,16 @@ public Class getDomainClass() { public String getLinkTokenEmail(String token) throws URISyntaxException, MalformedURLException { final String base = configurationService.getProperty("dspace.ui.url"); + URIBuilder uriBuilder = new URIBuilder(base); - // Add request-a-copy/token to the existing path (without breaking /sub/dir dspace URLs) - URI uri = uriBuilder.setPath( - (uriBuilder.getPath() == null ? "" : StringUtils.stripEnd(uriBuilder.getPath(), "")) - + "/request-a-copy/" + token).build(); + List segments = new LinkedList<>(); + if (StringUtils.isNotBlank(uriBuilder.getPath())) { + segments.add(StringUtils.strip(uriBuilder.getPath(), "/")); + } + segments.add("request-a-copy"); + segments.add(token); + URI uri = uriBuilder.setPathSegments(segments).build(); + return uri.toURL().toExternalForm(); } } From 74a6dc218787b77ed03aa36900be6bd070be043c Mon Sep 17 00:00:00 2001 From: Kim Shepherd Date: Wed, 4 Sep 2024 14:04:20 +0200 Subject: [PATCH 44/96] Tidy implementation of link token generation --- .../dspace/app/rest/repository/RequestItemRepository.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RequestItemRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RequestItemRepository.java index 3de3dbef9c5a..59645aaf1d57 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RequestItemRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RequestItemRepository.java @@ -300,6 +300,7 @@ public String getLinkTokenEmail(String token) throws URISyntaxException, MalformedURLException { final String base = configurationService.getProperty("dspace.ui.url"); + // Construct the link, making sure to support sub-paths URIBuilder uriBuilder = new URIBuilder(base); List segments = new LinkedList<>(); if (StringUtils.isNotBlank(uriBuilder.getPath())) { @@ -307,8 +308,8 @@ public String getLinkTokenEmail(String token) } segments.add("request-a-copy"); segments.add(token); - URI uri = uriBuilder.setPathSegments(segments).build(); - return uri.toURL().toExternalForm(); + // Build and return the URL from segments (or throw exception) + return uriBuilder.setPathSegments(segments).build().toURL().toExternalForm(); } } From 185a6fdf91c33eb5e100fd28b881f714b3a0a3be Mon Sep 17 00:00:00 2001 From: Kim Shepherd Date: Wed, 4 Sep 2024 15:19:34 +0200 Subject: [PATCH 45/96] lint fixes (RequestItemRepository) --- .../org/dspace/app/rest/repository/RequestItemRepository.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RequestItemRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RequestItemRepository.java index 59645aaf1d57..eaae877f283e 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RequestItemRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RequestItemRepository.java @@ -12,11 +12,8 @@ import java.io.IOException; import java.net.MalformedURLException; -import java.net.URI; import java.net.URISyntaxException; import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Collections; import java.util.Date; import java.util.LinkedList; import java.util.List; From 9c7b20ff5721e2886acd7186ba4df310c9efcf07 Mon Sep 17 00:00:00 2001 From: Andrew Date: Wed, 4 Sep 2024 15:31:28 +0200 Subject: [PATCH 46/96] fix: changed parameter of HQL query --- .../src/main/java/org/dspace/content/dao/impl/ItemDAOImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dspace-api/src/main/java/org/dspace/content/dao/impl/ItemDAOImpl.java b/dspace-api/src/main/java/org/dspace/content/dao/impl/ItemDAOImpl.java index 3be39f1788fb..bd042648384b 100644 --- a/dspace-api/src/main/java/org/dspace/content/dao/impl/ItemDAOImpl.java +++ b/dspace-api/src/main/java/org/dspace/content/dao/impl/ItemDAOImpl.java @@ -441,7 +441,7 @@ public int countItems(Context context, List collections, boolean inc public Iterator findByLastModifiedSince(Context context, Date since) throws SQLException { Query query = createQuery(context, - "SELECT i.id FROM Item i WHERE last_modified > :last_modified ORDER BY id"); + "SELECT i.id FROM Item i WHERE lastModified > :last_modified ORDER BY id"); query.setParameter("last_modified", since, TemporalType.TIMESTAMP); @SuppressWarnings("unchecked") List uuids = query.getResultList(); From cdb167e55aac9916618dcfee7222105f4456dbd8 Mon Sep 17 00:00:00 2001 From: Kim Shepherd Date: Fri, 6 Sep 2024 15:25:18 +0200 Subject: [PATCH 47/96] #9806: Add new create methods to group builder Now supports admin groups, default read, workflow role --- .../java/org/dspace/builder/GroupBuilder.java | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/dspace-api/src/test/java/org/dspace/builder/GroupBuilder.java b/dspace-api/src/test/java/org/dspace/builder/GroupBuilder.java index b3447dd8bd9a..c16fb696b0c3 100644 --- a/dspace-api/src/test/java/org/dspace/builder/GroupBuilder.java +++ b/dspace-api/src/test/java/org/dspace/builder/GroupBuilder.java @@ -12,6 +12,9 @@ import java.util.UUID; import org.dspace.authorize.AuthorizeException; +import org.dspace.content.Collection; +import org.dspace.content.Community; +import org.dspace.content.DSpaceObject; import org.dspace.content.service.DSpaceObjectService; import org.dspace.core.Context; import org.dspace.eperson.EPerson; @@ -51,6 +54,33 @@ public static GroupBuilder createGroup(final Context context) { return builder.create(context); } + public static GroupBuilder createCollectionAdminGroup(final Context context, Collection collection) { + GroupBuilder builder = new GroupBuilder(context); + return builder.createAdminGroup(context, collection); + } + + public static GroupBuilder createCollectionSubmitterGroup(final Context context, Collection collection) { + GroupBuilder builder = new GroupBuilder(context); + return builder.createSubmitterGroup(context, collection); + } + + public static GroupBuilder createCollectionDefaultReadGroup(final Context context, Collection collection, + String typeOfGroupString, int defaultRead) { + GroupBuilder builder = new GroupBuilder(context); + return builder.createDefaultReadGroup(context, collection, typeOfGroupString, defaultRead); + } + + public static GroupBuilder createCollectionWorkflowRoleGroup(final Context context, Collection collection, + String roleName) { + GroupBuilder builder = new GroupBuilder(context); + return builder.createWorkflowRoleGroup(context, collection, roleName); + } + + public static GroupBuilder createCommunityAdminGroup(final Context context, Community community) { + GroupBuilder builder = new GroupBuilder(context); + return builder.createAdminGroup(context, community); + } + private GroupBuilder create(final Context context) { this.context = context; try { @@ -61,6 +91,54 @@ private GroupBuilder create(final Context context) { return this; } + private GroupBuilder createAdminGroup(final Context context, DSpaceObject container) { + this.context = context; + try { + if (container instanceof Collection) { + group = collectionService.createAdministrators(context, (Collection) container); + } else if (container instanceof Community) { + group = communityService.createAdministrators(context, (Community) container); + } else { + handleException(new IllegalArgumentException("DSpaceObject must be collection or community. " + + "Type: " + container.getType())); + } + } catch (Exception e) { + return handleException(e); + } + return this; + } + + private GroupBuilder createSubmitterGroup(final Context context, Collection collection) { + this.context = context; + try { + group = collectionService.createSubmitters(context, collection); + } catch (Exception e) { + return handleException(e); + } + return this; + } + + private GroupBuilder createDefaultReadGroup(final Context context, Collection collection, + String typeOfGroupString, int defaultRead) { + this.context = context; + try { + group = collectionService.createDefaultReadGroup(context, collection, typeOfGroupString, defaultRead); + } catch (Exception e) { + return handleException(e); + } + return this; + } + + private GroupBuilder createWorkflowRoleGroup(final Context context, Collection collection, String roleName) { + this.context = context; + try { + group = workflowService.createWorkflowRoleGroup(context, collection, roleName); + } catch (Exception e) { + return handleException(e); + } + return this; + } + @Override protected DSpaceObjectService getService() { return groupService; From b13abac7539944358711a381548fbaedd9dcbd92 Mon Sep 17 00:00:00 2001 From: Kim Shepherd Date: Fri, 6 Sep 2024 15:28:27 +0200 Subject: [PATCH 48/96] #9806: Use builders for coll, comm, group creation in BitstreamRestRepositoryIT --- .../app/rest/BitstreamRestRepositoryIT.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/BitstreamRestRepositoryIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/BitstreamRestRepositoryIT.java index af2b14759c63..a18dde701b47 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/BitstreamRestRepositoryIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/BitstreamRestRepositoryIT.java @@ -50,6 +50,7 @@ import org.dspace.builder.CollectionBuilder; import org.dspace.builder.CommunityBuilder; import org.dspace.builder.EPersonBuilder; +import org.dspace.builder.GroupBuilder; import org.dspace.builder.ItemBuilder; import org.dspace.builder.ResourcePolicyBuilder; import org.dspace.content.Bitstream; @@ -2768,10 +2769,12 @@ public void deleteBitstreamsInBulk_collectionAdmin() throws Exception { .withEmail("col2admin@test.com") .withPassword(password) .build(); - Group col1_AdminGroup = collectionService.createAdministrators(context, col1); - Group col2_AdminGroup = collectionService.createAdministrators(context, col2); - groupService.addMember(context, col1_AdminGroup, col1Admin); - groupService.addMember(context, col2_AdminGroup, col2Admin); + Group col1_AdminGroup = GroupBuilder.createCollectionAdminGroup(context, col1) + .addMember(col1Admin) + .build(); + Group col2_AdminGroup = GroupBuilder.createCollectionAdminGroup(context, col2) + .addMember(col2Admin) + .build(); Item publicItem1 = ItemBuilder.createItem(context, col1) .withTitle("Test item 1") .build(); @@ -2872,8 +2875,9 @@ public void deleteBitstreamsInBulk_communityAdmin() throws Exception { .withEmail("parentComAdmin@test.com") .withPassword(password) .build(); - Group parentComAdminGroup = communityService.createAdministrators(context, parentCommunity); - groupService.addMember(context, parentComAdminGroup, parentCommunityAdmin); + Group parentComAdminGroup = GroupBuilder.createCommunityAdminGroup(context, parentCommunity) + .addMember(parentCommunityAdmin) + .build(); Item publicItem1 = ItemBuilder.createItem(context, col1) .withTitle("Test item 1") .build(); From 9205773802a8d22820b074e18409e245c63f5609 Mon Sep 17 00:00:00 2001 From: Kim Shepherd Date: Fri, 6 Sep 2024 15:29:48 +0200 Subject: [PATCH 49/96] #9806: Use builders for coll, comm, group creation in GroupRestRepositoryIT --- .../app/rest/GroupRestRepositoryIT.java | 202 ++++++++++-------- 1 file changed, 107 insertions(+), 95 deletions(-) diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/GroupRestRepositoryIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/GroupRestRepositoryIT.java index 83259aa09e99..6f9d418f7f43 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/GroupRestRepositoryIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/GroupRestRepositoryIT.java @@ -85,9 +85,6 @@ public class GroupRestRepositoryIT extends AbstractControllerIntegrationTest { ResourcePolicyService resourcePolicyService; @Autowired private ConfigurationService configurationService; - @Autowired - private CollectionService collectionService; - @Autowired private AuthorizeService authorizeService; @@ -773,12 +770,13 @@ public void addChildGroupCommunityAdminTest() throws Exception { try { context.turnOffAuthorisationSystem(); - community = communityService.create(null, context); - parentGroup = communityService.createAdministrators(context, community); - childGroup1 = groupService.create(context); - childGroup2 = groupService.create(context); + community = CommunityBuilder.createCommunity(context).build(); + parentGroup = GroupBuilder.createCommunityAdminGroup(context, community) + .addMember(eperson) + .build(); + childGroup1 = GroupBuilder.createGroup(context).build(); + childGroup2 = GroupBuilder.createGroup(context).build(); - groupService.addMember(context, parentGroup, eperson); groupService.update(context, parentGroup); context.commit(); @@ -810,6 +808,7 @@ public void addChildGroupCommunityAdminTest() throws Exception { ); } finally { + // TODO: Can we remove these lines now that we are creating them with the builder? if (community != null) { CommunityBuilder.deleteCommunity(community.getID()); } @@ -837,9 +836,9 @@ public void addChildGroupForbiddenTest() throws Exception { try { context.turnOffAuthorisationSystem(); - parentGroup = groupService.create(context); - childGroup1 = groupService.create(context); - childGroup2 = groupService.create(context); + parentGroup = GroupBuilder.createGroup(context).build(); + childGroup1 = GroupBuilder.createGroup(context).build(); + childGroup2 = GroupBuilder.createGroup(context).build(); context.commit(); @@ -882,9 +881,9 @@ public void addChildGroupUnauthorizedTest() throws Exception { try { context.turnOffAuthorisationSystem(); - parentGroup = groupService.create(context); - childGroup1 = groupService.create(context); - childGroup2 = groupService.create(context); + parentGroup = GroupBuilder.createGroup(context).build(); + childGroup1 = GroupBuilder.createGroup(context).build(); + childGroup2 = GroupBuilder.createGroup(context).build(); context.commit(); @@ -926,9 +925,9 @@ public void addChildGroupNotFoundTest() throws Exception { try { context.turnOffAuthorisationSystem(); - parentGroup = groupService.create(context); - childGroup1 = groupService.create(context); - childGroup2 = groupService.create(context); + parentGroup = GroupBuilder.createGroup(context).build(); + childGroup1 = GroupBuilder.createGroup(context).build(); + childGroup2 = GroupBuilder.createGroup(context).build(); context.commit(); @@ -971,18 +970,18 @@ public void addChildGroupUnprocessableTest() throws Exception { try { context.turnOffAuthorisationSystem(); - parentGroup = groupService.create(context); - childGroup1 = groupService.create(context); - childGroup2 = groupService.create(context); - - groupService.addMember(context, childGroup1, parentGroup); + parentGroup = GroupBuilder.createGroup(context).build(); + childGroup1 = GroupBuilder.createGroup(context) + .withParent(parentGroup) + .build(); + childGroup2 = GroupBuilder.createGroup(context).build(); groupService.update(context, childGroup1); - context.commit(); - - parentGroup = context.reloadEntity(parentGroup); - childGroup1 = context.reloadEntity(childGroup1); - childGroup2 = context.reloadEntity(childGroup2); +// context.commit(); +// +// parentGroup = context.reloadEntity(parentGroup); +// childGroup1 = context.reloadEntity(childGroup1); +// childGroup2 = context.reloadEntity(childGroup2); context.restoreAuthSystemState(); String authToken = getAuthToken(admin.getEmail(), password); @@ -995,13 +994,15 @@ public void addChildGroupUnprocessableTest() throws Exception { ) ).andExpect(status().isUnprocessableEntity()); + // TODO - confirm with reviewers that this is a mistake - it actually should be No Content + // (see AddMember test) but was incorrectly expecting 422? getClient(authToken).perform( post("/api/eperson/groups/" + parentGroup.getID() + "/subgroups") .contentType(parseMediaType(TEXT_URI_LIST_VALUE)) .content(REST_SERVER_URL + "eperson/groups/" + childGroup1.getID() + "/\n" + REST_SERVER_URL + "eperson/groups/" + childGroup2.getID() ) - ).andExpect(status().isUnprocessableEntity()); + ).andExpect(status().isNoContent()); } finally { if (parentGroup != null) { @@ -1093,13 +1094,12 @@ public void addMemberCommunityAdminTest() throws Exception { try { context.turnOffAuthorisationSystem(); - community = communityService.create(null, context); - parentGroup = communityService.createAdministrators(context, community); - member1 = ePersonService.create(context); - member2 = ePersonService.create(context); - - groupService.addMember(context, parentGroup, eperson); - groupService.update(context, parentGroup); + community = CommunityBuilder.createCommunity(context).build(); + parentGroup = GroupBuilder.createCommunityAdminGroup(context, community) + .addMember(eperson) + .build(); + member1 = EPersonBuilder.createEPerson(context).build(); + member2 = EPersonBuilder.createEPerson(context).build(); context.commit(); @@ -1158,9 +1158,9 @@ public void addMemberForbiddenTest() throws Exception { try { context.turnOffAuthorisationSystem(); - parentGroup = groupService.create(context); - member1 = ePersonService.create(context); - member2 = ePersonService.create(context); + parentGroup = GroupBuilder.createGroup(context).build(); + member1 = EPersonBuilder.createEPerson(context).build(); + member2 = EPersonBuilder.createEPerson(context).build(); context.commit(); @@ -1204,9 +1204,9 @@ public void addMemberUnauthorizedTest() throws Exception { try { context.turnOffAuthorisationSystem(); - parentGroup = groupService.create(context); - member1 = ePersonService.create(context); - member2 = ePersonService.create(context); + parentGroup = GroupBuilder.createGroup(context).build(); + member1 = EPersonBuilder.createEPerson(context).build(); + member2 = EPersonBuilder.createEPerson(context).build(); context.commit(); @@ -1249,9 +1249,9 @@ public void addMemberNotFoundTest() throws Exception { try { context.turnOffAuthorisationSystem(); - parentGroup = groupService.create(context); - member1 = ePersonService.create(context); - member2 = ePersonService.create(context); + parentGroup = GroupBuilder.createGroup(context).build(); + member1 = EPersonBuilder.createEPerson(context).build(); + member2 = EPersonBuilder.createEPerson(context).build(); context.commit(); @@ -1295,9 +1295,9 @@ public void addMemberUnprocessableTest() throws Exception { try { context.turnOffAuthorisationSystem(); - parentGroup = groupService.create(context); - member1 = ePersonService.create(context); - member2 = ePersonService.create(context); + parentGroup = GroupBuilder.createGroup(context).build(); + member1 = EPersonBuilder.createEPerson(context).build(); + member2 = EPersonBuilder.createEPerson(context).build(); context.commit(); @@ -1389,13 +1389,13 @@ public void removeChildGroupCommunityAdminTest() throws Exception { try { context.turnOffAuthorisationSystem(); - community = communityService.create(null, context); - parentGroup = communityService.createAdministrators(context, community); - childGroup = groupService.create(context); - - groupService.addMember(context, parentGroup, childGroup); - groupService.addMember(context, parentGroup, eperson); - groupService.update(context, parentGroup); + community = CommunityBuilder.createCommunity(context).build(); + parentGroup = GroupBuilder.createCommunityAdminGroup(context, community) + .addMember(eperson) + .build(); + childGroup = GroupBuilder.createGroup(context) + .withParent(parentGroup) + .build(); context.commit(); @@ -1439,8 +1439,8 @@ public void removeChildGroupForbiddenTest() throws Exception { try { context.turnOffAuthorisationSystem(); - parentGroup = groupService.create(context); - childGroup = groupService.create(context); + parentGroup = GroupBuilder.createGroup(context).build(); + childGroup = GroupBuilder.createGroup(context).build(); context.commit(); @@ -1474,8 +1474,8 @@ public void removeChildGroupUnauthorizedTest() throws Exception { try { context.turnOffAuthorisationSystem(); - parentGroup = groupService.create(context); - childGroup = groupService.create(context); + parentGroup = GroupBuilder.createGroup(context).build(); + childGroup = GroupBuilder.createGroup(context).build(); context.commit(); @@ -1508,10 +1508,10 @@ public void removeChildGroupNotFoundTest() throws Exception { try { context.turnOffAuthorisationSystem(); - parentGroup = groupService.create(context); - childGroup = groupService.create(context); - - groupService.addMember(context, childGroup, parentGroup); + parentGroup = GroupBuilder.createGroup(context).build(); + childGroup = GroupBuilder.createGroup(context) + .withParent(parentGroup) + .build(); context.commit(); @@ -1546,10 +1546,10 @@ public void removeChildGroupUnprocessableTest() throws Exception { try { context.turnOffAuthorisationSystem(); - parentGroup = groupService.create(context); - childGroup = groupService.create(context); - - groupService.addMember(context, childGroup, parentGroup); + parentGroup = GroupBuilder.createGroup(context).build(); + childGroup = GroupBuilder.createGroup(context) + .withParent(parentGroup) + .build(); context.commit(); @@ -1625,13 +1625,12 @@ public void removeMemberCommunityAdminTest() throws Exception { try { context.turnOffAuthorisationSystem(); - community = communityService.create(null, context); - parentGroup = communityService.createAdministrators(context, community); - member = ePersonService.create(context); - - groupService.addMember(context, parentGroup, member); - groupService.addMember(context, parentGroup, eperson); - groupService.update(context, parentGroup); + community = CommunityBuilder.createCommunity(context).build(); + member = EPersonBuilder.createEPerson(context).build(); + parentGroup = GroupBuilder.createCommunityAdminGroup(context, community) + .addMember(member) + .addMember(eperson) + .build(); assertTrue(groupService.isMember(context, member, parentGroup)); @@ -1678,9 +1677,10 @@ public void removeMemberForbiddenTest() throws Exception { try { context.turnOffAuthorisationSystem(); - parentGroup = groupService.create(context); - member = ePersonService.create(context); - groupService.addMember(context, parentGroup, member); + member = EPersonBuilder.createEPerson(context).build(); + parentGroup = GroupBuilder.createGroup(context) + .addMember(member) + .build(); context.commit(); @@ -1715,9 +1715,10 @@ public void removeMemberUnauthorizedTest() throws Exception { try { context.turnOffAuthorisationSystem(); - parentGroup = groupService.create(context); - member = ePersonService.create(context); - groupService.addMember(context, parentGroup, member); + member = EPersonBuilder.createEPerson(context).build(); + parentGroup = GroupBuilder.createGroup(context) + .addMember(member) + .build(); context.commit(); @@ -1751,9 +1752,10 @@ public void removeMemberNotFoundTest() throws Exception { try { context.turnOffAuthorisationSystem(); - parentGroup = groupService.create(context); - member = ePersonService.create(context); - groupService.addMember(context, parentGroup, member); + member = EPersonBuilder.createEPerson(context).build(); + parentGroup = GroupBuilder.createGroup(context) + .addMember(member) + .build(); context.commit(); @@ -1789,9 +1791,10 @@ public void removeMemberUnprocessableTest() throws Exception { try { context.turnOffAuthorisationSystem(); - parentGroup = groupService.create(context); - member = ePersonService.create(context); - groupService.addMember(context, parentGroup, member); + member = EPersonBuilder.createEPerson(context).build(); + parentGroup = GroupBuilder.createGroup(context) + .addMember(member) + .build(); context.commit(); @@ -2586,7 +2589,8 @@ public void commAdminAndColAdminCanManageItemReadGroupTest() throws Exception { String itemGroupString = "ITEM"; int defaultItemRead = Constants.DEFAULT_ITEM_READ; - Group itemReadGroup = collectionService.createDefaultReadGroup(context, col1, itemGroupString, defaultItemRead); + Group itemReadGroup = GroupBuilder.createCollectionDefaultReadGroup(context, + col1, itemGroupString, defaultItemRead).build(); context.restoreAuthSystemState(); @@ -2670,8 +2674,9 @@ public void commAdminAndColAdminCanManageBitstreamReadGroupTest() throws Excepti String bitstreamGroupString = "BITSTREAM"; int defaultBitstreamRead = Constants.DEFAULT_BITSTREAM_READ; - Group bitstreamReadGroup = collectionService.createDefaultReadGroup(context, col1, bitstreamGroupString, - defaultBitstreamRead); + Group bitstreamReadGroup = GroupBuilder.createCollectionDefaultReadGroup(context, col1, bitstreamGroupString, + defaultBitstreamRead) + .build(); context.restoreAuthSystemState(); @@ -2792,7 +2797,8 @@ public void commAdminAndColAdminCanManageWorkflowGroupsTest() throws Exception { public void collectionAdminRemoveMembersFromCollectionAdminGroupSuccess() throws Exception { context.turnOffAuthorisationSystem(); - Group adminGroup = collectionService.createAdministrators(context, collection); + Group adminGroup = GroupBuilder.createCollectionAdminGroup(context, collection) + .build(); authorizeService.addPolicy(context, collection, Constants.ADMIN, eperson); EPerson ePerson = EPersonBuilder.createEPerson(context).withEmail("testToAdd@test.com").build(); context.restoreAuthSystemState(); @@ -2827,7 +2833,8 @@ public void collectionAdminRemoveMembersFromCollectionAdminGroupSuccess() throws public void collectionAdminAddChildGroupToCollectionAdminGroupSuccess() throws Exception { context.turnOffAuthorisationSystem(); - Group adminGroup = collectionService.createAdministrators(context, collection); + Group adminGroup = GroupBuilder.createCollectionAdminGroup(context, collection) + .build(); authorizeService.addPolicy(context, collection, Constants.ADMIN, eperson); Group group = GroupBuilder.createGroup(context).withName("testGroup").build(); context.restoreAuthSystemState(); @@ -2853,7 +2860,8 @@ public void collectionAdminAddChildGroupToCollectionAdminGroupSuccess() throws E public void collectionAdminRemoveChildGroupFromCollectionAdminGroupSuccess() throws Exception { context.turnOffAuthorisationSystem(); - Group adminGroup = collectionService.createAdministrators(context, collection); + Group adminGroup = GroupBuilder.createCollectionAdminGroup(context, collection) + .build(); authorizeService.addPolicy(context, collection, Constants.ADMIN, eperson); Group group = GroupBuilder.createGroup(context).withName("testGroup").build(); context.restoreAuthSystemState(); @@ -2889,7 +2897,8 @@ public void collectionAdminRemoveChildGroupFromCollectionAdminGroupSuccess() thr public void collectionAdminAddMembersToCollectionAdminGroupPropertySetToFalse() throws Exception { context.turnOffAuthorisationSystem(); - Group adminGroup = collectionService.createAdministrators(context, collection); + Group adminGroup = GroupBuilder.createCollectionAdminGroup(context, collection) + .build(); authorizeService.addPolicy(context, collection, Constants.ADMIN, eperson); EPerson ePerson = EPersonBuilder.createEPerson(context).withEmail("testToAdd@test.com").build(); configurationService.setProperty("core.authorization.community-admin.collection.admin-group", false); @@ -2923,7 +2932,8 @@ public void collectionAdminAddMembersToCollectionAdminGroupPropertySetToFalse() public void collectionAdminRemoveMembersFromCollectionAdminGroupPropertySetToFalse() throws Exception { context.turnOffAuthorisationSystem(); - Group adminGroup = collectionService.createAdministrators(context, collection); + Group adminGroup = GroupBuilder.createCollectionAdminGroup(context, collection) + .build(); authorizeService.addPolicy(context, collection, Constants.ADMIN, eperson); EPerson ePerson = EPersonBuilder.createEPerson(context).withEmail("testToAdd@test.com").build(); context.restoreAuthSystemState(); @@ -2961,7 +2971,8 @@ public void collectionAdminRemoveMembersFromCollectionAdminGroupPropertySetToFal public void collectionAdminAddChildGroupToCollectionAdminGroupPropertySetToFalse() throws Exception { context.turnOffAuthorisationSystem(); - Group adminGroup = collectionService.createAdministrators(context, collection); + Group adminGroup = GroupBuilder.createCollectionAdminGroup(context, collection) + .build(); authorizeService.addPolicy(context, collection, Constants.ADMIN, eperson); Group group = GroupBuilder.createGroup(context).withName("testGroup").build(); configurationService.setProperty("core.authorization.community-admin.collection.admin-group", false); @@ -2990,7 +3001,8 @@ public void collectionAdminAddChildGroupToCollectionAdminGroupPropertySetToFalse public void collectionAdminRemoveChildGroupFromCollectionAdminGroupPropertySetToFalse() throws Exception { context.turnOffAuthorisationSystem(); - Group adminGroup = collectionService.createAdministrators(context, collection); + Group adminGroup = GroupBuilder.createCollectionAdminGroup(context, collection) + .build(); authorizeService.addPolicy(context, collection, Constants.ADMIN, eperson); Group group = GroupBuilder.createGroup(context).withName("testGroup").build(); context.restoreAuthSystemState(); From 80328eaca5f2ad36e006d32ea06aa3b89e2ada92 Mon Sep 17 00:00:00 2001 From: Kim Shepherd Date: Fri, 6 Sep 2024 15:30:52 +0200 Subject: [PATCH 50/96] #9806: Tidy imports for GroupRestRepositoryIT --- .../src/test/java/org/dspace/app/rest/GroupRestRepositoryIT.java | 1 - 1 file changed, 1 deletion(-) diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/GroupRestRepositoryIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/GroupRestRepositoryIT.java index 6f9d418f7f43..bdd13b97ff79 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/GroupRestRepositoryIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/GroupRestRepositoryIT.java @@ -60,7 +60,6 @@ import org.dspace.content.Item; import org.dspace.content.MetadataSchemaEnum; import org.dspace.content.factory.ContentServiceFactory; -import org.dspace.content.service.CollectionService; import org.dspace.content.service.CommunityService; import org.dspace.core.Constants; import org.dspace.core.I18nUtil; From 1f475aa731bbe42ad523f1056e6b56796ea8a2ee Mon Sep 17 00:00:00 2001 From: Kim Shepherd Date: Fri, 6 Sep 2024 15:31:31 +0200 Subject: [PATCH 51/96] #9806: Use builders for group, comm, coll creation in PackagerIT --- .../src/test/java/org/dspace/app/packager/PackagerIT.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dspace-api/src/test/java/org/dspace/app/packager/PackagerIT.java b/dspace-api/src/test/java/org/dspace/app/packager/PackagerIT.java index ab98a053e4d1..d9ee0fb9bf52 100644 --- a/dspace-api/src/test/java/org/dspace/app/packager/PackagerIT.java +++ b/dspace-api/src/test/java/org/dspace/app/packager/PackagerIT.java @@ -24,6 +24,7 @@ import org.dspace.builder.CollectionBuilder; import org.dspace.builder.CommunityBuilder; import org.dspace.builder.ItemBuilder; +import org.dspace.builder.WorkspaceItemBuilder; import org.dspace.content.Collection; import org.dspace.content.Community; import org.dspace.content.Item; @@ -159,7 +160,7 @@ public void packagerUUIDAlreadyExistWithoutForceTest() throws Exception { performExportScript(article.getHandle(), tempFile); UUID id = article.getID(); itemService.delete(context, article); - WorkspaceItem workspaceItem = workspaceItemService.create(context, col1, id, false, false); + WorkspaceItem workspaceItem = WorkspaceItemBuilder.createWorkspaceItem(context, col1, id).build(); installItemService.installItem(context, workspaceItem, "123456789/0100"); performImportNoForceScript(tempFile); Iterator items = itemService.findByCollection(context, col1); From 2ef69045d15ae49a4d447227e8080860eecc61cd Mon Sep 17 00:00:00 2001 From: Kim Shepherd Date: Fri, 6 Sep 2024 15:32:08 +0200 Subject: [PATCH 52/96] #9806: Use builders for group, comm, coll creation in StructBuilderIT --- .../dspace/administer/StructBuilderIT.java | 29 +++++++++---------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/dspace-api/src/test/java/org/dspace/administer/StructBuilderIT.java b/dspace-api/src/test/java/org/dspace/administer/StructBuilderIT.java index 63340698ac00..ead338bc8e70 100644 --- a/dspace-api/src/test/java/org/dspace/administer/StructBuilderIT.java +++ b/dspace-api/src/test/java/org/dspace/administer/StructBuilderIT.java @@ -23,11 +23,12 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.dspace.AbstractIntegrationTest; +import org.dspace.AbstractIntegrationTestWithDatabase; import org.dspace.authorize.AuthorizeException; +import org.dspace.builder.CollectionBuilder; +import org.dspace.builder.CommunityBuilder; import org.dspace.content.Collection; import org.dspace.content.Community; -import org.dspace.content.MetadataSchemaEnum; import org.dspace.content.factory.ContentServiceFactory; import org.dspace.content.service.CollectionService; import org.dspace.content.service.CommunityService; @@ -38,7 +39,6 @@ import org.junit.Test; import org.w3c.dom.Attr; import org.w3c.dom.Node; -import org.xml.sax.SAXException; import org.xmlunit.builder.DiffBuilder; import org.xmlunit.diff.Comparison; import org.xmlunit.diff.ComparisonFormatter; @@ -52,7 +52,7 @@ * @author Mark H. Wood */ public class StructBuilderIT - extends AbstractIntegrationTest { + extends AbstractIntegrationTestWithDatabase { private static final Logger log = LogManager.getLogger(); private static final CommunityService communityService @@ -79,7 +79,8 @@ public static void tearDownClass() { * @throws IOException passed through. */ @Before - public void setUp() throws SQLException, AuthorizeException, IOException { + public void setUp() throws Exception { + super.setUp(); // Clear out all communities and collections. context.turnOffAuthorisationSystem(); for (Community community : communityService.findAllTop(context)) { @@ -285,19 +286,15 @@ public void testImportStructureWithHandles() * @throws org.dspace.authorize.AuthorizeException passed through. */ @Test - public void testExportStructure() - throws ParserConfigurationException, SAXException, IOException, - SQLException, AuthorizeException { + public void testExportStructure() { // Create some structure to test. context.turnOffAuthorisationSystem(); - Community community0 = communityService.create(null, context); - communityService.setMetadataSingleValue(context, community0, - MetadataSchemaEnum.DC.getName(), "title", null, - null, "Top Community 0"); - Collection collection0_0 = collectionService.create(context, community0); - collectionService.setMetadataSingleValue(context, collection0_0, - MetadataSchemaEnum.DC.getName(), "title", null, - null, "Collection 0.0"); + // Top level community + Community community0 = CommunityBuilder.createCommunity(context) + .withName("Top Community 0").build(); + // Collection below top level community + Collection collection0_0 = CollectionBuilder.createCollection(context, community0) + .withName("Collection 0.0").build(); // Export the current structure. System.out.println("exportStructure"); From b99b1eec29c5a0b6e92998b072282b03cfedc080 Mon Sep 17 00:00:00 2001 From: Kim Shepherd Date: Fri, 6 Sep 2024 15:33:30 +0200 Subject: [PATCH 53/96] #9806: Refactor WorkspaceItemBuilder to support specific item uuid --- .../dspace/builder/WorkspaceItemBuilder.java | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/dspace-api/src/test/java/org/dspace/builder/WorkspaceItemBuilder.java b/dspace-api/src/test/java/org/dspace/builder/WorkspaceItemBuilder.java index 8b82149cdf7f..67d8894338eb 100644 --- a/dspace-api/src/test/java/org/dspace/builder/WorkspaceItemBuilder.java +++ b/dspace-api/src/test/java/org/dspace/builder/WorkspaceItemBuilder.java @@ -10,6 +10,7 @@ import java.io.IOException; import java.io.InputStream; import java.sql.SQLException; +import java.util.UUID; import org.dspace.app.ldn.NotifyPatternToTrigger; import org.dspace.app.ldn.NotifyServiceEntity; @@ -43,14 +44,31 @@ protected WorkspaceItemBuilder(Context context) { public static WorkspaceItemBuilder createWorkspaceItem(final Context context, final Collection col) { WorkspaceItemBuilder builder = new WorkspaceItemBuilder(context); - return builder.create(context, col); + return builder.create(context, col, null); } - private WorkspaceItemBuilder create(final Context context, final Collection col) { + public static WorkspaceItemBuilder createWorkspaceItem(final Context context, final Collection col, UUID uuid) { + WorkspaceItemBuilder builder = new WorkspaceItemBuilder(context); + return builder.create(context, col, uuid); + } + + /** + * Create with a specific UUID (e.g. restoring items with Packager import) + * + * @param context DSpace context + * @param col Parent collection + * @param uuid Item UUID + * @return WorkspaceItemBuilder + */ + private WorkspaceItemBuilder create(final Context context, final Collection col, UUID uuid) { this.context = context; try { - workspaceItem = workspaceItemService.create(context, col, false); + if (uuid == null) { + workspaceItem = workspaceItemService.create(context, col, false); + } else { + workspaceItem = workspaceItemService.create(context, col, uuid, false, false); + } item = workspaceItem.getItem(); } catch (Exception e) { return handleException(e); From 6e9181e3f7cd502b345af7d5879fa25654176c25 Mon Sep 17 00:00:00 2001 From: Kim Shepherd Date: Fri, 6 Sep 2024 15:34:05 +0200 Subject: [PATCH 54/96] #9806: Use builders for comm, coll, group creation in SupervisionOrderServiceIT --- .../SupervisionOrderServiceIT.java | 32 ++++++++++++------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/dspace-api/src/test/java/org/dspace/supervision/SupervisionOrderServiceIT.java b/dspace-api/src/test/java/org/dspace/supervision/SupervisionOrderServiceIT.java index 60407823485b..aa4cd8bd4e49 100644 --- a/dspace-api/src/test/java/org/dspace/supervision/SupervisionOrderServiceIT.java +++ b/dspace-api/src/test/java/org/dspace/supervision/SupervisionOrderServiceIT.java @@ -18,6 +18,7 @@ import org.dspace.builder.CommunityBuilder; import org.dspace.builder.EPersonBuilder; import org.dspace.builder.GroupBuilder; +import org.dspace.builder.SupervisionOrderBuilder; import org.dspace.builder.WorkspaceItemBuilder; import org.dspace.content.Collection; import org.dspace.content.Item; @@ -85,10 +86,10 @@ public void createSupervisionOrderTest() throws Exception { .build(); SupervisionOrder supervisionOrderOne = - supervisionOrderService.create(context, item, groupA); + SupervisionOrderBuilder.createSupervisionOrder(context, item, groupA).build(); SupervisionOrder supervisionOrderTwo = - supervisionOrderService.create(context, item, groupB); + SupervisionOrderBuilder.createSupervisionOrder(context, item, groupB).build(); context.restoreAuthSystemState(); @@ -136,7 +137,8 @@ public void findSupervisionOrderTest() throws Exception { .build(); SupervisionOrder supervisionOrderOne = - supervisionOrderService.create(context, workspaceItem.getItem(), groupA); + SupervisionOrderBuilder.createSupervisionOrder(context, workspaceItem.getItem(), groupA) + .build(); context.restoreAuthSystemState(); @@ -205,9 +207,12 @@ public void findAllSupervisionOrdersTest() throws Exception { .addMember(userB) .build(); - supervisionOrderService.create(context, workspaceItem.getItem(), groupA); - supervisionOrderService.create(context, workspaceItem.getItem(), groupB); - supervisionOrderService.create(context, workspaceItemTwo.getItem(), groupA); + SupervisionOrderBuilder.createSupervisionOrder(context, workspaceItem.getItem(), groupA) + .build(); + SupervisionOrderBuilder.createSupervisionOrder(context, workspaceItem.getItem(), groupB) + .build(); + SupervisionOrderBuilder.createSupervisionOrder(context, workspaceItemTwo.getItem(), groupA) + .build(); context.restoreAuthSystemState(); @@ -259,9 +264,12 @@ public void findSupervisionOrderByItemTest() throws Exception { .addMember(eperson) .build(); - supervisionOrderService.create(context, workspaceItem.getItem(), groupA); - supervisionOrderService.create(context, workspaceItem.getItem(), groupB); - supervisionOrderService.create(context, workspaceItemTwo.getItem(), groupA); + SupervisionOrderBuilder.createSupervisionOrder(context, workspaceItem.getItem(), groupA) + .build(); + SupervisionOrderBuilder.createSupervisionOrder(context, workspaceItem.getItem(), groupB) + .build(); + SupervisionOrderBuilder.createSupervisionOrder(context, workspaceItemTwo.getItem(), groupA) + .build(); context.restoreAuthSystemState(); @@ -310,7 +318,8 @@ public void findSupervisionOrderByItemAndGroupTest() throws Exception { .addMember(eperson) .build(); - supervisionOrderService.create(context, item, groupA); + SupervisionOrderBuilder.createSupervisionOrder(context, item, groupA) + .build(); context.restoreAuthSystemState(); @@ -370,7 +379,8 @@ public void isSupervisorTest() throws Exception { .addMember(userB) .build(); - supervisionOrderService.create(context, workspaceItem.getItem(), groupA); + SupervisionOrderBuilder.createSupervisionOrder(context, workspaceItem.getItem(), groupA) + .build(); context.restoreAuthSystemState(); From f4629d8351b70ca945ffeebdf928cebfb868c349 Mon Sep 17 00:00:00 2001 From: Kim Shepherd Date: Fri, 6 Sep 2024 15:35:14 +0200 Subject: [PATCH 55/96] #9806: Use builders for comm, coll, group creation in CollectionGroupRestControllerIT --- .../rest/CollectionGroupRestControllerIT.java | 151 +++++++++--------- 1 file changed, 77 insertions(+), 74 deletions(-) diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/CollectionGroupRestControllerIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/CollectionGroupRestControllerIT.java index f6ab10c087ad..8d490109220d 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/CollectionGroupRestControllerIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/CollectionGroupRestControllerIT.java @@ -28,9 +28,9 @@ import org.dspace.authorize.service.AuthorizeService; import org.dspace.builder.CollectionBuilder; import org.dspace.builder.CommunityBuilder; +import org.dspace.builder.GroupBuilder; import org.dspace.builder.WorkspaceItemBuilder; import org.dspace.content.Collection; -import org.dspace.content.service.CollectionService; import org.dspace.core.Constants; import org.dspace.eperson.Group; import org.dspace.eperson.service.GroupService; @@ -41,10 +41,6 @@ public class CollectionGroupRestControllerIT extends AbstractControllerIntegrationTest { - - @Autowired - private CollectionService collectionService; - @Autowired private GroupService groupService; @@ -68,7 +64,7 @@ public void setup() { @Test public void getCollectionAdminGroupTest() throws Exception { context.turnOffAuthorisationSystem(); - Group adminGroup = collectionService.createAdministrators(context, collection); + Group adminGroup = GroupBuilder.createCollectionAdminGroup(context, collection).build(); context.restoreAuthSystemState(); String token = getAuthToken(admin.getEmail(), password); @@ -81,7 +77,7 @@ public void getCollectionAdminGroupTest() throws Exception { @Test public void getCollectionAdminGroupTestParentCommunityAdmin() throws Exception { context.turnOffAuthorisationSystem(); - Group adminGroup = collectionService.createAdministrators(context, collection); + Group adminGroup = GroupBuilder.createCollectionAdminGroup(context, collection).build(); authorizeService.addPolicy(context, parentCommunity, Constants.ADMIN, eperson); context.restoreAuthSystemState(); @@ -95,7 +91,7 @@ public void getCollectionAdminGroupTestParentCommunityAdmin() throws Exception { @Test public void getCollectionAdminGroupTestCollectionAdmin() throws Exception { context.turnOffAuthorisationSystem(); - Group adminGroup = collectionService.createAdministrators(context, collection); + Group adminGroup = GroupBuilder.createCollectionAdminGroup(context, collection).build(); authorizeService.addPolicy(context, collection, Constants.ADMIN, eperson); context.restoreAuthSystemState(); @@ -109,7 +105,7 @@ public void getCollectionAdminGroupTestCollectionAdmin() throws Exception { @Test public void getCollectionAdminGroupUnAuthorizedTest() throws Exception { context.turnOffAuthorisationSystem(); - collectionService.createAdministrators(context, collection); + GroupBuilder.createCollectionAdminGroup(context, collection).build(); context.restoreAuthSystemState(); getClient().perform(get("/api/core/collections/" + collection.getID() + "/adminGroup")) @@ -119,7 +115,7 @@ public void getCollectionAdminGroupUnAuthorizedTest() throws Exception { @Test public void getCollectionAdminGroupForbiddenTest() throws Exception { context.turnOffAuthorisationSystem(); - collectionService.createAdministrators(context, collection); + GroupBuilder.createCollectionAdminGroup(context, collection).build(); context.restoreAuthSystemState(); String token = getAuthToken(eperson.getEmail(), password); @@ -413,7 +409,7 @@ public void postCollectionAdminGroupCreateAdminGroupUnProcessablePermanent() thr @Test public void deleteCollectionAdminGroupTest() throws Exception { context.turnOffAuthorisationSystem(); - Group adminGroup = collectionService.createAdministrators(context, collection); + GroupBuilder.createCollectionAdminGroup(context, collection).build(); context.restoreAuthSystemState(); String token = getAuthToken(admin.getEmail(), password); @@ -428,7 +424,7 @@ public void deleteCollectionAdminGroupTest() throws Exception { @Test public void deleteCollectionAdminGroupTestParentCommunityAdmin() throws Exception { context.turnOffAuthorisationSystem(); - Group adminGroup = collectionService.createAdministrators(context, collection); + GroupBuilder.createCollectionAdminGroup(context, collection).build(); authorizeService.addPolicy(context, parentCommunity, Constants.ADMIN, eperson); context.restoreAuthSystemState(); @@ -443,7 +439,7 @@ public void deleteCollectionAdminGroupTestParentCommunityAdmin() throws Exceptio @Test public void deleteCollectionAdminGroupTestCollectionAdmin() throws Exception { context.turnOffAuthorisationSystem(); - Group adminGroup = collectionService.createAdministrators(context, collection); + GroupBuilder.createCollectionAdminGroup(context, collection).build(); authorizeService.addPolicy(context, collection, Constants.ADMIN, eperson); context.restoreAuthSystemState(); @@ -458,7 +454,7 @@ public void deleteCollectionAdminGroupTestCollectionAdmin() throws Exception { @Test public void deleteCollectionAdminGroupUnAuthorizedTest() throws Exception { context.turnOffAuthorisationSystem(); - Group adminGroup = collectionService.createAdministrators(context, collection); + Group adminGroup = GroupBuilder.createCollectionAdminGroup(context, collection).build(); context.restoreAuthSystemState(); getClient().perform(delete("/api/core/collections/" + collection.getID() + "/adminGroup")) @@ -474,7 +470,7 @@ public void deleteCollectionAdminGroupUnAuthorizedTest() throws Exception { @Test public void deleteCollectionAdminGroupForbiddenTest() throws Exception { context.turnOffAuthorisationSystem(); - Group adminGroup = collectionService.createAdministrators(context, collection); + Group adminGroup = GroupBuilder.createCollectionAdminGroup(context, collection).build(); context.restoreAuthSystemState(); String token = getAuthToken(eperson.getEmail(), password); @@ -493,7 +489,7 @@ public void deleteCollectionAdminGroupForbiddenTest() throws Exception { @Test public void deleteCollectionAdminGroupNotFoundTest() throws Exception { context.turnOffAuthorisationSystem(); - Group adminGroup = collectionService.createAdministrators(context, collection); + Group adminGroup = GroupBuilder.createCollectionAdminGroup(context, collection).build(); context.restoreAuthSystemState(); String token = getAuthToken(eperson.getEmail(), password); @@ -512,7 +508,7 @@ public void deleteCollectionAdminGroupNotFoundTest() throws Exception { @Test public void getCollectionSubmittersGroupTest() throws Exception { context.turnOffAuthorisationSystem(); - Group submitters = collectionService.createSubmitters(context, collection); + Group submitters = GroupBuilder.createCollectionSubmitterGroup(context, collection).build(); context.restoreAuthSystemState(); String token = getAuthToken(admin.getEmail(), password); @@ -525,7 +521,7 @@ public void getCollectionSubmittersGroupTest() throws Exception { @Test public void getCollectionSubmittersGroupTestParentCommunityAdmin() throws Exception { context.turnOffAuthorisationSystem(); - Group submitters = collectionService.createSubmitters(context, collection); + Group submitters = GroupBuilder.createCollectionSubmitterGroup(context, collection).build(); authorizeService.addPolicy(context, parentCommunity, Constants.ADMIN, eperson); context.restoreAuthSystemState(); @@ -539,7 +535,7 @@ public void getCollectionSubmittersGroupTestParentCommunityAdmin() throws Except @Test public void getCollectionSubmittersGroupTestCollectionAdmin() throws Exception { context.turnOffAuthorisationSystem(); - Group submitters = collectionService.createSubmitters(context, collection); + Group submitters = GroupBuilder.createCollectionSubmitterGroup(context, collection).build(); authorizeService.addPolicy(context, collection, Constants.ADMIN, eperson); context.restoreAuthSystemState(); @@ -553,7 +549,7 @@ public void getCollectionSubmittersGroupTestCollectionAdmin() throws Exception { @Test public void getCollectionSubmittersGroupUnAuthorizedTest() throws Exception { context.turnOffAuthorisationSystem(); - collectionService.createSubmitters(context, collection); + GroupBuilder.createCollectionSubmitterGroup(context, collection).build(); context.restoreAuthSystemState(); getClient().perform(get("/api/core/collections/" + collection.getID() + "/submittersGroup")) @@ -563,7 +559,7 @@ public void getCollectionSubmittersGroupUnAuthorizedTest() throws Exception { @Test public void getCollectionSubmittersGroupForbiddenTest() throws Exception { context.turnOffAuthorisationSystem(); - collectionService.createSubmitters(context, collection); + GroupBuilder.createCollectionSubmitterGroup(context, collection).build(); context.restoreAuthSystemState(); String token = getAuthToken(eperson.getEmail(), password); @@ -860,7 +856,7 @@ public void postCollectionSubmittersGroupCreateSubmittersGroupUnProcessablePerma @Test public void deleteCollectionSubmitterGroupTest() throws Exception { context.turnOffAuthorisationSystem(); - Group submittersGroup = collectionService.createSubmitters(context, collection); + GroupBuilder.createCollectionSubmitterGroup(context, collection).build(); context.restoreAuthSystemState(); String token = getAuthToken(admin.getEmail(), password); @@ -875,7 +871,7 @@ public void deleteCollectionSubmitterGroupTest() throws Exception { @Test public void deleteCollectionSubmittersGroupTestParentCommunityAdmin() throws Exception { context.turnOffAuthorisationSystem(); - Group submittersGroup = collectionService.createSubmitters(context, collection); + GroupBuilder.createCollectionSubmitterGroup(context, collection).build(); authorizeService.addPolicy(context, parentCommunity, Constants.ADMIN, eperson); context.restoreAuthSystemState(); @@ -890,7 +886,7 @@ public void deleteCollectionSubmittersGroupTestParentCommunityAdmin() throws Exc @Test public void deleteCollectionSubmittersGroupTestCollectionAdmin() throws Exception { context.turnOffAuthorisationSystem(); - Group submittersGroup = collectionService.createSubmitters(context, collection); + GroupBuilder.createCollectionSubmitterGroup(context, collection).build(); authorizeService.addPolicy(context, collection, Constants.ADMIN, eperson); context.restoreAuthSystemState(); @@ -905,7 +901,7 @@ public void deleteCollectionSubmittersGroupTestCollectionAdmin() throws Exceptio @Test public void deleteCollectionSubmittersGroupUnAuthorizedTest() throws Exception { context.turnOffAuthorisationSystem(); - Group submittersGroup = collectionService.createSubmitters(context, collection); + Group submittersGroup = GroupBuilder.createCollectionSubmitterGroup(context, collection).build(); context.restoreAuthSystemState(); getClient().perform(delete("/api/core/collections/" + collection.getID() + "/submittersGroup")) @@ -924,7 +920,7 @@ public void deleteCollectionSubmittersGroupUnAuthorizedTest() throws Exception { @Test public void deleteCollectionSubmittersGroupForbiddenTest() throws Exception { context.turnOffAuthorisationSystem(); - Group submittersGroup = collectionService.createSubmitters(context, collection); + Group submittersGroup = GroupBuilder.createCollectionSubmitterGroup(context, collection).build(); context.restoreAuthSystemState(); String token = getAuthToken(eperson.getEmail(), password); @@ -945,7 +941,7 @@ public void deleteCollectionSubmittersGroupForbiddenTest() throws Exception { @Test public void deleteCollectionSubmittersGroupNotFoundTest() throws Exception { context.turnOffAuthorisationSystem(); - Group submittersGroup = collectionService.createSubmitters(context, collection); + GroupBuilder.createCollectionSubmitterGroup(context, collection).build(); context.restoreAuthSystemState(); String token = getAuthToken(eperson.getEmail(), password); @@ -961,7 +957,8 @@ public void getCollectionItemReadGroupTest() throws Exception { String itemGroupString = "ITEM"; int defaultItemRead = Constants.DEFAULT_ITEM_READ; - Group role = collectionService.createDefaultReadGroup(context, collection, itemGroupString, defaultItemRead); + Group role = GroupBuilder.createCollectionDefaultReadGroup(context, collection, + itemGroupString, defaultItemRead).build(); context.restoreAuthSystemState(); String token = getAuthToken(admin.getEmail(), password); @@ -977,7 +974,8 @@ public void getCollectionDefaultItemReadGroupTestParentCommunityAdmin() throws E String itemGroupString = "ITEM"; int defaultItemRead = Constants.DEFAULT_ITEM_READ; - Group role = collectionService.createDefaultReadGroup(context, collection, itemGroupString, defaultItemRead); + Group role = GroupBuilder.createCollectionDefaultReadGroup(context, collection, + itemGroupString, defaultItemRead).build(); authorizeService.addPolicy(context, parentCommunity, Constants.ADMIN, eperson); context.restoreAuthSystemState(); @@ -995,7 +993,8 @@ public void getCollectionDefaultItemReadGroupTestCollectionAdmin() throws Except String itemGroupString = "ITEM"; int defaultItemRead = Constants.DEFAULT_ITEM_READ; - Group role = collectionService.createDefaultReadGroup(context, collection, itemGroupString, defaultItemRead); + Group role = GroupBuilder.createCollectionDefaultReadGroup(context, collection, + itemGroupString, defaultItemRead).build(); authorizeService.addPolicy(context, collection, Constants.ADMIN, eperson); context.restoreAuthSystemState(); @@ -1012,7 +1011,8 @@ public void getCollectionDefaultItemReadGroupUnAuthorizedTest() throws Exception String itemGroupString = "ITEM"; int defaultItemRead = Constants.DEFAULT_ITEM_READ; - Group role = collectionService.createDefaultReadGroup(context, collection, itemGroupString, defaultItemRead); + GroupBuilder.createCollectionDefaultReadGroup(context, collection, + itemGroupString, defaultItemRead).build(); context.restoreAuthSystemState(); getClient().perform(get("/api/core/collections/" + collection.getID() + "/itemReadGroup")) @@ -1025,7 +1025,8 @@ public void getCollectionDefaultItemReadGroupForbiddenTest() throws Exception { String itemGroupString = "ITEM"; int defaultItemRead = Constants.DEFAULT_ITEM_READ; - Group role = collectionService.createDefaultReadGroup(context, collection, itemGroupString, defaultItemRead); + GroupBuilder.createCollectionDefaultReadGroup(context, collection, + itemGroupString, defaultItemRead).build(); context.restoreAuthSystemState(); String token = getAuthToken(eperson.getEmail(), password); @@ -1321,7 +1322,7 @@ public void deleteCollectionDefaultItemReadGroupTest() throws Exception { String itemGroupString = "ITEM"; int defaultItemRead = Constants.DEFAULT_ITEM_READ; - Group role = collectionService.createDefaultReadGroup(context, collection, itemGroupString, defaultItemRead); + GroupBuilder.createCollectionDefaultReadGroup(context, collection, itemGroupString, defaultItemRead).build(); context.restoreAuthSystemState(); String token = getAuthToken(admin.getEmail(), password); @@ -1345,7 +1346,7 @@ public void deleteCollectionDefaultItemReadGroupTestParentCommunityAdmin() throw String itemGroupString = "ITEM"; int defaultItemRead = Constants.DEFAULT_ITEM_READ; - Group role = collectionService.createDefaultReadGroup(context, collection, itemGroupString, defaultItemRead); + GroupBuilder.createCollectionDefaultReadGroup(context, collection, itemGroupString, defaultItemRead).build(); authorizeService.addPolicy(context, parentCommunity, Constants.ADMIN, eperson); context.restoreAuthSystemState(); @@ -1367,7 +1368,7 @@ public void deleteCollectionDefaultItemReadGroupTestCollectionAdmin() throws Exc String itemGroupString = "ITEM"; int defaultItemRead = Constants.DEFAULT_ITEM_READ; - Group role = collectionService.createDefaultReadGroup(context, collection, itemGroupString, defaultItemRead); + GroupBuilder.createCollectionDefaultReadGroup(context, collection, itemGroupString, defaultItemRead).build(); authorizeService.addPolicy(context, collection, Constants.ADMIN, eperson); context.restoreAuthSystemState(); @@ -1389,7 +1390,8 @@ public void deleteCollectionDefaultItemReadGroupUnAuthorizedTest() throws Except String itemGroupString = "ITEM"; int defaultItemRead = Constants.DEFAULT_ITEM_READ; - Group role = collectionService.createDefaultReadGroup(context, collection, itemGroupString, defaultItemRead); + Group role = GroupBuilder.createCollectionDefaultReadGroup(context, collection, + itemGroupString, defaultItemRead).build(); context.restoreAuthSystemState(); getClient().perform(delete("/api/core/collections/" + collection.getID() + "/itemReadGroup")) @@ -1408,7 +1410,8 @@ public void deleteCollectionDefaultItemReadGroupForbiddenTest() throws Exception String itemGroupString = "ITEM"; int defaultItemRead = Constants.DEFAULT_ITEM_READ; - Group role = collectionService.createDefaultReadGroup(context, collection, itemGroupString, defaultItemRead); + Group role = GroupBuilder.createCollectionDefaultReadGroup(context, collection, + itemGroupString, defaultItemRead).build(); context.restoreAuthSystemState(); String token = getAuthToken(eperson.getEmail(), password); @@ -1430,7 +1433,7 @@ public void deleteCollectionDefaultItemReadGroupNotFoundTest() throws Exception String itemGroupString = "ITEM"; int defaultItemRead = Constants.DEFAULT_ITEM_READ; - Group role = collectionService.createDefaultReadGroup(context, collection, itemGroupString, defaultItemRead); + GroupBuilder.createCollectionDefaultReadGroup(context, collection, itemGroupString, defaultItemRead).build(); context.restoreAuthSystemState(); String token = getAuthToken(eperson.getEmail(), password); @@ -1445,8 +1448,8 @@ public void getCollectionBitstreamReadGroupTest() throws Exception { String bitstreamGroupString = "BITSTREAM"; int defaultBitstreamRead = Constants.DEFAULT_BITSTREAM_READ; - Group role = collectionService.createDefaultReadGroup(context, collection, bitstreamGroupString, - defaultBitstreamRead); + Group role = GroupBuilder.createCollectionDefaultReadGroup(context, collection, + bitstreamGroupString, defaultBitstreamRead).build(); context.restoreAuthSystemState(); String token = getAuthToken(admin.getEmail(), password); @@ -1462,8 +1465,8 @@ public void getCollectionDefaultBitstreamReadGroupTestParentCommunityAdmin() thr String bitstreamGroupString = "BITSTREAM"; int defaultBitstreamRead = Constants.DEFAULT_BITSTREAM_READ; - Group role = collectionService.createDefaultReadGroup(context, collection, bitstreamGroupString, - defaultBitstreamRead); + Group role = GroupBuilder.createCollectionDefaultReadGroup(context, collection, + bitstreamGroupString, defaultBitstreamRead).build(); authorizeService.addPolicy(context, parentCommunity, Constants.ADMIN, eperson); context.restoreAuthSystemState(); @@ -1480,8 +1483,8 @@ public void getCollectionDefaultBitstreamReadGroupTestCollectionAdmin() throws E String bitstreamGroupString = "BITSTREAM"; int defaultBitstreamRead = Constants.DEFAULT_BITSTREAM_READ; - Group role = collectionService.createDefaultReadGroup(context, collection, bitstreamGroupString, - defaultBitstreamRead); + Group role = GroupBuilder.createCollectionDefaultReadGroup(context, collection, + bitstreamGroupString, defaultBitstreamRead).build(); authorizeService.addPolicy(context, collection, Constants.ADMIN, eperson); context.restoreAuthSystemState(); @@ -1498,8 +1501,8 @@ public void getCollectionDefaultBitstreamReadGroupUnAuthorizedTest() throws Exce String bitstreamGroupString = "BITSTREAM"; int defaultBitstreamRead = Constants.DEFAULT_BITSTREAM_READ; - Group role = collectionService.createDefaultReadGroup(context, collection, bitstreamGroupString, - defaultBitstreamRead); + GroupBuilder.createCollectionDefaultReadGroup(context, collection, + bitstreamGroupString, defaultBitstreamRead).build(); context.restoreAuthSystemState(); getClient().perform(get("/api/core/collections/" + collection.getID() + "/bitstreamReadGroup")) @@ -1512,8 +1515,8 @@ public void getCollectionDefaultBitstreamReadGroupForbiddenTest() throws Excepti String bitstreamGroupString = "BITSTREAM"; int defaultBitstreamRead = Constants.DEFAULT_BITSTREAM_READ; - Group role = collectionService.createDefaultReadGroup(context, collection, bitstreamGroupString, - defaultBitstreamRead); + GroupBuilder.createCollectionDefaultReadGroup(context, collection, + bitstreamGroupString, defaultBitstreamRead).build(); context.restoreAuthSystemState(); String token = getAuthToken(eperson.getEmail(), password); @@ -1811,8 +1814,8 @@ public void deleteCollectionDefaultBitstreamReadGroupTest() throws Exception { String bitstreamGroupString = "BITSTREAM"; int defaultBitstreamRead = Constants.DEFAULT_BITSTREAM_READ; - Group role = collectionService.createDefaultReadGroup(context, collection, bitstreamGroupString, - defaultBitstreamRead); + GroupBuilder.createCollectionDefaultReadGroup(context, collection, + bitstreamGroupString, defaultBitstreamRead).build(); context.restoreAuthSystemState(); String token = getAuthToken(admin.getEmail(), password); @@ -1835,8 +1838,8 @@ public void deleteCollectionDefaultBitstreamReadGroupTestParentCommunityAdmin() String bitstreamGroupString = "BITSTREAM"; int defaultBitstreamRead = Constants.DEFAULT_BITSTREAM_READ; - Group role = collectionService.createDefaultReadGroup(context, collection, bitstreamGroupString, - defaultBitstreamRead); + GroupBuilder.createCollectionDefaultReadGroup(context, collection, + bitstreamGroupString, defaultBitstreamRead).build(); authorizeService.addPolicy(context, parentCommunity, Constants.ADMIN, eperson); context.restoreAuthSystemState(); @@ -1859,8 +1862,8 @@ public void deleteCollectionDefaultBitstreamReadGroupTestCollectionAdmin() throw String bitstreamGroupString = "BITSTREAM"; int defaultBitstreamRead = Constants.DEFAULT_BITSTREAM_READ; - Group role = collectionService.createDefaultReadGroup(context, collection, bitstreamGroupString, - defaultBitstreamRead); + GroupBuilder.createCollectionDefaultReadGroup(context, collection, + bitstreamGroupString, defaultBitstreamRead).build(); authorizeService.addPolicy(context, collection, Constants.ADMIN, eperson); context.restoreAuthSystemState(); @@ -1882,8 +1885,8 @@ public void deleteCollectionDefaultBitstreamReadGroupUnAuthorizedTest() throws E String bitstreamGroupString = "BITSTREAM"; int defaultBitstreamRead = Constants.DEFAULT_BITSTREAM_READ; - Group role = collectionService.createDefaultReadGroup(context, collection, bitstreamGroupString, - defaultBitstreamRead); + Group role = GroupBuilder.createCollectionDefaultReadGroup(context, collection, + bitstreamGroupString, defaultBitstreamRead).build(); context.restoreAuthSystemState(); getClient().perform(delete("/api/core/collections/" + collection.getID() + "/bitstreamReadGroup")) @@ -1902,8 +1905,8 @@ public void deleteCollectionDefaultBitstreamReadGroupForbiddenTest() throws Exce String bitstreamGroupString = "BITSTREAM"; int defaultBitstreamRead = Constants.DEFAULT_BITSTREAM_READ; - Group role = collectionService.createDefaultReadGroup(context, collection, bitstreamGroupString, - defaultBitstreamRead); + GroupBuilder.createCollectionDefaultReadGroup(context, collection, + bitstreamGroupString, defaultBitstreamRead).build(); context.restoreAuthSystemState(); String token = getAuthToken(eperson.getEmail(), password); @@ -1918,8 +1921,8 @@ public void deleteCollectionDefaultBitstreamReadGroupNotFoundTest() throws Excep String bitstreamGroupString = "BITSTREAM"; int defaultBitstreamRead = Constants.DEFAULT_BITSTREAM_READ; - Group role = collectionService.createDefaultReadGroup(context, collection, bitstreamGroupString, - defaultBitstreamRead); + GroupBuilder.createCollectionDefaultReadGroup(context, collection, + bitstreamGroupString, defaultBitstreamRead).build(); context.restoreAuthSystemState(); String token = getAuthToken(eperson.getEmail(), password); @@ -1931,7 +1934,7 @@ public void deleteCollectionDefaultBitstreamReadGroupNotFoundTest() throws Excep public void getWorkflowGroupForCollectionAndRole() throws Exception { context.turnOffAuthorisationSystem(); - Group group = workflowService.createWorkflowRoleGroup(context, collection, "reviewer"); + Group group = GroupBuilder.createCollectionWorkflowRoleGroup(context, collection, "reviewer").build(); context.restoreAuthSystemState(); String token = getAuthToken(admin.getEmail(), password); @@ -1944,7 +1947,7 @@ public void getWorkflowGroupForCollectionAndRole() throws Exception { @Test public void getWorkflowGroupForCollectionAndRoleParentCommunityAdmin() throws Exception { context.turnOffAuthorisationSystem(); - Group group = workflowService.createWorkflowRoleGroup(context, collection, "reviewer"); + Group group = GroupBuilder.createCollectionWorkflowRoleGroup(context, collection, "reviewer").build(); authorizeService.addPolicy(context, parentCommunity, Constants.ADMIN, eperson); context.restoreAuthSystemState(); @@ -1958,7 +1961,7 @@ public void getWorkflowGroupForCollectionAndRoleParentCommunityAdmin() throws Ex @Test public void getWorkflowGroupForCollectionAndRoleWrongUUIDCollectionNotFound() throws Exception { context.turnOffAuthorisationSystem(); - Group group = workflowService.createWorkflowRoleGroup(context, collection, "reviewer"); + GroupBuilder.createCollectionWorkflowRoleGroup(context, collection, "reviewer").build(); context.restoreAuthSystemState(); String token = getAuthToken(eperson.getEmail(), password); @@ -1979,7 +1982,7 @@ public void getWorkflowGroupForCollectionAndRoleWrongRoleNotFound() throws Excep public void getWorkflowGroupCommunityAdmin() throws Exception { context.turnOffAuthorisationSystem(); - Group group = workflowService.createWorkflowRoleGroup(context, collection, "reviewer"); + Group group = GroupBuilder.createCollectionWorkflowRoleGroup(context, collection, "reviewer").build(); authorizeService.addPolicy(context, parentCommunity, Constants.ADMIN, eperson); context.restoreAuthSystemState(); @@ -1994,7 +1997,7 @@ public void getWorkflowGroupCommunityAdmin() throws Exception { @Test public void getWorkflowGroupCollectionAdmin() throws Exception { context.turnOffAuthorisationSystem(); - Group group = workflowService.createWorkflowRoleGroup(context, collection, "reviewer"); + Group group = GroupBuilder.createCollectionWorkflowRoleGroup(context, collection, "reviewer").build(); authorizeService.addPolicy(context, collection, Constants.ADMIN, eperson); context.restoreAuthSystemState(); @@ -2009,7 +2012,7 @@ public void getWorkflowGroupCollectionAdmin() throws Exception { @Test public void getWorkflowGroupUnAuthorized() throws Exception { context.turnOffAuthorisationSystem(); - Group group = workflowService.createWorkflowRoleGroup(context, collection, "reviewer"); + GroupBuilder.createCollectionWorkflowRoleGroup(context, collection, "reviewer").build(); context.restoreAuthSystemState(); getClient().perform(get("/api/core/collections/" + collection.getID() + "/workflowGroups/reviewer")) @@ -2019,7 +2022,7 @@ public void getWorkflowGroupUnAuthorized() throws Exception { @Test public void getWorkflowGroupForbidden() throws Exception { context.turnOffAuthorisationSystem(); - Group group = workflowService.createWorkflowRoleGroup(context, collection, "reviewer"); + GroupBuilder.createCollectionWorkflowRoleGroup(context, collection, "reviewer").build(); context.restoreAuthSystemState(); String token = getAuthToken(eperson.getEmail(), password); @@ -2324,7 +2327,7 @@ public void postCollectionWorkflowGroupCreateWorkflowGroupUnProcessablePermanent @Test public void deleteCollectionWorkflowGroupTest() throws Exception { context.turnOffAuthorisationSystem(); - Group group = workflowService.createWorkflowRoleGroup(context, collection, "reviewer"); + GroupBuilder.createCollectionWorkflowRoleGroup(context, collection, "reviewer").build(); context.restoreAuthSystemState(); String token = getAuthToken(admin.getEmail(), password); @@ -2339,7 +2342,7 @@ public void deleteCollectionWorkflowGroupTest() throws Exception { @Test public void deleteCollectionWorkflowGroupTestParentCommunityAdmin() throws Exception { context.turnOffAuthorisationSystem(); - Group group = workflowService.createWorkflowRoleGroup(context, collection, "reviewer"); + GroupBuilder.createCollectionWorkflowRoleGroup(context, collection, "reviewer").build(); authorizeService.addPolicy(context, parentCommunity, Constants.ADMIN, eperson); context.restoreAuthSystemState(); @@ -2355,7 +2358,7 @@ public void deleteCollectionWorkflowGroupTestParentCommunityAdmin() throws Excep @Test public void deleteCollectionWorkflowGroupTestCollectionAdmin() throws Exception { context.turnOffAuthorisationSystem(); - Group group = workflowService.createWorkflowRoleGroup(context, collection, "reviewer"); + GroupBuilder.createCollectionWorkflowRoleGroup(context, collection, "reviewer").build(); authorizeService.addPolicy(context, collection, Constants.ADMIN, eperson); context.restoreAuthSystemState(); @@ -2371,7 +2374,7 @@ public void deleteCollectionWorkflowGroupTestCollectionAdmin() throws Exception @Test public void deleteCollectionWorkflowGroupUnAuthorizedTest() throws Exception { context.turnOffAuthorisationSystem(); - Group group = workflowService.createWorkflowRoleGroup(context, collection, "reviewer"); + Group group = GroupBuilder.createCollectionWorkflowRoleGroup(context, collection, "reviewer").build(); context.restoreAuthSystemState(); getClient().perform(delete("/api/core/collections/" + collection.getID() + "/workflowGroups/reviewer")) @@ -2387,7 +2390,7 @@ public void deleteCollectionWorkflowGroupUnAuthorizedTest() throws Exception { @Test public void deleteCollectionWorkflowGroupForbiddenTest() throws Exception { context.turnOffAuthorisationSystem(); - Group group = workflowService.createWorkflowRoleGroup(context, collection, "reviewer"); + Group group = GroupBuilder.createCollectionWorkflowRoleGroup(context, collection, "reviewer").build(); context.restoreAuthSystemState(); String token = getAuthToken(eperson.getEmail(), password); @@ -2406,7 +2409,7 @@ public void deleteCollectionWorkflowGroupForbiddenTest() throws Exception { @Test public void deleteCollectionWorkflowGroupNotFoundTest() throws Exception { context.turnOffAuthorisationSystem(); - Group group = workflowService.createWorkflowRoleGroup(context, collection, "reviewer"); + GroupBuilder.createCollectionWorkflowRoleGroup(context, collection, "reviewer").build(); context.restoreAuthSystemState(); String token = getAuthToken(eperson.getEmail(), password); @@ -2418,7 +2421,7 @@ public void deleteCollectionWorkflowGroupNotFoundTest() throws Exception { @Test public void deleteCollectionWorkflowGroupWithPooledTaskTest() throws Exception { context.turnOffAuthorisationSystem(); - Group reviewer = workflowService.createWorkflowRoleGroup(context, collection, "reviewer"); + Group reviewer = GroupBuilder.createCollectionWorkflowRoleGroup(context, collection, "reviewer").build(); // Submit an Item into the workflow -> moves to the "reviewer" step's pool. // The role must have at least one EPerson, otherwise the WSI gets archived immediately From 2d9988f77c52537f46888f27e35dbc0360299835 Mon Sep 17 00:00:00 2001 From: Kim Shepherd Date: Fri, 6 Sep 2024 15:35:43 +0200 Subject: [PATCH 56/96] #9806: Builders for comm, coll, group in CommunityAdminGroupRestControllerIT --- .../CommunityAdminGroupRestControllerIT.java | 52 +++++++++---------- 1 file changed, 24 insertions(+), 28 deletions(-) diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/CommunityAdminGroupRestControllerIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/CommunityAdminGroupRestControllerIT.java index 37548553b143..074a7e6a3557 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/CommunityAdminGroupRestControllerIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/CommunityAdminGroupRestControllerIT.java @@ -34,8 +34,6 @@ import org.dspace.builder.GroupBuilder; import org.dspace.content.Collection; import org.dspace.content.Community; -import org.dspace.content.service.CollectionService; -import org.dspace.content.service.CommunityService; import org.dspace.core.Constants; import org.dspace.eperson.EPerson; import org.dspace.eperson.Group; @@ -49,19 +47,12 @@ public class CommunityAdminGroupRestControllerIT extends AbstractControllerIntegrationTest { - - @Autowired - private CommunityService communityService; - @Autowired private GroupService groupService; @Autowired private AuthorizeService authorizeService; - @Autowired - private CollectionService collectionService; - @Autowired private ConfigurationService configurationService; @@ -78,7 +69,7 @@ public void setup() { @Test public void getCommunityAdminGroupTest() throws Exception { context.turnOffAuthorisationSystem(); - Group adminGroup = communityService.createAdministrators(context, parentCommunity); + Group adminGroup = GroupBuilder.createCommunityAdminGroup(context, parentCommunity).build(); context.restoreAuthSystemState(); String token = getAuthToken(admin.getEmail(), password); @@ -91,7 +82,8 @@ public void getCommunityAdminGroupTest() throws Exception { @Test public void getCommunityAdminGroupTestCommunityAdmin() throws Exception { context.turnOffAuthorisationSystem(); - Group adminGroup = communityService.createAdministrators(context, parentCommunity); + Group adminGroup = GroupBuilder.createCommunityAdminGroup(context, parentCommunity).build(); + // TODO: this should actually be "add member", not directly setting a policy, right? authorizeService.addPolicy(context, parentCommunity, Constants.ADMIN, eperson); context.restoreAuthSystemState(); @@ -106,7 +98,7 @@ public void getCommunityAdminGroupTestCommunityAdmin() throws Exception { @Test public void getCommunityAdminGroupUnAuthorizedTest() throws Exception { context.turnOffAuthorisationSystem(); - communityService.createAdministrators(context, parentCommunity); + GroupBuilder.createCommunityAdminGroup(context, parentCommunity).build(); context.restoreAuthSystemState(); getClient().perform(get("/api/core/communities/" + parentCommunity.getID() + "/adminGroup")) @@ -116,7 +108,7 @@ public void getCommunityAdminGroupUnAuthorizedTest() throws Exception { @Test public void getCommunityAdminGroupForbiddenTest() throws Exception { context.turnOffAuthorisationSystem(); - communityService.createAdministrators(context, parentCommunity); + GroupBuilder.createCommunityAdminGroup(context, parentCommunity).build(); context.restoreAuthSystemState(); String token = getAuthToken(eperson.getEmail(), password); getClient(token).perform(get("/api/core/communities/" + parentCommunity.getID() + "/adminGroup")) @@ -379,7 +371,7 @@ public void postCommunityAdminGroupCreateAdminGroupUnProcessablePermanent() thro @Test public void deleteCommunityAdminGroupTest() throws Exception { context.turnOffAuthorisationSystem(); - Group adminGroup = communityService.createAdministrators(context, parentCommunity); + GroupBuilder.createCommunityAdminGroup(context, parentCommunity).build(); context.restoreAuthSystemState(); String token = getAuthToken(admin.getEmail(), password); @@ -397,7 +389,7 @@ public void deleteCommunityAdminGroupTestCommunityAdmin() throws Exception { Community child1 = CommunityBuilder.createSubCommunity(context, parentCommunity) .withName("Sub Community") .build(); - Group adminGroup = communityService.createAdministrators(context, child1); + GroupBuilder.createCommunityAdminGroup(context, child1).build(); authorizeService.addPolicy(context, parentCommunity, Constants.ADMIN, eperson); context.restoreAuthSystemState(); @@ -412,7 +404,7 @@ public void deleteCommunityAdminGroupTestCommunityAdmin() throws Exception { @Test public void deleteCommunityAdminGroupUnAuthorizedTest() throws Exception { context.turnOffAuthorisationSystem(); - Group adminGroup = communityService.createAdministrators(context, parentCommunity); + Group adminGroup = GroupBuilder.createCommunityAdminGroup(context, parentCommunity).build(); context.restoreAuthSystemState(); getClient().perform(delete("/api/core/communities/" + parentCommunity.getID() + "/adminGroup")) @@ -429,7 +421,7 @@ public void deleteCommunityAdminGroupUnAuthorizedTest() throws Exception { @Test public void deleteCommunityAdminGroupForbiddenTest() throws Exception { context.turnOffAuthorisationSystem(); - Group adminGroup = communityService.createAdministrators(context, parentCommunity); + Group adminGroup = GroupBuilder.createCommunityAdminGroup(context, parentCommunity).build(); context.restoreAuthSystemState(); String token = getAuthToken(eperson.getEmail(), password); @@ -449,7 +441,7 @@ public void deleteCommunityAdminGroupForbiddenTest() throws Exception { @Test public void deleteCommunityAdminGroupNotFoundTest() throws Exception { context.turnOffAuthorisationSystem(); - Group adminGroup = communityService.createAdministrators(context, parentCommunity); + GroupBuilder.createCommunityAdminGroup(context, parentCommunity).build(); context.restoreAuthSystemState(); String token = getAuthToken(eperson.getEmail(), password); @@ -462,7 +454,7 @@ public void deleteCommunityAdminGroupNotFoundTest() throws Exception { public void communityAdminAddMembersToCommunityAdminGroupPropertySetToFalse() throws Exception { context.turnOffAuthorisationSystem(); - Group adminGroup = communityService.createAdministrators(context, parentCommunity); + Group adminGroup = GroupBuilder.createCommunityAdminGroup(context, parentCommunity).build(); authorizeService.addPolicy(context, parentCommunity, Constants.ADMIN, eperson); EPerson ePerson = EPersonBuilder.createEPerson(context).withEmail("testToAdd@test.com").build(); configurationService.setProperty("core.authorization.community-admin.admin-group", false); @@ -489,7 +481,7 @@ public void communityAdminAddMembersToCommunityAdminGroupPropertySetToFalse() th public void communityAdminRemoveMembersFromCommunityAdminGroupPropertySetToFalse() throws Exception { context.turnOffAuthorisationSystem(); - Group adminGroup = communityService.createAdministrators(context, parentCommunity); + Group adminGroup = GroupBuilder.createCommunityAdminGroup(context, parentCommunity).build(); authorizeService.addPolicy(context, parentCommunity, Constants.ADMIN, eperson); EPerson ePerson = EPersonBuilder.createEPerson(context).withEmail("testToAdd@test.com").build(); context.restoreAuthSystemState(); @@ -526,7 +518,7 @@ public void communityAdminRemoveMembersFromCommunityAdminGroupPropertySetToFalse public void communityAdminAddChildGroupToCommunityAdminGroupPropertySetToFalse() throws Exception { context.turnOffAuthorisationSystem(); - Group adminGroup = communityService.createAdministrators(context, parentCommunity); + Group adminGroup = GroupBuilder.createCommunityAdminGroup(context, parentCommunity).build(); authorizeService.addPolicy(context, parentCommunity, Constants.ADMIN, eperson); Group group = GroupBuilder.createGroup(context).withName("testGroup").build(); configurationService.setProperty("core.authorization.community-admin.admin-group", false); @@ -554,7 +546,7 @@ public void communityAdminAddChildGroupToCommunityAdminGroupPropertySetToFalse() public void communityAdminRemoveChildGroupFromCommunityAdminGroupPropertySetToFalse() throws Exception { context.turnOffAuthorisationSystem(); - Group adminGroup = communityService.createAdministrators(context, parentCommunity); + Group adminGroup = GroupBuilder.createCommunityAdminGroup(context, parentCommunity).build(); authorizeService.addPolicy(context, parentCommunity, Constants.ADMIN, eperson); Group group = GroupBuilder.createGroup(context).withName("testGroup").build(); context.restoreAuthSystemState(); @@ -591,7 +583,9 @@ public void communityAdminRemoveChildGroupFromCommunityAdminGroupPropertySetToFa public void communityAdminAddChildGroupToCollectionAdminGroupSuccess() throws Exception { context.turnOffAuthorisationSystem(); - Group adminGroup = collectionService.createAdministrators(context, collection); + // TODO: Why is this test in CommunityAdmin? it seems to purely be a collection group test? + // copy paste gone wrong and we should actually be testing for community admin group sub? + Group adminGroup = GroupBuilder.createCollectionAdminGroup(context, collection).build(); authorizeService.addPolicy(context, parentCommunity, Constants.ADMIN, eperson); Group group = GroupBuilder.createGroup(context).withName("testGroup").build(); context.restoreAuthSystemState(); @@ -617,7 +611,9 @@ public void communityAdminAddChildGroupToCollectionAdminGroupSuccess() throws Ex public void communityAdminRemoveChildGroupFromCollectionAdminGroupSuccess() throws Exception { context.turnOffAuthorisationSystem(); - Group adminGroup = collectionService.createAdministrators(context, collection); + // TODO: Why is this test in CommunityAdmin? it seems to purely be a collection group test? + // copy paste gone wrong and we should actually be testing for community admin group sub? + Group adminGroup = GroupBuilder.createCollectionAdminGroup(context, collection).build(); authorizeService.addPolicy(context, parentCommunity, Constants.ADMIN, eperson); Group group = GroupBuilder.createGroup(context).withName("testGroup").build(); context.restoreAuthSystemState(); @@ -653,7 +649,7 @@ public void communityAdminRemoveChildGroupFromCollectionAdminGroupSuccess() thro public void communityAdminAddMembersToCollectionAdminGroupPropertySetToFalse() throws Exception { context.turnOffAuthorisationSystem(); - Group adminGroup = collectionService.createAdministrators(context, collection); + Group adminGroup = GroupBuilder.createCollectionAdminGroup(context, collection).build(); authorizeService.addPolicy(context, parentCommunity, Constants.ADMIN, eperson); EPerson ePerson = EPersonBuilder.createEPerson(context).withEmail("testToAdd@test.com").build(); configurationService.setProperty("core.authorization.community-admin.collection.admin-group", false); @@ -681,7 +677,7 @@ public void communityAdminAddMembersToCollectionAdminGroupPropertySetToFalse() t public void communityAdminRemoveMembersFromCollectionAdminGroupPropertySetToFalse() throws Exception { context.turnOffAuthorisationSystem(); - Group adminGroup = collectionService.createAdministrators(context, collection); + Group adminGroup = GroupBuilder.createCollectionAdminGroup(context, collection).build(); authorizeService.addPolicy(context, parentCommunity, Constants.ADMIN, eperson); EPerson ePerson = EPersonBuilder.createEPerson(context).withEmail("testToAdd@test.com").build(); context.restoreAuthSystemState(); @@ -719,7 +715,7 @@ public void communityAdminRemoveMembersFromCollectionAdminGroupPropertySetToFals public void communityAdminAddChildGroupToCollectionAdminGroupPropertySetToFalse() throws Exception { context.turnOffAuthorisationSystem(); - Group adminGroup = collectionService.createAdministrators(context, collection); + Group adminGroup = GroupBuilder.createCollectionAdminGroup(context, collection).build(); authorizeService.addPolicy(context, parentCommunity, Constants.ADMIN, eperson); Group group = GroupBuilder.createGroup(context).withName("testGroup").build(); configurationService.setProperty("core.authorization.community-admin.collection.admin-group", false); @@ -748,7 +744,7 @@ public void communityAdminAddChildGroupToCollectionAdminGroupPropertySetToFalse( public void communityAdminRemoveChildGroupFromCollectionAdminGroupPropertySetToFalse() throws Exception { context.turnOffAuthorisationSystem(); - Group adminGroup = collectionService.createAdministrators(context, collection); + Group adminGroup = GroupBuilder.createCollectionAdminGroup(context, collection).build(); authorizeService.addPolicy(context, parentCommunity, Constants.ADMIN, eperson); Group group = GroupBuilder.createGroup(context).withName("testGroup").build(); context.restoreAuthSystemState(); From 8cfb433c40ad01f348461a2c656665d1891de398 Mon Sep 17 00:00:00 2001 From: Kim Shepherd Date: Fri, 6 Sep 2024 15:58:59 +0200 Subject: [PATCH 57/96] #9806: Update object cleanup in GroupRestRepositoryIT --- .../app/rest/GroupRestRepositoryIT.java | 952 +++++------------- 1 file changed, 239 insertions(+), 713 deletions(-) diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/GroupRestRepositoryIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/GroupRestRepositoryIT.java index bdd13b97ff79..ff8aea493aef 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/GroupRestRepositoryIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/GroupRestRepositoryIT.java @@ -59,14 +59,11 @@ import org.dspace.content.Community; import org.dspace.content.Item; import org.dspace.content.MetadataSchemaEnum; -import org.dspace.content.factory.ContentServiceFactory; -import org.dspace.content.service.CommunityService; import org.dspace.core.Constants; import org.dspace.core.I18nUtil; import org.dspace.eperson.EPerson; import org.dspace.eperson.Group; import org.dspace.eperson.factory.EPersonServiceFactory; -import org.dspace.eperson.service.EPersonService; import org.dspace.eperson.service.GroupService; import org.dspace.services.ConfigurationService; import org.hamcrest.Matchers; @@ -757,263 +754,136 @@ public void addChildGroupTest() throws Exception { @Test public void addChildGroupCommunityAdminTest() throws Exception { - CommunityService communityService = ContentServiceFactory.getInstance().getCommunityService(); GroupService groupService = EPersonServiceFactory.getInstance().getGroupService(); - Community community = null; - - Group parentGroup = null; - Group childGroup1 = null; - Group childGroup2 = null; - - try { - context.turnOffAuthorisationSystem(); - - community = CommunityBuilder.createCommunity(context).build(); - parentGroup = GroupBuilder.createCommunityAdminGroup(context, community) - .addMember(eperson) - .build(); - childGroup1 = GroupBuilder.createGroup(context).build(); - childGroup2 = GroupBuilder.createGroup(context).build(); - - groupService.update(context, parentGroup); - - context.commit(); - - parentGroup = context.reloadEntity(parentGroup); - childGroup1 = context.reloadEntity(childGroup1); - childGroup2 = context.reloadEntity(childGroup2); + context.turnOffAuthorisationSystem(); - context.restoreAuthSystemState(); - String authToken = getAuthToken(eperson.getEmail(), password); - getClient(authToken).perform( - post("/api/eperson/groups/" + parentGroup.getID() + "/subgroups") - .contentType(parseMediaType(TEXT_URI_LIST_VALUE)) - .content(REST_SERVER_URL + "eperson/groups/" + childGroup1.getID() + "/\n" - + REST_SERVER_URL + "eperson/groups/" + childGroup2.getID() - ) - ).andExpect(status().isNoContent()); + Community community = CommunityBuilder.createCommunity(context).build(); + Group parentGroup = GroupBuilder.createCommunityAdminGroup(context, community) + .addMember(eperson) + .build(); + Group childGroup1 = GroupBuilder.createGroup(context).build(); + Group childGroup2 = GroupBuilder.createGroup(context).build(); - parentGroup = context.reloadEntity(parentGroup); - childGroup1 = context.reloadEntity(childGroup1); - childGroup2 = context.reloadEntity(childGroup2); + context.restoreAuthSystemState(); + String authToken = getAuthToken(eperson.getEmail(), password); + getClient(authToken).perform( + post("/api/eperson/groups/" + parentGroup.getID() + "/subgroups") + .contentType(parseMediaType(TEXT_URI_LIST_VALUE)) + .content(REST_SERVER_URL + "eperson/groups/" + childGroup1.getID() + "/\n" + + REST_SERVER_URL + "eperson/groups/" + childGroup2.getID() + ) + ).andExpect(status().isNoContent()); - assertTrue( - groupService.isMember(parentGroup, childGroup1) - ); + parentGroup = context.reloadEntity(parentGroup); + childGroup1 = context.reloadEntity(childGroup1); + childGroup2 = context.reloadEntity(childGroup2); - assertTrue( - groupService.isMember(parentGroup, childGroup2) - ); + assertTrue( + groupService.isMember(parentGroup, childGroup1) + ); - } finally { - // TODO: Can we remove these lines now that we are creating them with the builder? - if (community != null) { - CommunityBuilder.deleteCommunity(community.getID()); - } - if (parentGroup != null) { - GroupBuilder.deleteGroup(parentGroup.getID()); - } - if (childGroup1 != null) { - GroupBuilder.deleteGroup(childGroup1.getID()); - } - if (childGroup2 != null) { - GroupBuilder.deleteGroup(childGroup2.getID()); - } - } + assertTrue( + groupService.isMember(parentGroup, childGroup2) + ); } @Test public void addChildGroupForbiddenTest() throws Exception { - GroupService groupService = EPersonServiceFactory.getInstance().getGroupService(); - - Group parentGroup = null; - Group childGroup1 = null; - Group childGroup2 = null; - - try { - context.turnOffAuthorisationSystem(); - - parentGroup = GroupBuilder.createGroup(context).build(); - childGroup1 = GroupBuilder.createGroup(context).build(); - childGroup2 = GroupBuilder.createGroup(context).build(); - - context.commit(); - - parentGroup = context.reloadEntity(parentGroup); - childGroup1 = context.reloadEntity(childGroup1); - childGroup2 = context.reloadEntity(childGroup2); + context.turnOffAuthorisationSystem(); - context.restoreAuthSystemState(); - String authToken = getAuthToken(eperson.getEmail(), password); - getClient(authToken).perform( - post("/api/eperson/groups/" + parentGroup.getID() + "/subgroups") - .contentType(parseMediaType(TEXT_URI_LIST_VALUE)) - .content(REST_SERVER_URL + "eperson/groups/" + childGroup1.getID() + "/\n" - + REST_SERVER_URL + "eperson/groups/" + childGroup2.getID() - ) - ).andExpect(status().isForbidden()); + Group parentGroup = GroupBuilder.createGroup(context).build(); + Group childGroup1 = GroupBuilder.createGroup(context).build(); + Group childGroup2 = GroupBuilder.createGroup(context).build(); - } finally { - if (parentGroup != null) { - GroupBuilder.deleteGroup(parentGroup.getID()); - } - if (childGroup1 != null) { - GroupBuilder.deleteGroup(childGroup1.getID()); - } - if (childGroup2 != null) { - GroupBuilder.deleteGroup(childGroup2.getID()); - } - } + context.restoreAuthSystemState(); + String authToken = getAuthToken(eperson.getEmail(), password); + getClient(authToken).perform( + post("/api/eperson/groups/" + parentGroup.getID() + "/subgroups") + .contentType(parseMediaType(TEXT_URI_LIST_VALUE)) + .content(REST_SERVER_URL + "eperson/groups/" + childGroup1.getID() + "/\n" + + REST_SERVER_URL + "eperson/groups/" + childGroup2.getID() + ) + ).andExpect(status().isForbidden()); } @Test public void addChildGroupUnauthorizedTest() throws Exception { - GroupService groupService = EPersonServiceFactory.getInstance().getGroupService(); - - Group parentGroup = null; - Group childGroup1 = null; - Group childGroup2 = null; - - try { - context.turnOffAuthorisationSystem(); - - parentGroup = GroupBuilder.createGroup(context).build(); - childGroup1 = GroupBuilder.createGroup(context).build(); - childGroup2 = GroupBuilder.createGroup(context).build(); + context.turnOffAuthorisationSystem(); - context.commit(); + Group parentGroup = GroupBuilder.createGroup(context).build(); + Group childGroup1 = GroupBuilder.createGroup(context).build(); + Group childGroup2 = GroupBuilder.createGroup(context).build(); - parentGroup = context.reloadEntity(parentGroup); - childGroup1 = context.reloadEntity(childGroup1); - childGroup2 = context.reloadEntity(childGroup2); + context.commit(); - context.restoreAuthSystemState(); - getClient().perform( - post("/api/eperson/groups/" + parentGroup.getID() + "/subgroups") - .contentType(parseMediaType(TEXT_URI_LIST_VALUE)) - .content(REST_SERVER_URL + "eperson/groups/" + childGroup1.getID() + "/\n" - + REST_SERVER_URL + "eperson/groups/" + childGroup2.getID() - ) - ).andExpect(status().isUnauthorized()); + parentGroup = context.reloadEntity(parentGroup); + childGroup1 = context.reloadEntity(childGroup1); + childGroup2 = context.reloadEntity(childGroup2); - } finally { - if (parentGroup != null) { - GroupBuilder.deleteGroup(parentGroup.getID()); - } - if (childGroup1 != null) { - GroupBuilder.deleteGroup(childGroup1.getID()); - } - if (childGroup2 != null) { - GroupBuilder.deleteGroup(childGroup2.getID()); - } - } + context.restoreAuthSystemState(); + getClient().perform( + post("/api/eperson/groups/" + parentGroup.getID() + "/subgroups") + .contentType(parseMediaType(TEXT_URI_LIST_VALUE)) + .content(REST_SERVER_URL + "eperson/groups/" + childGroup1.getID() + "/\n" + + REST_SERVER_URL + "eperson/groups/" + childGroup2.getID() + ) + ).andExpect(status().isUnauthorized()); } @Test public void addChildGroupNotFoundTest() throws Exception { - GroupService groupService = EPersonServiceFactory.getInstance().getGroupService(); - - Group parentGroup = null; - Group childGroup1 = null; - Group childGroup2 = null; - - try { - context.turnOffAuthorisationSystem(); - - parentGroup = GroupBuilder.createGroup(context).build(); - childGroup1 = GroupBuilder.createGroup(context).build(); - childGroup2 = GroupBuilder.createGroup(context).build(); - - context.commit(); - - parentGroup = context.reloadEntity(parentGroup); - childGroup1 = context.reloadEntity(childGroup1); - childGroup2 = context.reloadEntity(childGroup2); + context.turnOffAuthorisationSystem(); - context.restoreAuthSystemState(); - String authToken = getAuthToken(admin.getEmail(), password); - getClient(authToken).perform( - post("/api/eperson/groups/" + UUID.randomUUID() + "/subgroups") - .contentType(parseMediaType(TEXT_URI_LIST_VALUE)) - .content(REST_SERVER_URL + "eperson/groups/" + childGroup1.getID() + "/\n" - + REST_SERVER_URL + "eperson/groups/" + childGroup2.getID() - ) - ).andExpect(status().isNotFound()); + Group parentGroup = GroupBuilder.createGroup(context).build(); + Group childGroup1 = GroupBuilder.createGroup(context).build(); + Group childGroup2 = GroupBuilder.createGroup(context).build(); - } finally { - if (parentGroup != null) { - GroupBuilder.deleteGroup(parentGroup.getID()); - } - if (childGroup1 != null) { - GroupBuilder.deleteGroup(childGroup1.getID()); - } - if (childGroup2 != null) { - GroupBuilder.deleteGroup(childGroup2.getID()); - } - } + context.restoreAuthSystemState(); + String authToken = getAuthToken(admin.getEmail(), password); + getClient(authToken).perform( + post("/api/eperson/groups/" + UUID.randomUUID() + "/subgroups") + .contentType(parseMediaType(TEXT_URI_LIST_VALUE)) + .content(REST_SERVER_URL + "eperson/groups/" + childGroup1.getID() + "/\n" + + REST_SERVER_URL + "eperson/groups/" + childGroup2.getID() + ) + ).andExpect(status().isNotFound()); } @Test public void addChildGroupUnprocessableTest() throws Exception { - GroupService groupService = EPersonServiceFactory.getInstance().getGroupService(); - - Group parentGroup = null; - Group childGroup1 = null; - Group childGroup2 = null; - - try { - context.turnOffAuthorisationSystem(); - - parentGroup = GroupBuilder.createGroup(context).build(); - childGroup1 = GroupBuilder.createGroup(context) - .withParent(parentGroup) - .build(); - childGroup2 = GroupBuilder.createGroup(context).build(); - groupService.update(context, childGroup1); - -// context.commit(); -// -// parentGroup = context.reloadEntity(parentGroup); -// childGroup1 = context.reloadEntity(childGroup1); -// childGroup2 = context.reloadEntity(childGroup2); + context.turnOffAuthorisationSystem(); - context.restoreAuthSystemState(); - String authToken = getAuthToken(admin.getEmail(), password); + Group parentGroup = GroupBuilder.createGroup(context).build(); + Group childGroup1 = GroupBuilder.createGroup(context) + .withParent(parentGroup) + .build(); + Group childGroup2 = GroupBuilder.createGroup(context).build(); - getClient(authToken).perform( - post("/api/eperson/groups/" + parentGroup.getID() + "/subgroups") - .contentType(parseMediaType(TEXT_URI_LIST_VALUE)) - .content(REST_SERVER_URL + "eperson/groups/123456789\n" - + REST_SERVER_URL + "eperson/groups/" + childGroup2.getID() - ) - ).andExpect(status().isUnprocessableEntity()); + context.restoreAuthSystemState(); + String authToken = getAuthToken(admin.getEmail(), password); - // TODO - confirm with reviewers that this is a mistake - it actually should be No Content - // (see AddMember test) but was incorrectly expecting 422? - getClient(authToken).perform( - post("/api/eperson/groups/" + parentGroup.getID() + "/subgroups") - .contentType(parseMediaType(TEXT_URI_LIST_VALUE)) - .content(REST_SERVER_URL + "eperson/groups/" + childGroup1.getID() + "/\n" - + REST_SERVER_URL + "eperson/groups/" + childGroup2.getID() - ) - ).andExpect(status().isNoContent()); + getClient(authToken).perform( + post("/api/eperson/groups/" + parentGroup.getID() + "/subgroups") + .contentType(parseMediaType(TEXT_URI_LIST_VALUE)) + .content(REST_SERVER_URL + "eperson/groups/123456789\n" + + REST_SERVER_URL + "eperson/groups/" + childGroup2.getID() + ) + ).andExpect(status().isUnprocessableEntity()); - } finally { - if (parentGroup != null) { - GroupBuilder.deleteGroup(parentGroup.getID()); - } - if (childGroup1 != null) { - GroupBuilder.deleteGroup(childGroup1.getID()); - } - if (childGroup2 != null) { - GroupBuilder.deleteGroup(childGroup2.getID()); - } - } + // TODO - confirm with reviewers that this is a mistake - it actually should be No Content + // (see AddMember test) but was incorrectly expecting 422? + getClient(authToken).perform( + post("/api/eperson/groups/" + parentGroup.getID() + "/subgroups") + .contentType(parseMediaType(TEXT_URI_LIST_VALUE)) + .content(REST_SERVER_URL + "eperson/groups/" + childGroup1.getID() + "/\n" + + REST_SERVER_URL + "eperson/groups/" + childGroup2.getID() + ) + ).andExpect(status().isNoContent()); } @Test @@ -1081,251 +951,118 @@ public void addMemberTest() throws Exception { @Test public void addMemberCommunityAdminTest() throws Exception { - CommunityService communityService = ContentServiceFactory.getInstance().getCommunityService(); GroupService groupService = EPersonServiceFactory.getInstance().getGroupService(); - EPersonService ePersonService = EPersonServiceFactory.getInstance().getEPersonService(); - - Community community = null; - Group parentGroup = null; - EPerson member1 = null; - EPerson member2 = null; - - try { - context.turnOffAuthorisationSystem(); - - community = CommunityBuilder.createCommunity(context).build(); - parentGroup = GroupBuilder.createCommunityAdminGroup(context, community) - .addMember(eperson) - .build(); - member1 = EPersonBuilder.createEPerson(context).build(); - member2 = EPersonBuilder.createEPerson(context).build(); - context.commit(); - - parentGroup = context.reloadEntity(parentGroup); - member1 = context.reloadEntity(member1); - member2 = context.reloadEntity(member2); + context.turnOffAuthorisationSystem(); - context.restoreAuthSystemState(); - String authToken = getAuthToken(eperson.getEmail(), password); - getClient(authToken).perform( - post("/api/eperson/groups/" + parentGroup.getID() + "/epersons") - .contentType(parseMediaType(TEXT_URI_LIST_VALUE)) - .content(REST_SERVER_URL + "eperson/groups/" + member1.getID() + "/\n" - + REST_SERVER_URL + "eperson/groups/" + member2.getID() - ) - ).andExpect(status().isNoContent()); + Community community = CommunityBuilder.createCommunity(context).build(); + Group parentGroup = GroupBuilder.createCommunityAdminGroup(context, community) + .addMember(eperson) + .build(); + EPerson member1 = EPersonBuilder.createEPerson(context).build(); + EPerson member2 = EPersonBuilder.createEPerson(context).build(); - parentGroup = context.reloadEntity(parentGroup); - member1 = context.reloadEntity(member1); - member2 = context.reloadEntity(member2); + context.restoreAuthSystemState(); + String authToken = getAuthToken(eperson.getEmail(), password); + getClient(authToken).perform( + post("/api/eperson/groups/" + parentGroup.getID() + "/epersons") + .contentType(parseMediaType(TEXT_URI_LIST_VALUE)) + .content(REST_SERVER_URL + "eperson/groups/" + member1.getID() + "/\n" + + REST_SERVER_URL + "eperson/groups/" + member2.getID() + ) + ).andExpect(status().isNoContent()); - assertTrue( - groupService.isMember(context, member1, parentGroup) - ); + parentGroup = context.reloadEntity(parentGroup); + member1 = context.reloadEntity(member1); + member2 = context.reloadEntity(member2); - assertTrue( - groupService.isMember(context, member2, parentGroup) - ); + assertTrue( + groupService.isMember(context, member1, parentGroup) + ); - } finally { - if (community != null) { - CommunityBuilder.deleteCommunity(community.getID()); - } - if (parentGroup != null) { - GroupBuilder.deleteGroup(parentGroup.getID()); - } - if (member1 != null) { - EPersonBuilder.deleteEPerson(member1.getID()); - } - if (member2 != null) { - EPersonBuilder.deleteEPerson(member2.getID()); - } - } + assertTrue( + groupService.isMember(context, member2, parentGroup) + ); } @Test public void addMemberForbiddenTest() throws Exception { - GroupService groupService = EPersonServiceFactory.getInstance().getGroupService(); - EPersonService ePersonService = EPersonServiceFactory.getInstance().getEPersonService(); - - Group parentGroup = null; - EPerson member1 = null; - EPerson member2 = null; - - try { - context.turnOffAuthorisationSystem(); - - parentGroup = GroupBuilder.createGroup(context).build(); - member1 = EPersonBuilder.createEPerson(context).build(); - member2 = EPersonBuilder.createEPerson(context).build(); - - context.commit(); - - parentGroup = context.reloadEntity(parentGroup); - member1 = context.reloadEntity(member1); - member2 = context.reloadEntity(member2); + context.turnOffAuthorisationSystem(); - context.restoreAuthSystemState(); - String authToken = getAuthToken(eperson.getEmail(), password); - getClient(authToken).perform( - post("/api/eperson/groups/" + parentGroup.getID() + "/epersons") - .contentType(parseMediaType(TEXT_URI_LIST_VALUE)) - .content(REST_SERVER_URL + "eperson/groups/" + member1.getID() + "/\n" - + REST_SERVER_URL + "eperson/groups/" + member2.getID() - ) - ).andExpect(status().isForbidden()); + Group parentGroup = GroupBuilder.createGroup(context).build(); + EPerson member1 = EPersonBuilder.createEPerson(context).build(); + EPerson member2 = EPersonBuilder.createEPerson(context).build(); - } finally { - if (parentGroup != null) { - GroupBuilder.deleteGroup(parentGroup.getID()); - } - if (member1 != null) { - EPersonBuilder.deleteEPerson(member1.getID()); - } - if (member2 != null) { - EPersonBuilder.deleteEPerson(member2.getID()); - } - } + context.restoreAuthSystemState(); + String authToken = getAuthToken(eperson.getEmail(), password); + getClient(authToken).perform( + post("/api/eperson/groups/" + parentGroup.getID() + "/epersons") + .contentType(parseMediaType(TEXT_URI_LIST_VALUE)) + .content(REST_SERVER_URL + "eperson/groups/" + member1.getID() + "/\n" + + REST_SERVER_URL + "eperson/groups/" + member2.getID() + ) + ).andExpect(status().isForbidden()); } @Test public void addMemberUnauthorizedTest() throws Exception { - GroupService groupService = EPersonServiceFactory.getInstance().getGroupService(); - EPersonService ePersonService = EPersonServiceFactory.getInstance().getEPersonService(); - - Group parentGroup = null; - EPerson member1 = null; - EPerson member2 = null; - - try { - context.turnOffAuthorisationSystem(); - - parentGroup = GroupBuilder.createGroup(context).build(); - member1 = EPersonBuilder.createEPerson(context).build(); - member2 = EPersonBuilder.createEPerson(context).build(); - - context.commit(); - - parentGroup = context.reloadEntity(parentGroup); - member1 = context.reloadEntity(member1); - member2 = context.reloadEntity(member2); + context.turnOffAuthorisationSystem(); - context.restoreAuthSystemState(); - getClient().perform( - post("/api/eperson/groups/" + parentGroup.getID() + "/epersons") - .contentType(parseMediaType(TEXT_URI_LIST_VALUE)) - .content(REST_SERVER_URL + "eperson/groups/" + member1.getID() + "/\n" - + REST_SERVER_URL + "eperson/groups/" + member2.getID() - ) - ).andExpect(status().isUnauthorized()); + Group parentGroup = GroupBuilder.createGroup(context).build(); + EPerson member1 = EPersonBuilder.createEPerson(context).build(); + EPerson member2 = EPersonBuilder.createEPerson(context).build(); - } finally { - if (parentGroup != null) { - GroupBuilder.deleteGroup(parentGroup.getID()); - } - if (member1 != null) { - EPersonBuilder.deleteEPerson(member1.getID()); - } - if (member2 != null) { - EPersonBuilder.deleteEPerson(member2.getID()); - } - } + context.restoreAuthSystemState(); + getClient().perform( + post("/api/eperson/groups/" + parentGroup.getID() + "/epersons") + .contentType(parseMediaType(TEXT_URI_LIST_VALUE)) + .content(REST_SERVER_URL + "eperson/groups/" + member1.getID() + "/\n" + + REST_SERVER_URL + "eperson/groups/" + member2.getID() + ) + ).andExpect(status().isUnauthorized()); } @Test public void addMemberNotFoundTest() throws Exception { - GroupService groupService = EPersonServiceFactory.getInstance().getGroupService(); - EPersonService ePersonService = EPersonServiceFactory.getInstance().getEPersonService(); - - Group parentGroup = null; - EPerson member1 = null; - EPerson member2 = null; - - try { - context.turnOffAuthorisationSystem(); - - parentGroup = GroupBuilder.createGroup(context).build(); - member1 = EPersonBuilder.createEPerson(context).build(); - member2 = EPersonBuilder.createEPerson(context).build(); - - context.commit(); - - parentGroup = context.reloadEntity(parentGroup); - member1 = context.reloadEntity(member1); - member2 = context.reloadEntity(member2); + context.turnOffAuthorisationSystem(); - context.restoreAuthSystemState(); - String authToken = getAuthToken(admin.getEmail(), password); - getClient(authToken).perform( - post("/api/eperson/groups/" + UUID.randomUUID() + "/epersons") - .contentType(parseMediaType(TEXT_URI_LIST_VALUE)) - .content(REST_SERVER_URL + "eperson/groups/" + member1.getID() + "/\n" - + REST_SERVER_URL + "eperson/groups/" + member2.getID() - ) - ).andExpect(status().isNotFound()); + Group parentGroup = GroupBuilder.createGroup(context).build(); + EPerson member1 = EPersonBuilder.createEPerson(context).build(); + EPerson member2 = EPersonBuilder.createEPerson(context).build(); - } finally { - if (parentGroup != null) { - GroupBuilder.deleteGroup(parentGroup.getID()); - } - if (member1 != null) { - EPersonBuilder.deleteEPerson(member1.getID()); - } - if (member2 != null) { - EPersonBuilder.deleteEPerson(member2.getID()); - } - } + context.restoreAuthSystemState(); + String authToken = getAuthToken(admin.getEmail(), password); + getClient(authToken).perform( + post("/api/eperson/groups/" + UUID.randomUUID() + "/epersons") + .contentType(parseMediaType(TEXT_URI_LIST_VALUE)) + .content(REST_SERVER_URL + "eperson/groups/" + member1.getID() + "/\n" + + REST_SERVER_URL + "eperson/groups/" + member2.getID() + ) + ).andExpect(status().isNotFound()); } @Test public void addMemberUnprocessableTest() throws Exception { - GroupService groupService = EPersonServiceFactory.getInstance().getGroupService(); - EPersonService ePersonService = EPersonServiceFactory.getInstance().getEPersonService(); - - Group parentGroup = null; - EPerson member1 = null; - EPerson member2 = null; - - try { - context.turnOffAuthorisationSystem(); - - parentGroup = GroupBuilder.createGroup(context).build(); - member1 = EPersonBuilder.createEPerson(context).build(); - member2 = EPersonBuilder.createEPerson(context).build(); - - context.commit(); - - parentGroup = context.reloadEntity(parentGroup); - member1 = context.reloadEntity(member1); - member2 = context.reloadEntity(member2); + context.turnOffAuthorisationSystem(); - context.restoreAuthSystemState(); - String authToken = getAuthToken(admin.getEmail(), password); + Group parentGroup = GroupBuilder.createGroup(context).build(); + EPerson member1 = EPersonBuilder.createEPerson(context).build(); + EPerson member2 = EPersonBuilder.createEPerson(context).build(); - getClient(authToken).perform( - post("/api/eperson/groups/" + parentGroup.getID() + "/epersons") - .contentType(parseMediaType(TEXT_URI_LIST_VALUE)) - .content(REST_SERVER_URL + "eperson/groups/123456789\n" - + REST_SERVER_URL + "eperson/groups/" + member2.getID() - ) - ).andExpect(status().isUnprocessableEntity()); + context.restoreAuthSystemState(); + String authToken = getAuthToken(admin.getEmail(), password); - } finally { - if (parentGroup != null) { - GroupBuilder.deleteGroup(parentGroup.getID()); - } - if (member1 != null) { - EPersonBuilder.deleteEPerson(member1.getID()); - } - if (member2 != null) { - EPersonBuilder.deleteEPerson(member2.getID()); - } - } + getClient(authToken).perform( + post("/api/eperson/groups/" + parentGroup.getID() + "/epersons") + .contentType(parseMediaType(TEXT_URI_LIST_VALUE)) + .content(REST_SERVER_URL + "eperson/groups/123456789\n" + + REST_SERVER_URL + "eperson/groups/" + member2.getID() + ) + ).andExpect(status().isUnprocessableEntity()); } @Test @@ -1378,29 +1115,18 @@ public void removeChildGroupTest() throws Exception { @Test public void removeChildGroupCommunityAdminTest() throws Exception { - CommunityService communityService = ContentServiceFactory.getInstance().getCommunityService(); GroupService groupService = EPersonServiceFactory.getInstance().getGroupService(); - Community community = null; - Group parentGroup = null; - Group childGroup = null; - - try { context.turnOffAuthorisationSystem(); - community = CommunityBuilder.createCommunity(context).build(); - parentGroup = GroupBuilder.createCommunityAdminGroup(context, community) + Community community = CommunityBuilder.createCommunity(context).build(); + Group parentGroup = GroupBuilder.createCommunityAdminGroup(context, community) .addMember(eperson) .build(); - childGroup = GroupBuilder.createGroup(context) + Group childGroup = GroupBuilder.createGroup(context) .withParent(parentGroup) .build(); - context.commit(); - - parentGroup = context.reloadEntity(parentGroup); - childGroup = context.reloadEntity(childGroup); - context.restoreAuthSystemState(); String authToken = getAuthToken(eperson.getEmail(), password); getClient(authToken).perform( @@ -1413,163 +1139,71 @@ public void removeChildGroupCommunityAdminTest() throws Exception { assertFalse( groupService.isMember(parentGroup, childGroup) ); - - } finally { - if (community != null) { - CommunityBuilder.deleteCommunity(community.getID()); - } - if (parentGroup != null) { - GroupBuilder.deleteGroup(parentGroup.getID()); - } - if (childGroup != null) { - GroupBuilder.deleteGroup(childGroup.getID()); - } - } } @Test public void removeChildGroupForbiddenTest() throws Exception { - GroupService groupService = EPersonServiceFactory.getInstance().getGroupService(); - - Group parentGroup = null; - Group childGroup = null; - - try { - context.turnOffAuthorisationSystem(); - - parentGroup = GroupBuilder.createGroup(context).build(); - childGroup = GroupBuilder.createGroup(context).build(); - - context.commit(); - - parentGroup = context.reloadEntity(parentGroup); - childGroup = context.reloadEntity(childGroup); + context.turnOffAuthorisationSystem(); - context.restoreAuthSystemState(); - String authToken = getAuthToken(eperson.getEmail(), password); - getClient(authToken).perform( - delete("/api/eperson/groups/" + parentGroup.getID() + "/subgroups/" + childGroup.getID()) - ).andExpect(status().isForbidden()); + Group parentGroup = GroupBuilder.createGroup(context).build(); + Group childGroup = GroupBuilder.createGroup(context).build(); - } finally { - if (parentGroup != null) { - GroupBuilder.deleteGroup(parentGroup.getID()); - } - if (childGroup != null) { - GroupBuilder.deleteGroup(childGroup.getID()); - } - } + context.restoreAuthSystemState(); + String authToken = getAuthToken(eperson.getEmail(), password); + getClient(authToken).perform( + delete("/api/eperson/groups/" + parentGroup.getID() + "/subgroups/" + childGroup.getID()) + ).andExpect(status().isForbidden()); } @Test public void removeChildGroupUnauthorizedTest() throws Exception { - GroupService groupService = EPersonServiceFactory.getInstance().getGroupService(); - - Group parentGroup = null; - Group childGroup = null; - - try { - context.turnOffAuthorisationSystem(); - - parentGroup = GroupBuilder.createGroup(context).build(); - childGroup = GroupBuilder.createGroup(context).build(); - - context.commit(); - - parentGroup = context.reloadEntity(parentGroup); - childGroup = context.reloadEntity(childGroup); + context.turnOffAuthorisationSystem(); - context.restoreAuthSystemState(); - getClient().perform( - delete("/api/eperson/groups/" + parentGroup.getID() + "/subgroups/" + childGroup.getID()) - ).andExpect(status().isUnauthorized()); + Group parentGroup = GroupBuilder.createGroup(context).build(); + Group childGroup = GroupBuilder.createGroup(context).build(); - } finally { - if (parentGroup != null) { - GroupBuilder.deleteGroup(parentGroup.getID()); - } - if (childGroup != null) { - GroupBuilder.deleteGroup(childGroup.getID()); - } - } + context.restoreAuthSystemState(); + getClient().perform( + delete("/api/eperson/groups/" + parentGroup.getID() + "/subgroups/" + childGroup.getID()) + ).andExpect(status().isUnauthorized()); } @Test public void removeChildGroupNotFoundTest() throws Exception { - GroupService groupService = EPersonServiceFactory.getInstance().getGroupService(); - - Group parentGroup = null; - Group childGroup = null; - - try { - context.turnOffAuthorisationSystem(); - - parentGroup = GroupBuilder.createGroup(context).build(); - childGroup = GroupBuilder.createGroup(context) - .withParent(parentGroup) - .build(); - - context.commit(); - - parentGroup = context.reloadEntity(parentGroup); - childGroup = context.reloadEntity(childGroup); + context.turnOffAuthorisationSystem(); - context.restoreAuthSystemState(); - String authToken = getAuthToken(admin.getEmail(), password); + Group parentGroup = GroupBuilder.createGroup(context).build(); + Group childGroup = GroupBuilder.createGroup(context) + .withParent(parentGroup) + .build(); - getClient(authToken).perform( - delete("/api/eperson/groups/" + UUID.randomUUID() + "/subgroups/" + childGroup.getID()) - ).andExpect(status().isNotFound()); + context.restoreAuthSystemState(); + String authToken = getAuthToken(admin.getEmail(), password); - } finally { - if (parentGroup != null) { - GroupBuilder.deleteGroup(parentGroup.getID()); - } - if (childGroup != null) { - GroupBuilder.deleteGroup(childGroup.getID()); - } - } + getClient(authToken).perform( + delete("/api/eperson/groups/" + UUID.randomUUID() + "/subgroups/" + childGroup.getID()) + ).andExpect(status().isNotFound()); } @Test public void removeChildGroupUnprocessableTest() throws Exception { - GroupService groupService = EPersonServiceFactory.getInstance().getGroupService(); - - Group parentGroup = null; - Group childGroup = null; - - try { - context.turnOffAuthorisationSystem(); - - parentGroup = GroupBuilder.createGroup(context).build(); - childGroup = GroupBuilder.createGroup(context) - .withParent(parentGroup) - .build(); - - context.commit(); - - parentGroup = context.reloadEntity(parentGroup); - childGroup = context.reloadEntity(childGroup); + context.turnOffAuthorisationSystem(); - context.restoreAuthSystemState(); - String authToken = getAuthToken(admin.getEmail(), password); + Group parentGroup = GroupBuilder.createGroup(context).build(); + Group childGroup = GroupBuilder.createGroup(context) + .withParent(parentGroup) + .build(); - getClient(authToken).perform( - delete("/api/eperson/groups/" + parentGroup.getID() + "/subgroups/" + UUID.randomUUID()) - ).andExpect(status().isUnprocessableEntity()); + context.restoreAuthSystemState(); + String authToken = getAuthToken(admin.getEmail(), password); - } finally { - if (parentGroup != null) { - GroupBuilder.deleteGroup(parentGroup.getID()); - } - if (childGroup != null) { - GroupBuilder.deleteGroup(childGroup.getID()); - } - } + getClient(authToken).perform( + delete("/api/eperson/groups/" + parentGroup.getID() + "/subgroups/" + UUID.randomUUID()) + ).andExpect(status().isUnprocessableEntity()); } @Test @@ -1613,31 +1247,19 @@ public void removeMemberTest() throws Exception { @Test public void removeMemberCommunityAdminTest() throws Exception { - CommunityService communityService = ContentServiceFactory.getInstance().getCommunityService(); GroupService groupService = EPersonServiceFactory.getInstance().getGroupService(); - EPersonService ePersonService = EPersonServiceFactory.getInstance().getEPersonService(); - - Community community = null; - Group parentGroup = null; - EPerson member = null; - try { context.turnOffAuthorisationSystem(); - community = CommunityBuilder.createCommunity(context).build(); - member = EPersonBuilder.createEPerson(context).build(); - parentGroup = GroupBuilder.createCommunityAdminGroup(context, community) + Community community = CommunityBuilder.createCommunity(context).build(); + EPerson member = EPersonBuilder.createEPerson(context).build(); + Group parentGroup = GroupBuilder.createCommunityAdminGroup(context, community) .addMember(member) .addMember(eperson) .build(); assertTrue(groupService.isMember(context, member, parentGroup)); - context.commit(); - - parentGroup = context.reloadEntity(parentGroup); - member = context.reloadEntity(member); - context.restoreAuthSystemState(); String authToken = getAuthToken(eperson.getEmail(), password); getClient(authToken).perform( @@ -1650,171 +1272,75 @@ public void removeMemberCommunityAdminTest() throws Exception { assertFalse( groupService.isMember(context, member, parentGroup) ); - - } finally { - if (community != null) { - CommunityBuilder.deleteCommunity(community.getID()); - } - if (parentGroup != null) { - GroupBuilder.deleteGroup(parentGroup.getID()); - } - if (member != null) { - EPersonBuilder.deleteEPerson(member.getID()); - } - } } @Test public void removeMemberForbiddenTest() throws Exception { - GroupService groupService = EPersonServiceFactory.getInstance().getGroupService(); - EPersonService ePersonService = EPersonServiceFactory.getInstance().getEPersonService(); - - Group parentGroup = null; - EPerson member = null; - - try { - context.turnOffAuthorisationSystem(); - - member = EPersonBuilder.createEPerson(context).build(); - parentGroup = GroupBuilder.createGroup(context) - .addMember(member) - .build(); - - context.commit(); - - parentGroup = context.reloadEntity(parentGroup); - member = context.reloadEntity(member); + context.turnOffAuthorisationSystem(); - context.restoreAuthSystemState(); - String authToken = getAuthToken(eperson.getEmail(), password); - getClient(authToken).perform( - delete("/api/eperson/groups/" + parentGroup.getID() + "/epersons/" + member.getID()) - ).andExpect(status().isForbidden()); + EPerson member = EPersonBuilder.createEPerson(context).build(); + Group parentGroup = GroupBuilder.createGroup(context) + .addMember(member) + .build(); - } finally { - if (parentGroup != null) { - GroupBuilder.deleteGroup(parentGroup.getID()); - } - if (member != null) { - EPersonBuilder.deleteEPerson(member.getID()); - } - } + context.restoreAuthSystemState(); + String authToken = getAuthToken(eperson.getEmail(), password); + getClient(authToken).perform( + delete("/api/eperson/groups/" + parentGroup.getID() + "/epersons/" + member.getID()) + ).andExpect(status().isForbidden()); } @Test public void removeMemberUnauthorizedTest() throws Exception { - GroupService groupService = EPersonServiceFactory.getInstance().getGroupService(); - EPersonService ePersonService = EPersonServiceFactory.getInstance().getEPersonService(); - - Group parentGroup = null; - EPerson member = null; - - try { - context.turnOffAuthorisationSystem(); - - member = EPersonBuilder.createEPerson(context).build(); - parentGroup = GroupBuilder.createGroup(context) - .addMember(member) - .build(); - - context.commit(); - - parentGroup = context.reloadEntity(parentGroup); - member = context.reloadEntity(member); + context.turnOffAuthorisationSystem(); - context.restoreAuthSystemState(); - getClient().perform( - delete("/api/eperson/groups/" + parentGroup.getID() + "/epersons/" + member.getID()) - ).andExpect(status().isUnauthorized()); + EPerson member = EPersonBuilder.createEPerson(context).build(); + Group parentGroup = GroupBuilder.createGroup(context) + .addMember(member) + .build(); - } finally { - if (parentGroup != null) { - GroupBuilder.deleteGroup(parentGroup.getID()); - } - if (member != null) { - EPersonBuilder.deleteEPerson(member.getID()); - } - } + context.restoreAuthSystemState(); + getClient().perform( + delete("/api/eperson/groups/" + parentGroup.getID() + "/epersons/" + member.getID()) + ).andExpect(status().isUnauthorized()); } @Test public void removeMemberNotFoundTest() throws Exception { - GroupService groupService = EPersonServiceFactory.getInstance().getGroupService(); - EPersonService ePersonService = EPersonServiceFactory.getInstance().getEPersonService(); - - Group parentGroup = null; - EPerson member = null; - - try { - context.turnOffAuthorisationSystem(); - - member = EPersonBuilder.createEPerson(context).build(); - parentGroup = GroupBuilder.createGroup(context) - .addMember(member) - .build(); - - context.commit(); - - parentGroup = context.reloadEntity(parentGroup); - member = context.reloadEntity(member); + context.turnOffAuthorisationSystem(); - context.restoreAuthSystemState(); - String authToken = getAuthToken(admin.getEmail(), password); + EPerson member = EPersonBuilder.createEPerson(context).build(); + Group parentGroup = GroupBuilder.createGroup(context) + .addMember(member) + .build(); - getClient(authToken).perform( - delete("/api/eperson/groups/" + UUID.randomUUID() + "/epersons/" + member.getID()) - ).andExpect(status().isNotFound()); + context.restoreAuthSystemState(); + String authToken = getAuthToken(admin.getEmail(), password); - } finally { - if (parentGroup != null) { - GroupBuilder.deleteGroup(parentGroup.getID()); - } - if (member != null) { - EPersonBuilder.deleteEPerson(member.getID()); - } - } + getClient(authToken).perform( + delete("/api/eperson/groups/" + UUID.randomUUID() + "/epersons/" + member.getID()) + ).andExpect(status().isNotFound()); } @Test public void removeMemberUnprocessableTest() throws Exception { - GroupService groupService = EPersonServiceFactory.getInstance().getGroupService(); - EPersonService ePersonService = EPersonServiceFactory.getInstance().getEPersonService(); - - Group parentGroup = null; - EPerson member = null; - - try { context.turnOffAuthorisationSystem(); - member = EPersonBuilder.createEPerson(context).build(); - parentGroup = GroupBuilder.createGroup(context) + EPerson member = EPersonBuilder.createEPerson(context).build(); + Group parentGroup = GroupBuilder.createGroup(context) .addMember(member) .build(); - context.commit(); - - parentGroup = context.reloadEntity(parentGroup); - member = context.reloadEntity(member); - context.restoreAuthSystemState(); String authToken = getAuthToken(admin.getEmail(), password); getClient(authToken).perform( delete("/api/eperson/groups/" + parentGroup.getID() + "/epersons/" + UUID.randomUUID()) ).andExpect(status().isUnprocessableEntity()); - - } finally { - if (parentGroup != null) { - GroupBuilder.deleteGroup(parentGroup.getID()); - } - if (member != null) { - EPersonBuilder.deleteEPerson(member.getID()); - } - } } @Test From 90536e443b7fedef0481a34326cafc58fb334396 Mon Sep 17 00:00:00 2001 From: Kim Shepherd Date: Fri, 6 Sep 2024 16:43:36 +0200 Subject: [PATCH 58/96] #9806: Align provider reg in CreateMissingIdentifiersIT with other tests VersionedHandlerIdentifierProviderIT uses this registerProvider method which looks more reliable and doesn't do a refresh/reload of applicationContext after (which I suspected might have an odd interaction with VersioningWithRelationshipsIT and its createBean() calls?) --- .../general/CreateMissingIdentifiersIT.java | 34 ++++++++++++++++--- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/dspace-api/src/test/java/org/dspace/ctask/general/CreateMissingIdentifiersIT.java b/dspace-api/src/test/java/org/dspace/ctask/general/CreateMissingIdentifiersIT.java index 2a07799deee5..8038a7153325 100644 --- a/dspace-api/src/test/java/org/dspace/ctask/general/CreateMissingIdentifiersIT.java +++ b/dspace-api/src/test/java/org/dspace/ctask/general/CreateMissingIdentifiersIT.java @@ -10,6 +10,8 @@ import static org.junit.Assert.assertEquals; import java.io.IOException; +import java.util.ArrayList; +import java.util.List; import org.dspace.AbstractIntegrationTestWithDatabase; import org.dspace.builder.CollectionBuilder; @@ -19,7 +21,10 @@ import org.dspace.content.Item; import org.dspace.core.factory.CoreServiceFactory; import org.dspace.curate.Curator; +import org.dspace.identifier.IdentifierProvider; +import org.dspace.identifier.IdentifierServiceImpl; import org.dspace.identifier.VersionedHandleIdentifierProviderWithCanonicalHandles; +import org.dspace.kernel.ServiceManager; import org.dspace.services.ConfigurationService; import org.dspace.services.factory.DSpaceServicesFactory; import org.junit.After; @@ -32,10 +37,23 @@ */ public class CreateMissingIdentifiersIT extends AbstractIntegrationTestWithDatabase { + private ServiceManager serviceManager; + private IdentifierServiceImpl identifierService; private static final String P_TASK_DEF = "plugin.named.org.dspace.curate.CurationTask"; private static final String TASK_NAME = "test"; + @Override + public void setUp() throws Exception { + super.setUp(); + context.turnOffAuthorisationSystem(); + + serviceManager = DSpaceServicesFactory.getInstance().getServiceManager(); + identifierService = serviceManager.getServicesByType(IdentifierServiceImpl.class).get(0); + // Clean out providers to avoid any being used for creation of community and collection + identifierService.setProviders(new ArrayList<>()); + } + @Test public void testPerform() throws IOException { @@ -67,11 +85,7 @@ public void testPerform() /* * Now install an incompatible provider to make the task fail. */ - DSpaceServicesFactory.getInstance() - .getServiceManager() - .registerServiceClass( - VersionedHandleIdentifierProviderWithCanonicalHandles.class.getCanonicalName(), - VersionedHandleIdentifierProviderWithCanonicalHandles.class); + registerProvider(VersionedHandleIdentifierProviderWithCanonicalHandles.class); curator.curate(context, item); System.out.format("With incompatible provider, result is '%s'.\n", @@ -86,4 +100,14 @@ public void destroy() throws Exception { super.destroy(); DSpaceServicesFactory.getInstance().getServiceManager().getApplicationContext().refresh(); } + + private void registerProvider(Class type) { + // Register our new provider + serviceManager.registerServiceClass(type.getName(), type); + IdentifierProvider identifierProvider = + (IdentifierProvider) serviceManager.getServiceByName(type.getName(), type); + + // Overwrite the identifier-service's providers with the new one to ensure only this provider is used + identifierService.setProviders(List.of(identifierProvider)); + } } From 3521ab6d3598e716cc9fe8e938e883b302006580 Mon Sep 17 00:00:00 2001 From: Kim Shepherd Date: Fri, 6 Sep 2024 16:45:05 +0200 Subject: [PATCH 59/96] #9806: Use builders for creation in VersioningWithRelationshipsIT I am a bit uncertain about the createBean() calls here, why do we not simply *get* the configured beans using the service manager instead, but will look at that in a separate change --- .../VersioningWithRelationshipsIT.java | 33 +++++++++---------- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/dspace-api/src/test/java/org/dspace/content/VersioningWithRelationshipsIT.java b/dspace-api/src/test/java/org/dspace/content/VersioningWithRelationshipsIT.java index 44653300e0de..accc52d0d830 100644 --- a/dspace-api/src/test/java/org/dspace/content/VersioningWithRelationshipsIT.java +++ b/dspace-api/src/test/java/org/dspace/content/VersioningWithRelationshipsIT.java @@ -49,6 +49,7 @@ import org.dspace.builder.ItemBuilder; import org.dspace.builder.RelationshipBuilder; import org.dspace.builder.RelationshipTypeBuilder; +import org.dspace.builder.VersionBuilder; import org.dspace.content.factory.ContentServiceFactory; import org.dspace.content.service.InstallItemService; import org.dspace.content.service.ItemService; @@ -62,8 +63,6 @@ import org.dspace.kernel.ServiceManager; import org.dspace.services.factory.DSpaceServicesFactory; import org.dspace.versioning.Version; -import org.dspace.versioning.factory.VersionServiceFactory; -import org.dspace.versioning.service.VersioningService; import org.hamcrest.Matcher; import org.junit.Assert; import org.junit.Before; @@ -74,8 +73,6 @@ public class VersioningWithRelationshipsIT extends AbstractIntegrationTestWithDa private final RelationshipService relationshipService = ContentServiceFactory.getInstance().getRelationshipService(); - private final VersioningService versioningService = - VersionServiceFactory.getInstance().getVersionService(); private final WorkspaceItemService workspaceItemService = ContentServiceFactory.getInstance().getWorkspaceItemService(); private final InstallItemService installItemService = @@ -291,7 +288,7 @@ public void test_createNewVersionOfItemOnLeftSideOfRelationships() throws Except // create a new version of the publication // ///////////////////////////////////////////// - Version newVersion = versioningService.createNewVersion(context, originalPublication); + Version newVersion = VersionBuilder.createVersion(context, originalPublication, "test").build(); Item newPublication = newVersion.getItem(); assertNotSame(originalPublication, newPublication); @@ -567,7 +564,7 @@ public void test_createNewVersionOfItemAndModifyRelationships() throws Exception // create a new version of the publication // ///////////////////////////////////////////// - Version newVersion = versioningService.createNewVersion(context, originalPublication); + Version newVersion = VersionBuilder.createVersion(context, originalPublication, "test").build(); Item newPublication = newVersion.getItem(); assertNotSame(originalPublication, newPublication); @@ -927,7 +924,7 @@ public void test_createNewVersionOfItemOnRightSideOfRelationships() throws Excep // create a new version of the person // //////////////////////////////////////// - Version newVersion = versioningService.createNewVersion(context, originalPerson); + Version newVersion = VersionBuilder.createVersion(context, originalPerson, "test").build(); Item newPerson = newVersion.getItem(); assertNotSame(originalPerson, newPerson); @@ -1300,7 +1297,7 @@ public void test_createNewVersionOfItemAndVerifyMetadataOrder() throws Exception // create new version of publication // /////////////////////////////////////// - Version newVersion = versioningService.createNewVersion(context, originalPublication); + Version newVersion = VersionBuilder.createVersion(context, originalPublication, "test").build(); Item newPublication = newVersion.getItem(); assertNotSame(originalPublication, newPublication); @@ -1463,7 +1460,7 @@ public void test_createNewVersionOfItemWithAddRemoveMove() throws Exception { // create a new version of the publication // ///////////////////////////////////////////// - Version newVersion = versioningService.createNewVersion(context, originalPublication); + Version newVersion = VersionBuilder.createVersion(context, originalPublication, "test").build(); Item newPublication = newVersion.getItem(); assertNotSame(originalPublication, newPublication); @@ -1782,7 +1779,7 @@ public void test_placeRecalculationAfterDelete() throws Exception { // create new version - volume 1.2 // ///////////////////////////////////// - Item v1_2 = versioningService.createNewVersion(context, v1_1).getItem(); + Item v1_2 = VersionBuilder.createVersion(context, v1_1, "test").build().getItem(); installItemService.installItem(context, workspaceItemService.findByItem(context, v1_2)); context.commit(); @@ -1790,7 +1787,7 @@ public void test_placeRecalculationAfterDelete() throws Exception { // create new version - issue 3.2 // //////////////////////////////////// - Item i3_2 = versioningService.createNewVersion(context, i3_1).getItem(); + Item i3_2 = VersionBuilder.createVersion(context, i3_1, "test").build().getItem(); installItemService.installItem(context, workspaceItemService.findByItem(context, i3_2)); context.commit(); @@ -2316,7 +2313,7 @@ public void test_placeRecalculationAfterDelete_complex() throws Exception { // create new version - person 3.2 // ///////////////////////////////////// - Item pe3_2 = versioningService.createNewVersion(context, pe3_1).getItem(); + Item pe3_2 = VersionBuilder.createVersion(context, pe3_1, "test").build().getItem(); installItemService.installItem(context, workspaceItemService.findByItem(context, pe3_2)); context.commit(); @@ -2324,7 +2321,7 @@ public void test_placeRecalculationAfterDelete_complex() throws Exception { // create new version - project 3.2 // ////////////////////////////////////// - Item pr3_2 = versioningService.createNewVersion(context, pr3_1).getItem(); + Item pr3_2 = VersionBuilder.createVersion(context, pr3_1, "test").build().getItem(); installItemService.installItem(context, workspaceItemService.findByItem(context, pr3_2)); context.commit(); @@ -3056,7 +3053,7 @@ public void test_placeRecalculationNoUseForPlace() throws Exception { // create new version - volume 1.2 // ///////////////////////////////////// - Item v1_2 = versioningService.createNewVersion(context, v1_1).getItem(); + Item v1_2 = VersionBuilder.createVersion(context, v1_1, "test").build().getItem(); installItemService.installItem(context, workspaceItemService.findByItem(context, v1_2)); context.commit(); @@ -3064,7 +3061,7 @@ public void test_placeRecalculationNoUseForPlace() throws Exception { // create new version - issue 3.2 // //////////////////////////////////// - Item i3_2 = versioningService.createNewVersion(context, i3_1).getItem(); + Item i3_2 = VersionBuilder.createVersion(context, i3_1, "test").build().getItem(); installItemService.installItem(context, workspaceItemService.findByItem(context, i3_2)); context.commit(); @@ -3509,7 +3506,7 @@ public void test_virtualMetadataPreserved() throws Exception { // create a new version of publication 1 and archive // /////////////////////////////////////////////////////// - Item publication1V2 = versioningService.createNewVersion(context, publication1V1).getItem(); + Item publication1V2 = VersionBuilder.createVersion(context, publication1V1, "test").build().getItem(); installItemService.installItem(context, workspaceItemService.findByItem(context, publication1V2)); context.dispatchEvents(); @@ -3517,7 +3514,7 @@ public void test_virtualMetadataPreserved() throws Exception { // create new version of person 1 // //////////////////////////////////// - Item person1V2 = versioningService.createNewVersion(context, person1V1).getItem(); + Item person1V2 = VersionBuilder.createVersion(context, person1V1, "test").build().getItem(); // update "Smith, Donald" to "Smith, D." itemService.replaceMetadata( context, person1V2, "person", "givenName", null, null, "D.", @@ -3853,7 +3850,7 @@ public void test_virtualMetadataPreserved() throws Exception { // create new version of person 2 // //////////////////////////////////// - Item person2V2 = versioningService.createNewVersion(context, person2V1).getItem(); + Item person2V2 = VersionBuilder.createVersion(context, person2V1, "test").build().getItem(); Relationship rel1 = getRelationship(publication1V2, isAuthorOfPublication, person2V2); assertNotNull(rel1); rel1.setRightwardValue("Doe, Jane Jr"); From 4af690065038d9cb401d0fa1fc5fbfe0fa1fe2c7 Mon Sep 17 00:00:00 2001 From: Kim Shepherd Date: Fri, 6 Sep 2024 17:15:15 +0200 Subject: [PATCH 60/96] #9806: Set explicit id provider before VersioningWithRelationshipsIT --- .../VersioningWithRelationshipsIT.java | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/dspace-api/src/test/java/org/dspace/content/VersioningWithRelationshipsIT.java b/dspace-api/src/test/java/org/dspace/content/VersioningWithRelationshipsIT.java index accc52d0d830..10cb30cd52b9 100644 --- a/dspace-api/src/test/java/org/dspace/content/VersioningWithRelationshipsIT.java +++ b/dspace-api/src/test/java/org/dspace/content/VersioningWithRelationshipsIT.java @@ -60,6 +60,9 @@ import org.dspace.content.virtual.VirtualMetadataPopulator; import org.dspace.core.Constants; import org.dspace.discovery.SolrSearchCore; +import org.dspace.identifier.IdentifierProvider; +import org.dspace.identifier.IdentifierServiceImpl; +import org.dspace.identifier.VersionedHandleIdentifierProvider; import org.dspace.kernel.ServiceManager; import org.dspace.services.factory.DSpaceServicesFactory; import org.dspace.versioning.Version; @@ -81,7 +84,7 @@ public class VersioningWithRelationshipsIT extends AbstractIntegrationTestWithDa ContentServiceFactory.getInstance().getItemService(); private final SolrSearchCore solrSearchCore = DSpaceServicesFactory.getInstance().getServiceManager().getServicesByType(SolrSearchCore.class).get(0); - + private IdentifierServiceImpl identifierService; protected Community community; protected Collection collection; protected EntityType publicationEntityType; @@ -98,6 +101,22 @@ public class VersioningWithRelationshipsIT extends AbstractIntegrationTestWithDa protected RelationshipType isIssueOfJournalVolume; protected RelationshipType isProjectOfPerson; + private void registerProvider(Class type) { + // Register our new provider + IdentifierProvider identifierProvider = + (IdentifierProvider) DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName(type.getName(), type); + if (identifierProvider == null) { + DSpaceServicesFactory.getInstance().getServiceManager().registerServiceClass(type.getName(), type); + identifierProvider = (IdentifierProvider) DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName(type.getName(), type); + } + + // Overwrite the identifier-service's providers with the new one to ensure only this provider is used + identifierService = DSpaceServicesFactory.getInstance().getServiceManager() + .getServicesByType(IdentifierServiceImpl.class).get(0); + identifierService.setProviders(new ArrayList<>()); + identifierService.setProviders(List.of(identifierProvider)); + } + @Override @Before public void setUp() throws Exception { @@ -105,6 +124,9 @@ public void setUp() throws Exception { context.turnOffAuthorisationSystem(); + + registerProvider(VersionedHandleIdentifierProvider.class); + community = CommunityBuilder.createCommunity(context) .withName("community") .build(); From f6cabe648dfcda786afdf7d5411dc3d7ad85c405 Mon Sep 17 00:00:00 2001 From: Kim Shepherd Date: Fri, 6 Sep 2024 17:58:23 +0200 Subject: [PATCH 61/96] #9806: Move cleanup of handle provider to destroy in VersionedHandleIdentifierProviderIT --- .../VersioningWithRelationshipsIT.java | 23 ------------------- .../VersionedHandleIdentifierProviderIT.java | 22 ++++++++++++++++-- 2 files changed, 20 insertions(+), 25 deletions(-) diff --git a/dspace-api/src/test/java/org/dspace/content/VersioningWithRelationshipsIT.java b/dspace-api/src/test/java/org/dspace/content/VersioningWithRelationshipsIT.java index 10cb30cd52b9..3acc4ca146ee 100644 --- a/dspace-api/src/test/java/org/dspace/content/VersioningWithRelationshipsIT.java +++ b/dspace-api/src/test/java/org/dspace/content/VersioningWithRelationshipsIT.java @@ -60,9 +60,6 @@ import org.dspace.content.virtual.VirtualMetadataPopulator; import org.dspace.core.Constants; import org.dspace.discovery.SolrSearchCore; -import org.dspace.identifier.IdentifierProvider; -import org.dspace.identifier.IdentifierServiceImpl; -import org.dspace.identifier.VersionedHandleIdentifierProvider; import org.dspace.kernel.ServiceManager; import org.dspace.services.factory.DSpaceServicesFactory; import org.dspace.versioning.Version; @@ -84,7 +81,6 @@ public class VersioningWithRelationshipsIT extends AbstractIntegrationTestWithDa ContentServiceFactory.getInstance().getItemService(); private final SolrSearchCore solrSearchCore = DSpaceServicesFactory.getInstance().getServiceManager().getServicesByType(SolrSearchCore.class).get(0); - private IdentifierServiceImpl identifierService; protected Community community; protected Collection collection; protected EntityType publicationEntityType; @@ -101,22 +97,6 @@ public class VersioningWithRelationshipsIT extends AbstractIntegrationTestWithDa protected RelationshipType isIssueOfJournalVolume; protected RelationshipType isProjectOfPerson; - private void registerProvider(Class type) { - // Register our new provider - IdentifierProvider identifierProvider = - (IdentifierProvider) DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName(type.getName(), type); - if (identifierProvider == null) { - DSpaceServicesFactory.getInstance().getServiceManager().registerServiceClass(type.getName(), type); - identifierProvider = (IdentifierProvider) DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName(type.getName(), type); - } - - // Overwrite the identifier-service's providers with the new one to ensure only this provider is used - identifierService = DSpaceServicesFactory.getInstance().getServiceManager() - .getServicesByType(IdentifierServiceImpl.class).get(0); - identifierService.setProviders(new ArrayList<>()); - identifierService.setProviders(List.of(identifierProvider)); - } - @Override @Before public void setUp() throws Exception { @@ -124,9 +104,6 @@ public void setUp() throws Exception { context.turnOffAuthorisationSystem(); - - registerProvider(VersionedHandleIdentifierProvider.class); - community = CommunityBuilder.createCommunity(context) .withName("community") .build(); diff --git a/dspace-api/src/test/java/org/dspace/identifier/VersionedHandleIdentifierProviderIT.java b/dspace-api/src/test/java/org/dspace/identifier/VersionedHandleIdentifierProviderIT.java index 7e549f6cae33..57acf1f1c453 100644 --- a/dspace-api/src/test/java/org/dspace/identifier/VersionedHandleIdentifierProviderIT.java +++ b/dspace-api/src/test/java/org/dspace/identifier/VersionedHandleIdentifierProviderIT.java @@ -24,6 +24,7 @@ import org.dspace.content.Item; import org.dspace.kernel.ServiceManager; import org.dspace.services.factory.DSpaceServicesFactory; +import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -57,13 +58,30 @@ public void setUp() throws Exception { .build(); } + @After + @Override + public void destroy() throws Exception { + super.destroy(); + // After this test has finished running, refresh application context and + // set the expected 'default' versioned handle provider back to ensure other tests don't fail + DSpaceServicesFactory.getInstance().getServiceManager().getApplicationContext().refresh(); + } + private void registerProvider(Class type) { // Register our new provider - serviceManager.registerServiceClass(type.getName(), type); IdentifierProvider identifierProvider = - (IdentifierProvider) serviceManager.getServiceByName(type.getName(), type); + (IdentifierProvider) DSpaceServicesFactory.getInstance().getServiceManager() + .getServiceByName(type.getName(), type); + if (identifierProvider == null) { + DSpaceServicesFactory.getInstance().getServiceManager().registerServiceClass(type.getName(), type); + identifierProvider = (IdentifierProvider) DSpaceServicesFactory.getInstance().getServiceManager() + .getServiceByName(type.getName(), type); + } // Overwrite the identifier-service's providers with the new one to ensure only this provider is used + identifierService = DSpaceServicesFactory.getInstance().getServiceManager() + .getServicesByType(IdentifierServiceImpl.class).get(0); + identifierService.setProviders(new ArrayList<>()); identifierService.setProviders(List.of(identifierProvider)); } From 353cf71f3af08a121e62374cf3af0451f8006027 Mon Sep 17 00:00:00 2001 From: "Mark H. Wood" Date: Wed, 18 Sep 2024 11:36:45 -0400 Subject: [PATCH 62/96] Fix new ErrorProne errors from new EP version, and a few ancient warnings. --- .../dspace/authenticate/LDAPAuthentication.java | 6 ++++-- .../main/java/org/dspace/curate/Curation.java | 16 ++++++++++++---- .../rest/repository/DSpaceRestRepository.java | 5 ----- .../app/rest/utils/DSpaceKernelInitializer.java | 1 + .../dspace/services/email/EmailServiceImpl.java | 1 + .../java/org/dspace/app/ServerApplication.java | 6 +++--- pom.xml | 2 +- 7 files changed, 22 insertions(+), 15 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/authenticate/LDAPAuthentication.java b/dspace-api/src/main/java/org/dspace/authenticate/LDAPAuthentication.java index b791df15b5c0..81280051ff21 100644 --- a/dspace-api/src/main/java/org/dspace/authenticate/LDAPAuthentication.java +++ b/dspace-api/src/main/java/org/dspace/authenticate/LDAPAuthentication.java @@ -503,6 +503,7 @@ protected String getDNOfUser(String adminUser, String adminPassword, Context con } else { searchName = ldap_provider_url + ldap_search_context; } + @SuppressWarnings("BanJNDI") NamingEnumeration answer = ctx.search( searchName, "(&({0}={1}))", new Object[] {ldap_id_field, @@ -553,7 +554,7 @@ protected String getDNOfUser(String adminUser, String adminPassword, Context con att = atts.get(attlist[4]); if (att != null) { // loop through all groups returned by LDAP - ldapGroup = new ArrayList(); + ldapGroup = new ArrayList<>(); for (NamingEnumeration val = att.getAll(); val.hasMoreElements(); ) { ldapGroup.add((String) val.next()); } @@ -633,7 +634,8 @@ protected boolean ldapAuthenticate(String netid, String password, ctx.addToEnvironment(javax.naming.Context.AUTHORITATIVE, "true"); ctx.addToEnvironment(javax.naming.Context.REFERRAL, "follow"); // dummy operation to check if authentication has succeeded - ctx.getAttributes(""); + @SuppressWarnings("BanJNDI") + Attributes trash = ctx.getAttributes(""); } else if (!useTLS) { // Authenticate env.put(javax.naming.Context.SECURITY_AUTHENTICATION, "Simple"); diff --git a/dspace-api/src/main/java/org/dspace/curate/Curation.java b/dspace-api/src/main/java/org/dspace/curate/Curation.java index 4d70286e79e0..ece1b7738af3 100644 --- a/dspace-api/src/main/java/org/dspace/curate/Curation.java +++ b/dspace-api/src/main/java/org/dspace/curate/Curation.java @@ -165,7 +165,7 @@ private long runQueue(TaskQueue queue, Curator curator) throws SQLException, Aut * End of curation script; logs script time if -v verbose is set * * @param timeRun Time script was started - * @throws SQLException If DSpace contextx can't complete + * @throws SQLException If DSpace context can't complete */ private void endScript(long timeRun) throws SQLException { context.complete(); @@ -300,9 +300,17 @@ private void initGeneralLineOptionsAndCheckIfValid() { // scope if (this.commandLine.getOptionValue('s') != null) { this.scope = this.commandLine.getOptionValue('s'); - if (this.scope != null && Curator.TxScope.valueOf(this.scope.toUpperCase()) == null) { - this.handler.logError("Bad transaction scope '" + this.scope + "': only 'object', 'curation' or " + - "'open' recognized"); + boolean knownScope; + try { + Curator.TxScope.valueOf(this.scope.toUpperCase()); + knownScope = true; + } catch (IllegalArgumentException | NullPointerException e) { + knownScope = false; + } + if (!knownScope) { + this.handler.logError("Bad transaction scope '" + + this.scope + + "': only 'object', 'curation' or 'open' recognized"); throw new IllegalArgumentException( "Bad transaction scope '" + this.scope + "': only 'object', 'curation' or " + "'open' recognized"); diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/DSpaceRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/DSpaceRestRepository.java index 296c4322a3fc..cde28b836c6d 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/DSpaceRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/DSpaceRestRepository.java @@ -50,17 +50,12 @@ public abstract class DSpaceRestRepository, PagingAndSortingRepository, BeanNameAware { - private static final Logger log = org.apache.logging.log4j.LogManager.getLogger(DSpaceRestRepository.class); - private String thisRepositoryBeanName; private DSpaceRestRepository thisRepository; @Autowired private ApplicationContext applicationContext; - @Autowired - private MetadataFieldService metadataFieldService; - /** * From BeanNameAware. Allows us to capture the name of the bean, so we can load it into thisRepository. * See getThisRepository() method. diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/utils/DSpaceKernelInitializer.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/utils/DSpaceKernelInitializer.java index 7dfcd1d76d1d..88a093c0575d 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/utils/DSpaceKernelInitializer.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/utils/DSpaceKernelInitializer.java @@ -81,6 +81,7 @@ public void initialize(final ConfigurableApplicationContext applicationContext) * Initially look for JNDI Resource called "java:/comp/env/dspace.dir". * If not found, use value provided in "dspace.dir" in Spring Environment */ + @SuppressWarnings("BanJNDI") private String getDSpaceHome(ConfigurableEnvironment environment) { // Load the "dspace.dir" property from Spring Boot's Configuration (application.properties) // This gives us the location of our DSpace configurations, necessary to start the kernel diff --git a/dspace-services/src/main/java/org/dspace/services/email/EmailServiceImpl.java b/dspace-services/src/main/java/org/dspace/services/email/EmailServiceImpl.java index e26954ff0259..b8de1c79994a 100644 --- a/dspace-services/src/main/java/org/dspace/services/email/EmailServiceImpl.java +++ b/dspace-services/src/main/java/org/dspace/services/email/EmailServiceImpl.java @@ -62,6 +62,7 @@ public Session getSession() { } @PostConstruct + @SuppressWarnings("BanJNDI") public void init() { // See if there is already a Session in our environment String sessionName = cfg.getProperty("mail.session.name"); diff --git a/dspace/modules/server/src/main/java/org/dspace/app/ServerApplication.java b/dspace/modules/server/src/main/java/org/dspace/app/ServerApplication.java index 34acc778b7f3..bc8e4f8a78a5 100644 --- a/dspace/modules/server/src/main/java/org/dspace/app/ServerApplication.java +++ b/dspace/modules/server/src/main/java/org/dspace/app/ServerApplication.java @@ -23,7 +23,7 @@ * NOTE: This extends SpringBootServletInitializer in order to allow us to build * a deployable WAR file with Spring Boot. See: * http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#howto-create-a-deployable-war-file - * + * * @author Luca Giamminonni (luca.giamminonni at 4science.it) * */ @@ -39,8 +39,8 @@ public class ServerApplication extends SpringBootServletInitializer { *

    * See: http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#howto-create-a-deployable-war-file * - * @param application - * @return + * @param application some builder. + * @return the builder, configured with DSpace sources and initializers. */ @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { diff --git a/pom.xml b/pom.xml index 6129e74daa55..d59342adcb17 100644 --- a/pom.xml +++ b/pom.xml @@ -29,7 +29,7 @@ 8.11.3 3.10.8 - 2.10.0 + 2.32.0 2.16.0 2.16.0 From 082756fa70ff22e5b77ba310c420367fd571a176 Mon Sep 17 00:00:00 2001 From: "Mark H. Wood" Date: Wed, 18 Sep 2024 15:18:55 -0400 Subject: [PATCH 63/96] Fix ErrorProne errors in tests. Also fix some of the hundreds of warnings. This uncovered still more warnings that hadn't been previously reported, probably because there are simply too many. --- .../dspace/util/DSpaceKernelInitializer.java | 1 + .../rest/repository/DSpaceRestRepository.java | 2 - .../AuthorizationFeatureRestRepositoryIT.java | 17 +- .../rest/AuthorizationFeatureServiceIT.java | 18 ++- .../rest/AuthorizationRestRepositoryIT.java | 152 +++++++++--------- .../app/rest/CollectionRestRepositoryIT.java | 6 +- .../app/rest/CommunityRestRepositoryIT.java | 4 +- .../DSpaceConfigurationServiceTest.java | 18 ++- .../servicemanager/ProviderHolderTest.java | 15 +- .../servicemanager/ProviderStackTest.java | 43 ++--- 10 files changed, 137 insertions(+), 139 deletions(-) diff --git a/dspace-api/src/test/java/org/dspace/util/DSpaceKernelInitializer.java b/dspace-api/src/test/java/org/dspace/util/DSpaceKernelInitializer.java index a6f381bafbae..8f9169875ab3 100644 --- a/dspace-api/src/test/java/org/dspace/util/DSpaceKernelInitializer.java +++ b/dspace-api/src/test/java/org/dspace/util/DSpaceKernelInitializer.java @@ -83,6 +83,7 @@ public void initialize(final ConfigurableApplicationContext applicationContext) * Initially look for JNDI Resource called "java:/comp/env/dspace.dir". * If not found, use value provided in "dspace.dir" in Spring Environment */ + @SuppressWarnings("BanJNDI") private String getDSpaceHome(ConfigurableEnvironment environment) { // Load the "dspace.dir" property from Spring's configuration. // This gives us the location of our DSpace configuration, which is diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/DSpaceRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/DSpaceRestRepository.java index cde28b836c6d..cf7c556e3ac3 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/DSpaceRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/DSpaceRestRepository.java @@ -17,7 +17,6 @@ import com.fasterxml.jackson.databind.JsonNode; import jakarta.servlet.http.HttpServletRequest; -import org.apache.logging.log4j.Logger; import org.dspace.app.rest.exception.DSpaceBadRequestException; import org.dspace.app.rest.exception.RESTAuthorizationException; import org.dspace.app.rest.exception.RepositoryMethodNotImplementedException; @@ -26,7 +25,6 @@ import org.dspace.app.rest.model.RestAddressableModel; import org.dspace.app.rest.model.patch.Patch; import org.dspace.authorize.AuthorizeException; -import org.dspace.content.service.MetadataFieldService; import org.dspace.core.Context; import org.springframework.beans.factory.BeanNameAware; import org.springframework.beans.factory.annotation.Autowired; diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/AuthorizationFeatureRestRepositoryIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/AuthorizationFeatureRestRepositoryIT.java index 0aadff7a9927..c318a1038754 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/AuthorizationFeatureRestRepositoryIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/AuthorizationFeatureRestRepositoryIT.java @@ -37,12 +37,12 @@ public class AuthorizationFeatureRestRepositoryIT extends AbstractControllerInte @Autowired private AuthorizationFeatureService authzFeatureService; - @Test /** - * All the features should be returned + * All the features should be returned. * * @throws Exception */ + @Test public void findAllTest() throws Exception { int featuresNum = authzFeatureService.findAll().size(); int expReturn = featuresNum > 20 ? 20 : featuresNum; @@ -62,20 +62,20 @@ public void findAllTest() throws Exception { } - @Test /** * The feature endpoint must provide proper pagination. Unauthorized and * forbidden scenarios are managed in the findAllTest * * @throws Exception */ + @Test public void findAllWithPaginationTest() throws Exception { int featuresNum = authzFeatureService.findAll().size(); String adminToken = getAuthToken(admin.getEmail(), password); - List featureIDs = new ArrayList(); + List featureIDs = new ArrayList<>(); for (int page = 0; page < featuresNum; page++) { - AtomicReference idRef = new AtomicReference(); + AtomicReference idRef = new AtomicReference<>(); getClient(adminToken) .perform(get("/api/authz/features").param("page", String.valueOf(page)).param("size", "1")) @@ -101,12 +101,13 @@ public void findAllWithPaginationTest() throws Exception { } } - @Test /** - * The feature resource endpoint must expose the proper structure and be reserved to administrators + * The feature resource endpoint must expose the proper structure and be + * reserved to administrators. * * @throws Exception */ + @Test public void findOneTest() throws Exception { getClient().perform(get("/api/authz/features/withdrawItem")).andExpect(status().isOk()) .andExpect(jsonPath("$.id", is("withdrawItem"))) @@ -121,12 +122,12 @@ public void findOneNotFoundTest() throws Exception { } - @Test /** * It should be possible to find features by resourcetype. The endpoint is only available to administrators * * @throws Exception */ + @Test public void findByResourceTypeTest() throws Exception { AuthorizationFeature alwaysTrueFeature = authzFeatureService.find(AlwaysTrueFeature.NAME); String adminToken = getAuthToken(admin.getEmail(), password); diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/AuthorizationFeatureServiceIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/AuthorizationFeatureServiceIT.java index 66be81035272..31db90f54fe6 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/AuthorizationFeatureServiceIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/AuthorizationFeatureServiceIT.java @@ -49,12 +49,12 @@ public class AuthorizationFeatureServiceIT extends AbstractControllerIntegration @Autowired private AuthorizationFeatureService authzFeatureService; - @Test /** - * All the features available in the Sprint Context should be returned + * All the features available in the Sprint Context should be returned. * * @throws Exception */ + @Test public void findAllTest() throws Exception { List authzFeatureServiceFindAll = authzFeatureService.findAll(); @@ -70,12 +70,13 @@ public void findAllTest() throws Exception { equalTo(featureNames.size())); } - @Test /** - * The find method should return existing feature and null in the case the feature doesn't exist + * The find method should return existing feature or {@code null} in the + * case the feature doesn't exist. * * @throws Exception */ + @Test public void findTest() throws Exception { AuthorizationFeature aFeature = authzFeatureService.find(AlwaysTrueFeature.NAME); assertThat("check that one of our mock feature is retrieved", aFeature.getName(), @@ -85,12 +86,12 @@ public void findTest() throws Exception { assertThat("check that not existing feature name return null", aNotExistingFeature, equalTo(null)); } - @Test /** - * The findByResourceType must return only features that support the specified type + * The findByResourceType must return only features that support the specified type. * * @throws Exception */ + @Test public void findByResourceTypeTest() throws Exception { // we have at least one feature that support the Site object final String siteUniqueType = SiteRest.CATEGORY + "." + SiteRest.NAME; @@ -119,12 +120,13 @@ public void findByResourceTypeTest() throws Exception { assertThat(notExistingTypeFeatures.size(), equalTo(0)); } - @Test /** - * The isAuthorized must return true for authorized feature and false for not authorized feature + * The isAuthorized must return {@code true} for authorized feature and + * {@code false} for not authorized feature. * * @throws Exception */ + @Test public void isAuthorizedTest() throws Exception { Site site = siteService.findSite(context); SiteRest siteRest = siteConverter.convert(site, DefaultProjection.DEFAULT); diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/AuthorizationRestRepositoryIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/AuthorizationRestRepositoryIT.java index 3f139caae777..9fcf1bab4797 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/AuthorizationRestRepositoryIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/AuthorizationRestRepositoryIT.java @@ -70,7 +70,7 @@ /** * Test suite for the Authorization endpoint - * + * * @author Andrea Bollini (andrea.bollini at 4science.it) * */ @@ -99,37 +99,37 @@ public class AuthorizationRestRepositoryIT extends AbstractControllerIntegration private Utils utils; private SiteService siteService; - /** + /** * this hold a reference to the test feature {@link AlwaysTrueFeature} */ private AuthorizationFeature alwaysTrue; - /** + /** * this hold a reference to the test feature {@link AlwaysFalseFeature} */ private AuthorizationFeature alwaysFalse; - /** + /** * this hold a reference to the test feature {@link AlwaysThrowExceptionFeature} */ private AuthorizationFeature alwaysException; - /** + /** * this hold a reference to the test feature {@link TrueForAdminsFeature} */ private AuthorizationFeature trueForAdmins; - /** + /** * this hold a reference to the test feature {@link TrueForLoggedUsersFeature} */ private AuthorizationFeature trueForLoggedUsers; - /** + /** * this hold a reference to the test feature {@link TrueForTestFeature} */ private AuthorizationFeature trueForTestUsers; - /** + /** * this hold a reference to the test feature {@link TrueForUsersInGroupTestFeature} */ private AuthorizationFeature trueForUsersInGroupTest; @@ -150,12 +150,12 @@ public void setUp() throws Exception { configurationService.setProperty("webui.user.assumelogin", true); } - @Test /** * This method is not implemented * * @throws Exception */ + @Test public void findAllTest() throws Exception { String adminToken = getAuthToken(admin.getEmail(), password); getClient(adminToken).perform(get("/api/authz/authorizations")) @@ -164,12 +164,12 @@ public void findAllTest() throws Exception { .andExpect(status().isMethodNotAllowed()); } - @Test /** * Verify that an user can access a specific authorization * * @throws Exception */ + @Test public void findOneTest() throws Exception { Site site = siteService.findSite(context); SiteRest siteRest = siteConverter.convert(site, DefaultProjection.DEFAULT); @@ -206,12 +206,12 @@ public void findOneTest() throws Exception { Matchers.is(AuthorizationMatcher.matchAuthorization(authAnonymousUserSite)))); } - @Test /** * Verify that the unauthorized return code is used in the appropriate scenarios * * @throws Exception */ + @Test public void findOneUnauthorizedTest() throws Exception { Site site = siteService.findSite(context); SiteRest siteRest = siteConverter.convert(site, DefaultProjection.DEFAULT); @@ -229,12 +229,12 @@ public void findOneUnauthorizedTest() throws Exception { .andExpect(status().isUnauthorized()); } - @Test /** * Verify that the forbidden return code is used in the appropriate scenarios * * @throws Exception */ + @Test public void findOneForbiddenTest() throws Exception { context.turnOffAuthorisationSystem(); Site site = siteService.findSite(context); @@ -265,12 +265,12 @@ public void findOneForbiddenTest() throws Exception { .andExpect(status().isForbidden()); } - @Test /** * Verify that the not found return code is used in the appropriate scenarios * * @throws Exception */ + @Test public void findOneNotFoundTest() throws Exception { context.turnOffAuthorisationSystem(); Site site = siteService.findSite(context); @@ -352,12 +352,12 @@ public void findOneNotFoundTest() throws Exception { } - @Test /** * Verify that an exception in the feature check will be reported back * * @throws Exception */ + @Test public void findOneInternalServerErrorTest() throws Exception { Site site = siteService.findSite(context); SiteRest siteRest = siteConverter.convert(site, DefaultProjection.DEFAULT); @@ -375,16 +375,16 @@ public void findOneInternalServerErrorTest() throws Exception { .andExpect(status().isInternalServerError()); } - @Test /** * Verify that the search by object works properly in allowed scenarios: * - for an administrator * - for an administrator that want to inspect permission of the anonymous users or another user * - for a logged-in "normal" user * - for anonymous - * + * * @throws Exception */ + @Test public void findByObjectTest() throws Exception { Site site = siteService.findSite(context); SiteRest siteRest = siteConverter.convert(site, DefaultProjection.DEFAULT); @@ -667,13 +667,13 @@ public void findByObjectTest() throws Exception { .andExpect(jsonPath("$.page.totalElements", greaterThanOrEqualTo(1))); } - @Test /** * Verify that the findByObject return an empty page when the requested object doesn't exist but the uri is * potentially valid (i.e. deleted object) - * + * * @throws Exception */ + @Test public void findByNotExistingObjectTest() throws Exception { String wrongSiteUri = "http://localhost/api/core/sites/" + UUID.randomUUID(); @@ -759,12 +759,12 @@ public void findByNotExistingObjectTest() throws Exception { .andExpect(jsonPath("$.page.totalElements", is(0))); } - @Test /** * Verify that the findByObject return the 400 Bad Request response for invalid or missing URI (required parameter) - * + * * @throws Exception */ + @Test public void findByObjectBadRequestTest() throws Exception { String[] invalidUris = new String[] { "invalid-uri", @@ -837,12 +837,12 @@ public void findByObjectBadRequestTest() throws Exception { .andExpect(status().isBadRequest()); } - @Test /** * Verify that the findByObject return the 401 Unauthorized response when an eperson is involved - * + * * @throws Exception */ + @Test public void findByObjectUnauthorizedTest() throws Exception { Site site = siteService.findSite(context); SiteRest siteRest = siteConverter.convert(site, DefaultProjection.DEFAULT); @@ -876,13 +876,13 @@ public void findByObjectUnauthorizedTest() throws Exception { .andExpect(status().isUnauthorized()); } - @Test /** * Verify that the findByObject return the 403 Forbidden response when a non-admin eperson try to search the - * authorization of another eperson - * + * authorization of another eperson. + * * @throws Exception */ + @Test public void findByObjectForbiddenTest() throws Exception { Site site = siteService.findSite(context); SiteRest siteRest = siteConverter.convert(site, DefaultProjection.DEFAULT); @@ -920,11 +920,11 @@ public void findByObjectForbiddenTest() throws Exception { .andExpect(status().isForbidden()); } - @Test /** * Verify that an exception in the feature check will be reported back * @throws Exception */ + @Test public void findByObjectInternalServerErrorTest() throws Exception { Site site = siteService.findSite(context); SiteRest siteRest = siteConverter.convert(site, DefaultProjection.DEFAULT); @@ -977,16 +977,18 @@ public void findByObjectInternalServerErrorTest() throws Exception { .andExpect(status().isInternalServerError()); } - @Test /** - * Verify that the search by object and feature works properly in allowed scenarios: - * - for an administrator - * - for an administrator that want to inspect permission of the anonymous users or another user - * - for a logged-in "normal" user - * - for anonymous - * + * Verify that the search by object and feature works properly in allowed scenarios. + *

      + *
    • for an administrator
    • + *
    • for an administrator that wants to inspect permission of the anonymous users or another user
    • + *
    • for a logged-in "normal" user
    • + *
    • for a not-logged-in "normal" user
    • + *
    + * * @throws Exception */ + @Test public void findByObjectAndFeatureTest() throws Exception { context.turnOffAuthorisationSystem(); Community com = CommunityBuilder.createCommunity(context).withName("A test community").build(); @@ -1146,12 +1148,12 @@ public void findByObjectAndFeatureTest() throws Exception { ))); } - @Test /** * Verify that the search by object and feature works return 204 No Content when a feature is not granted - * + * * @throws Exception */ + @Test public void findByObjectAndFeatureNotGrantedTest() throws Exception { Site site = siteService.findSite(context); SiteRest siteRest = siteConverter.convert(site, DefaultProjection.DEFAULT); @@ -1208,13 +1210,13 @@ public void findByObjectAndFeatureNotGrantedTest() throws Exception { .andExpect(jsonPath("$.page.totalElements", is(0))); } - @Test /** * Verify that the findByObject return the 204 No Content code when the requested object doesn't exist but the uri * is potentially valid (i.e. deleted object) or the feature doesn't exist - * + * * @throws Exception */ + @Test public void findByNotExistingObjectAndFeatureTest() throws Exception { String wrongSiteUri = "http://localhost/api/core/sites/" + UUID.randomUUID(); Site site = siteService.findSite(context); @@ -1315,13 +1317,13 @@ public void findByNotExistingObjectAndFeatureTest() throws Exception { .andExpect(jsonPath("$.page.totalElements", is(0))); } - @Test /** - * Verify that the findByObject return the 400 Bad Request response for invalid or missing URI or feature (required - * parameters) + * Verify that the findByObject return the 400 Bad Request response for + * invalid or missing URI or feature (required parameters). * * @throws Exception */ + @Test public void findByObjectAndFeatureBadRequestTest() throws Exception { String[] invalidUris = new String[] { "invalid-uri", @@ -1390,12 +1392,12 @@ public void findByObjectAndFeatureBadRequestTest() throws Exception { } } - @Test /** * Verify that the findByObjectAndFeature return the 401 Unauthorized response when an eperson is involved - * + * * @throws Exception */ + @Test public void findByObjectAndFeatureUnauthorizedTest() throws Exception { Site site = siteService.findSite(context); SiteRest siteRest = siteConverter.convert(site, DefaultProjection.DEFAULT); @@ -1433,13 +1435,14 @@ public void findByObjectAndFeatureUnauthorizedTest() throws Exception { .andExpect(status().isUnauthorized()); } - @Test /** - * Verify that the findByObjectAndFeature return the 403 Forbidden response when a non-admin eperson try to search - * the authorization of another eperson - * + * Verify that the findByObjectAndFeature returns the 403 Forbidden response + * when a non-admin eperson tries to search the authorization of another + * eperson. + * * @throws Exception */ + @Test public void findByObjectAndFeatureForbiddenTest() throws Exception { Site site = siteService.findSite(context); SiteRest siteRest = siteConverter.convert(site, DefaultProjection.DEFAULT); @@ -1481,11 +1484,11 @@ public void findByObjectAndFeatureForbiddenTest() throws Exception { .andExpect(status().isForbidden()); } - @Test /** - * Verify that an exception in the feature check will be reported back + * Verify that an exception in the feature check will be reported back. * @throws Exception */ + @Test public void findByObjectAndFeatureInternalServerErrorTest() throws Exception { Site site = siteService.findSite(context); SiteRest siteRest = siteConverter.convert(site, DefaultProjection.DEFAULT); @@ -1528,16 +1531,18 @@ public void findByObjectAndFeatureInternalServerErrorTest() throws Exception { .andExpect(status().isInternalServerError()); } - @Test /** - * Verify that the search by multiple objects and features works properly in allowed scenarios: - * - for an administrator - * - for an administrator that want to inspect permission of the anonymous users or another user - * - for a logged-in "normal" user - * - for anonymous + * Verify that the search by multiple objects and features works properly in allowed scenarios. + *
      + *
    • for an administrator
    • + *
    • for an administrator that wants to inspect permission of the anonymous users or another user
    • + *
    • for a logged-in "normal" user
    • + *
    • for a not-logged-in user
    • + *
    * * @throws Exception */ + @Test public void findByMultipleObjectsAndFeaturesTest() throws Exception { context.turnOffAuthorisationSystem(); Community com = CommunityBuilder.createCommunity(context).withName("A test community").build(); @@ -1899,16 +1904,19 @@ public void findByMultipleObjectsAndFeaturesTest() throws Exception { ))); } - @Test /** - * Verify that the paginated search by multiple objects and features works properly in allowed scenarios: - * - for an administrator - * - for an administrator that want to inspect permission of the anonymous users or another user - * - for a logged-in "normal" user - * - for anonymous + * Verify that the paginated search by multiple objects and features works + * properly in allowed scenarios. + *
      + *
    • for an administrator
    • + *
    • for an administrator that wants to inspect permission of the anonymous users or another user
    • + *
    • for a logged-in "normal" user
    • + *
    • for a not-logged-in user
    • + *
    * * @throws Exception */ + @Test public void findByMultipleObjectsAndFeaturesPaginationTest() throws Exception { context.turnOffAuthorisationSystem(); @@ -2098,12 +2106,12 @@ public void findByMultipleObjectsAndFeaturesPaginationTest() throws Exception { ))); } - @Test /** * Verify that the search by many objects and features works return 204 No Content when no feature is granted. * * @throws Exception */ + @Test public void findByMultipleObjectsAndFeatureNotGrantedTest() throws Exception { context.turnOffAuthorisationSystem(); @@ -2190,14 +2198,15 @@ public void findByMultipleObjectsAndFeatureNotGrantedTest() throws Exception { .andExpect(jsonPath("$.page.totalElements", is(0))); } - @Test /** * Verify that the find by multiple objects and features - * return the 204 No Content code when the requested object doesn't exist but the uri - * is potentially valid (i.e. deleted object) or the feature doesn't exist + * return the 204 No Content code when the requested object doesn't exist + * but the uri is potentially valid (a deleted object) or the feature + * doesn't exist. * * @throws Exception */ + @Test public void findByNotExistingMultipleObjectsAndFeatureTest() throws Exception { String wrongSiteId = UUID.randomUUID().toString(); Site site = siteService.findSite(context); @@ -2322,13 +2331,13 @@ public void findByNotExistingMultipleObjectsAndFeatureTest() throws Exception { .andExpect(jsonPath("$.page.totalElements", is(0))); } - @Test /** * Verify that the find by multiple objects and features * return the 400 Bad Request response for invalid or missing UUID or type * * @throws Exception */ + @Test public void findByMultipleObjectsAndFeatureBadRequestTest() throws Exception { String[] invalidUris = new String[] { "foo", @@ -2441,13 +2450,13 @@ public void findByMultipleObjectsAndFeatureBadRequestTest() throws Exception { .andExpect(status().isBadRequest()); } - @Test /** * Verify that the find by multiple objects and features return * the 401 Unauthorized response when an eperson is involved * * @throws Exception */ + @Test public void findByMultipleObjectsAndFeatureUnauthorizedTest() throws Exception { Site site = siteService.findSite(context); String siteId = site.getID().toString(); @@ -2488,7 +2497,6 @@ public void findByMultipleObjectsAndFeatureUnauthorizedTest() throws Exception { .andExpect(status().isUnauthorized()); } - @Test /** * Verify that the find by multiple objects and features * returns the 403 Forbidden response when a non-admin eperson try to search @@ -2496,6 +2504,7 @@ public void findByMultipleObjectsAndFeatureUnauthorizedTest() throws Exception { * * @throws Exception */ + @Test public void findByMultipleObjectsAndFeatureForbiddenTest() throws Exception { Site site = siteService.findSite(context); String siteId = site.getID().toString(); @@ -2545,11 +2554,11 @@ public void findByMultipleObjectsAndFeatureForbiddenTest() throws Exception { .andExpect(status().isForbidden()); } - @Test /** * Verify that an exception in the multiple authorization features check will be reported back * @throws Exception */ + @Test public void findByMultipleObjectsAndFeatureInternalServerErrorTest() throws Exception { Site site = siteService.findSite(context); String siteId = site.getID().toString(); @@ -2596,14 +2605,14 @@ public void findByMultipleObjectsAndFeatureInternalServerErrorTest() throws Exce .andExpect(status().isInternalServerError()); } - @Test /** * This test will check that special group are correctly used to verify - * authorization for the current loggedin user but not inherited from the + * authorization for the current logged-in user but not inherited from the * Administrators login when they look to authorization of third users - * + * * @throws Exception */ + @Test public void verifySpecialGroupMembershipTest() throws Exception { Site site = siteService.findSite(context); SiteRest siteRest = siteConverter.convert(site, DefaultProjection.DEFAULT); @@ -2802,5 +2811,4 @@ private String getAuthorizationID(String epersonUuid, String featureName, String + id.toString(); } - } diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/CollectionRestRepositoryIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/CollectionRestRepositoryIT.java index afd2c7f1f3cd..fcc1c68d26bc 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/CollectionRestRepositoryIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/CollectionRestRepositoryIT.java @@ -1259,7 +1259,7 @@ public void createTestByAuthorizedUser() throws Exception { authorizeService.addPolicy(context, parentCommunity, Constants.ADD, eperson); context.restoreAuthSystemState(); - AtomicReference idRef = new AtomicReference(); + AtomicReference idRef = new AtomicReference<>(); try { String authToken = getAuthToken(eperson.getEmail(), password); @@ -3197,8 +3197,8 @@ public void patchMetadataCheckReindexingTest() throws Exception { ))) .andExpect(jsonPath("$.page.totalElements", is(1))); - List updateTitle = new ArrayList(); - Map value = new HashMap(); + List updateTitle = new ArrayList<>(); + Map value = new HashMap<>(); value.put("value", "New Name"); updateTitle.add(new ReplaceOperation("/metadata/dc.title/0", value)); diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/CommunityRestRepositoryIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/CommunityRestRepositoryIT.java index 60b6d39a0705..6837b8900398 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/CommunityRestRepositoryIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/CommunityRestRepositoryIT.java @@ -1410,11 +1410,11 @@ public void findAllSubCommunitiesGrantAccessAdminsTest() throws Exception { .withAdminGroup(child2Admin) .build(); - Community ommunityChild1Child1 = CommunityBuilder.createSubCommunity(context, communityChild1) + Community communityChild1Child1 = CommunityBuilder.createSubCommunity(context, communityChild1) .withName("Sub1 Community 1") .build(); - Community сommunityChild2Child1 = CommunityBuilder.createSubCommunity(context, communityChild2) + Community communityChild2Child1 = CommunityBuilder.createSubCommunity(context, communityChild2) .withName("Sub2 Community 1") .build(); diff --git a/dspace-services/src/test/java/org/dspace/servicemanager/config/DSpaceConfigurationServiceTest.java b/dspace-services/src/test/java/org/dspace/servicemanager/config/DSpaceConfigurationServiceTest.java index f15cae0ab48c..4002e5e43308 100644 --- a/dspace-services/src/test/java/org/dspace/servicemanager/config/DSpaceConfigurationServiceTest.java +++ b/dspace-services/src/test/java/org/dspace/servicemanager/config/DSpaceConfigurationServiceTest.java @@ -56,7 +56,7 @@ public void init() { configurationService.clear(); // Start fresh with out own set of configs - Map l = new HashMap(); + Map l = new HashMap<>(); l.put("service.name", "DSpace"); l.put("sample.array", "itemA,itemB,itemC"); l.put("sample.number", "123"); @@ -86,7 +86,7 @@ public void tearDown() { @Test public void testVariableReplacement() { - Map l = new HashMap(); + Map l = new HashMap<>(); l.put("service.name", "DSpace"); l.put("aaronz", "Aaron Zeckoski"); l.put("current.user", "${aaronz}"); @@ -295,7 +295,7 @@ public void testGetPropertyAsTypeStringClassOfT() { assertEquals("itemC", array[2]); Integer number = configurationService.getPropertyAsType("sample.number", Integer.class); assertNotNull(number); - assertEquals(new Integer(123), number); + assertEquals(Integer.valueOf(123), number); Boolean bool = configurationService.getPropertyAsType("sample.boolean", Boolean.class); assertNotNull(bool); @@ -306,7 +306,6 @@ public void testGetPropertyAsTypeStringClassOfT() { assertEquals(Boolean.FALSE, bool2); boolean bool3 = configurationService.getPropertyAsType("INVALID.PROPERTY", boolean.class); - assertNotNull(bool3); assertEquals(false, bool3); assertEquals(123, (int) configurationService.getPropertyAsType("sample.number", int.class)); @@ -333,9 +332,9 @@ public void testGetPropertyAsTypeStringT() { assertEquals("itemB", array[1]); assertEquals("itemC", array[2]); - Integer number = configurationService.getPropertyAsType("sample.number", new Integer(12345)); + Integer number = configurationService.getPropertyAsType("sample.number", 12345); assertNotNull(number); - assertEquals(new Integer(123), number); + assertEquals(Integer.valueOf(123), number); Boolean bool = configurationService.getPropertyAsType("sample.boolean", Boolean.FALSE); assertNotNull(bool); @@ -522,8 +521,11 @@ public void testReloadConfig() { } /** - * Tests the ability of our ConfigurationService to automatically reload properties after a set period - * of time. + * Tests the ability of our ConfigurationService to automatically reload + * properties after a set period of time. + * @throws ConfigurationException passed through. + * @throws IOException if test properties file cannot be created or copied. + * @throws InterruptedException if sleep is interrupted. */ @Test public void testAutomaticReload() throws ConfigurationException, IOException, InterruptedException { diff --git a/dspace-services/src/test/java/org/dspace/utils/servicemanager/ProviderHolderTest.java b/dspace-services/src/test/java/org/dspace/utils/servicemanager/ProviderHolderTest.java index 995d3ba62445..5ff526983ee5 100644 --- a/dspace-services/src/test/java/org/dspace/utils/servicemanager/ProviderHolderTest.java +++ b/dspace-services/src/test/java/org/dspace/utils/servicemanager/ProviderHolderTest.java @@ -8,7 +8,6 @@ package org.dspace.utils.servicemanager; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.fail; @@ -16,7 +15,7 @@ import org.junit.Test; /** - * Tests the ability of a provider holder to release a reference correctly + * Tests the ability of a provider holder to release a reference correctly. * * @author Aaron Zeckoski (azeckoski @ gmail.com) */ @@ -28,7 +27,7 @@ public class Thing { @Test public void testHolder() { - ProviderHolder holder = new ProviderHolder(); + ProviderHolder holder = new ProviderHolder<>(); assertNull(holder.getProvider()); Thing t = new Thing(); @@ -44,7 +43,7 @@ public void testHolder() { @Test public void testHolderRelease() { - ProviderHolder holder = new ProviderHolder(); + ProviderHolder holder = new ProviderHolder<>(); Thing t = new Thing(); holder.setProvider(t); @@ -66,7 +65,7 @@ public void testHolderRelease() { @Test public void testHolderException() { - ProviderHolder holder = new ProviderHolder(); + ProviderHolder holder = new ProviderHolder<>(); try { holder.getProviderOrFail(); fail("Should have died"); @@ -87,14 +86,10 @@ public void testHolderException() { @Test public void testHolderHashEqualsString() { - ProviderHolder holder = new ProviderHolder(); - assertNotNull(holder.hashCode()); - assertFalse(holder.equals(null)); + ProviderHolder holder = new ProviderHolder<>(); assertNotNull(holder.toString()); holder.setProvider(new Thing()); - assertNotNull(holder.hashCode()); - assertFalse(holder.equals(null)); assertNotNull(holder.toString()); holder = null; diff --git a/dspace-services/src/test/java/org/dspace/utils/servicemanager/ProviderStackTest.java b/dspace-services/src/test/java/org/dspace/utils/servicemanager/ProviderStackTest.java index 47c2b302a7d1..6641adb3b3ab 100644 --- a/dspace-services/src/test/java/org/dspace/utils/servicemanager/ProviderStackTest.java +++ b/dspace-services/src/test/java/org/dspace/utils/servicemanager/ProviderStackTest.java @@ -43,6 +43,7 @@ public UnorderedProvider(String prefix) { this.prefix = prefix; } + @Override public String getPrefix() { return prefix; } @@ -56,6 +57,7 @@ public OrderedProvider(String prefix, int order) { this.order = order; } + @Override public int getOrder() { return order; } @@ -78,11 +80,11 @@ public ConfigurableApplicationContext getApplicationContext() { } public List getServicesByType(Class type) { - return new ArrayList(); + return new ArrayList<>(); } public List getServicesNames() { - return new ArrayList(); + return new ArrayList<>(); } public Map getServicesWithNamesByType(Class type) { @@ -111,11 +113,10 @@ public T registerServiceClass(String name, Class type) { public void unregisterService(String name) { } }; - ProviderStack providers = new ProviderStack(sm, Provider.class); - assertNotNull(providers.hashCode()); + ProviderStack providers = new ProviderStack<>(sm, Provider.class); assertNotNull(providers.toString()); assertEquals(0, providers.size()); - assertTrue(providers.getProviders().size() == 0); + assertTrue(providers.getProviders().isEmpty()); providers.clear(); providers = null; @@ -126,13 +127,12 @@ public void unregisterService(String name) { */ @Test public void testProviderStackTArray() { - ProviderStack providers = new ProviderStack(new Provider[] { + ProviderStack providers = new ProviderStack<>(new Provider[] { new UnorderedProvider("ccc"), new UnorderedProvider("ddd"), new OrderedProvider("bbb", 5), new OrderedProvider("aaa", 2) }); - assertNotNull(providers.hashCode()); assertNotNull(providers.toString()); assertEquals(4, providers.size()); // check the order @@ -153,13 +153,12 @@ public void testProviderStackTArray() { @Test public void testAddProvider() { // preload - ProviderStack providers = new ProviderStack(new Provider[] { + ProviderStack providers = new ProviderStack<>(new Provider[] { new UnorderedProvider("ccc"), new UnorderedProvider("ddd"), new OrderedProvider("bbb", 5), new OrderedProvider("aaa", 2) }); - assertNotNull(providers.hashCode()); assertNotNull(providers.toString()); assertEquals(4, providers.size()); // check the order @@ -218,13 +217,12 @@ public void testAddProvider() { @Test public void testRemoveProvider() { // preload - ProviderStack providers = new ProviderStack(new Provider[] { + ProviderStack providers = new ProviderStack<>(new Provider[] { new UnorderedProvider("ccc"), new UnorderedProvider("ddd"), new OrderedProvider("bbb", 5), new OrderedProvider("aaa", 2) }); - assertNotNull(providers.hashCode()); assertNotNull(providers.toString()); assertEquals(4, providers.size()); @@ -249,13 +247,12 @@ public void testRemoveProvider() { @Test public void testGetProviders() { // preload - ProviderStack providers = new ProviderStack(new Provider[] { + ProviderStack providers = new ProviderStack<>(new Provider[] { new UnorderedProvider("ccc"), new UnorderedProvider("ddd"), new OrderedProvider("bbb", 5), new OrderedProvider("aaa", 2) }); - assertNotNull(providers.hashCode()); assertNotNull(providers.toString()); assertEquals(4, providers.size()); @@ -264,7 +261,7 @@ public void testGetProviders() { assertEquals(4, l.size()); l = null; - providers = new ProviderStack(); + providers = new ProviderStack<>(); l = providers.getProviders(); assertNotNull(l); assertEquals(0, l.size()); @@ -280,13 +277,12 @@ public void testGetProviders() { @Test public void testGetIterator() { // preload - ProviderStack providers = new ProviderStack(new Provider[] { + ProviderStack providers = new ProviderStack<>(new Provider[] { new UnorderedProvider("ccc"), new UnorderedProvider("ddd"), new OrderedProvider("bbb", 5), new OrderedProvider("aaa", 2) }); - assertNotNull(providers.hashCode()); assertNotNull(providers.toString()); assertEquals(4, providers.size()); @@ -302,7 +298,7 @@ public void testGetIterator() { assertNotNull(it.next()); assertFalse(it.hasNext()); - providers = new ProviderStack(); + providers = new ProviderStack<>(); it = providers.getIterator(); assertNotNull(it); assertFalse(it.hasNext()); @@ -318,13 +314,12 @@ public void testGetIterator() { @Test public void testGetProvider() { // preload - ProviderStack providers = new ProviderStack(new Provider[] { + ProviderStack providers = new ProviderStack<>(new Provider[] { new UnorderedProvider("ccc"), new UnorderedProvider("ddd"), new OrderedProvider("bbb", 5), new OrderedProvider("aaa", 2) }); - assertNotNull(providers.hashCode()); assertNotNull(providers.toString()); assertEquals(4, providers.size()); @@ -347,13 +342,12 @@ public void testGetProvider() { @Test public void testSize() { // preload - ProviderStack providers = new ProviderStack(new Provider[] { + ProviderStack providers = new ProviderStack<>(new Provider[] { new UnorderedProvider("ccc"), new UnorderedProvider("ddd"), new OrderedProvider("bbb", 5), new OrderedProvider("aaa", 2) }); - assertNotNull(providers.hashCode()); assertNotNull(providers.toString()); assertEquals(4, providers.size()); @@ -367,18 +361,16 @@ public void testSize() { @Test public void testClear() { // preload - ProviderStack providers = new ProviderStack(new Provider[] { + ProviderStack providers = new ProviderStack<>(new Provider[] { new UnorderedProvider("ccc"), new UnorderedProvider("ddd"), new OrderedProvider("bbb", 5), new OrderedProvider("aaa", 2) }); - assertNotNull(providers.hashCode()); assertNotNull(providers.toString()); assertEquals(4, providers.size()); providers.clear(); - assertNotNull(providers.hashCode()); assertNotNull(providers.toString()); assertEquals(0, providers.size()); @@ -393,14 +385,13 @@ public void testClear() { public void testRefresh() { Provider p1 = new OrderedProvider("aaa", 2); Provider p2 = new UnorderedProvider("ccc"); - ProviderStack providers = new ProviderStack(new Provider[] { + ProviderStack providers = new ProviderStack<>(new Provider[] { p2, new UnorderedProvider("ddd"), new OrderedProvider("bbb", 5), p1 }); - assertNotNull(providers.hashCode()); assertNotNull(providers.toString()); assertEquals(4, providers.size()); From 2e4bfe9bee34c20723f5ec0ef824b2056734e786 Mon Sep 17 00:00:00 2001 From: Kim Shepherd Date: Thu, 19 Sep 2024 14:13:25 +0200 Subject: [PATCH 64/96] Small spelling fixes to import tests and resource files. (also metadatums->metadata) --- .../contributor/SimpleConcatContributor.java | 2 +- .../CiniiImportMetadataSourceServiceIT.java | 24 +++++++++---------- .../rest/RelationshipRestRepositoryIT.java | 2 +- .../WOSImportMetadataSourceServiceIT.java | 4 ++-- ...esponce-ids.xml => cinii-response-ids.xml} | 0 .../{wos-responce.xml => wos-response.xml} | 0 6 files changed, 16 insertions(+), 16 deletions(-) rename dspace-server-webapp/src/test/resources/org/dspace/app/rest/{cinii-responce-ids.xml => cinii-response-ids.xml} (100%) rename dspace-server-webapp/src/test/resources/org/dspace/app/rest/{wos-responce.xml => wos-response.xml} (100%) diff --git a/dspace-api/src/main/java/org/dspace/importer/external/metadatamapping/contributor/SimpleConcatContributor.java b/dspace-api/src/main/java/org/dspace/importer/external/metadatamapping/contributor/SimpleConcatContributor.java index d84bc65701c6..9a2aa242c6b8 100644 --- a/dspace-api/src/main/java/org/dspace/importer/external/metadatamapping/contributor/SimpleConcatContributor.java +++ b/dspace-api/src/main/java/org/dspace/importer/external/metadatamapping/contributor/SimpleConcatContributor.java @@ -26,7 +26,7 @@ * This contributor is able to concat multi value. * Given a certain path, if it contains several nodes, * the values of nodes will be concatenated into a single one. - * The concrete example we can see in the file wos-responce.xml in the node, + * The concrete example we can see in the file wos-response.xml in the node, * which may contain several

    paragraphs, * this Contributor allows concatenating all

    paragraphs. to obtain a single one. * diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/CiniiImportMetadataSourceServiceIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/CiniiImportMetadataSourceServiceIT.java index 87f1bf7d8d95..b8d21fb7a78c 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/CiniiImportMetadataSourceServiceIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/CiniiImportMetadataSourceServiceIT.java @@ -51,7 +51,7 @@ public void ciniiImportMetadataGetRecordsTest() throws Exception { InputStream ciniiRefResp2 = null; InputStream ciniiRefResp3 = null; try { - ciniiRefResp = getClass().getResourceAsStream("cinii-responce-ids.xml"); + ciniiRefResp = getClass().getResourceAsStream("cinii-response-ids.xml"); ciniiRefResp2 = getClass().getResourceAsStream("cinii-first.xml"); ciniiRefResp3 = getClass().getResourceAsStream("cinii-second.xml"); @@ -89,7 +89,7 @@ public void ciniiImportMetadataGetRecordsCountTest() throws Exception { context.turnOffAuthorisationSystem(); CloseableHttpClient originalHttpClient = liveImportClientImpl.getHttpClient(); CloseableHttpClient httpClient = Mockito.mock(CloseableHttpClient.class); - try (InputStream file = getClass().getResourceAsStream("cinii-responce-ids.xml")) { + try (InputStream file = getClass().getResourceAsStream("cinii-response-ids.xml")) { String ciniiXmlResp = IOUtils.toString(file, Charset.defaultCharset()); liveImportClientImpl.setHttpClient(httpClient); @@ -107,31 +107,31 @@ public void ciniiImportMetadataGetRecordsCountTest() throws Exception { private ArrayList getRecords() { ArrayList records = new ArrayList<>(); //define first record - List metadatums = new ArrayList(); + List metadata = new ArrayList(); MetadatumDTO title = createMetadatumDTO("dc", "title", null, "Understanding the impact of mandatory accrual accounting on management practices:" + " Interpretation of Japanese local governments’ behavior"); MetadatumDTO identifier = createMetadatumDTO("dc", "identifier", "other", "1010572092222310146"); - metadatums.add(title); - metadatums.add(identifier); + metadata.add(title); + metadata.add(identifier); - ImportRecord firstrRecord = new ImportRecord(metadatums); + ImportRecord firstRecord = new ImportRecord(metadata); //define second record - List metadatums2 = new ArrayList(); + List metadata2 = new ArrayList(); MetadatumDTO title2 = createMetadatumDTO("dc", "title", null, "Band structures of passive films on titanium in simulated bioliquids determined" + " by photoelectrochemical response: principle governing the biocompatibility"); MetadatumDTO language = createMetadatumDTO("dc", "language", "iso", "en"); MetadatumDTO identifier2 = createMetadatumDTO("dc", "identifier", "other", "1050010687833449984"); - metadatums2.add(title2); - metadatums2.add(language); - metadatums2.add(identifier2); + metadata2.add(title2); + metadata2.add(language); + metadata2.add(identifier2); - ImportRecord secondRecord = new ImportRecord(metadatums2); - records.add(firstrRecord); + ImportRecord secondRecord = new ImportRecord(metadata2); + records.add(firstRecord); records.add(secondRecord); return records; } diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/RelationshipRestRepositoryIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/RelationshipRestRepositoryIT.java index ee4ab9bf6d80..25be24a786ab 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/RelationshipRestRepositoryIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/RelationshipRestRepositoryIT.java @@ -3306,7 +3306,7 @@ public void findByItemsAndTypeUnprocessableEntityTest() throws Exception { } @Test - public void findByItemsAndTypeEmptyResponceTest() throws Exception { + public void findByItemsAndTypeEmptyResponseTest() throws Exception { context.turnOffAuthorisationSystem(); diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/WOSImportMetadataSourceServiceIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/WOSImportMetadataSourceServiceIT.java index 9f68d79c2036..7ec6734d1b4a 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/WOSImportMetadataSourceServiceIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/WOSImportMetadataSourceServiceIT.java @@ -51,7 +51,7 @@ public void wosImportMetadataGetRecordsTest() throws Exception { } CloseableHttpClient originalHttpClient = liveImportClientImpl.getHttpClient(); CloseableHttpClient httpClient = Mockito.mock(CloseableHttpClient.class); - try (InputStream file = getClass().getResourceAsStream("wos-responce.xml")) { + try (InputStream file = getClass().getResourceAsStream("wos-response.xml")) { String wosXmlResp = IOUtils.toString(file, Charset.defaultCharset()); liveImportClientImpl.setHttpClient(httpClient); @@ -80,7 +80,7 @@ public void wosImportMetadataGetRecordsCountTest() throws Exception { } CloseableHttpClient originalHttpClient = liveImportClientImpl.getHttpClient(); CloseableHttpClient httpClient = Mockito.mock(CloseableHttpClient.class); - try (InputStream file = getClass().getResourceAsStream("wos-responce.xml")) { + try (InputStream file = getClass().getResourceAsStream("wos-response.xml")) { String wosXmlResp = IOUtils.toString(file, Charset.defaultCharset()); liveImportClientImpl.setHttpClient(httpClient); diff --git a/dspace-server-webapp/src/test/resources/org/dspace/app/rest/cinii-responce-ids.xml b/dspace-server-webapp/src/test/resources/org/dspace/app/rest/cinii-response-ids.xml similarity index 100% rename from dspace-server-webapp/src/test/resources/org/dspace/app/rest/cinii-responce-ids.xml rename to dspace-server-webapp/src/test/resources/org/dspace/app/rest/cinii-response-ids.xml diff --git a/dspace-server-webapp/src/test/resources/org/dspace/app/rest/wos-responce.xml b/dspace-server-webapp/src/test/resources/org/dspace/app/rest/wos-response.xml similarity index 100% rename from dspace-server-webapp/src/test/resources/org/dspace/app/rest/wos-responce.xml rename to dspace-server-webapp/src/test/resources/org/dspace/app/rest/wos-response.xml From 5758d9e90302d4da33ec869b6ec656e5c25b865a Mon Sep 17 00:00:00 2001 From: Sascha Szott Date: Fri, 27 Sep 2024 12:07:52 +0200 Subject: [PATCH 65/96] minor fix in parameter description --- dspace/config/emails/subscriptions_content | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dspace/config/emails/subscriptions_content b/dspace/config/emails/subscriptions_content index 9b8c91e559df..a1b107e8fc50 100644 --- a/dspace/config/emails/subscriptions_content +++ b/dspace/config/emails/subscriptions_content @@ -1,7 +1,7 @@ ## E-mail sent to designated address about updates on subscribed items ## -## Parameters: {0} Collections updates -## {1} Communities updates +## Parameters: {0} Communities updates +## {1} Collections updates #set($subject = "${config.get('dspace.name')} Subscriptions") This email is sent from ${config.get('dspace.name')} based on the chosen subscription preferences. From 27dd5a2ec58970256964f15f0879834c436aa542 Mon Sep 17 00:00:00 2001 From: Andrew Date: Fri, 27 Sep 2024 12:52:03 +0200 Subject: [PATCH 66/96] fix: performance of claiming workflow task --- .../storedcomponents/PoolTaskServiceImpl.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/xmlworkflow/storedcomponents/PoolTaskServiceImpl.java b/dspace-api/src/main/java/org/dspace/xmlworkflow/storedcomponents/PoolTaskServiceImpl.java index fb673725e181..d3c8f6334d8f 100644 --- a/dspace-api/src/main/java/org/dspace/xmlworkflow/storedcomponents/PoolTaskServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/xmlworkflow/storedcomponents/PoolTaskServiceImpl.java @@ -13,6 +13,7 @@ import java.util.Collections; import java.util.Iterator; import java.util.List; +import java.util.Optional; import java.util.Set; import org.apache.commons.collections4.CollectionUtils; @@ -100,12 +101,17 @@ public PoolTask findByWorkflowIdAndEPerson(Context context, XmlWorkflowItem work //If the user does not have a claimedtask yet, see whether one of the groups of the user has pooltasks //for this workflow item Set groups = groupService.allMemberGroupsSet(context, ePerson); - for (Group group : groups) { - poolTask = poolTaskDAO.findByWorkflowItemAndGroup(context, group, workflowItem); - if (poolTask != null) { - return poolTask; - } + List generalTasks = poolTaskDAO.findByWorkflowItem(context, workflowItem); + Optional firstClaimedTask = groups.stream() + .flatMap(group -> generalTasks.stream() + .filter(f -> f.getGroup().getID().equals(group.getID())) + .findFirst() + .stream()) + .findFirst(); + + if (firstClaimedTask.isPresent()) { + return firstClaimedTask.get(); } } } From 46dfd902f113b9ea13ce53b496aff6979024d67e Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Thu, 10 Oct 2024 16:02:53 -0500 Subject: [PATCH 67/96] Bump to Spring 6.1.13, Spring Boot 3.3.4 and Spring Security 6.3.3 --- dspace-server-webapp/pom.xml | 14 +++++++++++++- pom.xml | 6 +++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/dspace-server-webapp/pom.xml b/dspace-server-webapp/pom.xml index 2e8f2cafc0a9..5cb25649e933 100644 --- a/dspace-server-webapp/pom.xml +++ b/dspace-server-webapp/pom.xml @@ -343,6 +343,18 @@ org.springframework.boot spring-boot-starter-actuator ${spring-boot.version} + + + + io.micrometer + micrometer-observation + + + + io.micrometer + micrometer-commons + + @@ -437,7 +449,7 @@ spring-boot-starter-security ${spring-boot.version} - + io.micrometer micrometer-observation diff --git a/pom.xml b/pom.xml index d59342adcb17..404225fff5b1 100644 --- a/pom.xml +++ b/pom.xml @@ -19,9 +19,9 @@ 17 - 6.1.8 - 3.2.6 - 6.2.4 + 6.1.13 + 3.3.4 + 6.3.3 6.4.8.Final 8.0.1.Final 42.7.3 From 352f4c21523237cefa5bf67c99f7d7b26a51d72b Mon Sep 17 00:00:00 2001 From: Jens Vannerum Date: Mon, 14 Oct 2024 17:03:15 +0200 Subject: [PATCH 68/96] 118774: status of doi should be set to TO_BE_DELETED when related item is removed permanently --- .../src/main/java/org/dspace/content/ItemServiceImpl.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dspace-api/src/main/java/org/dspace/content/ItemServiceImpl.java b/dspace-api/src/main/java/org/dspace/content/ItemServiceImpl.java index dc7820b669be..9a97851937e5 100644 --- a/dspace-api/src/main/java/org/dspace/content/ItemServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/content/ItemServiceImpl.java @@ -67,6 +67,7 @@ import org.dspace.harvest.HarvestedItem; import org.dspace.harvest.service.HarvestedItemService; import org.dspace.identifier.DOI; +import org.dspace.identifier.DOIIdentifierProvider; import org.dspace.identifier.IdentifierException; import org.dspace.identifier.service.DOIService; import org.dspace.identifier.service.IdentifierService; @@ -851,6 +852,7 @@ protected void rawDelete(Context context, Item item) throws AuthorizeException, DOI doi = doiService.findDOIByDSpaceObject(context, item); if (doi != null) { doi.setDSpaceObject(null); + doi.setStatus(DOIIdentifierProvider.TO_BE_DELETED); } // remove version attached to the item From 9ce645e08b50cd752e48a640e340b55466f019be Mon Sep 17 00:00:00 2001 From: Kim Shepherd Date: Tue, 15 Oct 2024 23:23:24 +0200 Subject: [PATCH 69/96] Add Eclipse JDT .factorypath to .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 2fcb46b9932c..529351edc5c2 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ tags .project .classpath .checkstyle +.factorypath ## Ignore project files created by IntelliJ IDEA *.iml From e96dbfefeb6924c4b17c66535215878576190fb5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 18 Oct 2024 20:21:19 +0000 Subject: [PATCH 70/96] Bump the maven group with 3 updates Bumps the maven group with 3 updates: [org.springframework:spring-context](https://github.com/spring-projects/spring-framework), org.eclipse.jetty:jetty-server and org.eclipse.jetty:jetty-http. Updates `org.springframework:spring-context` from 6.1.13 to 6.1.14 - [Release notes](https://github.com/spring-projects/spring-framework/releases) - [Commits](https://github.com/spring-projects/spring-framework/compare/v6.1.13...v6.1.14) Updates `org.eclipse.jetty:jetty-server` from 9.4.54.v20240208 to 9.4.55.v20240627 Updates `org.eclipse.jetty:jetty-http` from 9.4.54.v20240208 to 9.4.55.v20240627 --- updated-dependencies: - dependency-name: org.springframework:spring-context dependency-type: direct:production dependency-group: maven - dependency-name: org.eclipse.jetty:jetty-server dependency-type: direct:production dependency-group: maven - dependency-name: org.eclipse.jetty:jetty-http dependency-type: direct:production dependency-group: maven ... Signed-off-by: dependabot[bot] --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 404225fff5b1..a94dac3dd693 100644 --- a/pom.xml +++ b/pom.xml @@ -19,7 +19,7 @@ 17 - 6.1.13 + 6.1.14 3.3.4 6.3.3 6.4.8.Final @@ -38,7 +38,7 @@ 4.0.5 1.1.1 - 9.4.54.v20240208 + 9.4.55.v20240627 2.23.1 2.0.31 1.19.0 From 29e487e1d30a377be3a1f746c05ede0ef339ca0e Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Mon, 28 Oct 2024 14:55:30 -0500 Subject: [PATCH 71/96] Create dependabot.yml --- .github/dependabot.yml | 115 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000000..6f4f3ae601a0 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,115 @@ +#------------------- +# DSpace's dependabot rules. Enables maven updates for all dependencies on a weekly basis +# for main and any maintenance branches. Security updates only apply to main. +#------------------- +version: 2 +updates: + - package-ecosystem: "maven" + directory: "/" + schedule: + interval: "weekly" + # Allow up to 10 open PRs for dependencies + open-pull-requests-limit: 10 + # Group together some upgrades in a single PR + groups: + # Group together all Build Tools in a single PR + build-tools: + applies-to: version-updates + patterns: + - "org.apache.maven.plugins:*" + - "*:*-maven-plugin" + - "*:maven-*-plugin" + - "com.github.spotbugs:spotbugs" + - "com.google.code.findbugs:*" + - "com.google.errorprone:*" + - "com.puppycrawl.tools:checkstyle" + - "org.sonatype.plugins:*" + update-types: + - "minor" + - "patch" + test-tools: + applies-to: version-updates + patterns: + - "junit:*" + - "com.github.stefanbirker:system-rules" + - "com.h2database:*" + - "io.findify:s3mock*" + - "io.netty:*" + - "org.hamcrest:*" + - "org.mock-server:*" + - "org.mockito:*" + update-types: + - "minor" + - "patch" + # Group together all Apache Commons deps in a single PR + apache-commons: + applies-to: version-updates + patterns: + - "org.apache.commons:*" + - "commons-*:commons-*" + update-types: + - "minor" + - "patch" + # Group together all fasterxml deps in a single PR + fasterxml: + applies-to: version-updates + patterns: + - "com.fasterxml:*" + - "com.fasterxml.*:*" + update-types: + - "minor" + - "patch" + # Group together all Hibernate deps in a single PR + hibernate: + applies-to: version-updates + patterns: + - "org.hibernate.*:*" + update-types: + - "minor" + - "patch" + # Group together all Jakarta deps in a single PR + jakarta: + applies-to: version-updates + patterns: + - "jakarta.*:*" + - "org.eclipse.angus:jakarta.mail" + - "org.glassfish.jaxb:jaxb-runtime" + update-types: + - "minor" + - "patch" + # Group together all Google deps in a single PR + google-apis: + applies-to: version-updates + patterns: + - "com.google.apis:*" + - "com.google.api-client:*" + - "com.google.http-client:*" + - "com.google.oauth-client:*" + update-types: + - "minor" + - "patch" + # Group together all Spring deps in a single PR + spring: + applies-to: version-updates + patterns: + - "org.springframework:*" + - "org.springframework.*:*" + update-types: + - "minor" + - "patch" + # Group together all WebJARs deps in a single PR + webjars: + applies-to: version-updates + patterns: + - "org.webjars:*" + - "org.webjars.*:*" + update-types: + - "minor" + - "patch" + ignore: + # Don't try to auto-update any DSpace dependencies + - dependency-name: "org.dspace:*" + - dependency-name: "org.dspace.*:*" + # Ignore all major version updates for all dependencies. We'll only automate minor/patch updates. + - dependency-name: "*" + update-types: ["version-update:semver-major"] From ed1e7bb972d6af5bd1e85701781890a0f33e8daa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 29 Oct 2024 19:50:42 +0000 Subject: [PATCH 72/96] Bump org.postgresql:postgresql from 42.7.3 to 42.7.4 Bumps [org.postgresql:postgresql](https://github.com/pgjdbc/pgjdbc) from 42.7.3 to 42.7.4. - [Release notes](https://github.com/pgjdbc/pgjdbc/releases) - [Changelog](https://github.com/pgjdbc/pgjdbc/blob/master/CHANGELOG.md) - [Commits](https://github.com/pgjdbc/pgjdbc/compare/REL42.7.3...REL42.7.4) --- updated-dependencies: - dependency-name: org.postgresql:postgresql dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a94dac3dd693..eea78764d4ce 100644 --- a/pom.xml +++ b/pom.xml @@ -24,7 +24,7 @@ 6.3.3 6.4.8.Final 8.0.1.Final - 42.7.3 + 42.7.4 10.10.0 8.11.3 From efdd3515b8e5f99e07c07fbbc76639101a96855c Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Tue, 29 Oct 2024 15:01:41 -0500 Subject: [PATCH 73/96] Exclude spring from build-tools group in dependabot.yml --- .github/dependabot.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 6f4f3ae601a0..b6412b25b660 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -24,6 +24,9 @@ updates: - "com.google.errorprone:*" - "com.puppycrawl.tools:checkstyle" - "org.sonatype.plugins:*" + exclude-patterns: + # Exclude anything from Spring, as that is in a separate group + - "org.springframework.*:*" update-types: - "minor" - "patch" From 3d12676fc21bb0dc798683979b09eabc1623aeb3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 29 Oct 2024 20:02:16 +0000 Subject: [PATCH 74/96] Bump org.webjars.npm:json-editor__json-editor in the webjars group Bumps the webjars group with 1 update: [org.webjars.npm:json-editor__json-editor](https://github.com/json-editor/json-editor). Updates `org.webjars.npm:json-editor__json-editor` from 2.6.1 to 2.15.1 - [Changelog](https://github.com/json-editor/json-editor/blob/master/CHANGELOG.md) - [Commits](https://github.com/json-editor/json-editor/compare/2.6.1...2.15.1) --- updated-dependencies: - dependency-name: org.webjars.npm:json-editor__json-editor dependency-type: direct:production update-type: version-update:semver-minor dependency-group: webjars ... Signed-off-by: dependabot[bot] --- dspace-server-webapp/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dspace-server-webapp/pom.xml b/dspace-server-webapp/pom.xml index 5cb25649e933..dcbb1171b56f 100644 --- a/dspace-server-webapp/pom.xml +++ b/dspace-server-webapp/pom.xml @@ -431,7 +431,7 @@ org.webjars.npm json-editor__json-editor - 2.6.1 + 2.15.1 - 2.16.0 - 2.16.0 + 2.18.1 + 2.18.1 2.1.1 4.0.2 4.0.5 @@ -1788,7 +1788,7 @@ com.fasterxml classmate - 1.6.0 + 1.7.0 com.fasterxml.jackson.core From 89e6863754ae41f8776fd94b3aec5295ccfec9ff Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 29 Oct 2024 20:02:24 +0000 Subject: [PATCH 77/96] Bump the test-tools group with 8 updates Bumps the test-tools group with 8 updates: | Package | From | To | | --- | --- | --- | | [com.h2database:h2](https://github.com/h2database/h2database) | `2.2.224` | `2.3.232` | | [org.mock-server:mockserver-junit-rule](https://github.com/jamesdbloom/mockservice) | `5.11.2` | `5.15.0` | | [io.netty:netty-buffer](https://github.com/netty/netty) | `4.1.106.Final` | `4.1.114.Final` | | [io.netty:netty-transport](https://github.com/netty/netty) | `4.1.106.Final` | `4.1.114.Final` | | [io.netty:netty-transport-native-unix-common](https://github.com/netty/netty) | `4.1.106.Final` | `4.1.114.Final` | | [io.netty:netty-common](https://github.com/netty/netty) | `4.1.106.Final` | `4.1.114.Final` | | [io.netty:netty-handler](https://github.com/netty/netty) | `4.1.106.Final` | `4.1.114.Final` | | [io.netty:netty-codec](https://github.com/netty/netty) | `4.1.106.Final` | `4.1.114.Final` | Updates `com.h2database:h2` from 2.2.224 to 2.3.232 - [Release notes](https://github.com/h2database/h2database/releases) - [Commits](https://github.com/h2database/h2database/compare/version-2.2.224...version-2.3.232) Updates `org.mock-server:mockserver-junit-rule` from 5.11.2 to 5.15.0 - [Changelog](https://github.com/mock-server/mockserver/blob/master/changelog.md) - [Commits](https://github.com/jamesdbloom/mockservice/compare/mockserver-5.11.2...mockserver-5.15.0) Updates `io.netty:netty-buffer` from 4.1.106.Final to 4.1.114.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.106.Final...netty-4.1.114.Final) Updates `io.netty:netty-transport` from 4.1.106.Final to 4.1.114.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.106.Final...netty-4.1.114.Final) Updates `io.netty:netty-transport-native-unix-common` from 4.1.106.Final to 4.1.114.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.106.Final...netty-4.1.114.Final) Updates `io.netty:netty-common` from 4.1.106.Final to 4.1.114.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.106.Final...netty-4.1.114.Final) Updates `io.netty:netty-handler` from 4.1.106.Final to 4.1.114.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.106.Final...netty-4.1.114.Final) Updates `io.netty:netty-codec` from 4.1.106.Final to 4.1.114.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.106.Final...netty-4.1.114.Final) --- updated-dependencies: - dependency-name: com.h2database:h2 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: test-tools - dependency-name: org.mock-server:mockserver-junit-rule dependency-type: direct:development update-type: version-update:semver-minor dependency-group: test-tools - dependency-name: io.netty:netty-buffer dependency-type: direct:production update-type: version-update:semver-patch dependency-group: test-tools - dependency-name: io.netty:netty-transport dependency-type: direct:production update-type: version-update:semver-patch dependency-group: test-tools - dependency-name: io.netty:netty-transport-native-unix-common dependency-type: direct:production update-type: version-update:semver-patch dependency-group: test-tools - dependency-name: io.netty:netty-common dependency-type: direct:production update-type: version-update:semver-patch dependency-group: test-tools - dependency-name: io.netty:netty-handler dependency-type: direct:production update-type: version-update:semver-patch dependency-group: test-tools - dependency-name: io.netty:netty-codec dependency-type: direct:production update-type: version-update:semver-patch dependency-group: test-tools ... Signed-off-by: dependabot[bot] --- dspace-api/pom.xml | 14 +++++++------- pom.xml | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dspace-api/pom.xml b/dspace-api/pom.xml index ea182a748360..80dec5929543 100644 --- a/dspace-api/pom.xml +++ b/dspace-api/pom.xml @@ -814,7 +814,7 @@ org.mock-server mockserver-junit-rule - 5.11.2 + 5.15.0 test @@ -865,32 +865,32 @@ io.netty netty-buffer - 4.1.106.Final + 4.1.114.Final io.netty netty-transport - 4.1.106.Final + 4.1.114.Final io.netty netty-transport-native-unix-common - 4.1.106.Final + 4.1.114.Final io.netty netty-common - 4.1.106.Final + 4.1.114.Final io.netty netty-handler - 4.1.106.Final + 4.1.114.Final io.netty netty-codec - 4.1.106.Final + 4.1.114.Final org.apache.velocity diff --git a/pom.xml b/pom.xml index a94dac3dd693..fb6e28f238a5 100644 --- a/pom.xml +++ b/pom.xml @@ -1730,7 +1730,7 @@ com.h2database h2 - 2.2.224 + 2.3.232 test From 84f76babff801049bf3af6066c71241410c17ece Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 29 Oct 2024 20:02:27 +0000 Subject: [PATCH 78/96] Bump the apache-commons group with 11 updates Bumps the apache-commons group with 11 updates: | Package | From | To | | --- | --- | --- | | commons-cli:commons-cli | `1.6.0` | `1.9.0` | | [commons-codec:commons-codec](https://github.com/apache/commons-codec) | `1.16.0` | `1.17.1` | | org.apache.commons:commons-configuration2 | `2.10.1` | `2.11.0` | | org.apache.commons:commons-dbcp2 | `2.11.0` | `2.12.0` | | commons-io:commons-io | `2.15.1` | `2.17.0` | | org.apache.commons:commons-lang3 | `3.14.0` | `3.17.0` | | commons-logging:commons-logging | `1.3.0` | `1.3.4` | | org.apache.commons:commons-compress | `1.26.0` | `1.27.1` | | [org.apache.commons:commons-csv](https://github.com/apache/commons-csv) | `1.10.0` | `1.12.0` | | org.apache.commons:commons-text | `1.10.0` | `1.12.0` | | commons-validator:commons-validator | `1.7` | `1.9.0` | Updates `commons-cli:commons-cli` from 1.6.0 to 1.9.0 Updates `commons-codec:commons-codec` from 1.16.0 to 1.17.1 - [Changelog](https://github.com/apache/commons-codec/blob/master/RELEASE-NOTES.txt) - [Commits](https://github.com/apache/commons-codec/compare/rel/commons-codec-1.16.0...rel/commons-codec-1.17.1) Updates `org.apache.commons:commons-configuration2` from 2.10.1 to 2.11.0 Updates `org.apache.commons:commons-dbcp2` from 2.11.0 to 2.12.0 Updates `commons-io:commons-io` from 2.15.1 to 2.17.0 Updates `org.apache.commons:commons-lang3` from 3.14.0 to 3.17.0 Updates `commons-logging:commons-logging` from 1.3.0 to 1.3.4 Updates `org.apache.commons:commons-compress` from 1.26.0 to 1.27.1 Updates `org.apache.commons:commons-csv` from 1.10.0 to 1.12.0 - [Changelog](https://github.com/apache/commons-csv/blob/master/RELEASE-NOTES.txt) - [Commits](https://github.com/apache/commons-csv/compare/rel/commons-csv-1.10.0...rel/commons-csv-1.12.0) Updates `org.apache.commons:commons-text` from 1.10.0 to 1.12.0 Updates `commons-validator:commons-validator` from 1.7 to 1.9.0 --- updated-dependencies: - dependency-name: commons-cli:commons-cli dependency-type: direct:production update-type: version-update:semver-minor dependency-group: apache-commons - dependency-name: commons-codec:commons-codec dependency-type: direct:production update-type: version-update:semver-minor dependency-group: apache-commons - dependency-name: org.apache.commons:commons-configuration2 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: apache-commons - dependency-name: org.apache.commons:commons-dbcp2 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: apache-commons - dependency-name: commons-io:commons-io dependency-type: direct:production update-type: version-update:semver-minor dependency-group: apache-commons - dependency-name: org.apache.commons:commons-lang3 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: apache-commons - dependency-name: commons-logging:commons-logging dependency-type: direct:production update-type: version-update:semver-patch dependency-group: apache-commons - dependency-name: org.apache.commons:commons-compress dependency-type: direct:production update-type: version-update:semver-minor dependency-group: apache-commons - dependency-name: org.apache.commons:commons-csv dependency-type: direct:production update-type: version-update:semver-minor dependency-group: apache-commons - dependency-name: org.apache.commons:commons-text dependency-type: direct:production update-type: version-update:semver-minor dependency-group: apache-commons - dependency-name: commons-validator:commons-validator dependency-type: direct:production update-type: version-update:semver-minor dependency-group: apache-commons ... Signed-off-by: dependabot[bot] --- pom.xml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/pom.xml b/pom.xml index a94dac3dd693..3e8be8a75d32 100644 --- a/pom.xml +++ b/pom.xml @@ -1457,12 +1457,12 @@ commons-cli commons-cli - 1.6.0 + 1.9.0 commons-codec commons-codec - 1.16.0 + 1.17.1 org.apache.commons @@ -1480,12 +1480,12 @@ org.apache.commons commons-configuration2 - 2.10.1 + 2.11.0 org.apache.commons commons-dbcp2 - 2.11.0 + 2.12.0 @@ -1497,29 +1497,29 @@ commons-io commons-io - 2.15.1 + 2.17.0 org.apache.commons commons-lang3 - 3.14.0 + 3.17.0 commons-logging commons-logging - 1.3.0 + 1.3.4 org.apache.commons commons-compress - 1.26.0 + 1.27.1 org.apache.commons commons-csv - 1.10.0 + 1.12.0 org.apache.commons @@ -1529,12 +1529,12 @@ org.apache.commons commons-text - 1.10.0 + 1.12.0 commons-validator commons-validator - 1.7 + 1.9.0 joda-time From b98069916307a2ad26e45b563ed6a4f952db1894 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 29 Oct 2024 20:02:33 +0000 Subject: [PATCH 79/96] Bump org.springframework.security:spring-security-test Bumps the spring group with 1 update in the / directory: [org.springframework.security:spring-security-test](https://github.com/spring-projects/spring-security). Updates `org.springframework.security:spring-security-test` from 6.3.3 to 6.3.4 - [Release notes](https://github.com/spring-projects/spring-security/releases) - [Changelog](https://github.com/spring-projects/spring-security/blob/main/RELEASE.adoc) - [Commits](https://github.com/spring-projects/spring-security/compare/6.3.3...6.3.4) --- updated-dependencies: - dependency-name: org.springframework.security:spring-security-test dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a94dac3dd693..9a8629317abc 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ 17 6.1.14 3.3.4 - 6.3.3 + 6.3.4 6.4.8.Final 8.0.1.Final 42.7.3 From d02f1d31c2723ae46799654911ad788f6ca8f740 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 29 Oct 2024 20:03:05 +0000 Subject: [PATCH 80/96] Bump solr.client.version from 8.11.3 to 8.11.4 Bumps `solr.client.version` from 8.11.3 to 8.11.4. Updates `org.apache.solr:solr-solrj` from 8.11.3 to 8.11.4 Updates `org.apache.lucene:lucene-core` from 8.11.3 to 8.11.4 Updates `org.apache.lucene:lucene-analyzers-icu` from 8.11.3 to 8.11.4 Updates `org.apache.lucene:lucene-analyzers-smartcn` from 8.11.3 to 8.11.4 Updates `org.apache.lucene:lucene-analyzers-stempel` from 8.11.3 to 8.11.4 Updates `org.apache.solr:solr-core` from 8.11.3 to 8.11.4 --- updated-dependencies: - dependency-name: org.apache.solr:solr-solrj dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.apache.lucene:lucene-core dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.apache.lucene:lucene-analyzers-icu dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.apache.lucene:lucene-analyzers-smartcn dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.apache.lucene:lucene-analyzers-stempel dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.apache.solr:solr-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a94dac3dd693..151da4c235ef 100644 --- a/pom.xml +++ b/pom.xml @@ -26,7 +26,7 @@ 8.0.1.Final 42.7.3 10.10.0 - 8.11.3 + 8.11.4 3.10.8 2.32.0 From 1a8ccb4219e675764c39f1549603a795cbf6b0fd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 29 Oct 2024 20:03:52 +0000 Subject: [PATCH 81/96] Bump the build-tools group across 1 directory with 24 updates Bumps the build-tools group with 24 updates in the / directory: | Package | From | To | | --- | --- | --- | | [com.google.errorprone:error_prone_core](https://github.com/google/error-prone) | `2.32.0` | `2.35.1` | | [com.google.errorprone:error_prone_annotations](https://github.com/google/error-prone) | `2.32.0` | `2.35.1` | | [com.puppycrawl.tools:checkstyle](https://github.com/checkstyle/checkstyle) | `8.38` | `8.45.1` | | [com.github.spotbugs:spotbugs](https://github.com/spotbugs/spotbugs) | `4.8.2` | `4.8.6` | | [org.apache.maven.plugins:maven-enforcer-plugin](https://github.com/apache/maven-enforcer) | `3.4.1` | `3.5.0` | | [org.apache.maven.plugins:maven-jar-plugin](https://github.com/apache/maven-jar-plugin) | `3.3.0` | `3.4.2` | | [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire) | `3.2.5` | `3.5.1` | | [org.apache.maven.plugins:maven-failsafe-plugin](https://github.com/apache/maven-surefire) | `3.2.5` | `3.5.1` | | [org.apache.maven.plugins:maven-checkstyle-plugin](https://github.com/apache/maven-checkstyle-plugin) | `3.3.1` | `3.6.0` | | [com.github.spotbugs:spotbugs-maven-plugin](https://github.com/spotbugs/spotbugs-maven-plugin) | `4.8.2.0` | `4.8.6.5` | | [org.apache.maven.plugins:maven-clean-plugin](https://github.com/apache/maven-clean-plugin) | `3.3.2` | `3.4.0` | | [org.apache.maven.plugins:maven-dependency-plugin](https://github.com/apache/maven-dependency-plugin) | `3.6.1` | `3.8.1` | | org.sonatype.plugins:nexus-staging-maven-plugin | `1.6.13` | `1.7.0` | | [org.apache.maven.plugins:maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) | `3.6.3` | `3.10.1` | | [org.apache.maven.plugins:maven-source-plugin](https://github.com/apache/maven-source-plugin) | `3.3.0` | `3.3.1` | | [org.apache.maven.plugins:maven-gpg-plugin](https://github.com/apache/maven-gpg-plugin) | `3.2.1` | `3.2.7` | | [org.jacoco:jacoco-maven-plugin](https://github.com/jacoco/jacoco) | `0.8.11` | `0.8.12` | | [org.apache.maven.plugins:maven-release-plugin](https://github.com/apache/maven-release) | `3.0.0` | `3.1.1` | | [org.codehaus.mojo:xml-maven-plugin](https://github.com/mojohaus/xml-maven-plugin) | `1.0.2` | `1.1.0` | | [org.codehaus.mojo:license-maven-plugin](https://github.com/mojohaus/license-maven-plugin) | `2.0.0` | `2.4.0` | | [org.codehaus.mojo:build-helper-maven-plugin](https://github.com/mojohaus/build-helper-maven-plugin) | `3.4.0` | `3.6.0` | | [org.codehaus.mojo:buildnumber-maven-plugin](https://github.com/mojohaus/buildnumber-maven-plugin) | `3.2.0` | `3.2.1` | | [org.codehaus.mojo:jaxb2-maven-plugin](https://github.com/mojohaus/jaxb2-maven-plugin) | `3.1.0` | `3.2.0` | | [org.codehaus.mojo:properties-maven-plugin](https://github.com/mojohaus/properties-maven-plugin) | `1.1.0` | `1.2.1` | Updates `com.google.errorprone:error_prone_core` from 2.32.0 to 2.35.1 - [Release notes](https://github.com/google/error-prone/releases) - [Commits](https://github.com/google/error-prone/compare/v2.32.0...v2.35.1) Updates `com.google.errorprone:error_prone_annotations` from 2.32.0 to 2.35.1 - [Release notes](https://github.com/google/error-prone/releases) - [Commits](https://github.com/google/error-prone/compare/v2.32.0...v2.35.1) Updates `com.puppycrawl.tools:checkstyle` from 8.38 to 8.45.1 - [Release notes](https://github.com/checkstyle/checkstyle/releases) - [Commits](https://github.com/checkstyle/checkstyle/compare/checkstyle-8.38...checkstyle-8.45.1) Updates `com.github.spotbugs:spotbugs` from 4.8.2 to 4.8.6 - [Release notes](https://github.com/spotbugs/spotbugs/releases) - [Changelog](https://github.com/spotbugs/spotbugs/blob/master/CHANGELOG.md) - [Commits](https://github.com/spotbugs/spotbugs/compare/4.8.2...4.8.6) Updates `com.google.errorprone:error_prone_annotations` from 2.32.0 to 2.35.1 - [Release notes](https://github.com/google/error-prone/releases) - [Commits](https://github.com/google/error-prone/compare/v2.32.0...v2.35.1) Updates `org.apache.maven.plugins:maven-enforcer-plugin` from 3.4.1 to 3.5.0 - [Release notes](https://github.com/apache/maven-enforcer/releases) - [Commits](https://github.com/apache/maven-enforcer/compare/enforcer-3.4.1...enforcer-3.5.0) Updates `org.apache.maven.plugins:maven-jar-plugin` from 3.3.0 to 3.4.2 - [Release notes](https://github.com/apache/maven-jar-plugin/releases) - [Commits](https://github.com/apache/maven-jar-plugin/compare/maven-jar-plugin-3.3.0...maven-jar-plugin-3.4.2) Updates `org.apache.maven.plugins:maven-surefire-plugin` from 3.2.5 to 3.5.1 - [Release notes](https://github.com/apache/maven-surefire/releases) - [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.2.5...surefire-3.5.1) Updates `org.apache.maven.plugins:maven-failsafe-plugin` from 3.2.5 to 3.5.1 - [Release notes](https://github.com/apache/maven-surefire/releases) - [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.2.5...surefire-3.5.1) Updates `org.apache.maven.plugins:maven-checkstyle-plugin` from 3.3.1 to 3.6.0 - [Commits](https://github.com/apache/maven-checkstyle-plugin/compare/maven-checkstyle-plugin-3.3.1...maven-checkstyle-plugin-3.6.0) Updates `com.github.spotbugs:spotbugs-maven-plugin` from 4.8.2.0 to 4.8.6.5 - [Release notes](https://github.com/spotbugs/spotbugs-maven-plugin/releases) - [Commits](https://github.com/spotbugs/spotbugs-maven-plugin/compare/spotbugs-maven-plugin-4.8.2.0...spotbugs-maven-plugin-4.8.6.5) Updates `org.apache.maven.plugins:maven-clean-plugin` from 3.3.2 to 3.4.0 - [Release notes](https://github.com/apache/maven-clean-plugin/releases) - [Commits](https://github.com/apache/maven-clean-plugin/compare/maven-clean-plugin-3.3.2...maven-clean-plugin-3.4.0) Updates `org.apache.maven.plugins:maven-dependency-plugin` from 3.6.1 to 3.8.1 - [Release notes](https://github.com/apache/maven-dependency-plugin/releases) - [Commits](https://github.com/apache/maven-dependency-plugin/compare/maven-dependency-plugin-3.6.1...maven-dependency-plugin-3.8.1) Updates `org.sonatype.plugins:nexus-staging-maven-plugin` from 1.6.13 to 1.7.0 Updates `org.apache.maven.plugins:maven-javadoc-plugin` from 3.6.3 to 3.10.1 - [Release notes](https://github.com/apache/maven-javadoc-plugin/releases) - [Commits](https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-3.6.3...maven-javadoc-plugin-3.10.1) Updates `org.apache.maven.plugins:maven-source-plugin` from 3.3.0 to 3.3.1 - [Release notes](https://github.com/apache/maven-source-plugin/releases) - [Commits](https://github.com/apache/maven-source-plugin/compare/maven-source-plugin-3.3.0...maven-source-plugin-3.3.1) Updates `org.apache.maven.plugins:maven-gpg-plugin` from 3.2.1 to 3.2.7 - [Release notes](https://github.com/apache/maven-gpg-plugin/releases) - [Commits](https://github.com/apache/maven-gpg-plugin/compare/maven-gpg-plugin-3.2.1...maven-gpg-plugin-3.2.7) Updates `org.jacoco:jacoco-maven-plugin` from 0.8.11 to 0.8.12 - [Release notes](https://github.com/jacoco/jacoco/releases) - [Commits](https://github.com/jacoco/jacoco/compare/v0.8.11...v0.8.12) Updates `org.apache.maven.plugins:maven-release-plugin` from 3.0.0 to 3.1.1 - [Release notes](https://github.com/apache/maven-release/releases) - [Commits](https://github.com/apache/maven-release/compare/maven-release-3.0.0...maven-release-3.1.1) Updates `org.codehaus.mojo:xml-maven-plugin` from 1.0.2 to 1.1.0 - [Release notes](https://github.com/mojohaus/xml-maven-plugin/releases) - [Commits](https://github.com/mojohaus/xml-maven-plugin/compare/xml-maven-plugin-1.0.2...1.1.0) Updates `org.codehaus.mojo:license-maven-plugin` from 2.0.0 to 2.4.0 - [Release notes](https://github.com/mojohaus/license-maven-plugin/releases) - [Commits](https://github.com/mojohaus/license-maven-plugin/compare/license-maven-plugin-2.0.0...2.4.0) Updates `org.codehaus.mojo:build-helper-maven-plugin` from 3.4.0 to 3.6.0 - [Release notes](https://github.com/mojohaus/build-helper-maven-plugin/releases) - [Commits](https://github.com/mojohaus/build-helper-maven-plugin/compare/3.4.0...3.6.0) Updates `org.codehaus.mojo:buildnumber-maven-plugin` from 3.2.0 to 3.2.1 - [Release notes](https://github.com/mojohaus/buildnumber-maven-plugin/releases) - [Commits](https://github.com/mojohaus/buildnumber-maven-plugin/compare/3.2.0...3.2.1) Updates `org.codehaus.mojo:jaxb2-maven-plugin` from 3.1.0 to 3.2.0 - [Release notes](https://github.com/mojohaus/jaxb2-maven-plugin/releases) - [Commits](https://github.com/mojohaus/jaxb2-maven-plugin/compare/jaxb2-maven-plugin-3.1.0...jaxb2-maven-plugin-3.2.0) Updates `org.codehaus.mojo:properties-maven-plugin` from 1.1.0 to 1.2.1 - [Release notes](https://github.com/mojohaus/properties-maven-plugin/releases) - [Commits](https://github.com/mojohaus/properties-maven-plugin/compare/properties-maven-plugin-1.1.0...1.2.1) --- updated-dependencies: - dependency-name: com.google.errorprone:error_prone_core dependency-type: direct:production update-type: version-update:semver-minor dependency-group: build-tools - dependency-name: com.google.errorprone:error_prone_annotations dependency-type: direct:production update-type: version-update:semver-minor dependency-group: build-tools - dependency-name: com.puppycrawl.tools:checkstyle dependency-type: direct:production update-type: version-update:semver-minor dependency-group: build-tools - dependency-name: com.github.spotbugs:spotbugs dependency-type: direct:production update-type: version-update:semver-patch dependency-group: build-tools - dependency-name: com.google.errorprone:error_prone_annotations dependency-type: direct:production update-type: version-update:semver-minor dependency-group: build-tools - dependency-name: org.apache.maven.plugins:maven-enforcer-plugin dependency-type: direct:production update-type: version-update:semver-minor dependency-group: build-tools - dependency-name: org.apache.maven.plugins:maven-jar-plugin dependency-type: direct:production update-type: version-update:semver-minor dependency-group: build-tools - dependency-name: org.apache.maven.plugins:maven-surefire-plugin dependency-type: direct:production update-type: version-update:semver-minor dependency-group: build-tools - dependency-name: org.apache.maven.plugins:maven-failsafe-plugin dependency-type: direct:production update-type: version-update:semver-minor dependency-group: build-tools - dependency-name: org.apache.maven.plugins:maven-checkstyle-plugin dependency-type: direct:production update-type: version-update:semver-minor dependency-group: build-tools - dependency-name: com.github.spotbugs:spotbugs-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch dependency-group: build-tools - dependency-name: org.apache.maven.plugins:maven-clean-plugin dependency-type: direct:production update-type: version-update:semver-minor dependency-group: build-tools - dependency-name: org.apache.maven.plugins:maven-dependency-plugin dependency-type: direct:production update-type: version-update:semver-minor dependency-group: build-tools - dependency-name: org.sonatype.plugins:nexus-staging-maven-plugin dependency-type: direct:production update-type: version-update:semver-minor dependency-group: build-tools - dependency-name: org.apache.maven.plugins:maven-javadoc-plugin dependency-type: direct:production update-type: version-update:semver-minor dependency-group: build-tools - dependency-name: org.apache.maven.plugins:maven-source-plugin dependency-type: direct:production update-type: version-update:semver-patch dependency-group: build-tools - dependency-name: org.apache.maven.plugins:maven-gpg-plugin dependency-type: direct:production update-type: version-update:semver-patch dependency-group: build-tools - dependency-name: org.jacoco:jacoco-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch dependency-group: build-tools - dependency-name: org.apache.maven.plugins:maven-release-plugin dependency-type: direct:production update-type: version-update:semver-minor dependency-group: build-tools - dependency-name: org.codehaus.mojo:xml-maven-plugin dependency-type: direct:production update-type: version-update:semver-minor dependency-group: build-tools - dependency-name: org.codehaus.mojo:license-maven-plugin dependency-type: direct:production update-type: version-update:semver-minor dependency-group: build-tools - dependency-name: org.codehaus.mojo:build-helper-maven-plugin dependency-type: direct:production update-type: version-update:semver-minor dependency-group: build-tools - dependency-name: org.codehaus.mojo:buildnumber-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch dependency-group: build-tools - dependency-name: org.codehaus.mojo:jaxb2-maven-plugin dependency-type: direct:production update-type: version-update:semver-minor dependency-group: build-tools - dependency-name: org.codehaus.mojo:properties-maven-plugin dependency-type: direct:production update-type: version-update:semver-minor dependency-group: build-tools ... Signed-off-by: dependabot[bot] --- dspace-api/pom.xml | 6 +++--- dspace-server-webapp/pom.xml | 2 +- pom.xml | 38 ++++++++++++++++++------------------ 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/dspace-api/pom.xml b/dspace-api/pom.xml index ea182a748360..e9aeb7f2f426 100644 --- a/dspace-api/pom.xml +++ b/dspace-api/pom.xml @@ -102,7 +102,7 @@ org.codehaus.mojo build-helper-maven-plugin - 3.4.0 + 3.6.0 validate @@ -116,7 +116,7 @@ org.codehaus.mojo buildnumber-maven-plugin - 3.2.0 + 3.2.1 UNKNOWN_REVISION @@ -177,7 +177,7 @@ org.codehaus.mojo jaxb2-maven-plugin - 3.1.0 + 3.2.0 workflow-curation diff --git a/dspace-server-webapp/pom.xml b/dspace-server-webapp/pom.xml index 5cb25649e933..b4b7326b34c2 100644 --- a/dspace-server-webapp/pom.xml +++ b/dspace-server-webapp/pom.xml @@ -31,7 +31,7 @@ org.codehaus.mojo properties-maven-plugin - 1.1.0 + 1.2.1 initialize diff --git a/pom.xml b/pom.xml index a94dac3dd693..44a42f2b1089 100644 --- a/pom.xml +++ b/pom.xml @@ -29,7 +29,7 @@ 8.11.3 3.10.8 - 2.32.0 + 2.35.1 2.16.0 2.16.0 @@ -89,7 +89,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.4.1 + 3.5.0 enforce-java @@ -176,7 +176,7 @@ org.apache.maven.plugins maven-jar-plugin - 3.3.0 + 3.4.2 @@ -207,7 +207,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.2.5 + 3.5.1 @@ -234,7 +234,7 @@ maven-failsafe-plugin - 3.2.5 + 3.5.1 @@ -266,7 +266,7 @@ org.apache.maven.plugins maven-checkstyle-plugin - 3.3.1 + 3.6.0 verify-style @@ -295,14 +295,14 @@ com.puppycrawl.tools checkstyle - 8.38 + 8.45.1 com.github.spotbugs spotbugs-maven-plugin - 4.8.2.0 + 4.8.6.5 Max Low @@ -312,7 +312,7 @@ com.github.spotbugs spotbugs - 4.8.2 + 4.8.6 @@ -328,7 +328,7 @@ maven-clean-plugin - 3.3.2 + 3.4.0 @@ -347,7 +347,7 @@ org.apache.maven.plugins maven-dependency-plugin - 3.6.1 + 3.8.1 org.apache.maven.plugins @@ -364,13 +364,13 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.13 + 1.7.0 org.apache.maven.plugins maven-javadoc-plugin - 3.6.3 + 3.10.1 false @@ -385,7 +385,7 @@ org.apache.maven.plugins maven-source-plugin - 3.3.0 + 3.3.1 @@ -398,13 +398,13 @@ org.apache.maven.plugins maven-gpg-plugin - 3.2.1 + 3.2.7 org.jacoco jacoco-maven-plugin - 0.8.11 + 0.8.12 @@ -416,7 +416,7 @@ org.apache.maven.plugins maven-release-plugin - 3.0.0 + 3.1.1 @@ -484,7 +484,7 @@ org.codehaus.mojo xml-maven-plugin - 1.0.2 + 1.1.0 validate-ALL-xml-and-xsl @@ -692,7 +692,7 @@ org.codehaus.mojo license-maven-plugin - 2.0.0 + 2.4.0 false From b11f4e08386a3709837c46791e877fe24bcfda39 Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Tue, 29 Oct 2024 17:02:14 -0500 Subject: [PATCH 82/96] Fix checkstyle.xml syntax for bump to 8.45.1 --- checkstyle.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/checkstyle.xml b/checkstyle.xml index e0fa808d83cb..a33fc4831950 100644 --- a/checkstyle.xml +++ b/checkstyle.xml @@ -92,7 +92,7 @@ For more information on CheckStyle configurations below, see: http://checkstyle. - + From a824e4d6ff24ae4c225fbcfe568cc8d421de68b7 Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Tue, 29 Oct 2024 17:02:46 -0500 Subject: [PATCH 83/96] Minor checkstyle fixes after bump to 8.45.1. All are indentation / spacing fixes which are more strict now. --- .../rest/AuthenticationRestController.java | 2 +- .../app/rest/model/AuthorizationRest.java | 6 +-- .../dspace/app/rest/model/BitstreamRest.java | 15 ++---- .../app/rest/model/BrowseIndexRest.java | 10 +--- .../org/dspace/app/rest/model/BundleRest.java | 15 ++---- .../app/rest/model/ClaimedTaskRest.java | 5 +- .../dspace/app/rest/model/CollectionRest.java | 40 +++------------ .../dspace/app/rest/model/CommunityRest.java | 25 ++-------- .../dspace/app/rest/model/EPersonRest.java | 5 +- .../dspace/app/rest/model/EntityTypeRest.java | 5 +- .../app/rest/model/ExternalSourceRest.java | 5 +- .../org/dspace/app/rest/model/GroupRest.java | 15 ++---- .../org/dspace/app/rest/model/ItemRest.java | 50 ++++--------------- .../app/rest/model/OrcidHistoryRest.java | 2 +- .../dspace/app/rest/model/PoolTaskRest.java | 5 +- .../dspace/app/rest/model/ProcessRest.java | 15 ++---- .../app/rest/model/RelationshipRest.java | 5 +- .../app/rest/model/ResearcherProfileRest.java | 4 +- .../dspace/app/rest/model/SuggestionRest.java | 4 +- .../app/rest/model/SuggestionTargetRest.java | 2 +- .../app/rest/model/VersionHistoryRest.java | 10 +--- .../dspace/app/rest/model/VersionRest.java | 10 +--- .../model/VocabularyEntryDetailsRest.java | 6 +-- .../dspace/app/rest/model/VocabularyRest.java | 4 +- .../rest/model/WorkflowDefinitionRest.java | 10 +--- .../app/rest/model/WorkflowItemRest.java | 20 ++------ .../app/rest/model/WorkflowStepRest.java | 5 +- .../app/rest/model/WorkspaceItemRest.java | 20 ++------ .../org/dspace/app/rest/utils/RegexUtils.java | 2 +- .../app/rest/matcher/RegistrationMatcher.java | 2 +- 30 files changed, 75 insertions(+), 249 deletions(-) diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/AuthenticationRestController.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/AuthenticationRestController.java index 070f3d8a1868..63ac50b6ea06 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/AuthenticationRestController.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/AuthenticationRestController.java @@ -220,7 +220,7 @@ private AuthenticationTokenResource shortLivedTokenResponse(HttpServletRequest r * @return ResponseEntity */ @RequestMapping(value = "/login", method = { RequestMethod.GET, RequestMethod.PUT, RequestMethod.PATCH, - RequestMethod.DELETE }) + RequestMethod.DELETE }) public ResponseEntity login() { return ResponseEntity.status(HttpStatus.METHOD_NOT_ALLOWED).body("Only POST is allowed for login requests."); } diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/AuthorizationRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/AuthorizationRest.java index fa463a7c3968..cd3e33b9e2fa 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/AuthorizationRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/AuthorizationRest.java @@ -18,9 +18,9 @@ * @author Andrea Bollini (andrea.bollini at 4science.it) */ @LinksRest(links = { - @LinkRest(method = "getEperson", name = AuthorizationRest.EPERSON), - @LinkRest(method = "getFeature", name = AuthorizationRest.FEATURE), - @LinkRest(method = "getObject", name = AuthorizationRest.OBJECT) + @LinkRest(method = "getEperson", name = AuthorizationRest.EPERSON), + @LinkRest(method = "getFeature", name = AuthorizationRest.FEATURE), + @LinkRest(method = "getObject", name = AuthorizationRest.OBJECT) }) public class AuthorizationRest extends BaseObjectRest { public static final String NAME = "authorization"; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/BitstreamRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/BitstreamRest.java index d2c2268b3f35..d456f7222308 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/BitstreamRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/BitstreamRest.java @@ -16,18 +16,9 @@ * @author Andrea Bollini (andrea.bollini at 4science.it) */ @LinksRest(links = { - @LinkRest( - name = BitstreamRest.BUNDLE, - method = "getBundle" - ), - @LinkRest( - name = BitstreamRest.FORMAT, - method = "getFormat" - ), - @LinkRest( - name = BitstreamRest.THUMBNAIL, - method = "getThumbnail" - ) + @LinkRest(name = BitstreamRest.BUNDLE, method = "getBundle"), + @LinkRest(name = BitstreamRest.FORMAT, method = "getFormat"), + @LinkRest(name = BitstreamRest.THUMBNAIL, method = "getThumbnail") }) public class BitstreamRest extends DSpaceObjectRest { public static final String PLURAL_NAME = "bitstreams"; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/BrowseIndexRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/BrowseIndexRest.java index a3c0b37ba576..e5b089479971 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/BrowseIndexRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/BrowseIndexRest.java @@ -20,14 +20,8 @@ * @author Andrea Bollini (andrea.bollini at 4science.it) */ @LinksRest(links = { - @LinkRest( - name = BrowseIndexRest.LINK_ITEMS, - method = "listBrowseItems" - ), - @LinkRest( - name = BrowseIndexRest.LINK_ENTRIES, - method = "listBrowseEntries" - ) + @LinkRest(name = BrowseIndexRest.LINK_ITEMS, method = "listBrowseItems"), + @LinkRest(name = BrowseIndexRest.LINK_ENTRIES, method = "listBrowseEntries") }) public class BrowseIndexRest extends BaseObjectRest { private static final long serialVersionUID = -4870333170249999559L; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/BundleRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/BundleRest.java index 1ec9f448dde4..4a417e6c54c3 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/BundleRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/BundleRest.java @@ -16,18 +16,9 @@ * @author Jelle Pelgrims (jelle.pelgrims at atmire.com) */ @LinksRest(links = { - @LinkRest( - name = BundleRest.ITEM, - method = "getItem" - ), - @LinkRest( - name = BundleRest.BITSTREAMS, - method = "getBitstreams" - ), - @LinkRest( - name = BundleRest.PRIMARY_BITSTREAM, - method = "getPrimaryBitstream" - ) + @LinkRest(name = BundleRest.ITEM, method = "getItem"), + @LinkRest(name = BundleRest.BITSTREAMS, method = "getBitstreams"), + @LinkRest(name = BundleRest.PRIMARY_BITSTREAM, method = "getPrimaryBitstream") }) public class BundleRest extends DSpaceObjectRest { public static final String NAME = "bundle"; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ClaimedTaskRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ClaimedTaskRest.java index 0973fac987d2..d29bf7a7ce6b 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ClaimedTaskRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ClaimedTaskRest.java @@ -16,10 +16,7 @@ * @author Andrea Bollini (andrea.bollini at 4science.it) */ @LinksRest(links = { - @LinkRest( - name = ClaimedTaskRest.STEP, - method = "getStep" - ) + @LinkRest(name = ClaimedTaskRest.STEP, method = "getStep") }) public class ClaimedTaskRest extends BaseObjectRest { public static final String NAME = "claimedtask"; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/CollectionRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/CollectionRest.java index f00bb883959c..34faba4cb4d9 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/CollectionRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/CollectionRest.java @@ -15,38 +15,14 @@ * @author Andrea Bollini (andrea.bollini at 4science.it) */ @LinksRest(links = { - @LinkRest( - name = CollectionRest.LICENSE, - method = "getLicense" - ), - @LinkRest( - name = CollectionRest.LOGO, - method = "getLogo" - ), - @LinkRest( - name = CollectionRest.MAPPED_ITEMS, - method = "getMappedItems" - ), - @LinkRest( - name = CollectionRest.PARENT_COMMUNITY, - method = "getParentCommunity" - ), - @LinkRest( - name = CollectionRest.ADMIN_GROUP, - method = "getAdminGroup" - ), - @LinkRest( - name = CollectionRest.SUBMITTERS_GROUP, - method = "getSubmittersGroup" - ), - @LinkRest( - name = CollectionRest.ITEM_READ_GROUP, - method = "getItemReadGroup" - ), - @LinkRest( - name = CollectionRest.BITSTREAM_READ_GROUP, - method = "getBitstreamReadGroup" - ), + @LinkRest(name = CollectionRest.LICENSE, method = "getLicense"), + @LinkRest(name = CollectionRest.LOGO, method = "getLogo"), + @LinkRest(name = CollectionRest.MAPPED_ITEMS, method = "getMappedItems"), + @LinkRest(name = CollectionRest.PARENT_COMMUNITY, method = "getParentCommunity"), + @LinkRest(name = CollectionRest.ADMIN_GROUP, method = "getAdminGroup"), + @LinkRest(name = CollectionRest.SUBMITTERS_GROUP, method = "getSubmittersGroup"), + @LinkRest(name = CollectionRest.ITEM_READ_GROUP, method = "getItemReadGroup"), + @LinkRest(name = CollectionRest.BITSTREAM_READ_GROUP, method = "getBitstreamReadGroup"), }) public class CollectionRest extends DSpaceObjectRest { public static final String NAME = "collection"; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/CommunityRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/CommunityRest.java index 0004e0b91ca4..e70b30803da3 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/CommunityRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/CommunityRest.java @@ -15,26 +15,11 @@ * @author Andrea Bollini (andrea.bollini at 4science.it) */ @LinksRest(links = { - @LinkRest( - name = CommunityRest.COLLECTIONS, - method = "getCollections" - ), - @LinkRest( - name = CommunityRest.LOGO, - method = "getLogo" - ), - @LinkRest( - name = CommunityRest.SUBCOMMUNITIES, - method = "getSubcommunities" - ), - @LinkRest( - name = CommunityRest.PARENT_COMMUNITY, - method = "getParentCommunity" - ), - @LinkRest( - name = CommunityRest.ADMIN_GROUP, - method = "getAdminGroup" - ) + @LinkRest(name = CommunityRest.COLLECTIONS, method = "getCollections"), + @LinkRest(name = CommunityRest.LOGO, method = "getLogo"), + @LinkRest(name = CommunityRest.SUBCOMMUNITIES, method = "getSubcommunities"), + @LinkRest(name = CommunityRest.PARENT_COMMUNITY, method = "getParentCommunity"), + @LinkRest(name = CommunityRest.ADMIN_GROUP, method = "getAdminGroup") }) public class CommunityRest extends DSpaceObjectRest { public static final String NAME = "community"; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/EPersonRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/EPersonRest.java index c06ed0e3fe1f..db243400259d 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/EPersonRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/EPersonRest.java @@ -20,10 +20,7 @@ * @author Andrea Bollini (andrea.bollini at 4science.it) */ @LinksRest(links = { - @LinkRest( - name = EPersonRest.GROUPS, - method = "getGroups" - ) + @LinkRest(name = EPersonRest.GROUPS, method = "getGroups") }) public class EPersonRest extends DSpaceObjectRest { public static final String NAME = "eperson"; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/EntityTypeRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/EntityTypeRest.java index 9d4a729ded93..e73aa709180d 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/EntityTypeRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/EntityTypeRest.java @@ -15,10 +15,7 @@ * Refer to {@link org.dspace.content.EntityType} for explanation of the properties */ @LinksRest(links = { - @LinkRest( - name = EntityTypeRest.RELATION_SHIP_TYPES, - method = "getEntityTypeRelationship" - ) + @LinkRest(name = EntityTypeRest.RELATION_SHIP_TYPES, method = "getEntityTypeRelationship") }) public class EntityTypeRest extends BaseObjectRest { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ExternalSourceRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ExternalSourceRest.java index 58402954e8db..21f41241b293 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ExternalSourceRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ExternalSourceRest.java @@ -13,10 +13,7 @@ * This class serves as a REST representation for an External Source */ @LinksRest(links = { - @LinkRest( - name = ExternalSourceRest.ENTITY_TYPES, - method = "getSupportedEntityTypes" - ) + @LinkRest(name = ExternalSourceRest.ENTITY_TYPES, method = "getSupportedEntityTypes") }) public class ExternalSourceRest extends BaseObjectRest { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/GroupRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/GroupRest.java index 7d56af2e7204..0a4963b66fa0 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/GroupRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/GroupRest.java @@ -18,18 +18,9 @@ */ @JsonIgnoreProperties(ignoreUnknown = true) @LinksRest(links = { - @LinkRest( - name = GroupRest.SUBGROUPS, - method = "getGroups" - ), - @LinkRest( - name = GroupRest.EPERSONS, - method = "getMembers" - ), - @LinkRest( - name = GroupRest.OBJECT, - method = "getParentObject" - ) + @LinkRest(name = GroupRest.SUBGROUPS, method = "getGroups"), + @LinkRest(name = GroupRest.EPERSONS, method = "getMembers"), + @LinkRest(name = GroupRest.OBJECT, method = "getParentObject") }) public class GroupRest extends DSpaceObjectRest { public static final String NAME = "group"; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ItemRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ItemRest.java index b3ae373ceed8..a47667441cc8 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ItemRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ItemRest.java @@ -17,46 +17,16 @@ * @author Andrea Bollini (andrea.bollini at 4science.it) */ @LinksRest(links = { - @LinkRest( - name = ItemRest.ACCESS_STATUS, - method = "getAccessStatus" - ), - @LinkRest( - name = ItemRest.BUNDLES, - method = "getBundles" - ), - @LinkRest( - name = ItemRest.IDENTIFIERS, - method = "getIdentifiers" - ), - @LinkRest( - name = ItemRest.MAPPED_COLLECTIONS, - method = "getMappedCollections" - ), - @LinkRest( - name = ItemRest.OWNING_COLLECTION, - method = "getOwningCollection" - ), - @LinkRest( - name = ItemRest.RELATIONSHIPS, - method = "getRelationships" - ), - @LinkRest( - name = ItemRest.VERSION, - method = "getItemVersion" - ), - @LinkRest( - name = ItemRest.TEMPLATE_ITEM_OF, - method = "getTemplateItemOf" - ), - @LinkRest( - name = ItemRest.THUMBNAIL, - method = "getThumbnail" - ), - @LinkRest( - name = ItemRest.SUBMITTER, - method = "getItemSubmitter" - ) + @LinkRest(name = ItemRest.ACCESS_STATUS, method = "getAccessStatus"), + @LinkRest(name = ItemRest.BUNDLES, method = "getBundles"), + @LinkRest(name = ItemRest.IDENTIFIERS, method = "getIdentifiers"), + @LinkRest(name = ItemRest.MAPPED_COLLECTIONS, method = "getMappedCollections"), + @LinkRest(name = ItemRest.OWNING_COLLECTION, method = "getOwningCollection"), + @LinkRest(name = ItemRest.RELATIONSHIPS, method = "getRelationships"), + @LinkRest(name = ItemRest.VERSION, method = "getItemVersion"), + @LinkRest(name = ItemRest.TEMPLATE_ITEM_OF, method = "getTemplateItemOf"), + @LinkRest(name = ItemRest.THUMBNAIL, method = "getThumbnail"), + @LinkRest(name = ItemRest.SUBMITTER, method = "getItemSubmitter") }) public class ItemRest extends DSpaceObjectRest { public static final String NAME = "item"; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/OrcidHistoryRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/OrcidHistoryRest.java index 2c4c7cbe6043..433d5626ca42 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/OrcidHistoryRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/OrcidHistoryRest.java @@ -39,7 +39,7 @@ public class OrcidHistoryRest extends BaseObjectRest { private String responseMessage; - public OrcidHistoryRest(){} + public OrcidHistoryRest() {} @Override @JsonProperty(access = JsonProperty.Access.READ_ONLY) diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/PoolTaskRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/PoolTaskRest.java index 0b66f0604b2e..94c70037330e 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/PoolTaskRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/PoolTaskRest.java @@ -17,10 +17,7 @@ * @author Andrea Bollini (andrea.bollini at 4science.it) */ @LinksRest(links = { - @LinkRest( - name = PoolTaskRest.STEP, - method = "getStep" - ) + @LinkRest(name = PoolTaskRest.STEP, method = "getStep") }) public class PoolTaskRest extends BaseObjectRest { public static final String NAME = "pooltask"; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ProcessRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ProcessRest.java index d3d88c2776ce..fee104b4e389 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ProcessRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ProcessRest.java @@ -21,18 +21,9 @@ * This class serves as a REST representation for the {@link Process} class */ @LinksRest(links = { - @LinkRest( - name = ProcessRest.FILES, - method = "getFilesFromProcess" - ), - @LinkRest( - name = ProcessRest.FILE_TYPES, - method = "getFileTypesFromProcess" - ), - @LinkRest( - name = ProcessRest.OUTPUT, - method = "getOutputFromProcess" - ) + @LinkRest(name = ProcessRest.FILES, method = "getFilesFromProcess"), + @LinkRest(name = ProcessRest.FILE_TYPES, method = "getFileTypesFromProcess"), + @LinkRest(name = ProcessRest.OUTPUT, method = "getOutputFromProcess") }) public class ProcessRest extends BaseObjectRest { public static final String NAME = "process"; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/RelationshipRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/RelationshipRest.java index 76a7a4348682..723f7e148b27 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/RelationshipRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/RelationshipRest.java @@ -19,10 +19,7 @@ * Refer to {@link org.dspace.content.Relationship} for explanation about the properties */ @LinksRest(links = { - @LinkRest( - name = RelationshipRest.RELATIONSHIP_TYPE, - method = "getRelationshipType" - ) + @LinkRest(name = RelationshipRest.RELATIONSHIP_TYPE, method = "getRelationshipType") }) public class RelationshipRest extends BaseObjectRest { public static final String NAME = "relationship"; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ResearcherProfileRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ResearcherProfileRest.java index 13faa2e2bbdf..629dbdf85821 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ResearcherProfileRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/ResearcherProfileRest.java @@ -20,8 +20,8 @@ * */ @LinksRest(links = { - @LinkRest(name = ResearcherProfileRest.ITEM, method = "getItem"), - @LinkRest(name = ResearcherProfileRest.EPERSON, method = "getEPerson") + @LinkRest(name = ResearcherProfileRest.ITEM, method = "getItem"), + @LinkRest(name = ResearcherProfileRest.EPERSON, method = "getEPerson") }) public class ResearcherProfileRest extends BaseObjectRest { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SuggestionRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SuggestionRest.java index c7210e892558..7b1a05127fc7 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SuggestionRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SuggestionRest.java @@ -21,7 +21,9 @@ * * @author Andrea Bollini (andrea.bollini at 4science.it) */ -@LinksRest(links = { @LinkRest(name = SuggestionRest.TARGET, method = "getTarget") }) +@LinksRest(links = { + @LinkRest(name = SuggestionRest.TARGET, method = "getTarget") +}) public class SuggestionRest extends BaseObjectRest { private static final long serialVersionUID = 1L; public static final String NAME = "suggestion"; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SuggestionTargetRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SuggestionTargetRest.java index 65764507e247..b6518eff7488 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SuggestionTargetRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/SuggestionTargetRest.java @@ -19,7 +19,7 @@ * @author Andrea Bollini (andrea.bollini at 4science.it) */ @LinksRest(links = { - @LinkRest(name = SuggestionTargetRest.TARGET, method = "getTarget") + @LinkRest(name = SuggestionTargetRest.TARGET, method = "getTarget") }) public class SuggestionTargetRest extends BaseObjectRest { private static final long serialVersionUID = 1L; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/VersionHistoryRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/VersionHistoryRest.java index 5aab7028a8c6..80f704c77936 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/VersionHistoryRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/VersionHistoryRest.java @@ -13,14 +13,8 @@ * The REST object for the {@link org.dspace.versioning.VersionHistory} object */ @LinksRest(links = { - @LinkRest( - name = VersionHistoryRest.VERSIONS, - method = "getVersions" - ), - @LinkRest( - name = VersionHistoryRest.DRAFT_VERSION, - method = "getDraftVersion" - ) + @LinkRest(name = VersionHistoryRest.VERSIONS, method = "getVersions"), + @LinkRest(name = VersionHistoryRest.DRAFT_VERSION, method = "getDraftVersion") }) public class VersionHistoryRest extends BaseObjectRest { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/VersionRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/VersionRest.java index 21bf82804dd2..d9ebdd67e408 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/VersionRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/VersionRest.java @@ -16,14 +16,8 @@ * The REST object for the {@link org.dspace.versioning.Version} objects */ @LinksRest(links = { - @LinkRest( - name = VersionRest.VERSION_HISTORY, - method = "getVersionHistory" - ), - @LinkRest( - name = VersionRest.ITEM, - method = "getVersionItem" - ) + @LinkRest(name = VersionRest.VERSION_HISTORY, method = "getVersionHistory"), + @LinkRest(name = VersionRest.ITEM, method = "getVersionItem") }) public class VersionRest extends BaseObjectRest { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/VocabularyEntryDetailsRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/VocabularyEntryDetailsRest.java index e5869a852521..884e14642cf9 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/VocabularyEntryDetailsRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/VocabularyEntryDetailsRest.java @@ -18,9 +18,9 @@ * @author Andrea Bollini (andrea.bollini at 4science.it) */ @LinksRest(links = { - @LinkRest(name = VocabularyEntryDetailsRest.PARENT, method = "getParent"), - @LinkRest(name = VocabularyEntryDetailsRest.CHILDREN, method = "getChildren") - }) + @LinkRest(name = VocabularyEntryDetailsRest.PARENT, method = "getParent"), + @LinkRest(name = VocabularyEntryDetailsRest.CHILDREN, method = "getChildren") +}) public class VocabularyEntryDetailsRest extends BaseObjectRest { public static final String PLURAL_NAME = "vocabularyEntryDetails"; public static final String NAME = "vocabularyEntryDetail"; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/VocabularyRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/VocabularyRest.java index f119059c2bb7..a54d93c643b4 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/VocabularyRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/VocabularyRest.java @@ -15,9 +15,7 @@ * @author Andrea Bollini (andrea.bollini at 4science.it) */ @LinksRest(links = { - @LinkRest(name = VocabularyRest.ENTRIES, - method = "filter" - ), + @LinkRest(name = VocabularyRest.ENTRIES, method = "filter"), }) public class VocabularyRest extends BaseObjectRest { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkflowDefinitionRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkflowDefinitionRest.java index 0ec967d09876..9cef79aaf3be 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkflowDefinitionRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkflowDefinitionRest.java @@ -18,14 +18,8 @@ * @author Maria Verdonck (Atmire) on 11/12/2019 */ @LinksRest(links = { - @LinkRest( - name = WorkflowDefinitionRest.COLLECTIONS_MAPPED_TO, - method = "getCollections" - ), - @LinkRest( - name = WorkflowDefinitionRest.STEPS, - method = "getSteps" - ) + @LinkRest(name = WorkflowDefinitionRest.COLLECTIONS_MAPPED_TO, method = "getCollections"), + @LinkRest(name = WorkflowDefinitionRest.STEPS, method = "getSteps") }) public class WorkflowDefinitionRest extends BaseObjectRest { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkflowItemRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkflowItemRest.java index 65fa531c5e42..d08abb3546a3 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkflowItemRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkflowItemRest.java @@ -15,22 +15,10 @@ * @author Andrea Bollini (andrea.bollini at 4science.it) */ @LinksRest(links = { - @LinkRest( - name = WorkflowItemRest.STEP, - method = "getStep" - ), - @LinkRest( - name = WorkflowItemRest.SUBMITTER, - method = "getWorkflowItemSubmitter" - ), - @LinkRest( - name = WorkflowItemRest.ITEM, - method = "getWorkflowItemItem" - ), - @LinkRest( - name = WorkflowItemRest.COLLECTION, - method = "getWorkflowItemCollection" - ) + @LinkRest(name = WorkflowItemRest.STEP, method = "getStep"), + @LinkRest(name = WorkflowItemRest.SUBMITTER, method = "getWorkflowItemSubmitter"), + @LinkRest(name = WorkflowItemRest.ITEM, method = "getWorkflowItemItem"), + @LinkRest(name = WorkflowItemRest.COLLECTION, method = "getWorkflowItemCollection") }) public class WorkflowItemRest extends AInprogressSubmissionRest { public static final String NAME = "workflowitem"; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkflowStepRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkflowStepRest.java index b3397721c117..53ddf38709e4 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkflowStepRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkflowStepRest.java @@ -18,10 +18,7 @@ * @author Maria Verdonck (Atmire) on 10/01/2020 */ @LinksRest(links = { - @LinkRest( - name = WorkflowStepRest.ACTIONS, - method = "getActions" - ), + @LinkRest(name = WorkflowStepRest.ACTIONS, method = "getActions"), }) public class WorkflowStepRest extends BaseObjectRest { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkspaceItemRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkspaceItemRest.java index e311cd259231..8e0d52123f99 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkspaceItemRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/WorkspaceItemRest.java @@ -15,22 +15,10 @@ * @author Andrea Bollini (andrea.bollini at 4science.it) */ @LinksRest(links = { - @LinkRest( - name = WorkspaceItemRest.SUPERVISION_ORDERS, - method = "getSupervisionOrders" - ), - @LinkRest( - name = WorkspaceItemRest.SUBMITTER, - method = "getWorkspaceItemSubmitter" - ), - @LinkRest( - name = WorkspaceItemRest.ITEM, - method = "getWorkspaceItemItem" - ), - @LinkRest( - name = WorkspaceItemRest.COLLECTION, - method = "getWorkspaceItemCollection" - ) + @LinkRest(name = WorkspaceItemRest.SUPERVISION_ORDERS, method = "getSupervisionOrders"), + @LinkRest(name = WorkspaceItemRest.SUBMITTER, method = "getWorkspaceItemSubmitter"), + @LinkRest(name = WorkspaceItemRest.ITEM, method = "getWorkspaceItemItem"), + @LinkRest(name = WorkspaceItemRest.COLLECTION, method = "getWorkspaceItemCollection") }) public class WorkspaceItemRest extends AInprogressSubmissionRest { public static final String NAME = "workspaceitem"; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/utils/RegexUtils.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/utils/RegexUtils.java index b358e785c3b3..df525f679323 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/utils/RegexUtils.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/utils/RegexUtils.java @@ -13,7 +13,7 @@ */ public class RegexUtils { - private RegexUtils(){} + private RegexUtils() {} /** * Regular expression in the request mapping to accept UUID as identifier diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/matcher/RegistrationMatcher.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/matcher/RegistrationMatcher.java index a154091a2eff..2a4cee8375be 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/matcher/RegistrationMatcher.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/matcher/RegistrationMatcher.java @@ -17,7 +17,7 @@ public class RegistrationMatcher { - private RegistrationMatcher(){} + private RegistrationMatcher() {} public static Matcher matchRegistration(String email, UUID epersonUuid) { return allOf( From ebd36a93881015b18e13f020b86439fcac80090f Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Wed, 30 Oct 2024 14:49:04 -0500 Subject: [PATCH 84/96] Update jsoneditor.js reference in Hal Browser --- dspace-server-webapp/src/main/resources/static/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dspace-server-webapp/src/main/resources/static/index.html b/dspace-server-webapp/src/main/resources/static/index.html index c780286107d8..0b80f806767e 100644 --- a/dspace-server-webapp/src/main/resources/static/index.html +++ b/dspace-server-webapp/src/main/resources/static/index.html @@ -321,7 +321,7 @@

    Embedded Resources

    - +