Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: Proof of Issue 375 #377

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
206 commits
Select commit Hold shift + click to select a range
b9f5bf9
[DSC-879] Identifiers Signature should check all item types
eskander17 Feb 6, 2023
0891388
Merged dspace-cris-7 into DSC-879
atarix83 Apr 5, 2023
69e0acc
[DSC-1101] Porting of CST-10226
vins01-4science May 25, 2023
31f18a1
Merged dspace-cris-7 into DSC-1101
atarix83 May 30, 2023
4f4fe19
[DSC-1124] included inline-group fields for indexing
Micheleboychuk Jun 13, 2023
3db6753
[DSC-1124] added missing check for empty collection
Micheleboychuk Jun 14, 2023
0691ad2
[DSC-782][CST-6963] New metadata and solr index for file type
vins01-4science Jun 19, 2023
c8d232e
[DSC-782][CST-6963] Indexing bundle-bitstreams metadatas
vins01-4science Jun 19, 2023
1c8baf6
[DSC-782][CST-6963] Updated local.cfg for test folder
vins01-4science Jun 19, 2023
524dd01
[DSC-782] Fixes compilation errors
vins01-4science Jun 19, 2023
e4703a7
[DSC-782] Fixes NPE
vins01-4science Jun 20, 2023
61cbe84
Checkstyle fix for SolrServiceFileInfoPlugin.java
vins01-4science Jun 20, 2023
61f5039
[DSC-776] Restored mutliple entries import for bibtex files
vins01-4science Jul 11, 2023
83393d9
[CST-1072] Added support for additional custom filter to be injected …
Jul 27, 2023
1446578
[DSC-1161] Fix metadata validator for bind related metadata
Jul 27, 2023
a45f480
Merged dspace-cris-7 into DSC-879
atarix83 Jul 28, 2023
58536dc
Merged dspace-cris-7 into DSC-1161-type-bind-related-metadata-are-not…
Jul 31, 2023
64e2610
[DSC-1161] avoid longer variable name
Jul 31, 2023
bd6acf3
Merge branch 'dspace-cris-7' into DSC-1161-type-bind-related-metadata…
Aug 24, 2023
5d99682
[DSC-1161] fix MetadataValidator
Aug 25, 2023
b009810
Merge remote-tracking branch 'origin/DSC-1161-type-bind-related-metad…
Aug 25, 2023
8975ae5
test to check creation of multiple relationships might fail
floriangantner Aug 25, 2023
cc88923
fix wrong config property breaking tests
floriangantner Aug 28, 2023
f005ecb
[DSC-1198] add check to prevent empty metadata values with no authority
Maxgames17 Aug 28, 2023
9850542
[DSC-1161] hot fix MetadataAuthorityService inject
Aug 28, 2023
b226205
[DSC-1224] Export script that generates registry-file for schema
vins01-4science Aug 30, 2023
404c825
[DSC-1117] Fixes wrong property name in ApplicationConfig
vins01-4science Aug 31, 2023
8264b30
[DSC-1214] Fixed virtual field place after item update
LucaGiamminonni Aug 31, 2023
cfaafed
[DSC-1117] Fixes property key in rest.cfg
vins01-4science Aug 31, 2023
f0356d5
[DSC-1224] Refactoring of filename generation in script
vins01-4science Aug 31, 2023
1df9cb8
[DSC-1233] fixed issue with type of Pubmed during import
Micheleboychuk Sep 5, 2023
f813ff2
[DSC-1233] minor fix
Micheleboychuk Sep 5, 2023
62ca6eb
[DSC-1233] return null instead of launch the exception
Micheleboychuk Sep 5, 2023
f9de9fe
[DSC-1217] Update the wrong Scopus To Coar types mapping
eskander17 Sep 6, 2023
4dfcf69
[DSC-897] changed the implementation of Categories in statistics sect…
eskander17 Sep 7, 2023
15f6034
[DSC-1224] Fixes nil element generation
vins01-4science Sep 8, 2023
2d6a75c
[DSC-1224] Fixes nil element generation
vins01-4science Sep 8, 2023
4f4d01a
Merged dspace-cris-7 into DSC-1224
vins01-4science Sep 8, 2023
1e1cccd
[DSC-1117] Fixes wrong property name in ApplicationConfig
vins01-4science Aug 31, 2023
a068fa4
[DSC-1117] Fixes property key in rest.cfg
vins01-4science Aug 31, 2023
7c18ce8
Merged in DSC-1224 (pull request #1055)
vins01-4science Sep 11, 2023
191ac97
[DSC-1238][CST-11734] added type option to subscription-send process
Sep 11, 2023
8071287
Merged DSC-1238 into dspace-cris-7
corrad82-4s Sep 11, 2023
242db0b
Merged dspace-cris-7 into DSC-1233-PubMed-provider-does-not-work-prop…
atarix83 Sep 12, 2023
0cf9933
Merged in DSC-1233-PubMed-provider-does-not-work-properly (pull reque…
Micheleboychuk Sep 12, 2023
c15db0d
[DSC-897] excluded top categories report from Person Collection stati…
eskander17 Sep 12, 2023
a1b6845
[DSC-1234] added cell limit. Now if content of the cell is bigger tha…
Sep 12, 2023
883262c
[DSC-897] fixed broken ITs methods
eskander17 Sep 12, 2023
92fb4d3
[DSC-897] fixed broken IT method
eskander17 Sep 12, 2023
a4a1389
Merge remote-tracking branch 'bit-bucket/dspace-cris-7' into DSC-1072
vins01-4science Sep 13, 2023
a11f60b
[DSC-897] separated the configuration of statistics of all entity typ…
eskander17 Sep 13, 2023
fc82fa8
[DSC-1072] Refactored ternary operator with optional
vins01-4science Sep 13, 2023
7de3dd5
Merged in DSC-1072 (pull request #962)
corrad82-4s Sep 14, 2023
92a1e4c
[DSC-1247] Allow parameter for executing user to CLI processes (bulk-…
eskander17 Sep 19, 2023
55d20af
[DSC-1240] updated default doi metadata and added property for settin…
Sep 19, 2023
4efae73
[DSC-1241] Bitstream restrictions not reflected on its thumbnail
LucaGiamminonni Sep 20, 2023
166569a
[CST-6317] New COLLECTIONS rendering
Sep 12, 2022
2849bb1
Merged in DSC-740 (pull request #497)
Sep 20, 2023
16d4c69
Merged in DSC-897 (pull request #1077)
eskander17 Sep 21, 2023
052cc10
[CST-11738] TUHH: ORCID lookup with more data
eskander17 Sep 22, 2023
bed798b
[DSC-1246] change authentication-oidc.cfg
Sep 25, 2023
bcff6b6
Merged in DSC-1246-oidc-authentication-scopes-use-old-array-property-…
Sep 25, 2023
bab8602
[DSC-1240] made DOI_METADATA field in DOIIdentifierProvider private
Sep 26, 2023
5f63749
[DSC-1240] added description for identifier.doi.metadata in dspace.cfg
Sep 26, 2023
d7ca5e1
[CST-11876] Fixed bulk import values split
LucaGiamminonni Sep 27, 2023
bc8b5e0
[DSC-1243] added virtualField generator for primary and alt dois
Sep 28, 2023
99b4793
[CST-11738] ORCID lookup with more data
eskander17 Sep 28, 2023
3bf54e0
[DSC-1271] orcid extras change
steph-ieffam Sep 28, 2023
a08f121
Merged dspace-cris-7 into DSC-1161-type-bind-related-metadata-are-not…
francescopioscognamiglio Sep 29, 2023
5e85751
[DSC-1161] fix checkstyle violations
francescopioscognamiglio Sep 29, 2023
b3b69ee
[DSC-1161] refactoring to use type bind utility class
francescopioscognamiglio Sep 29, 2023
5c266ae
Merged dspace-cris-7 into DSC-1240
corrad82-4s Sep 29, 2023
5febe6c
Merged in DSC-1240 (pull request #1119)
Sep 29, 2023
cb757a8
Merged dspace-cris-7 into DSC-1161-type-bind-related-metadata-are-not…
francescopioscognamiglio Sep 29, 2023
072f5bd
[DSC-1161] add missing license
francescopioscognamiglio Sep 29, 2023
44f1c29
[CST-11820][DSC-1243] fix on xsd transformer and added alternative id…
Sep 29, 2023
606da4d
Merged in DSC-1161-type-bind-related-metadata-are-not-saved-on-the-re…
Sep 29, 2023
29f9136
[DSC-1271] fixed broken ITs
eskander17 Oct 2, 2023
9731363
[CST-12020] updated context retrieval process
Oct 2, 2023
5670b24
ported getContext method
Oct 2, 2023
48d1b75
[DSC-1243] added fixes according to the feedback and added tests for …
Oct 2, 2023
f1a57af
Merge remote-tracking branch 'origin/DSC-1243' into DSC-1243
Oct 2, 2023
8c0aa2d
[CST-10704] New external login flow for ORCID
vins01-4science Oct 4, 2023
f8dba8e
[CST-10704] fixes migration procedure
vins01-4science Oct 4, 2023
c187535
[CST-10704] Template for validation token
vins01-4science Oct 4, 2023
4088be0
[CST-10704] ITs for registation merge feature
vins01-4science Oct 4, 2023
7f1688c
[CST-10704] Minor fixes
vins01-4science Oct 4, 2023
1d2f4c3
[CST-10704] Minor fixes
vins01-4science Oct 4, 2023
c60ac59
[DSC-1278] fixed for authority metadata import with CSV
eskander17 Oct 3, 2023
1937e34
Merged in DSC-1234 (pull request #1098)
Oct 4, 2023
0178039
[maven-release-plugin] prepare release dspace-cris-2023.01.01
vins01-4science Oct 4, 2023
da3cefe
[maven-release-plugin] prepare for next development iteration
vins01-4science Oct 4, 2023
8f75b72
Merged in DSC-1120 (pull request #1160)
vins01-4science Oct 4, 2023
81326f2
Merged dspace-cris-7 into DSC-1243
corrad82-4s Oct 5, 2023
3ca6ca7
Merged in DSC-1243 (pull request #1139)
Oct 5, 2023
43ec174
[CST-10704] Minor fixes
vins01-4science Oct 5, 2023
57e2a2d
[CST-10704] Minor fixes
vins01-4science Oct 5, 2023
22ce3e1
[CST-10704] Minor fixes
vins01-4science Oct 5, 2023
d4f2923
[CST-10704] Fixes RegistrationDataScheduler
vins01-4science Oct 5, 2023
6b06709
[CST-10704] Fixes POST Error message
vins01-4science Oct 5, 2023
e477796
[DSC-1274] Porting of RorOrgUnitAuthority
Yevhenii-Lohatskyi Jun 16, 2023
e34909a
[DSC-1201] Make it possible to create related item using templates
NikitaKr1vonosov Aug 14, 2023
699e08c
[CST-10704] Fixes Failing RegistrationRepositoryIT
vins01-4science Oct 6, 2023
da48842
[CST-10704] Fixes Merge feature for logged-in users
vins01-4science Oct 6, 2023
31e7d1c
[CST-10704] Fixes Merge feature for logged-in users
vins01-4science Oct 6, 2023
27b44d9
[CST-10704] Feat ORCID default firstname and lastname
vins01-4science Oct 6, 2023
a6dab5b
[CST-10704] Feat allow creation of external accounts
vins01-4science Oct 6, 2023
8fd3350
[CST-10704] Fixes checkstyle issues
vins01-4science Oct 6, 2023
95ed674
[CST-10704] Refactors & Fixes
vins01-4science Oct 6, 2023
419e8a9
[DSC-1274] Implemented RorOrgUnitDataProvider
LucaGiamminonni Oct 6, 2023
a5da8ee
[CST-10704] Fixes user creation
vins01-4science Oct 6, 2023
ac0dad3
[CST-10704] Renamed email template
vins01-4science Oct 6, 2023
0be9db1
Merged in DSC-1217 (pull request #1073)
eskander17 Oct 9, 2023
f8149bb
[DSC-1282] added addDepositLicense to CreateWorkspaceItemWithExternal…
Oct 9, 2023
31fc4c5
[DSC-1274] Provider configuration
LucaGiamminonni Oct 9, 2023
20d7dc5
Merge remote-tracking branch '4Science-bitbucket/dspace-cris-7' into …
LucaGiamminonni Oct 9, 2023
3ecb092
Merged in CST-10704 (pull request #1163)
vins01-4science Oct 10, 2023
adc1857
[DSC-1251] Exposed request.item.type property
vins01-4science Oct 11, 2023
e20c3ef
Merged in DSC-1251 (pull request #1186)
vins01-4science Oct 11, 2023
ee8cead
Merge remote-tracking branch 'bit-bucket/dspace-cris-7' into DSC-1101
vins01-4science Oct 12, 2023
a35679c
Merged dspace-cris-7 into DSC-1124-inline-group-fields-should-be-indexed
vins01-4science Oct 12, 2023
0de462f
Merged in DSC-1124-inline-group-fields-should-be-indexed (pull reques…
Micheleboychuk Oct 12, 2023
37cb2c8
Merged in DSC-1101 (pull request #831)
vins01-4science Oct 12, 2023
d913b1e
DSC-1302 Default mapping of the migration from DSpace-CRIS 5 doesn't …
abollini Oct 12, 2023
7294b69
[DSC-1274] Configured RorOrgUnitAuthority as default authority for or…
LucaGiamminonni Oct 12, 2023
b5aafe5
[DSC-1296] added new metadata item.legacyoaiidentifier and updated me…
Oct 12, 2023
1e6aed9
Merged dspace-cris-7 into DSC-782
atarix83 Oct 12, 2023
e9576e6
[DSC-1201] disable template usage on related items by default (to be …
francescopioscognamiglio Oct 13, 2023
a820789
Merged in DSC-1201 (pull request #1010)
NikitaKr1vonosov Oct 13, 2023
0dc58de
Merged in DSC-782 (pull request #879)
vins01-4science Oct 13, 2023
2fed310
[CST-11738] import more information from ORCID Person
eskander17 Oct 13, 2023
79f2193
[CST-11738] added researcher id metadata
eskander17 Oct 13, 2023
1d485d1
[DSC-1282] checkstyle fixes
Oct 13, 2023
9cd790c
[CST-11738] fixed broken ITs
eskander17 Oct 13, 2023
9adb07b
Merge remote-tracking branch 'origin/dspace-cris-7' into CST-11738
eskander17 Oct 13, 2023
167f0ae
[CST-11738] fixed broken ITs testOrcidImportFiller
eskander17 Oct 13, 2023
6143382
Merged in DSC-1296 (pull request #1192)
Oct 16, 2023
5de1c43
Merged in DSC-1278 (pull request #1158)
eskander17 Oct 17, 2023
5568834
Merged in DSC-1271 (pull request #1146)
steph-ieffam Oct 17, 2023
0ed1f52
[DSC-1247] fixed broken ITs
eskander17 Oct 17, 2023
867919d
Merged dspace-cris-7 into CST-11738
steph-ieffam Oct 17, 2023
9d9b365
Merged dspace-cris-7 into DSC-1198
steph-ieffam Oct 17, 2023
47a4e75
[DSC-552] Fix plumx popup position in item page
davide-negretti Oct 17, 2023
8bc0bea
Merged in DSC-552 (pull request #1206)
Oct 17, 2023
be60d93
DSC-1304 expose dspace and cris versions in two different attributes
frabacche Oct 17, 2023
b5c979a
DSC-1304 DSpaceVersion stored into a Java constants
frabacche Oct 18, 2023
b6598bd
DSC-1304 DSpaceVersion stored into a Java constants
frabacche Oct 18, 2023
051e17e
DSC-1304 test fix
frabacche Oct 18, 2023
a5c859e
DSC-1304 checkstyle!
frabacche Oct 18, 2023
cc63d56
Merged in DSC-1282 (pull request #1172)
Oct 19, 2023
c35dc5b
[CST-7695] detect the duplication and return list of matched objects …
eskander17 Oct 19, 2023
0921934
[CST-10149] added logs for UpdateCrisMetricsWithExternalSource
Oct 18, 2023
7221ebc
[CST-10149] added new logs to UpdateCrisMetricsWithExternalSource and…
Oct 19, 2023
92b31ba
[DSC-1312] ITs for hidden publications in profile
vins01-4science Oct 19, 2023
4a4b886
[DSC-1312] Fixes tab with relation box shown only hidden entities
vins01-4science Oct 19, 2023
3beddec
[DSC-1312] Removes unused imports
vins01-4science Oct 19, 2023
45b22ef
[CST-11738] fixed broken ITs
eskander17 Oct 20, 2023
8b0fd3a
[DSC-1293] add a new metadata dc.title
eskander17 Oct 20, 2023
ffcc983
[CST-11738] fixed broken ITs
eskander17 Oct 20, 2023
f0f5fa2
Merge branch 'dspace-cris-7' into DSC-879
vins01-4science Oct 24, 2023
e529855
Merged in DSC-879 (pull request #643)
eskander17 Oct 24, 2023
5b4703a
[CST-11738] setting default behavior for orcid to 'will be referenced'
steph-ieffam Oct 25, 2023
72052ef
Merged dspace-cris-7 into CST-11738
steph-ieffam Oct 25, 2023
eeadc46
[CST-11738] fix IT
steph-ieffam Oct 25, 2023
1fcd95e
Merged in DSC-1247 (pull request #1118)
eskander17 Oct 25, 2023
c060a18
Merged in CST-11738 (pull request #1129)
eskander17 Oct 25, 2023
458b710
Merged in CST-7695 (pull request #1214)
eskander17 Oct 26, 2023
1722d98
[DSC-1324][CST-12375] Fixes ResearcherProfile creation for ORCID auth
vins01-4science Oct 26, 2023
b36a535
[DSC-898] fix dc.date.accessioned during migration of CRIS entities
steph-ieffam Oct 27, 2023
7c714f6
Merged in DSC-898 (pull request #1234)
steph-ieffam Oct 27, 2023
527bb04
Merged in DSC-1311 (pull request #1215)
Oct 27, 2023
35f3cf0
[CST-12350] Fixes overrides metadata in RegistrationData for auth users
vins01-4science Oct 27, 2023
10997c4
Merged dspace-cris-7 into CST-12350
atarix83 Oct 27, 2023
b62097d
Merged dspace-cris-7 into DSC-1324
atarix83 Oct 27, 2023
744809c
Merged in DSC-1293 (pull request #1223)
eskander17 Oct 30, 2023
1a9294a
Merged in DSC-1304-expose-separate-dspace-and-cris-versions (pull req…
frabacche Oct 30, 2023
944ee2f
Merged in DSC-1198 (pull request #1046)
Maxgames17 Oct 30, 2023
8be4591
[DSC-1319] Refactoring of ROR integration
LucaGiamminonni Oct 31, 2023
a81fbf6
Merged in DSC-776 (pull request #920)
vins01-4science Nov 1, 2023
01673c4
[DSC-1319] Finalized ror integration mapping
LucaGiamminonni Nov 2, 2023
bf55fc1
Merged dspace-cris-7 into DSC-1312
atarix83 Nov 3, 2023
02950cc
Merged dspace-cris-7 into DSC-1324
atarix83 Nov 3, 2023
f3de580
Merged dspace-cris-7 into CST-12350
atarix83 Nov 3, 2023
19438c5
Merged in DSC-1312 (pull request #1217)
vins01-4science Nov 3, 2023
3fa655e
Merged in DSC-1324 (pull request #1231)
vins01-4science Nov 3, 2023
2aadff3
Merged dspace-cris-7 into CST-12350
atarix83 Nov 3, 2023
9f7e3ee
[DSC-1319] Improved RorOrgUnitAuthority
LucaGiamminonni Nov 3, 2023
e2edcae
Merged dspace-cris-7 into CST-12350
atarix83 Nov 3, 2023
d369d2f
Merged in CST-12350 (pull request #1236)
vins01-4science Nov 3, 2023
c45e7d8
[DSC-1319] Added tests
LucaGiamminonni Nov 6, 2023
5e711e2
Merge remote-tracking branch '4Science-bitbucket/dspace-cris-7' into …
LucaGiamminonni Nov 6, 2023
bf5b19b
DSC-1342 Sitemap includes links to restricted content
abollini Nov 7, 2023
5b57a4c
[DSC-1321] add subscription.url config property
Yevhenii-Lohatskyi Nov 10, 2023
468c969
[DSC-1321] edit subscriptions_content email template
Yevhenii-Lohatskyi Nov 10, 2023
c732d50
[DSC-1321] Add class SubscriptionItem to prevent memory issues
Yevhenii-Lohatskyi Nov 10, 2023
0e99a19
[DSC-1321] refactor and change logic of SubscriptionEmailNotification…
Yevhenii-Lohatskyi Nov 10, 2023
9bfe6c2
[DSC-1321] small chane in StatisticsGenerator
Yevhenii-Lohatskyi Nov 10, 2023
3c8a912
[DSC-1321] Rewrite email composing in ContentGenerator
Yevhenii-Lohatskyi Nov 10, 2023
e0f261f
[DSC-1321] Remove now redundant interface SubscriptionGenerator since…
Yevhenii-Lohatskyi Nov 10, 2023
b1365e0
[DSC-1321] Edit subscriptions_email_configuration.xml
Yevhenii-Lohatskyi Nov 10, 2023
0f35f1f
Merged dspace-cris-7 into DSC-1321
Yevhenii-Lohatskyi Nov 10, 2023
a4e942e
[DSC-1321] small change in subscriptions_content
Yevhenii-Lohatskyi Nov 10, 2023
9940fcd
Merged in DSC-1321 (pull request #1271)
Yevhenii-Lohatskyi Nov 13, 2023
8df2205
test to check creation of multiple relationships might fail
floriangantner Aug 25, 2023
e8f379f
fix wrong config property breaking tests
floriangantner Aug 28, 2023
b2db662
Merge remote-tracking branch 'origin/dspace-cris-7-relationindexingfa…
floriangantner Nov 14, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dspace-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<parent>
<groupId>org.dspace</groupId>
<artifactId>dspace-parent</artifactId>
<version>cris-2023.01.01-SNAPSHOT</version>
<version>cris-2023.02.00-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>

Expand Down
28 changes: 15 additions & 13 deletions dspace-api/src/main/java/org/dspace/app/bulkedit/BulkImport.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import static org.apache.commons.lang3.StringUtils.isAllBlank;
import static org.apache.commons.lang3.StringUtils.isBlank;
import static org.apache.commons.lang3.StringUtils.isNotBlank;
import static org.apache.commons.lang3.StringUtils.split;
import static org.apache.commons.lang3.StringUtils.splitByWholeSeparator;
import static org.apache.commons.lang3.StringUtils.startsWith;
import static org.apache.commons.lang3.exception.ExceptionUtils.getRootCauseMessage;
import static org.apache.commons.lang3.math.NumberUtils.isCreatable;
Expand Down Expand Up @@ -258,19 +258,17 @@ public void setup() throws ParseException {
collectionId = commandLine.getOptionValue('c');
filename = commandLine.getOptionValue('f');

if (commandLine.hasOption('e')) {
if (commandLine.hasOption("er")) {
abortOnError = true;
}
}

@Override
public void internalRun() throws Exception {
context = new Context(Context.Mode.BATCH_EDIT);
assignCurrentUserInContext();
assignCurrentUserInContext(context);
assignSpecialGroupsInContext();

context.turnOffAuthorisationSystem();

InputStream inputStream = handler.getFileStream(context, filename)
.orElseThrow(() -> new IllegalArgumentException("Error reading file, the file couldn't be "
+ "found for filename: " + filename));
Expand All @@ -285,6 +283,7 @@ public void internalRun() throws Exception {
}

try {
context.turnOffAuthorisationSystem();
performImport(inputStream);
context.complete();
context.restoreAuthSystemState();
Expand Down Expand Up @@ -609,7 +608,8 @@ private boolean areMetadataValuesValid(Row row, boolean manyMetadataValuesAllowe
for (int index = firstMetadataIndex; index < row.getLastCellNum(); index++) {

String cellValue = WorkbookUtils.getCellValue(row, index);
String[] values = isNotBlank(cellValue) ? split(cellValue, METADATA_SEPARATOR) : new String[] { "" };
String[] values = isNotBlank(cellValue) ? splitByWholeSeparator(cellValue, METADATA_SEPARATOR)
: new String[] { "" };
if (values.length > 1 && !manyMetadataValuesAllowed) {
handleValidationErrorOnRow(row, "Multiple metadata value on the same cell not allowed "
+ "in the metadata group sheets: " + cellValue);
Expand Down Expand Up @@ -743,7 +743,7 @@ private List<String> validateAccessConditions(Row row) {
Map<String, AccessConditionOption> accessConditionOptions = getUploadAccessConditions();

return Arrays.stream(getAccessConditionValues(row))
.map(accessCondition -> split(accessCondition, ACCESS_CONDITION_ATTRIBUTES_SEPARATOR)[0])
.map(accessCondition -> splitByWholeSeparator(accessCondition, ACCESS_CONDITION_ATTRIBUTES_SEPARATOR)[0])
.filter(accessConditionName -> !accessConditionOptions.containsKey(accessConditionName))
.collect(Collectors.toList());
}
Expand Down Expand Up @@ -788,14 +788,14 @@ private List<AccessCondition> buildAccessConditions(Row row, String[] accessCond
}

return Arrays.stream(accessConditions)
.map(accessCondition -> split(accessCondition, ACCESS_CONDITION_ATTRIBUTES_SEPARATOR))
.map(accessCondition -> splitByWholeSeparator(accessCondition, ACCESS_CONDITION_ATTRIBUTES_SEPARATOR))
.map(accessConditionAttributes -> buildAccessCondition(accessConditionAttributes))
.collect(Collectors.toList());
}

private String[] getAccessConditionValues(Row row) {
String accessConditionCellValue = getCellValue(row, ACCESS_CONDITION_HEADER);
return split(accessConditionCellValue, METADATA_SEPARATOR);
return splitByWholeSeparator(accessConditionCellValue, METADATA_SEPARATOR);
}

private AccessCondition buildAccessCondition(String[] accessCondition) {
Expand Down Expand Up @@ -1306,12 +1306,13 @@ private void removeSingleMetadata(DSpaceObject dso, MetadataField field, String
}

private String getMetadataField(String field) {
return field.contains(LANGUAGE_SEPARATOR_PREFIX) ? split(field, LANGUAGE_SEPARATOR_PREFIX)[0] : field;
return field.contains(LANGUAGE_SEPARATOR_PREFIX) ? splitByWholeSeparator(field, LANGUAGE_SEPARATOR_PREFIX)[0]
: field;
}

private String getMetadataLanguage(String field) {
if (field.contains(LANGUAGE_SEPARATOR_PREFIX)) {
return split(field, LANGUAGE_SEPARATOR_PREFIX)[1].replace(LANGUAGE_SEPARATOR_SUFFIX, "");
return splitByWholeSeparator(field, LANGUAGE_SEPARATOR_PREFIX)[1].replace(LANGUAGE_SEPARATOR_SUFFIX, "");
}
return null;
}
Expand Down Expand Up @@ -1364,7 +1365,8 @@ private MultiValuedMap<String, MetadataValueVO> getMetadataFromRow(Row row, Map<
if (index >= firstMetadataIndex) {

String cellValue = WorkbookUtils.getCellValue(row, index);
String[] values = isNotBlank(cellValue) ? split(cellValue, METADATA_SEPARATOR) : new String[] { "" };
String[] values = isNotBlank(cellValue) ? splitByWholeSeparator(cellValue, METADATA_SEPARATOR)
: new String[] { "" };

List<MetadataValueVO> metadataValues = Arrays.stream(values)
.map(value -> buildMetadataValueVO(row, value, isMetadataGroupsSheet))
Expand Down Expand Up @@ -1601,7 +1603,7 @@ private void rollback() {
}
}

private void assignCurrentUserInContext() throws SQLException {
protected void assignCurrentUserInContext(Context context) throws SQLException, ParseException {
UUID uuid = getEpersonIdentifier();
if (uuid != null) {
EPerson ePerson = EPersonServiceFactory.getInstance().getEPersonService().find(context, uuid);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
*/
package org.dspace.app.bulkedit;

import java.sql.SQLException;

import org.apache.commons.cli.ParseException;
import org.dspace.core.Context;
import org.dspace.eperson.EPerson;
import org.dspace.eperson.factory.EPersonServiceFactory;

/**
* Extension of {@link BulkImport} for CLI.
*
Expand All @@ -15,4 +22,24 @@
*/
public class BulkImportCli extends BulkImport {

@Override
protected void assignCurrentUserInContext(Context context) throws ParseException {
if (commandLine.hasOption('e')) {
String ePersonEmail = commandLine.getOptionValue('e');
try {
EPerson ePerson =
EPersonServiceFactory.getInstance().getEPersonService().findByEmail(context, ePersonEmail);
if (ePerson == null) {
super.handler.logError("EPerson not found: " + ePersonEmail);
throw new IllegalArgumentException("Unable to find a user with email: " + ePersonEmail);
}
context.setCurrentUser(ePerson);
} catch (SQLException e) {
throw new IllegalArgumentException("SQLException trying to find user with email: " + ePersonEmail);
}
} else {
throw new ParseException("Required parameter -e missing!");
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
*/
package org.dspace.app.bulkedit;

import org.apache.commons.cli.Options;

/**
* Extension of {@link BulkImportScriptConfiguration} for CLI.
*
Expand All @@ -15,5 +17,13 @@
*/
public class BulkImportCliScriptConfiguration<T extends BulkImportCli> extends BulkImportScriptConfiguration<T> {

@Override
public Options getOptions() {
Options options = super.getOptions();
options.addOption("e", "email", true, "email address of user");
options.getOption("e").setRequired(true);
super.options = options;
return options;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ public Options getOptions() {
options.getOption("f").setType(InputStream.class);
options.getOption("f").setRequired(true);

options.addOption("e", "concludeOnError", false, "conclude the import at the first error");
options.getOption("e").setType(boolean.class);
options.getOption("e").setRequired(false);
options.addOption("er", "concludeOnError", false, "conclude the import at the first error");
options.getOption("er").setType(boolean.class);
options.getOption("er").setRequired(false);

super.options = options;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1369,8 +1369,8 @@ private int displayChanges(List<BulkEditChange> changes, boolean changed) {
* is the field is defined as authority controlled
*/
private boolean isAuthorityControlledField(String md) {
String mdf = StringUtils.substringAfter(md, ":");
mdf = StringUtils.substringBefore(mdf, "[");
String mdf = md.contains(":") ? StringUtils.substringAfter(md, ":") : md;
mdf = mdf.contains("[") ? StringUtils.substringBefore(mdf, "[") : mdf;
return metadataAuthorityService.isAuthorityAllowed(mdf.replaceAll("\\.", "_"), Constants.ITEM, null);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import java.util.List;
import java.util.Map;

import org.apache.commons.lang.StringUtils;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
Expand Down Expand Up @@ -107,7 +108,12 @@ public void appendValueOnLastRow(String header, String value, String separator)
throw new IllegalArgumentException("Unknown header '" + header + "'");
}
String cellContent = WorkbookUtils.getCellValue(lastRow, column);
createCell(lastRow, column, isEmpty(cellContent) ? value : cellContent + separator + value);
createCell(lastRow, column,
getValueLimitedByLength(isEmpty(cellContent) ? value : cellContent + separator + value));
}

private String getValueLimitedByLength(String value) {
return StringUtils.length(value) > 32726 ? value.substring(0, 32725) + "…" : value;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,22 @@ private void fillSignature(Context ctx, DSpaceObject iu, Map<String, List<String
}
}
}

List<String> plainSignatures = algo.getPlainSignature(iu, ctx);
for (String signature : plainSignatures) {
if (StringUtils.isNotEmpty(signature)) {
String key = "plain_" + algo.getSignatureType() + "_signature";
if (tmpMapFilter.containsKey(key)) {
List<String> obj = tmpMapFilter.get(key);
obj.add(signature);
tmpMapFilter.put(key, obj);
} else {
List<String> obj = new ArrayList<String>();
obj.add(signature);
tmpMapFilter.put(key, obj);
}
}
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
* http://www.dspace.org/license/
*/
package org.dspace.app.deduplication.utils;

import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.Objects;
import java.util.stream.Collectors;

import com.ibm.icu.text.CharsetDetector;
import com.ibm.icu.text.CharsetMatch;
Expand All @@ -22,12 +24,15 @@
import org.apache.logging.log4j.Logger;
import org.dspace.content.DSpaceObject;
import org.dspace.content.Item;
import org.dspace.content.MetadataFieldName;
import org.dspace.content.MetadataValue;
import org.dspace.content.WorkspaceItem;
import org.dspace.content.dto.MetadataValueDTO;
import org.dspace.content.factory.ContentServiceFactory;
import org.dspace.content.service.ItemService;
import org.dspace.content.service.WorkspaceItemService;
import org.dspace.core.Context;
import org.dspace.external.model.ExternalDataObject;
import org.dspace.workflow.WorkflowItem;
import org.dspace.workflow.WorkflowItemService;
import org.dspace.workflow.factory.WorkflowServiceFactory;
Expand Down Expand Up @@ -95,6 +100,37 @@ public List<String> getSignature(DSpaceObject item, Context context) {
}
}

public List<String> getPlainSignature(DSpaceObject item, Context context) {
List<String> result = new ArrayList<String>();
try {
MessageDigest digester = MessageDigest.getInstance("MD5");
List<String> values = getMultiValue(item, metadata);
if (values != null) {
for (String value : values) {
if (StringUtils.isNotEmpty(value)) {
String valueNorm = normalize(item, value);
digester.update(valueNorm.getBytes("UTF-8"));
byte[] signature = digester.digest();
char[] arr = new char[signature.length << 1];
for (int i = 0; i < signature.length; i++) {
int b = signature[i];
int idx = i << 1;
arr[idx] = HEX_DIGITS[(b >> 4) & 0xf];
arr[idx + 1] = HEX_DIGITS[b & 0xf];
}
String sigString = new String(arr);
result.add(sigString);
}
}
}
return result;
} catch (NoSuchAlgorithmException e) {
throw new RuntimeException(e.getMessage(), e);
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e.getMessage(), e);
}
}

protected String normalize(DSpaceObject item, Context context, String value) {
if (value != null) {
String temp = StringUtils.EMPTY;
Expand Down Expand Up @@ -210,6 +246,70 @@ protected List<String> getMultiValue(DSpaceObject item, String metadata) {
return retValue;
}

public List<String> getSignature(ExternalDataObject object) {
List<String> result = new ArrayList<String>();
try {
MessageDigest digester = MessageDigest.getInstance("MD5");
List<String> values = getMultiValue(object, metadata);
if (values != null) {
for (String value : values) {
if (StringUtils.isNotEmpty(value)) {
String valueNorm = normalize(object, value);
digester.update(valueNorm.getBytes("UTF-8"));
byte[] signature = digester.digest();
char[] arr = new char[signature.length << 1];
for (int i = 0; i < signature.length; i++) {
int b = signature[i];
int idx = i << 1;
arr[idx] = HEX_DIGITS[(b >> 4) & 0xf];
arr[idx + 1] = HEX_DIGITS[b & 0xf];
}
String sigString = new String(arr);
result.add(sigString);
}
}
}
return result;
} catch (NoSuchAlgorithmException e) {
throw new RuntimeException(e.getMessage(), e);
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e.getMessage(), e);
}
}

protected List<String> getMultiValue(ExternalDataObject object, String metadata) {
return object.getMetadata()
.stream()
.filter(metadataValueDTO ->
new MetadataFieldName(metadataValueDTO.getSchema(), metadataValueDTO.getElement(),
metadataValueDTO.getQualifier()).toString().equals(metadata))
.map(MetadataValueDTO::getValue)
.collect(Collectors.toList());
}

protected String normalize(ExternalDataObject object, String value) {
String result = value;
if (StringUtils.isEmpty(value)) {
if (StringUtils.isNotEmpty(prefix)) {
result = prefix + object.getId();
} else {
result = "entity:" + object.getId();
}
} else {
for (String prefix : ignorePrefix) {
if (value.startsWith(prefix)) {
result = value.substring(prefix.length());
break;
}
}
if (StringUtils.isNotEmpty(prefix)) {
result = prefix + result;
}
}

return result;
}

public String getMetadata() {
return metadata;
}
Expand Down
Loading
Loading