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 { ...@@ -60,6 +60,8 @@ public class AccessionDetails {
private Boolean art15; private Boolean art15;
private Integer sampStat; private Integer sampStat;
private List<Integer> storage; private List<Integer> storage;
@Field(type = FieldType.String)
private String doi;
@Field(type = FieldType.Object) @Field(type = FieldType.Object)
private Institute institute; private Institute institute;
...@@ -132,6 +134,7 @@ public class AccessionDetails { ...@@ -132,6 +134,7 @@ public class AccessionDetails {
ad.cropName=accession.getCropName(); ad.cropName=accession.getCropName();
ad.inSgsv = accession.getInSvalbard() != null && accession.getInSvalbard() == true ? true : false; ad.inSgsv = accession.getInSvalbard() != null && accession.getInSvalbard() == true ? true : false;
ad.cropName = accession.getCropName(); ad.cropName = accession.getCropName();
ad.doi = accession.getDoi();
if (accession.getAccessionId().getPdci() != null) { if (accession.getAccessionId().getPdci() != null) {
ad.pdciScore = accession.getAccessionId().getPdci().getScore(); ad.pdciScore = accession.getAccessionId().getPdci().getScore();
...@@ -538,4 +541,12 @@ public class AccessionDetails { ...@@ -538,4 +541,12 @@ public class AccessionDetails {
public void setAcceName(String acceName) { public void setAcceName(String acceName) {
this.acceName = 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; ...@@ -40,7 +40,7 @@ import javax.persistence.UniqueConstraint;
@Entity @Entity
@Table(name = "accession", @Table(name = "accession",
// Unique constraints // 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
indexes = { @Index(name = "IX_seqNo", columnList = "seqNo"), @Index(name = "IX_accession_lastModifiedDate", columnList = "lastModifiedDate") }) indexes = { @Index(name = "IX_seqNo", columnList = "seqNo"), @Index(name = "IX_accession_lastModifiedDate", columnList = "lastModifiedDate") })
public class Accession extends AccessionData { public class Accession extends AccessionData {
......
...@@ -81,6 +81,9 @@ public abstract class AccessionData implements IdUUID, Serializable { ...@@ -81,6 +81,9 @@ public abstract class AccessionData implements IdUUID, Serializable {
@JoinColumn(name = "id") @JoinColumn(name = "id")
private AccessionId accessionId; private AccessionId accessionId;
@Column(name = "doi")
private String doi;
@Column(name = "instCode", length = 10, nullable = false) @Column(name = "instCode", length = 10, nullable = false)
private String instituteCode; private String instituteCode;
...@@ -414,4 +417,12 @@ public abstract class AccessionData implements IdUUID, Serializable { ...@@ -414,4 +417,12 @@ public abstract class AccessionData implements IdUUID, Serializable {
public void setCrop(Crop crop) { public void setCrop(Crop crop) {
this.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 { ...@@ -78,6 +78,8 @@ public class AccessionJson {
private boolean historic; private boolean historic;
@JsonProperty(value = Accession.ACCEURL) @JsonProperty(value = Accession.ACCEURL)
private String acceUrl; private String acceUrl;
@JsonProperty(value = Accession.DOI)
private String doi;
public long getVersion() { public long getVersion() {
return version; return version;
...@@ -302,4 +304,12 @@ public class AccessionJson { ...@@ -302,4 +304,12 @@ public class AccessionJson {
public void setAcceUrl(String acceUrl) { public void setAcceUrl(String acceUrl) {
this.acceUrl = acceUrl; this.acceUrl = acceUrl;
} }
public String getDoi() {
return doi;
}
public void setDoi(String doi) {
this.doi = doi;
}
} }
...@@ -191,6 +191,11 @@ public interface Api1Constants { ...@@ -191,6 +191,11 @@ public interface Api1Constants {
*/ */
public static final String CROPNAME = "cropName"; public static final String CROPNAME = "cropName";
/**
* Accession DOI (Digital Object Identifier)
*/
public static final String DOI = "doi";
} }
public static interface Institute { public static interface Institute {
......
...@@ -91,4 +91,6 @@ public interface FilterConstants { ...@@ -91,4 +91,6 @@ public interface FilterConstants {
public static final String LAST_MODIFIED_DATE = "lastModifiedDate"; public static final String LAST_MODIFIED_DATE = "lastModifiedDate";
public static final String DOI = "doi";
} }
...@@ -208,6 +208,7 @@ public class DirectMysqlQuery { ...@@ -208,6 +208,7 @@ public class DirectMysqlQuery {
createQuery(whereBuffer, "col.collMissId", filters.get(FilterConstants.COLLMISSID), params); createQuery(whereBuffer, "col.collMissId", filters.get(FilterConstants.COLLMISSID), params);
createQuery(whereBuffer, "storage.storage", filters.get(FilterConstants.STORAGE), params); createQuery(whereBuffer, "storage.storage", filters.get(FilterConstants.STORAGE), params);
createQuery(whereBuffer, "pdci.score", filters.get(FilterConstants.PDCI), params); createQuery(whereBuffer, "pdci.score", filters.get(FilterConstants.PDCI), params);
createQuery(whereBuffer, "doi", filters.get(FilterConstants.DOI), params);
for (final AppliedFilter methodFilter : filters.methodFilters()) { for (final AppliedFilter methodFilter : filters.methodFilters()) {
// Handle Genesys Method! // Handle Genesys Method!
......
...@@ -83,6 +83,7 @@ public class FilterHandler { ...@@ -83,6 +83,7 @@ public class FilterHandler {
this.availableFilters.add(new BasicFilter(FilterConstants.CROPS, DataType.STRING)); this.availableFilters.add(new BasicFilter(FilterConstants.CROPS, DataType.STRING));
this.availableFilters.add(new BasicFilter(FilterConstants.CROPNAME, 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.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_ORIGIN, DataType.STRING));
this.availableFilters.add(new BasicFilter(FilterConstants.REGION_HOLD_INSTITUTE, DataType.STRING)); this.availableFilters.add(new BasicFilter(FilterConstants.REGION_HOLD_INSTITUTE, DataType.STRING));
......
...@@ -220,6 +220,7 @@ public class GenesysServiceImpl implements GenesysService, DatasetService { ...@@ -220,6 +220,7 @@ public class GenesysServiceImpl implements GenesysService, DatasetService {
columnList.add("geo." + Api1Constants.Geo.LATITUDE_LONGITUDE); columnList.add("geo." + Api1Constants.Geo.LATITUDE_LONGITUDE);
columnList.add("coll." + Api1Constants.Collecting.COLLMISSID); columnList.add("coll." + Api1Constants.Collecting.COLLMISSID);
columnList.add("pdci." + Api1Constants.Pdci.SCORE); columnList.add("pdci." + Api1Constants.Pdci.SCORE);
columnList.add(Api1Constants.Accession.DOI);
availableDisplayColumns = Collections.unmodifiableList(columnList); availableDisplayColumns = Collections.unmodifiableList(columnList);
List<String> displayList = new ArrayList<String>(); List<String> displayList = new ArrayList<String>();
......
...@@ -431,6 +431,7 @@ filter.lastModifiedDate=Last Modified Date ...@@ -431,6 +431,7 @@ filter.lastModifiedDate=Last Modified Date
filter.alias=Accession name filter.alias=Accession name
filter.crops=Crop name filter.crops=Crop name
filter.cropName=Provided crop name filter.cropName=Provided crop name
filter.doi=DOI
filter.regionOfOrigin=Region of Origin filter.regionOfOrigin=Region of Origin
filter.regionOfHoldingInstitute=Region of Holding Institute filter.regionOfHoldingInstitute=Region of Holding Institute
filter.orgCty.iso3=Country of Origin filter.orgCty.iso3=Country of Origin
...@@ -753,6 +754,7 @@ resolver.resolve=Resolve ...@@ -753,6 +754,7 @@ resolver.resolve=Resolve
resolver.page.reverse.title=Resolution results resolver.page.reverse.title=Resolution results
accession.purl=Permanent URL accession.purl=Permanent URL
accession.doi=DOI
menu.admin.kpi=KPI menu.admin.kpi=KPI
admin.kpi.index.page=KPI admin.kpi.index.page=KPI
......
...@@ -178,3 +178,38 @@ databaseChangeLog: ...@@ -178,3 +178,38 @@ databaseChangeLog:
- sql: - sql:
comment: accountType#SYSTEM to user#sys==1 comment: accountType#SYSTEM to user#sys==1
sql: update user set sys = 1 where accountType = 'SYSTEM'; 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 @@ ...@@ -341,6 +341,20 @@
</p> </p>
</div> </div>
</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> </c:if>
......
...@@ -239,6 +239,18 @@ ...@@ -239,6 +239,18 @@
<c:when test="${col eq 'pdci.score'}"> <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> <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>
<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:otherwise>
<c:set var="elVal" value="${accession}" /> <c:set var="elVal" value="${accession}" />
<c:forTokens items="${col}" delims="." var="item"> <c:forTokens items="${col}" delims="." var="item">
...@@ -880,6 +892,15 @@ ...@@ -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>" '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)))); }).appendTo(row))));
</c:when> </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'}"> <c:when test="${col eq 'crops'}">
var cropNamesTd = $("<td/>", { 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>" '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 @@ ...@@ -173,4 +173,9 @@
appliedFilters="${appliedFilters}" type="range"/> appliedFilters="${appliedFilters}" type="range"/>
</filters:panel> </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> </filters:group>
\ No newline at end of file
...@@ -123,6 +123,16 @@ ...@@ -123,6 +123,16 @@
</span> </span>
</div> </div>
</c:when> </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:when test="${type eq 'range'}">
<c:choose> <c:choose>
<c:when test="${filterKey eq 'geo.latitude'}"> <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