Skip to content

Commit

Permalink
Merge branch 'develop' to main
Browse files Browse the repository at this point in the history
* develop:
  UBO-231 reformat properties
  UBO-231 Added i18n and removed duplicate headings
  UBO-236 Do not display link to show '0 additional authors'
  UBO-234 Fixed label of relatedItem type
  UBO-233 Added ppn list import (#270)
  UBO-232 fix navigation with select2
  UBO-214 Add class reflecting oa state to label (#262)
  UBO-227 Create html anchor when paramater xEditorHook is present (#265)
  UBO-229 Add class attribute to mods:part/mods:detail type="volume"/mods:number in mods-display.xsl (#266)
  UBO-230 Do not display value for missing i18n key for unknow type of mods:relatedItem
  UBO-223 Lifted version of pica2mods to 2.5-SNAPSHOT
  UBO-226 Added data-href attribute to breadcrumb item in mycoreobject.xsl. Evaluate data-href attribute in html-layout.xsl (#263)
  fixed syntax error
  add css class to make editor buttons sticky
  UBO-208 add service for additional local search to find matching local users (#253)
  UBO-213 Added solr field licence (needed by ThULB/ThUniBib#258)
  UBO-212 overwrite opacity set by bootstrap, change to 0.4
  • Loading branch information
kkrebs committed Mar 22, 2023
2 parents 03b7642 + f9c51b2 commit 7abb302
Show file tree
Hide file tree
Showing 29 changed files with 1,330 additions and 972 deletions.
2 changes: 1 addition & 1 deletion ubo-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@
<dependency>
<groupId>org.mycore.pica2mods</groupId>
<artifactId>pica2mods-xslt</artifactId>
<version>2.4-SNAPSHOT</version>
<version>2.5-SNAPSHOT</version>
<scope>runtime</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/**
* Copyright (c) 2017 Duisburg-Essen University Library
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v2.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
**/

package org.mycore.ubo.importer.ppn;

import java.io.IOException;
import java.util.Arrays;

import org.jdom2.Document;
import org.jdom2.Element;
import org.mycore.common.content.MCRContent;
import org.mycore.common.content.MCRJDOMContent;
import org.mycore.common.content.transformer.MCRContentTransformer;

public class PPN2XMLTransformer extends MCRContentTransformer {

@Override
public MCRJDOMContent transform(MCRContent source) throws IOException {
Element root = new Element("list");
Document xml = new Document(root);

Arrays.stream(source.asString().split("\\s")).filter(p -> p.trim().length() > 0)
.forEach(ppn -> {
Element e = new Element("ppn");
e.setText(ppn);
root.addContent(e);
});
return new MCRJDOMContent(xml);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package org.mycore.ubo.ldap.picker;

import javax.naming.OperationNotSupportedException;

import org.mycore.ubo.local.LocalService;
import org.mycore.ubo.picker.PersonSearchResult;

public class LDAPWithLocalService extends LDAPService {

@Override
public PersonSearchResult searchPerson(String query) throws OperationNotSupportedException {
PersonSearchResult results = super.searchPerson(query);
LocalService ls = new LocalService();
PersonSearchResult localSr = ls.searchPerson(query);
results.personList.addAll(0, localSr.personList);
return results;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,18 @@

package org.mycore.ubo.resources;

import com.google.gson.Gson;
import org.mycore.access.MCRAccessManager;
import org.mycore.common.MCRSession;
import org.mycore.common.MCRSessionMgr;
import org.mycore.common.MCRSystemUserInformation;
import org.mycore.common.MCRUserInformation;
import org.mycore.common.config.MCRConfiguration2;
import org.mycore.ubo.picker.IdentityService;
import org.mycore.ubo.picker.PersonSearchResult;

import javax.naming.OperationNotSupportedException;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Response;

import com.google.gson.Gson;
import org.mycore.access.MCRAccessManager;
import org.mycore.common.config.MCRConfiguration2;
import org.mycore.ubo.picker.IdentityService;
import org.mycore.ubo.picker.PersonSearchResult;

@Path(UBOPersonSearchResource.PATH)
public class UBOPersonSearchResource {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<webpage lastModified="$Date: 2016-02-01 15:05:21 +0100 (Mo, 01 Feb 2016) $" id="dozbib.edit.publication">
<title xml:lang="de">Publikation bearbeiten</title>
<title xml:lang="en">Edit publication</title>

<article class="card">
<div class="card-body">
Expand Down Expand Up @@ -47,7 +48,7 @@
</fieldset>
<xed:bind xpath="metadata/def.modsContainer[@class='MCRMetaXML']/modsContainer/mods:mods">
<fieldset>
<legend>Publikation:</legend>
<legend><xed:output i18n="ubo.publication"/>:</legend>
<xed:include uri="webapp:import-editor.xed" ref="genre" />
<xed:include uri="webapp:import-editor.xed" ref="oa" />
<xed:include uri="webapp:import-editor.xed" ref="title.complex" />
Expand All @@ -68,7 +69,7 @@
</fieldset>
<xed:include uri="webapp:import-editor.xed" ref="relations" />
<fieldset>
<legend>erschienen in:</legend>
<legend><xed:output i18n="ubo.select.host"/>:</legend>
<xed:bind xpath="mods:relatedItem[@type='host']">
<xed:choose>
<xed:when test="string-length(@xlink:href) &gt; 0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
<xed:if test="not($host_intern='standalone')">
<fieldset>
<legend>
<xed:output value="concat('erschienen in ',$genres//category[@ID=$host_intern]/label[lang($CurrentLang)]/@text,':')" />
<xed:output value="concat(i18n:translate('ubo.select.host'),$genres//category[@ID=$host_intern]/label[lang($CurrentLang)]/@text,':')" />
</legend>
<xed:bind xpath="mods:relatedItem[@type='host']">
<xed:choose>
Expand All @@ -140,7 +140,7 @@
</xed:if>
</fieldset>
<fieldset>
<legend>Projektinformationen:</legend>
<legend><xed:output i18n="ubo.project.information"/>:</legend>
<xed:include uri="webapp:import-editor.xed" ref="projectInformation"/>
</fieldset>
</xed:bind>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@
<xed:template id="legend.ID">
<xed:bind xpath="/mycoreobject/@ID" default="{$UBO.projectid.default}_mods_00000000">
<xed:choose>
<xed:when test="contains(.,'_mods_00000000')">Neue Publikation erfassen: </xed:when>
<xed:otherwise>Eintrag <xed:output value="number(substring-after(.,'mods_'))"/> korrigieren: </xed:otherwise>
<xed:when test="contains(.,'_mods_00000000')"><xed:output i18n="ubo.newPublication" /></xed:when>
<xed:otherwise><xed:output i18n="ubo.entry.correct"/><xed:output value="number(substring-after(.,'mods_'))"/><xed:output i18n="ubo.entry.correct.colon"/></xed:otherwise>
</xed:choose>
</xed:bind>
</xed:template>
Expand Down Expand Up @@ -404,7 +404,7 @@
</xed:choose>
</span>
<div class="ml-auto pb-1">
<button class="btn btn-xs btn-primary mr-1" type="submit" xed:target="subselect" xed:href="../identitypicker.html?{xed:call-java('org.mycore.ubo.matcher.MCRUserMatcherUtils', 'getAttributesAsURLString', .)}">
<button id="{xed:generate-id()}" class="btn btn-xs btn-primary mr-1" type="submit" xed:target="subselect" xed:href="../identitypicker.html?{xed:call-java('org.mycore.ubo.matcher.MCRUserMatcherUtils', 'getAttributesAsURLString', .)}&amp;xEditorHook={xed:generate-id()}">
<xed:output i18n="search.select" />
</button>
</div>
Expand Down Expand Up @@ -828,16 +828,16 @@

<xed:template id="relations">
<fieldset>
<legend>Verweise:</legend>
<legend><xed:output i18n="edit.reference"/>:</legend>
<xed:repeat xpath="mods:relatedItem[not(@type='host')][not(@type='series')]" max="30">
<div class="form-group form-inline ubo-repeat-group">
<xed:bind xpath="@type" default="references">
<div class="mycore-form-label">
<select class="form-control custom-select">
<option value="references">Referenziert</option>
<option value="preceding">Vorgänger</option>
<option value="succeeding">Nachfolger</option>
<option value="reviewOf">Ist Review von</option>
<option value="references"><xed:output i18n="ubo.relatedItem.references" /></option>
<option value="preceding"><xed:output i18n="ubo.relatedItem.preceding" /></option>
<option value="succeeding"><xed:output i18n="ubo.relatedItem.succeeding" /></option>
<option value="reviewOf"><xed:output i18n="ubo.relatedItem.reviewOf" /></option>
</select>:
</div>
</xed:bind>
Expand Down
13 changes: 6 additions & 7 deletions ubo-common/src/main/resources/META-INF/resources/import-list.xed
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,13 @@
<xed:bind xpath="@sourceType">
<div class="form-group form-inline">
<label for="{generate-id()}" class="mycore-form-label">Quell-Format :</label>
<select id="{generate-id()}" class="form-control col-7 mr-1 custom-select">
<select id="{generate-id()}" class="form-control col-7 mr-1 custom-select" onchange="toggleEnrichment(this)">
<option value="BibTeX">BibTeX Quellcode</option>
<option value="ORCID">Publikationen aus dem ORCID Profil</option>
<option value="IAQ">Literaturliste im CSV-Format: IAQ</option>
<option value="NST">Literaturliste im CSV-Format: Nanostrukturtechnik</option>
<option value="Opto">Literaturliste im CSV-Format: Optoelektronik</option>
<option value="PPNList">Literaturliste im PPN-Listenformat</option>
</select>
</div>
</xed:bind>
Expand All @@ -89,13 +90,14 @@
<xed:bind xpath="source">
<div class="form-group form-inline">
<textarea id="{xed:generate-id()}" class="{$xed-validation-marker} form-control col" type="text"
placeholder="BibTeX Quellcode bzw. ORCID bzw. CSV-Literaturliste hierhin kopieren" rows="10"/>
placeholder="BibTeX Quellcode bzw. ORCID bzw. PPN/CSV-Literaturliste hierhin kopieren" rows="10"
oninput="toggleSubmit()"/>
</div>
<xed:validate required="true" display="global" />
</xed:bind>

<div>
<button class="btn btn-sm btn-primary" type="submit" xed:target="servlet" xed:href="DozBibImportServlet">
<button id="submitBtn" class="btn btn-sm btn-primary" disabled="disabled" type="submit" xed:target="servlet" xed:href="DozBibImportServlet">
<xed:output i18n="button.submit" />
</button>
</div>
Expand All @@ -105,10 +107,7 @@
</xed:bind>
</xed:form>

<script type="text/javascript">
$(document).ready(function() { $('select[class*="autocomplete"]').chosen({search_contains: true}); });
</script>

<script src="js/ImportList.js"/>
</div>
</article>
</webpage>
22 changes: 22 additions & 0 deletions ubo-common/src/main/resources/META-INF/resources/js/ImportList.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
$(document).ready(function () {
$('select[class*="autocomplete"]').chosen({search_contains: true});
});

function toggleEnrichment(select) {
if ($(select).val() == "PPNList") {
$("#enrich-yes").click();
$("#enrich-no").attr("disabled", "disabled");
} else {
$("#enrich-no").removeAttr("disabled");
}
}

function toggleSubmit() {
let v = $("textarea").val();

if (v === "undefined" || v.length == 0) {
$("#submitBtn").attr("disabled", "disabled");
} else {
$("#submitBtn").removeAttr("disabled");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@
font-size: 25px;
}

.ubo-sticky-editor-buttons {
position: sticky;
bottom: 0;
padding: 1.5rem 0 1rem 0;
background-color: rgba(255, 255, 255, 0.8);
margin-top: 2rem;
}

// Large devices (desktops) and below: <= 1200px
@include media-breakpoint-down(lg) {
// add/overwrite styles for responsive level lg and lower
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
@extend .py-0;
@extend .px-0;
}

.mycore-list > .list-group-item:first-child {
padding-top: 0px;
}
Expand All @@ -61,7 +61,7 @@
vertical-align: top;
margin: 0px 2px 0px 2px;
}

.orcid-status {
display: inline;
.orcid-info > img.orcid-icon {
Expand Down Expand Up @@ -122,7 +122,7 @@
margin-top: 2rem;
margin-bottom: 3rem;
}

.mycore-tag {
margin-right: 0.25rem;
}
Expand All @@ -138,7 +138,8 @@
margin-top: -.5rem;
}

.ubo-person-popover, .ubo-hover-pointer:hover {
.ubo-person-popover,
.ubo-hover-pointer:hover {
cursor: pointer;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@
}
}

.form-control::placeholder, .mycore-form-input-double::placeholder, .mycore-form-input::placeholder {
opacity: 0.4;
}

// Large devices (desktops) and below: <= 1200px
@include media-breakpoint-down(lg) {
// add/overwrite styles for responsive level lg and lower
Expand Down
53 changes: 53 additions & 0 deletions ubo-common/src/main/resources/META-INF/resources/scss/_ubo-oa.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
.oa-badge {
&-oa {
color: $oa-text;
background-color: $oa;
}
&-green {
color: $oa-green-text;
background-color: $oa-green;
}
&-gold {
color: $oa-gold-text;
background-color: $oa-gold;
}
&-closed {
color: $oa-closed-text;
background-color: $oa-closed;
}
&-platin {
color: $oa-platin-text;
background-color: $oa-platin;
}
&-hybrid {
color: $oa-hybrid-text;
background-color: $oa-hybrid;
}
&-bronze {
color: $oa-bronze-text;
background-color: $oa-bronze;
}
&-embargo {
color: $oa-embargo-text;
background-color: $oa-embargo;
}
&-unvalidated {
color: $oa-unvalidated-text;
background-color: $oa-unvalidated;
}
}

.oa-statistic {
&:hover {
filter: brightness(110%);
}
&-closed rect { fill: $oa-closed; }
&-oa rect { fill: $oa; }
&-green rect { fill: $oa-green; }
&-gold rect { fill: $oa-gold; }
&-platin rect { fill: $oa-platin; }
&-hybrid rect { fill: $oa-hybrid; }
&-bronze rect { fill: $oa-bronze; }
&-embargo rect { fill: $oa-embargo; }
&-unvalidated rect { fill: $oa-unvalidated; }
}
Loading

0 comments on commit 7abb302

Please sign in to comment.