Commit aac191e4 authored by Matija Obreza's avatar Matija Obreza

DOI code revision: liquibase rollback and DOI display

parent 94d43f60
...@@ -206,6 +206,7 @@ public class GenesysServiceImpl implements GenesysService, DatasetService { ...@@ -206,6 +206,7 @@ public class GenesysServiceImpl implements GenesysService, DatasetService {
public GenesysServiceImpl() { public GenesysServiceImpl() {
List<String> columnList = new ArrayList<String>(); List<String> columnList = new ArrayList<String>();
columnList.add(Api1Constants.Accession.DOI);
columnList.add("taxonomy." + Api1Constants.Taxonomy.SCIENTIFIC_NAME); columnList.add("taxonomy." + Api1Constants.Taxonomy.SCIENTIFIC_NAME);
columnList.add("taxonomy." + Api1Constants.Taxonomy.GENUS); columnList.add("taxonomy." + Api1Constants.Taxonomy.GENUS);
columnList.add("taxonomy." + Api1Constants.Taxonomy.SPECIES); columnList.add("taxonomy." + Api1Constants.Taxonomy.SPECIES);
...@@ -220,7 +221,6 @@ public class GenesysServiceImpl implements GenesysService, DatasetService { ...@@ -220,7 +221,6 @@ 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>();
......
...@@ -189,19 +189,23 @@ databaseChangeLog: ...@@ -189,19 +189,23 @@ databaseChangeLog:
- column: - column:
name: doi name: doi
type: varchar(255) type: varchar(255)
rollback:
- dropColumn:
tableName: accession
columnName: doi
- changeSet: - changeSet:
id: 1497558768000-3 id: 1497558768000-3
author: maxymborodenko (generated) author: maxymborodenko (generated)
changes: changes:
- addUniqueConstraint: - addUniqueConstraint:
columnNames: doi columnNames: doi
constraintName: UQ_accession_doi constraintName: UQ_accession_doi
deferrable: true tableName: accession
disabled: true rollback:
initiallyDeferred: true - dropUniqueConstraint:
tableName: accession tableName: accession
tablespace: A String constraintName: UQ_accession_doi
- changeSet: - changeSet:
id: 1497558768000-4 id: 1497558768000-4
...@@ -212,4 +216,4 @@ databaseChangeLog: ...@@ -212,4 +216,4 @@ databaseChangeLog:
columns: columns:
- column: - column:
name: doi name: doi
type: varchar(255) type: varchar(255)
\ No newline at end of file
...@@ -57,6 +57,23 @@ ...@@ -57,6 +57,23 @@
<spring:message code="accession.page.profile.title" arguments="${accession.accessionName}" argumentSeparator="|" /></h4> <spring:message code="accession.page.profile.title" arguments="${accession.accessionName}" argumentSeparator="|" /></h4>
<div class="section-inner-content"> <div class="section-inner-content">
<c:if test="${accession.doi ne null}">
<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}">
<a href="<c:url value="https://www.genesys-pgr.org/${accession.doi}" />"><c:out value="${accession.doi}" /></a>
</c:if>
</p>
</div>
</div>
</c:if>
<div class="row"> <div class="row">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12"> <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
<p> <p>
...@@ -341,23 +358,8 @@ ...@@ -341,23 +358,8 @@
</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>
<c:if test="${accession.acceUrl ne null}"> <c:if test="${accession.acceUrl ne null}">
<div class="row"> <div class="row">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12"> <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
......
...@@ -195,6 +195,15 @@ ...@@ -195,6 +195,15 @@
<td><p><a href="<c:url value="/acn/id/${accession.id}" />"><b><c:out value="${accession.acceNumb}"/></b></a></p></td> <td><p><a href="<c:url value="/acn/id/${accession.id}" />"><b><c:out value="${accession.acceNumb}"/></b></a></p></td>
<c:forEach items="${selectedColumns}" var="col" varStatus="i"> <c:forEach items="${selectedColumns}" var="col" varStatus="i">
<c:choose> <c:choose>
<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>">
<p>
<c:if test="${accession.doi ne null}">
<a href="<c:url value="https://www.genesys-pgr.org/${accession.doi}" />"><c:out value="${accession.doi}" /></a>
</c:if>
</p>
</td>
</c:when>
<c:when test="${col eq 'taxonomy.sciName'}"> <c:when test="${col eq 'taxonomy.sciName'}">
<td class="<c:if test='${i.count ge 2}'>hidden-xs</c:if> <c:if test='${i.count gt 2}'>hidden-sm</c:if>"><p><span dir="ltr" class="sci-name"><c:out escapeXml="false" value="${accession.taxonomy.sciNameHtml}"/></span></p></td> <td class="<c:if test='${i.count ge 2}'>hidden-xs</c:if> <c:if test='${i.count gt 2}'>hidden-sm</c:if>"><p><span dir="ltr" class="sci-name"><c:out escapeXml="false" value="${accession.taxonomy.sciNameHtml}"/></span></p></td>
</c:when> </c:when>
...@@ -239,18 +248,6 @@ ...@@ -239,18 +248,6 @@
<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">
...@@ -821,7 +818,16 @@ ...@@ -821,7 +818,16 @@
<c:forEach items="${selectedColumns}" var="col" varStatus="i"> <c:forEach items="${selectedColumns}" var="col" varStatus="i">
<c:choose> <c:choose>
<c:when test="${col eq 'taxonomy.sciName'}"> <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 'taxonomy.sciName'}">
$("<span/>", { $("<span/>", {
dir: 'ltr', dir: 'ltr',
'class': 'sci-name', 'class': 'sci-name',
...@@ -892,15 +898,6 @@ ...@@ -892,15 +898,6 @@
'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>"
......
...@@ -91,6 +91,11 @@ ...@@ -91,6 +91,11 @@
type="autocomplete"/> type="autocomplete"/>
</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:panel id="acceNumb" title="filter.acceNumb"> <filters:panel id="acceNumb" title="filter.acceNumb">
<filters:filter availableFilters="${availableFilters}" filterMap="${filters}" filterKey="acceNumb" <filters:filter availableFilters="${availableFilters}" filterMap="${filters}" filterKey="acceNumb"
appliedFilters="${appliedFilters}" type="like"/> appliedFilters="${appliedFilters}" type="like"/>
...@@ -173,9 +178,4 @@ ...@@ -173,9 +178,4 @@
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
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