Commit 94d43f60 authored by Maxym Borodenko's avatar Maxym Borodenko Committed by Matija Obreza

Add DOI field

parent 0d4e4e7c
......@@ -60,6 +60,8 @@ public class AccessionDetails {
private Boolean art15;
private Integer sampStat;
private List<Integer> storage;
@Field(type = FieldType.String)
private String doi;
@Field(type = FieldType.Object)
private Institute institute;
......@@ -132,6 +134,7 @@ public class AccessionDetails {
ad.cropName=accession.getCropName();
ad.inSgsv = accession.getInSvalbard() != null && accession.getInSvalbard() == true ? true : false;
ad.cropName = accession.getCropName();
ad.doi = accession.getDoi();
if (accession.getAccessionId().getPdci() != null) {
ad.pdciScore = accession.getAccessionId().getPdci().getScore();
......@@ -538,4 +541,12 @@ public class AccessionDetails {
public void setAcceName(String acceName) {
this.acceName = acceName;
}
public String getDoi() {
return doi;
}
public void setDoi(String doi) {
this.doi = doi;
}
}
......@@ -40,7 +40,7 @@ import javax.persistence.UniqueConstraint;
@Entity
@Table(name = "accession",
// Unique constraints
uniqueConstraints = { @UniqueConstraint(name = "UQ_accession_genus_inst", columnNames = { "instituteId", "taxGenus", "acceNumb" }) },
uniqueConstraints = { @UniqueConstraint(name = "UQ_accession_genus_inst", columnNames = { "instituteId", "taxGenus", "acceNumb" }), @UniqueConstraint(name = "UQ_accession_doi", columnNames = {"doi"})},
// Indexes
indexes = { @Index(name = "IX_seqNo", columnList = "seqNo"), @Index(name = "IX_accession_lastModifiedDate", columnList = "lastModifiedDate") })
public class Accession extends AccessionData {
......
......@@ -81,6 +81,9 @@ public abstract class AccessionData implements IdUUID, Serializable {
@JoinColumn(name = "id")
private AccessionId accessionId;
@Column(name = "doi")
private String doi;
@Column(name = "instCode", length = 10, nullable = false)
private String instituteCode;
......@@ -414,4 +417,12 @@ public abstract class AccessionData implements IdUUID, Serializable {
public void setCrop(Crop crop) {
this.crop = crop;
}
public String getDoi() {
return doi;
}
public void setDoi(String doi) {
this.doi = doi;
}
}
......@@ -78,6 +78,8 @@ public class AccessionJson {
private boolean historic;
@JsonProperty(value = Accession.ACCEURL)
private String acceUrl;
@JsonProperty(value = Accession.DOI)
private String doi;
public long getVersion() {
return version;
......@@ -302,4 +304,12 @@ public class AccessionJson {
public void setAcceUrl(String acceUrl) {
this.acceUrl = acceUrl;
}
public String getDoi() {
return doi;
}
public void setDoi(String doi) {
this.doi = doi;
}
}
......@@ -191,6 +191,11 @@ public interface Api1Constants {
*/
public static final String CROPNAME = "cropName";
/**
* Accession DOI (Digital Object Identifier)
*/
public static final String DOI = "doi";
}
public static interface Institute {
......
......@@ -91,4 +91,6 @@ public interface FilterConstants {
public static final String LAST_MODIFIED_DATE = "lastModifiedDate";
public static final String DOI = "doi";
}
......@@ -208,6 +208,7 @@ public class DirectMysqlQuery {
createQuery(whereBuffer, "col.collMissId", filters.get(FilterConstants.COLLMISSID), params);
createQuery(whereBuffer, "storage.storage", filters.get(FilterConstants.STORAGE), params);
createQuery(whereBuffer, "pdci.score", filters.get(FilterConstants.PDCI), params);
createQuery(whereBuffer, "doi", filters.get(FilterConstants.DOI), params);
for (final AppliedFilter methodFilter : filters.methodFilters()) {
// Handle Genesys Method!
......
......@@ -83,6 +83,7 @@ public class FilterHandler {
this.availableFilters.add(new BasicFilter(FilterConstants.CROPS, DataType.STRING));
this.availableFilters.add(new BasicFilter(FilterConstants.CROPNAME, DataType.STRING));
this.availableFilters.add(new BasicFilter(FilterConstants.LISTS, DataType.STRING));
this.availableFilters.add(new BasicFilter(FilterConstants.DOI, DataType.STRING));
this.availableFilters.add(new BasicFilter(FilterConstants.REGION_ORIGIN, DataType.STRING));
this.availableFilters.add(new BasicFilter(FilterConstants.REGION_HOLD_INSTITUTE, DataType.STRING));
......
......@@ -220,6 +220,7 @@ public class GenesysServiceImpl implements GenesysService, DatasetService {
columnList.add("geo." + Api1Constants.Geo.LATITUDE_LONGITUDE);
columnList.add("coll." + Api1Constants.Collecting.COLLMISSID);
columnList.add("pdci." + Api1Constants.Pdci.SCORE);
columnList.add(Api1Constants.Accession.DOI);
availableDisplayColumns = Collections.unmodifiableList(columnList);
List<String> displayList = new ArrayList<String>();
......
......@@ -431,6 +431,7 @@ filter.lastModifiedDate=Last Modified Date
filter.alias=Accession name
filter.crops=Crop name
filter.cropName=Provided crop name
filter.doi=DOI
filter.regionOfOrigin=Region of Origin
filter.regionOfHoldingInstitute=Region of Holding Institute
filter.orgCty.iso3=Country of Origin
......@@ -753,6 +754,7 @@ resolver.resolve=Resolve
resolver.page.reverse.title=Resolution results
accession.purl=Permanent URL
accession.doi=DOI
menu.admin.kpi=KPI
admin.kpi.index.page=KPI
......
......@@ -178,3 +178,38 @@ databaseChangeLog:
- sql:
comment: accountType#SYSTEM to user#sys==1
sql: update user set sys = 1 where accountType = 'SYSTEM';
- changeSet:
id: 1497558768000-2
author: maxymborodenko (generated)
changes:
- addColumn:
tableName: accession
columns:
- column:
name: doi
type: varchar(255)
- changeSet:
id: 1497558768000-3
author: maxymborodenko (generated)
changes:
- addUniqueConstraint:
columnNames: doi
constraintName: UQ_accession_doi
deferrable: true
disabled: true
initiallyDeferred: true
tableName: accession
tablespace: A String
- changeSet:
id: 1497558768000-4
author: maxymborodenko (generated)
changes:
- addColumn:
tableName: accessionhistoric
columns:
- column:
name: doi
type: varchar(255)
\ No newline at end of file
......@@ -341,6 +341,20 @@
</p>
</div>
</div>
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
<p>
<spring:message code="accession.doi" />
</p>
</div>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
<p property="dc:identifier">
<c:if test="${(accession.doi ne null) && (accession.doi ne '')}">
<a href="<c:url value="https://www.genesys-pgr.org/${accession.doi}" />"><c:out value="https://www.genesys-pgr.org/${accession.doi}" /></a>
</c:if>
</p>
</div>
</div>
</c:if>
......
......@@ -239,6 +239,18 @@
<c:when test="${col eq 'pdci.score'}">
<td class="notimportant <c:if test='${i.count ge 2}'>hidden-xs</c:if> <c:if test='${i.count gt 2}'>hidden-sm</c:if>"><p><fmt:formatNumber value="${accession.pdciScore}"/></p></td>
</c:when>
<c:when test="${col eq 'doi'}">
<td class="notimportant <c:if test='${i.count ge 2}'>hidden-xs</c:if> <c:if test='${i.count gt 2}'>hidden-sm</c:if>">
<c:choose>
<c:when test="${accession.doi ne null}">
<p>${accession.doi}</p>
</c:when>
<c:otherwise>
<p></p>
</c:otherwise>
</c:choose>
</td>
</c:when>
<c:otherwise>
<c:set var="elVal" value="${accession}" />
<c:forTokens items="${col}" delims="." var="item">
......@@ -880,6 +892,15 @@
'class': "notimportant <c:if test='${i.count ge 2}'>hidden-xs</c:if> <c:if test='${i.count gt 2}'>hidden-sm</c:if>"
}).appendTo(row))));
</c:when>
<c:when test="${col eq 'doi'}">
$("<i/>", { text: pagedData.content[i].doi })
.appendTo($("<span/>", {
dir: "ltr",
'class': "sci-name"
}).appendTo($("<p></p>").appendTo($("<td/>", {
'class': "notimportant <c:if test='${i.count ge 2}'>hidden-xs</c:if> <c:if test='${i.count gt 2}'>hidden-sm</c:if>"
}).appendTo(row))));
</c:when>
<c:when test="${col eq 'crops'}">
var cropNamesTd = $("<td/>", {
'class': "notimportant <c:if test='${i.count ge 2}'>hidden-xs</c:if> <c:if test='${i.count gt 2}'>hidden-sm</c:if>"
......
......@@ -173,4 +173,9 @@
appliedFilters="${appliedFilters}" type="range"/>
</filters:panel>
<filters:panel id="doi" title="filter.doi">
<filters:filter availableFilters="${availableFilters}" filterMap="${filters}" filterKey="doi"
appliedFilters="${appliedFilters}" type="exact"/>
</filters:panel>
</filters:group>
\ No newline at end of file
......@@ -123,6 +123,16 @@
</span>
</div>
</c:when>
<c:when test="${type eq 'exact'}">
<div class="input-group">
<input id="<c:out value="${normalizedKey}" />_input" class="span2 form-control string-type" />
<span class="input-group-btn">
<button class="btn btn-secondary notimportant filter-auto" type="button" norm-key="<c:out value="${normalizedKey}" />" i-key="<c:out value="${filter.key}" />">
<span class="glyphicon glyphicon-plus"></span>
</button>
</span>
</div>
</c:when>
<c:when test="${type eq 'range'}">
<c:choose>
<c:when test="${filterKey eq 'geo.latitude'}">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment