From fbd778de1093c35b97fc8e738bdf83ad59ed9e77 Mon Sep 17 00:00:00 2001 From: MajoBerger Date: Thu, 16 May 2024 13:52:10 +0200 Subject: [PATCH 1/8] add elg format --- .../crosswalks/oai/metadataFormats/elg.xsl | 917 ++++++++++++++++++ dspace/config/crosswalks/oai/xoai.xml | 35 + 2 files changed, 952 insertions(+) create mode 100644 dspace/config/crosswalks/oai/metadataFormats/elg.xsl diff --git a/dspace/config/crosswalks/oai/metadataFormats/elg.xsl b/dspace/config/crosswalks/oai/metadataFormats/elg.xsl new file mode 100644 index 000000000000..385044bdd4a8 --- /dev/null +++ b/dspace/config/crosswalks/oai/metadataFormats/elg.xsl @@ -0,0 +1,917 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + value automatically assigned - leave as is + + + + + + + + + + + http://w3id.org/meta-share/meta-share/ELG-SHARE + + LINDAT/CLARIAH-CZ + + + + http://purl.org/spar/datacite/handle + + + + + + + + + + + + LanguageResource + + + unspecified + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Organization + + + + + + + + + + + + + + + + + + + , + + + + + + Person + + + + + + + + + Organization + + + + + + + + + + + + + + + + + + + + + + http://w3id.org/meta-share/meta-share/OpenAIRE + + + + + + + + + + + + http://w3id.org/meta-share/meta-share/other + + + + + + + + Organization + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Corpus + http://w3id.org/meta-share/meta-share/unspecified + + + + + + + + http://w3id.org/meta-share/meta-share/noP + http://w3id.org/meta-share/meta-share/noS + + + + + + + + + + + + + + + + + + + + + + + + lcrMediaType + ldMediaType + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + http://w3id.org/meta-share/meta-share/ + + monolingual + bilingual + multilingual + + + http://w3id.org/meta-share/meta-share/unspecified + + + + + + + + + + + http://w3id.org/meta-share/meta-share/ + + monolingual + bilingual + multilingual + + + + + + + + + + + unspecified + + + unspecified + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + downloadable + sourceCode + + + + + + + + + + + + + + + + + + + + + + + + + + + demo + samples + + + + + + + + + + + + + + + + + + + + http://w3id.org/meta-share/meta-share/unspecified + + + + + + + ToolService + + undefined + + + + + + + + + + + false + + + + + + + http://w3id.org/meta-share/meta-share/unspecified + + + + + + + http://w3id.org/meta-share/meta-share/unspecified + + + + + false + + + + + + + LanguageDescription + + + http://w3id.org/meta-share/meta-share/grammar + http://w3id.org/meta-share/meta-share/model + http://w3id.org/meta-share/meta-share/other + + + + + + + + Grammar + http://w3id.org/meta-share/meta-share/unspecified + + + + + + + + + + + + http://w3id.org/meta-share/meta-share/unspecified + + -1 + + + + + + + + + + + + + Unspecified + + + + + + + + + + + LexicalConceptualResource + + + http://w3id.org/meta-share/meta-share/wordNet + + + + + + http://w3id.org/meta-share/meta-share/unspecified + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + http://w3id.org/meta-share/meta-share/four-gram + + + + + http://w3id.org/meta-share/meta-share/five-gram + + + + + http://w3id.org/meta-share/meta-share/T-HPair + + + + + http://w3id.org/meta-share/meta-share/article + + + + + http://w3id.org/meta-share/meta-share/bigram + + + + + http://w3id.org/meta-share/meta-share/byte + + + + + http://w3id.org/meta-share/meta-share/class + + + + + http://w3id.org/meta-share/meta-share/concept + + + + + http://w3id.org/meta-share/meta-share/diphone1 + + + + + http://w3id.org/meta-share/meta-share/element + + + + + http://w3id.org/meta-share/meta-share/entry + + + + + http://w3id.org/meta-share/meta-share/expression + + + + + http://w3id.org/meta-share/meta-share/file + + + + + http://w3id.org/meta-share/meta-share/frame1 + + + + + http://w3id.org/meta-share/meta-share/gb + + + + + http://w3id.org/meta-share/meta-share/hour1 + + + + + http://w3id.org/meta-share/meta-share/idiomaticExpression + + + + + http://w3id.org/meta-share/meta-share/image2 + + + + + http://w3id.org/meta-share/meta-share/item + + + + + http://w3id.org/meta-share/meta-share/kb + + + + + http://w3id.org/meta-share/meta-share/keyword1 + + + + + http://w3id.org/meta-share/meta-share/lexicalType + + + + + http://w3id.org/meta-share/meta-share/mb + + + + + http://w3id.org/meta-share/meta-share/minute + + + + + http://w3id.org/meta-share/meta-share/multiWordUnit + + + + + http://w3id.org/meta-share/meta-share/neologism + + + + + http://w3id.org/meta-share/meta-share/other + + + + + http://w3id.org/meta-share/meta-share/phoneme2 + + + + + http://w3id.org/meta-share/meta-share/phoneticUnit + + + + + http://w3id.org/meta-share/meta-share/predicate + + + + + http://w3id.org/meta-share/meta-share/rule + + + + + http://w3id.org/meta-share/meta-share/second + + + + + http://w3id.org/meta-share/meta-share/semanticUnit1 + + + + + http://w3id.org/meta-share/meta-share/sentence1 + + + + + http://w3id.org/meta-share/meta-share/shot1 + + + + + http://w3id.org/meta-share/meta-share/syllable2 + + + + + http://w3id.org/meta-share/meta-share/synset + + + + + http://w3id.org/meta-share/meta-share/syntacticUnit1 + + + + + http://w3id.org/meta-share/meta-share/term + + + + + http://w3id.org/meta-share/meta-share/text1 + + + + + http://w3id.org/meta-share/meta-share/token + + + + + http://w3id.org/meta-share/meta-share/trigram + + + + + http://w3id.org/meta-share/meta-share/turn + + + + + http://w3id.org/meta-share/meta-share/unigram + + + + + http://w3id.org/meta-share/meta-share/unit + + + + + http://w3id.org/meta-share/meta-share/utterance1 + + + + + http://w3id.org/meta-share/meta-share/word3 + + + + + + + + + + + + + + + + + + + + + + + + + + Model + + http://w3id.org/meta-share/meta-share/unspecified + + + http://w3id.org/meta-share/meta-share/unspecified + + + + + + + + + + + \ No newline at end of file diff --git a/dspace/config/crosswalks/oai/xoai.xml b/dspace/config/crosswalks/oai/xoai.xml index 96bfaffd8010..723aa02d7311 100644 --- a/dspace/config/crosswalks/oai/xoai.xml +++ b/dspace/config/crosswalks/oai/xoai.xml @@ -23,6 +23,7 @@ + This is the default context of the DSpace OAI-PMH data provider. @@ -230,6 +231,13 @@ http://schema.datacite.org/oai/oai-1.1/ http://schema.datacite.org/oai/oai-1.1/oai.xsd + + elg + metadataFormats/elg.xsl + http://w3id.org/meta-share/meta-share/ + http://w3id.org/meta-share/meta-share/ ../Schema/ELG-SHARE.xsd + + @@ -462,6 +470,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + From 265e440e99c1cf30b51d602ebc44eb90d91d583d Mon Sep 17 00:00:00 2001 From: MajoBerger Date: Thu, 16 May 2024 14:52:26 +0200 Subject: [PATCH 2/8] add shortestId funtion --- .../main/java/org/dspace/utils/LangUtil.java | 91 +++++++++++++++++++ .../resources/functions/ShortestIdFn.java | 26 ++++++ .../crosswalks/oai/metadataFormats/elg.xsl | 12 +-- 3 files changed, 123 insertions(+), 6 deletions(-) create mode 100644 dspace-oai/src/main/java/org/dspace/utils/LangUtil.java create mode 100644 dspace-oai/src/main/java/org/dspace/xoai/services/impl/resources/functions/ShortestIdFn.java diff --git a/dspace-oai/src/main/java/org/dspace/utils/LangUtil.java b/dspace-oai/src/main/java/org/dspace/utils/LangUtil.java new file mode 100644 index 000000000000..12c7885af15f --- /dev/null +++ b/dspace-oai/src/main/java/org/dspace/utils/LangUtil.java @@ -0,0 +1,91 @@ +package org.dspace.utils; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.nio.charset.StandardCharsets; +import java.util.HashMap; + +public class LangUtil { + private static org.apache.log4j.Logger log = org.apache.log4j.Logger + .getLogger(LangUtil.class); + + static final HashMap idToLang; + static { + idToLang = new HashMap<>(); + final InputStream langCodesInputStream = LangUtil.class.getClassLoader().getResourceAsStream("iso-639-3.tab"); + if(langCodesInputStream != null) { + try (BufferedReader reader = new BufferedReader(new InputStreamReader(langCodesInputStream, StandardCharsets.UTF_8))) { + String line; + while ((line = reader.readLine()) != null) { + Lang lang = new Lang(line); + idToLang.put(lang.getId(), lang); + if (lang.getPart2B() != null) { + idToLang.put(lang.getPart2B(), lang); + } + } + } catch (IOException e) { + log.error(e); + } + } + } + + public static String getShortestId(String id){ + Lang lang = idToLang.get(id); + if(lang != null){ + if(lang.getPart1() != null){ + return lang.getPart1(); + }else { + return lang.getId(); + } + } + return id; + } + + public static void main(String[] args){ + System.out.println(getShortestId("eng")); + System.out.println(getShortestId("deu")); + System.out.println(getShortestId("ger")); + System.out.println(getShortestId("wtf")); + } + + private static class Lang { + private final String id; + private final String part2B; + //private final String part2T; + private final String part1; + /*private final String scope; + private final String languageType; + private final String refName; + private final String comment;*/ + + public Lang(String line) { + String[] parts = line.split("\t", 8); + id = parts[0]; + part2B = parts[1].isEmpty() ? null : parts[1]; + //part2T = parts[2]; + part1 = parts[3].isEmpty() ? null : parts[3]; + /*scope = parts[4]; + languageType = parts[5]; + refName = parts[6]; + if(parts.length == 8){ + comment = parts[7]; + }else { + comment = ""; + }*/ + } + + public String getId() { + return id; + } + + public String getPart1() { + return part1; + } + + public String getPart2B() { + return part2B; + } + } +} \ No newline at end of file diff --git a/dspace-oai/src/main/java/org/dspace/xoai/services/impl/resources/functions/ShortestIdFn.java b/dspace-oai/src/main/java/org/dspace/xoai/services/impl/resources/functions/ShortestIdFn.java new file mode 100644 index 000000000000..4b25a961271a --- /dev/null +++ b/dspace-oai/src/main/java/org/dspace/xoai/services/impl/resources/functions/ShortestIdFn.java @@ -0,0 +1,26 @@ +/** + * 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.xoai.services.impl.resources.functions; + +import org.dspace.utils.LangUtil; + +/** + * Serves as proxy for call from XSL engine. Calls LicenseUtil + * @author Marian Berger (marian.berger at dataquest.sk) + */ +public class ShortestIdFn extends StringXSLFunction { + @Override + protected String getFnName() { + return "uriToAvailability"; + } + + @Override + protected String getStringResult(String param) { + return LangUtil.getShortestId(param); + } +} diff --git a/dspace/config/crosswalks/oai/metadataFormats/elg.xsl b/dspace/config/crosswalks/oai/metadataFormats/elg.xsl index 385044bdd4a8..1b00a2edf406 100644 --- a/dspace/config/crosswalks/oai/metadataFormats/elg.xsl +++ b/dspace/config/crosswalks/oai/metadataFormats/elg.xsl @@ -165,9 +165,9 @@ - + - + @@ -198,7 +198,7 @@ - + @@ -453,7 +453,7 @@ elg.xml:62: element typeOfVideoContent: Schemas validity error : Element '{http: + select="concat(tokenize(xalan:nodeset($files)[1]/doc:element[@name='bitstream']/doc:field[@name='url']/text(), 'bitstream/')[1], $handle, '/allzip')" /> @@ -603,7 +603,7 @@ elg.xml:62: element typeOfVideoContent: Schemas validity error : Element '{http: - + @@ -612,7 +612,7 @@ elg.xml:62: element typeOfVideoContent: Schemas validity error : Element '{http: test="doc:metadata/doc:element[@name='local']/doc:element[@name='size']/doc:element[@name='info']/doc:element/doc:field[@name='value']"> - + From e3383725de1680f86b55ee3d6bba7194dc6c3a55 Mon Sep 17 00:00:00 2001 From: MajoBerger Date: Thu, 16 May 2024 15:44:53 +0200 Subject: [PATCH 3/8] properties, formatting --- .../main/java/org/dspace/utils/LangUtil.java | 30 ++++++++++++++----- .../resources/DSpaceResourceResolver.java | 18 ++--------- .../resources/functions/ShortestIdFn.java | 2 +- dspace/config/clarin-dspace.cfg | 2 ++ .../crosswalks/oai/metadataFormats/elg.xsl | 9 +++--- 5 files changed, 32 insertions(+), 29 deletions(-) diff --git a/dspace-oai/src/main/java/org/dspace/utils/LangUtil.java b/dspace-oai/src/main/java/org/dspace/utils/LangUtil.java index 12c7885af15f..02236e95e1e7 100644 --- a/dspace-oai/src/main/java/org/dspace/utils/LangUtil.java +++ b/dspace-oai/src/main/java/org/dspace/utils/LangUtil.java @@ -1,3 +1,12 @@ +/** + * 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/ + */ + +/* Created for LINDAT/CLARIAH-CZ (UFAL) */ package org.dspace.utils; import java.io.BufferedReader; @@ -8,15 +17,20 @@ import java.util.HashMap; public class LangUtil { + + private LangUtil() {} private static org.apache.log4j.Logger log = org.apache.log4j.Logger .getLogger(LangUtil.class); static final HashMap idToLang; + static { idToLang = new HashMap<>(); - final InputStream langCodesInputStream = LangUtil.class.getClassLoader().getResourceAsStream("iso-639-3.tab"); - if(langCodesInputStream != null) { - try (BufferedReader reader = new BufferedReader(new InputStreamReader(langCodesInputStream, StandardCharsets.UTF_8))) { + final InputStream langCodesInputStream = LangUtil.class.getClassLoader() + .getResourceAsStream("iso-639-3.tab"); + if (langCodesInputStream != null) { + try (BufferedReader reader = new BufferedReader(new InputStreamReader(langCodesInputStream, + StandardCharsets.UTF_8))) { String line; while ((line = reader.readLine()) != null) { Lang lang = new Lang(line); @@ -31,19 +45,19 @@ public class LangUtil { } } - public static String getShortestId(String id){ + public static String getShortestId(String id) { Lang lang = idToLang.get(id); - if(lang != null){ - if(lang.getPart1() != null){ + if (lang != null) { + if (lang.getPart1() != null) { return lang.getPart1(); - }else { + } else { return lang.getId(); } } return id; } - public static void main(String[] args){ + public static void main(String[] args) { System.out.println(getShortestId("eng")); System.out.println(getShortestId("deu")); System.out.println(getShortestId("ger")); diff --git a/dspace-oai/src/main/java/org/dspace/xoai/services/impl/resources/DSpaceResourceResolver.java b/dspace-oai/src/main/java/org/dspace/xoai/services/impl/resources/DSpaceResourceResolver.java index aec4ea516e14..bb626bdfd798 100644 --- a/dspace-oai/src/main/java/org/dspace/xoai/services/impl/resources/DSpaceResourceResolver.java +++ b/dspace-oai/src/main/java/org/dspace/xoai/services/impl/resources/DSpaceResourceResolver.java @@ -23,21 +23,7 @@ import net.sf.saxon.s9api.ExtensionFunction; import org.dspace.services.ConfigurationService; import org.dspace.services.factory.DSpaceServicesFactory; -import org.dspace.xoai.services.impl.resources.functions.BibtexifyFn; -import org.dspace.xoai.services.impl.resources.functions.FormatFn; -import org.dspace.xoai.services.impl.resources.functions.GetAuthorFn; -import org.dspace.xoai.services.impl.resources.functions.GetContactFn; -import org.dspace.xoai.services.impl.resources.functions.GetFundingFn; -import org.dspace.xoai.services.impl.resources.functions.GetLangForCodeFn; -import org.dspace.xoai.services.impl.resources.functions.GetPropertyFn; -import org.dspace.xoai.services.impl.resources.functions.GetSizeFn; -import org.dspace.xoai.services.impl.resources.functions.GetUploadedMetadataFn; -import org.dspace.xoai.services.impl.resources.functions.LogMissingFn; -import org.dspace.xoai.services.impl.resources.functions.LogMissingMsgFn; -import org.dspace.xoai.services.impl.resources.functions.StringReplaceFn; -import org.dspace.xoai.services.impl.resources.functions.UriToLicenseFn; -import org.dspace.xoai.services.impl.resources.functions.UriToMetaShareFn; -import org.dspace.xoai.services.impl.resources.functions.UriToRestrictionsFn; +import org.dspace.xoai.services.impl.resources.functions.*; public class DSpaceResourceResolver implements ResourceResolver { // Requires usage of Saxon as OAI-PMH uses some XSLT 2 functions @@ -50,7 +36,7 @@ public class DSpaceResourceResolver implements ResourceResolver { */ List extensionFunctionList = List.of( new GetPropertyFn(), new StringReplaceFn(), new UriToMetaShareFn(), - new UriToLicenseFn(), new LogMissingMsgFn(), new UriToRestrictionsFn(), + new UriToLicenseFn(), new LogMissingMsgFn(), new UriToRestrictionsFn(), new ShortestIdFn(), new GetContactFn(), new GetAuthorFn(), new GetFundingFn(), new GetLangForCodeFn(), new GetPropertyFn(), new GetSizeFn(), new GetUploadedMetadataFn(), new LogMissingFn(), new BibtexifyFn(), new FormatFn() diff --git a/dspace-oai/src/main/java/org/dspace/xoai/services/impl/resources/functions/ShortestIdFn.java b/dspace-oai/src/main/java/org/dspace/xoai/services/impl/resources/functions/ShortestIdFn.java index 4b25a961271a..022755d68662 100644 --- a/dspace-oai/src/main/java/org/dspace/xoai/services/impl/resources/functions/ShortestIdFn.java +++ b/dspace-oai/src/main/java/org/dspace/xoai/services/impl/resources/functions/ShortestIdFn.java @@ -16,7 +16,7 @@ public class ShortestIdFn extends StringXSLFunction { @Override protected String getFnName() { - return "uriToAvailability"; + return "shortestIdFn"; } @Override diff --git a/dspace/config/clarin-dspace.cfg b/dspace/config/clarin-dspace.cfg index 32c94581b1ac..532d95a044f1 100644 --- a/dspace/config/clarin-dspace.cfg +++ b/dspace/config/clarin-dspace.cfg @@ -281,3 +281,5 @@ download.all.limit.min.file.count = 1 download.all.limit.max.file.size = 1073741824 # minimum total size of files for enabling download alert: download.all.alert.min.file.size = 10485760 +# used in elg crosswalk exposing download locations +elg.downloadLocation.exposed = 0 \ No newline at end of file diff --git a/dspace/config/crosswalks/oai/metadataFormats/elg.xsl b/dspace/config/crosswalks/oai/metadataFormats/elg.xsl index 1b00a2edf406..87e7ece3c990 100644 --- a/dspace/config/crosswalks/oai/metadataFormats/elg.xsl +++ b/dspace/config/crosswalks/oai/metadataFormats/elg.xsl @@ -11,7 +11,8 @@ xmlns:str="http://exslt.org/strings" xmlns:ms="http://w3id.org/meta-share/meta-share/" xmlns:confman="org.dspace.core.ConfigurationManager" - exclude-result-prefixes="doc logUtil isocodes license xalan str langUtil confman" + xmlns:fn="http://custom.crosswalk.functions" + exclude-result-prefixes="doc logUtil isocodes license xalan str langUtil confman fn" version="1.0"> @@ -74,8 +75,8 @@ select="//doc:element[@name='bundle']/doc:field[@name='name'][text()='ORIGINAL']/..//doc:element[@name='bitstream']"/> - - + + @@ -910,7 +911,7 @@ elg.xml:62: element typeOfVideoContent: Schemas validity error : Element '{http: - + From 815c459ed11bd36580162a8e50a28f5305847abc Mon Sep 17 00:00:00 2001 From: MajoBerger Date: Fri, 17 May 2024 09:07:44 +0200 Subject: [PATCH 4/8] checkstyle fix --- .../resources/DSpaceResourceResolver.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/dspace-oai/src/main/java/org/dspace/xoai/services/impl/resources/DSpaceResourceResolver.java b/dspace-oai/src/main/java/org/dspace/xoai/services/impl/resources/DSpaceResourceResolver.java index bb626bdfd798..5af22b3341af 100644 --- a/dspace-oai/src/main/java/org/dspace/xoai/services/impl/resources/DSpaceResourceResolver.java +++ b/dspace-oai/src/main/java/org/dspace/xoai/services/impl/resources/DSpaceResourceResolver.java @@ -23,12 +23,28 @@ import net.sf.saxon.s9api.ExtensionFunction; import org.dspace.services.ConfigurationService; import org.dspace.services.factory.DSpaceServicesFactory; -import org.dspace.xoai.services.impl.resources.functions.*; +import org.dspace.xoai.services.impl.resources.functions.BibtexifyFn; +import org.dspace.xoai.services.impl.resources.functions.FormatFn; +import org.dspace.xoai.services.impl.resources.functions.GetAuthorFn; +import org.dspace.xoai.services.impl.resources.functions.GetContactFn; +import org.dspace.xoai.services.impl.resources.functions.GetFundingFn; +import org.dspace.xoai.services.impl.resources.functions.GetLangForCodeFn; +import org.dspace.xoai.services.impl.resources.functions.GetPropertyFn; +import org.dspace.xoai.services.impl.resources.functions.GetSizeFn; +import org.dspace.xoai.services.impl.resources.functions.GetUploadedMetadataFn; +import org.dspace.xoai.services.impl.resources.functions.LogMissingFn; +import org.dspace.xoai.services.impl.resources.functions.LogMissingMsgFn; +import org.dspace.xoai.services.impl.resources.functions.ShortestIdFn; +import org.dspace.xoai.services.impl.resources.functions.StringReplaceFn; +import org.dspace.xoai.services.impl.resources.functions.UriToLicenseFn; +import org.dspace.xoai.services.impl.resources.functions.UriToMetaShareFn; +import org.dspace.xoai.services.impl.resources.functions.UriToRestrictionsFn; public class DSpaceResourceResolver implements ResourceResolver { // Requires usage of Saxon as OAI-PMH uses some XSLT 2 functions private static final TransformerFactory transformerFactory = TransformerFactory .newInstance("net.sf.saxon.TransformerFactoryImpl", null); + static { /* * Any additional extension functions that might be used in XST transformations @@ -48,6 +64,7 @@ public class DSpaceResourceResolver implements ResourceResolver { saxonTransformerFactory.getProcessor().registerExtensionFunction(en); } } + private final String basePath; public DSpaceResourceResolver() { From 8336b88c777da51668ddf119196b11e13c984d3c Mon Sep 17 00:00:00 2001 From: MajoBerger Date: Fri, 17 May 2024 09:08:13 +0200 Subject: [PATCH 5/8] elg crosswalk fixes --- .../main/java/org/dspace/utils/LangUtil.java | 2 +- .../crosswalks/oai/metadataFormats/elg.xsl | 34 ++++++++----------- 2 files changed, 15 insertions(+), 21 deletions(-) diff --git a/dspace-oai/src/main/java/org/dspace/utils/LangUtil.java b/dspace-oai/src/main/java/org/dspace/utils/LangUtil.java index 02236e95e1e7..dabb949c3586 100644 --- a/dspace-oai/src/main/java/org/dspace/utils/LangUtil.java +++ b/dspace-oai/src/main/java/org/dspace/utils/LangUtil.java @@ -2,7 +2,7 @@ * 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/ */ diff --git a/dspace/config/crosswalks/oai/metadataFormats/elg.xsl b/dspace/config/crosswalks/oai/metadataFormats/elg.xsl index 87e7ece3c990..f92914ba1684 100644 --- a/dspace/config/crosswalks/oai/metadataFormats/elg.xsl +++ b/dspace/config/crosswalks/oai/metadataFormats/elg.xsl @@ -3,19 +3,13 @@ --> - + @@ -40,7 +34,7 @@ - + @@ -64,7 +58,7 @@ - + @@ -75,8 +69,8 @@ select="//doc:element[@name='bundle']/doc:field[@name='name'][text()='ORIGINAL']/..//doc:element[@name='bitstream']"/> - - + + @@ -443,18 +437,18 @@ elg.xml:62: element typeOfVideoContent: Schemas validity error : Element '{http: - + - + + select="exsl:node-set($files)[1]/doc:element[@name='bitstream']/doc:field[@name='url']/text()" /> + test="sum(exsl:node-set($files)/doc:element[@name='bitstream']/doc:field[@name='size']/text()) < $lr.download.all.limit.max.file.size "> + select="concat(tokenize(exsl:node-set($files)[1]/doc:element[@name='bitstream']/doc:field[@name='url']/text(), 'bitstream/')[1], $handle, '/allzip')" /> @@ -622,7 +616,7 @@ elg.xml:62: element typeOfVideoContent: Schemas validity error : Element '{http: - + @@ -911,7 +905,7 @@ elg.xml:62: element typeOfVideoContent: Schemas validity error : Element '{http: - + From 9e9b7c5db5e593f0add51a359681d8fe1a5177ba Mon Sep 17 00:00:00 2001 From: MajoBerger Date: Fri, 17 May 2024 13:39:00 +0200 Subject: [PATCH 6/8] fixes based on review --- dspace-oai/src/main/java/org/dspace/utils/LangUtil.java | 9 ++++++++- .../services/impl/resources/DSpaceResourceResolver.java | 1 - dspace/config/clarin-dspace.cfg | 2 +- dspace/config/crosswalks/oai/metadataFormats/elg.xsl | 4 ++-- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/dspace-oai/src/main/java/org/dspace/utils/LangUtil.java b/dspace-oai/src/main/java/org/dspace/utils/LangUtil.java index dabb949c3586..c5531eb6a7f1 100644 --- a/dspace-oai/src/main/java/org/dspace/utils/LangUtil.java +++ b/dspace-oai/src/main/java/org/dspace/utils/LangUtil.java @@ -2,7 +2,7 @@ * 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/ */ @@ -16,6 +16,13 @@ import java.nio.charset.StandardCharsets; import java.util.HashMap; +/** + * Class is copied from the LINDAT/CLARIAH-CZ (This class is taken from UFAL-clarin. + * ...) and modified by + * + * @author Marian Berger (marian.berger at dataquest.sk) + */ public class LangUtil { private LangUtil() {} diff --git a/dspace-oai/src/main/java/org/dspace/xoai/services/impl/resources/DSpaceResourceResolver.java b/dspace-oai/src/main/java/org/dspace/xoai/services/impl/resources/DSpaceResourceResolver.java index 5af22b3341af..9d4790b9ff47 100644 --- a/dspace-oai/src/main/java/org/dspace/xoai/services/impl/resources/DSpaceResourceResolver.java +++ b/dspace-oai/src/main/java/org/dspace/xoai/services/impl/resources/DSpaceResourceResolver.java @@ -44,7 +44,6 @@ public class DSpaceResourceResolver implements ResourceResolver { // Requires usage of Saxon as OAI-PMH uses some XSLT 2 functions private static final TransformerFactory transformerFactory = TransformerFactory .newInstance("net.sf.saxon.TransformerFactoryImpl", null); - static { /* * Any additional extension functions that might be used in XST transformations diff --git a/dspace/config/clarin-dspace.cfg b/dspace/config/clarin-dspace.cfg index 532d95a044f1..a3002aea7ade 100644 --- a/dspace/config/clarin-dspace.cfg +++ b/dspace/config/clarin-dspace.cfg @@ -282,4 +282,4 @@ download.all.limit.max.file.size = 1073741824 # minimum total size of files for enabling download alert: download.all.alert.min.file.size = 10485760 # used in elg crosswalk exposing download locations -elg.downloadLocation.exposed = 0 \ No newline at end of file +elg.download-location.exposed = 0 \ No newline at end of file diff --git a/dspace/config/crosswalks/oai/metadataFormats/elg.xsl b/dspace/config/crosswalks/oai/metadataFormats/elg.xsl index f92914ba1684..b822d6e2fad5 100644 --- a/dspace/config/crosswalks/oai/metadataFormats/elg.xsl +++ b/dspace/config/crosswalks/oai/metadataFormats/elg.xsl @@ -70,7 +70,7 @@ - + @@ -435,7 +435,7 @@ elg.xml:62: element typeOfVideoContent: Schemas validity error : Element '{http: - + From bee9e0996bb23def528defbf8ed2937ca226f20a Mon Sep 17 00:00:00 2001 From: MajoBerger Date: Tue, 21 May 2024 13:08:50 +0200 Subject: [PATCH 7/8] remove commented out code --- dspace-oai/src/main/java/org/dspace/utils/LangUtil.java | 8 -------- 1 file changed, 8 deletions(-) diff --git a/dspace-oai/src/main/java/org/dspace/utils/LangUtil.java b/dspace-oai/src/main/java/org/dspace/utils/LangUtil.java index c5531eb6a7f1..389499f42ff3 100644 --- a/dspace-oai/src/main/java/org/dspace/utils/LangUtil.java +++ b/dspace-oai/src/main/java/org/dspace/utils/LangUtil.java @@ -87,14 +87,6 @@ public Lang(String line) { part2B = parts[1].isEmpty() ? null : parts[1]; //part2T = parts[2]; part1 = parts[3].isEmpty() ? null : parts[3]; - /*scope = parts[4]; - languageType = parts[5]; - refName = parts[6]; - if(parts.length == 8){ - comment = parts[7]; - }else { - comment = ""; - }*/ } public String getId() { From 55f61fafd2ccdb32cb8ccbb2624271c75a9b6048 Mon Sep 17 00:00:00 2001 From: MajoBerger Date: Tue, 21 May 2024 13:10:24 +0200 Subject: [PATCH 8/8] changed to generic email --- dspace-oai/src/main/java/org/dspace/utils/LangUtil.java | 2 +- dspace-oai/src/main/java/org/dspace/utils/LicenseUtil.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dspace-oai/src/main/java/org/dspace/utils/LangUtil.java b/dspace-oai/src/main/java/org/dspace/utils/LangUtil.java index 389499f42ff3..9fda94dbbd95 100644 --- a/dspace-oai/src/main/java/org/dspace/utils/LangUtil.java +++ b/dspace-oai/src/main/java/org/dspace/utils/LangUtil.java @@ -21,7 +21,7 @@ * ...) and modified by * - * @author Marian Berger (marian.berger at dataquest.sk) + * @author Marian Berger (dspace at dataquest.sk) */ public class LangUtil { diff --git a/dspace-oai/src/main/java/org/dspace/utils/LicenseUtil.java b/dspace-oai/src/main/java/org/dspace/utils/LicenseUtil.java index b9f913edcab7..975dbf39f1c7 100644 --- a/dspace-oai/src/main/java/org/dspace/utils/LicenseUtil.java +++ b/dspace-oai/src/main/java/org/dspace/utils/LicenseUtil.java @@ -26,8 +26,8 @@ * https://github.com/ufal/clarin-dspace/blob * * /si-master-origin/dspace-oai/src/main/java/cz/cuni/mff/ufal/utils/LicenseUtil.java) and modified by * - * @author Marian Berger (marian.berger at dataquest.sk) - * @author Milan Majchrak (milan.majchrak at dataquest.sk) + * @author Marian Berger (dspace at dataquest.sk) + * @author Milan Majchrak (dspace at dataquest.sk) */ public class LicenseUtil {