Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
* develop:
  add facet support for peer reviewed
  DMS-301 add css class for JOP service images and fix layout
  revert UBO-269 FSU040THUL-1276 - need some clarification
  UBO-293 FSU040THUL-2186 Fixed heading generated by org.mycore.ubo.publication.PublicationEventHandler.getRealNameFromNameElement for local users to "family name, given name" (#344)
  UBO-292 Made org.mycore.ubo.matcher.MCRUserMatcherLDAP#getUserNameFromLDAPUser protected (#343)
  UBO-285 Added missing i18n ubo.interviewer.abbreviated
  UBO-289 Surround 'MCRORCIDSessionUtils.getCurrentUser()' with try/catch (#341)
  UBO-287 Use xsl:key to speed up transformation
  DMS-300 adds a better way to show authors without floating
  UBO-281 Do not rely on certain values of display index of a work. Improved code readability (#333)
  UBO-282 Include mycore2orcid.js inresponse.xsl (was accidentally remo… (#339)
  UBO-282 Include mycore2orcid.js only when user is not guest (#334)
  UBO-280 Fixed incorrect display of ; (#332)
  add type submit to editor buttons
  layout fix: prevent breaking in names
  add partOf, connectionID and origin facets to default configuration
  UBO-275 Do not reuse stream
  UBO-277 Removed @min="4" from repeat element
  UBO-274 Fixed ArrayIndexOutBoundException when language code cannot be resolved
  layout finetuning for popover header close button
  do not reuse person.search.information for person details dialog
  UBO-272 Fixed StackOverflowError during indexing
  Fixed JOP link
  Save publication after repair event (#326)
  deactivate ORCIDWorkEventHandler until MCR-2960 is solved
  show affiliation only for admin role
  UBO-68 use the name identifier classification also in user editor (#325)
  Issues/ubo 266 tolerate repeated lead (#322)
  UBO-265 FSU040THUL-972 Made solr field fundingType multivalued (#321)
  UBO-269 FSU040THUL-1276 Changed cite of in.host from e.g.  'Jg. 13 (2023), Heft 1, S. 1 - 10, Artikel 9489' to 'Jg. 13 (2023), Heft 1, Artikel 9489, S. 1 - 10'
  UBO-267 PublicationEventHandler now also repairs
  Added ResearcherID
  UBO-18 use position for popup close button
  UBO-18 layout finetuning and add more details (#320)
  UBO-18 unify name identifier handling (#316)
  UBO-263 FSU040THUL-405 Allow to search arbitrary realm in LocalService
  UBO-31 add kdsf editor fields and other minor adoptions from koeln
  UBO-261 FSU040THUL-1243 Added/index dynamic solr field "*_nid_text" to solr-schema.json
  UBO-96 ORCID-Anbindung optimieren (#284)
  UBO-262 Set version of pica2mods to 2.8-SNAPSHOT
  UBO-259 FSU40THUL-1218 Made solr field "origin_exact" stored
  UBO-18 unify name identifier handling (#316)
  UBO-263 FSU040THUL-405 Allow to search arbitrary realm in LocalService
  UBO-31 add kdsf editor fields and other minor adoptions from koeln
  UBO-261 FSU040THUL-1243 Added/index dynamic solr field "*_nid_text" to solr-schema.json
  UBO-96 ORCID-Anbindung optimieren (#284)
  UBO-262 Set version of pica2mods to 2.8-SNAPSHOT
  UBO-259 FSU40THUL-1218 Made solr field "origin_exact" stored
  UBO-260 FSU040THUL-972 Support fundingType facet
  UBO-256 Add random UUID to user id of MCRUser generated in MCRUserMatcherUtils#getUserNameFromModsNameElement
  UBO-258 FSU040THUL-1065 Applied requested changes
  UBO-258 FSU040THUL-1065 Mark corresponding author in mods-display.xsl
  UBO-257 Upgrade version of pica2mods to 2.7-SNAPSHOT (#307)
  UBO-253 Apply classes to segments generated by <xsl:template match="item" mode="output.category" />
  UBO-255 Upgrade to mycore to version 2022.06.3-SNAPSHOT and pica2mods to version 2.6-SNAPSHOT
  • Loading branch information
kkrebs committed Jan 15, 2024
2 parents 25eac5f + be1b7c3 commit c9d82cb
Show file tree
Hide file tree
Showing 45 changed files with 3,252 additions and 1,846 deletions.
8 changes: 7 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@
<java.target.version>17</java.target.version>
<jquery.ui.version>1.13.2</jquery.ui.version>
<jquery.version>3.5.1</jquery.version>
<mycore.version>2022.06.2-SNAPSHOT</mycore.version>
<mycore.version>2022.06.3-SNAPSHOT</mycore.version>
<node.version>v16.0.0</node.version>
<pica2mods.version>2.8-SNAPSHOT</pica2mods.version>
<sortpom.sortDeps>scope,groupId,artifactId</sortpom.sortDeps>
<sortpom.sortFile>https://gist.githubusercontent.com/yagee-de/dfd3698c1b49173dbf251f74eb6a9297/raw/406460c088ff3cb6354e4ae6b40535e6f841607d/mycore_sort.xml</sortpom.sortFile>
<sortpom.sortProps>true</sortpom.sortProps>
Expand Down Expand Up @@ -300,6 +301,11 @@
<artifactId>commons-text</artifactId>
<version>1.10.0</version>
</dependency>
<dependency>
<groupId>org.mycore</groupId>
<artifactId>mycore-orcid2</artifactId>
<version>${mycore.version}</version>
</dependency>
<dependency>
<groupId>org.mycore.ubo</groupId>
<artifactId>ubo-cli</artifactId>
Expand Down
28 changes: 28 additions & 0 deletions ubo-cli/src/main/setup/classifications/accessrights.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<mycoreclass xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="MCRClassification.xsd" ID="accessrights">
<label xml:lang="en" text="Access Rights" description="Access Rights - KDSF" />
<label xml:lang="de" text="Zugangsrechte" description="Zugangsrechte - Werte nach KDSF" />
<label xml:lang="x-color" text="#8f989d" />
<categories>
<category ID="oa">
<label xml:lang="de" text="Open Access" />
<label xml:lang="x-color" text="#ea5a00" />
<label xml:lang="en" text="open access" />
</category>
<category ID="ea">
<label xml:lang="de" text="Zugang unterliegt Embargo" />
<label xml:lang="x-color" text="#d3d3d3" />
<label xml:lang="en" text="embargoed access" />
</category>
<category ID="ra">
<label xml:lang="de" text="eingeschränkter Zugang" />
<label xml:lang="x-color" text="#a6a6a8" />
<label xml:lang="en" text="restricted access" />
</category>
<category ID="moa">
<label xml:lang="de" text="nur Zugriff auf Metadaten" />
<label xml:lang="x-color" text="#7a7a7c" />
<label xml:lang="en" text="metadata only access" />
</category>
</categories>
</mycoreclass>
24 changes: 24 additions & 0 deletions ubo-cli/src/main/setup/classifications/nameIdentifier.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,42 @@
<category ID="scopus">
<label xml:lang="de" text="SCOPUS" />
<label xml:lang="en" text="SCOPUS" />
<label xml:lang="x-display" text="true" />
<label xml:lang="x-uri" text="https://www.scopus.com/authid/detail.url?partnerID=HzOxMe3b&amp;origin=inward&amp;authorId=" />
</category>
<category ID="gnd">
<label xml:lang="de" text="GND" />
<label xml:lang="en" text="GND" />
<label xml:lang="x-display" text="true" />
<label xml:lang="x-uri" text="https://d-nb.info/gnd/" />
</category>
<category ID="researcherid">
<label xml:lang="de" text="ResearcherID" />
<label xml:lang="en" text="ResearcherID" />
<label xml:lang="x-display" text="true" />
<label xml:lang="x-uri" text="http://www.researcherid.com/rid/" />
</category>
<category ID="orcid">
<label xml:lang="de" text="ORCID" />
<label xml:lang="en" text="ORCID" />
<label xml:lang="x-display" text="true" />
<label xml:lang="x-uri" text="https://orcid.org/" />
</category>
<category ID="lsf">
<label xml:lang="de" text="LSF ID" />
<label xml:lang="en" text="LSF ID" />
<label xml:lang="x-display" text="true" />
<label xml:lang="x-uri" text="https://www.uni-due.de/zim/services/suchdienste/mitarbeiter.php?id=" />
</category>
<category ID="local">
<label xml:lang="de" text="Lokale ID" />
<label xml:lang="en" text="Local ID" />
<label xml:lang="x-display" text="false" />
</category>
<category ID="connection">
<label xml:lang="de" text="Connection ID" />
<label xml:lang="en" text="Connection ID" />
<label xml:lang="x-display" text="false" />
</category>
</categories>
</mycoreclass>
18 changes: 18 additions & 0 deletions ubo-cli/src/main/setup/classifications/peerreviewed.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<mycoreclass xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="MCRClassification.xsd" ID="peerreviewed">

<label xml:lang="en" text="Peer Reviewed" description="todo" />
<label xml:lang="de" text="Peer Reviewed" description="todo" />

<categories>
<category ID="true">
<label xml:lang="de" text="Ja" />
<label xml:lang="en" text="Yes" />
</category>
<category ID="false">
<label xml:lang="de" text="Nein" />
<label xml:lang="en" text="No" />
</category>
</categories>

</mycoreclass>
38 changes: 38 additions & 0 deletions ubo-cli/src/main/setup/classifications/typeOfResource.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<mycoreclass xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="MCRClassification.xsd" ID="typeOfResource">
<label xml:lang="en" text="typeOfResource" />
<label xml:lang="de" text="typeOfResource" />
<label xml:lang="x-uri" text="http://www.mycore.org/classifications/typeOfResource" />
<categories>
<category ID="txt">
<label xml:lang="de" text="Text" />
<label xml:lang="en" text="Text" description="Resource intended to be perceived visually and understood through the use of language in written or spoken form." />
<url xlink:href="https://id.loc.gov/vocabulary/resourceTypes/txt.html" xlink:type="locator" />
</category>
<category ID="aud">
<label xml:lang="en" text="Audio" description="Resources expressed in an audible form, including music or other sounds." />
<label xml:lang="de" text="Audio" />
<url xlink:href="https://id.loc.gov/vocabulary/resourceTypes/aud.html" xlink:type="locator" />
</category>
<category ID="dat">
<label xml:lang="de" text="Datensatz" />
<label xml:lang="en" text="Dataset" description="Data encoded in a defined structure, but not normally displayed in its raw form." />
<url xlink:href="https://id.loc.gov/vocabulary/resourceTypes/dat.html" xlink:type="locator" />
</category>
<category ID="mov">
<label xml:lang="de" text="Bewegte Bilder" />
<label xml:lang="en" text="Moving image" description="Images intended to be perceived as moving, including motion pictures and video recordings." />
<url xlink:href="https://id.loc.gov/vocabulary/resourceTypes/mov.html" xlink:type="locator" />
</category>
<category ID="mul">
<label xml:lang="de" text="Multimedia" />
<label xml:lang="en" text="Multimedia" description="Electronic resource that is a computer program or which consists of multiple media types that are software driven." />
<url xlink:href="https://id.loc.gov/vocabulary/resourceTypes/mul.html" xlink:type="locator" />
</category>
<category ID="img">
<label xml:lang="de" text="Bild" />
<label xml:lang="en" text="Still image" description="Resource expressed through line, shape, shading, etc., intended to be perceived visually as a still image or images in two dimensions." />
<url xlink:href="https://id.loc.gov/vocabulary/resourceTypes/img.html" xlink:type="locator" />
</category>
</categories>
</mycoreclass>
36 changes: 0 additions & 36 deletions ubo-cli/src/main/setup/classifications/user_attributes.xml

This file was deleted.

4 changes: 2 additions & 2 deletions ubo-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@
</dependency>
<dependency>
<groupId>org.mycore</groupId>
<artifactId>mycore-orcid</artifactId>
<artifactId>mycore-orcid2</artifactId>
</dependency>
<dependency>
<groupId>org.mycore</groupId>
Expand Down Expand Up @@ -344,7 +344,7 @@
<dependency>
<groupId>org.mycore.pica2mods</groupId>
<artifactId>pica2mods-xslt</artifactId>
<version>2.5-SNAPSHOT</version>
<version>${pica2mods.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,30 +1,78 @@
package org.mycore.ubo.importer.orcid;

import java.io.IOException;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.jdom2.Element;
import org.jdom2.JDOMException;
import org.mycore.common.content.MCRContent;
import org.mycore.common.content.MCRJDOMContent;
import org.mycore.common.content.transformer.MCRContentTransformer;
import org.mycore.orcid.MCRORCIDProfile;
import org.mycore.orcid.works.MCRWorksSection;
import org.xml.sax.SAXException;
import org.mycore.orcid2.MCRORCIDUtils;
import org.mycore.orcid2.client.exception.MCRORCIDRequestException;
import org.mycore.orcid2.v3.client.MCRORCIDClientHelper;
import org.mycore.orcid2.v3.client.MCRORCIDSectionImpl;
import org.mycore.orcid2.v3.work.MCRORCIDWorkUtils;
import org.orcid.jaxb.model.v3.release.record.Work;
import org.orcid.jaxb.model.v3.release.record.summary.WorkGroup;
import org.orcid.jaxb.model.v3.release.record.summary.WorkSummary;
import org.orcid.jaxb.model.v3.release.record.summary.Works;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;

public class Orcid2WorksTransformer extends MCRContentTransformer {
public class Orcid2WorksTransformer extends MCRContentTransformer implements Comparator<WorkSummary> {

protected Logger LOGGER = LogManager.getLogger(Orcid2WorksTransformer.class);

public MCRJDOMContent transform(MCRContent source) throws IOException {
String orcid = source.asString();
List<Work> workList = new ArrayList<>();

MCRORCIDProfile profile = new MCRORCIDProfile(orcid);
try {
MCRWorksSection worksSection = profile.getWorksSection();
worksSection.fetchDetails();
Arrays.stream(source.asString().split("\\s"))
.filter(orcid -> orcid.trim().length() > 0)
.forEach(orcid -> {
try {
Works works = MCRORCIDClientHelper
.getClientFactory()
.createReadClient()
.fetch(orcid, MCRORCIDSectionImpl.WORKS, Works.class);

works.getWorkGroup()
.stream()
.map(WorkGroup::getWorkSummary)
.filter(wg -> wg.size() > 0)
.forEach(workSummaries -> {
workSummaries.sort(this);
WorkSummary workSummary = workSummaries.get(0);

Element modsCollection = worksSection.buildMODSCollection();
return new MCRJDOMContent(modsCollection);
} catch (JDOMException | SAXException ex) {
throw new IOException(ex);
Work work = MCRORCIDClientHelper
.getClientFactory()
.createReadClient()
.fetch(orcid, MCRORCIDSectionImpl.WORK, Work.class, workSummary.getPutCode());

workList.add(work);
});
} catch (MCRORCIDRequestException e) {
LOGGER.warn("Could not get works for ORCID {}. {}", orcid, e.getMessage());
}
});

List<Element> workElements = MCRORCIDWorkUtils.buildUnmergedMODSFromWorks(workList);
Element modsCollection = MCRORCIDUtils.buildMODSCollection(workElements);

return new MCRJDOMContent(modsCollection);
}

@Override
public int compare(WorkSummary ws1, WorkSummary ws2) {
int v = 0;
try {
v = Integer.parseInt(ws1.getDisplayIndex()) - Integer.parseInt(
ws2.getDisplayIndex());
} catch (Exception e) {
LOGGER.error("Could not compare WorkSummaries", e);
}
return v;
}
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,31 @@
package org.mycore.ubo.ldap.picker;

import java.util.Optional;

import javax.naming.OperationNotSupportedException;

import org.mycore.common.config.MCRConfiguration2;
import org.mycore.ubo.local.LocalService;
import org.mycore.ubo.picker.PersonSearchResult;
import org.mycore.user2.MCRRealmFactory;

public class LDAPWithLocalService extends LDAPService {

public static final String LDAP_REALM = MCRConfiguration2.getString(
"MCR.user2.IdentityManagement.UserCreation.LDAP.Realm").orElse(null);

@Override
public PersonSearchResult searchPerson(String query) throws OperationNotSupportedException {
PersonSearchResult results = super.searchPerson(query);
LocalService localService = new LocalService();
PersonSearchResult personSearchResult = localService.searchPerson(query);
results.join(personSearchResult, 0);

if (LDAP_REALM != null) {
Optional.ofNullable(MCRRealmFactory.getRealm(LDAP_REALM))
.ifPresent(realm -> results.join(localService.searchPerson(query, realm), 0));
}

return results;
}
}
Loading

0 comments on commit c9d82cb

Please sign in to comment.