Commit aac191e4 authored by Matija Obreza's avatar Matija Obreza

DOI code revision: liquibase rollback and DOI display

parent 94d43f60
Pipeline #1902 passed with stages
in 5 minutes and 54 seconds
......@@ -206,6 +206,7 @@ public class GenesysServiceImpl implements GenesysService, DatasetService {
public GenesysServiceImpl() {
List<String> columnList = new ArrayList<String>();
columnList.add(Api1Constants.Accession.DOI);
columnList.add("taxonomy." + Api1Constants.Taxonomy.SCIENTIFIC_NAME);
columnList.add("taxonomy." + Api1Constants.Taxonomy.GENUS);
columnList.add("taxonomy." + Api1Constants.Taxonomy.SPECIES);
......@@ -220,7 +221,6 @@ 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>();
......
......@@ -189,19 +189,23 @@ databaseChangeLog:
- column:
name: doi
type: varchar(255)
rollback:
- dropColumn:
tableName: accession
columnName: doi
- changeSet:
id: 1497558768000-3
author: maxymborodenko (generated)
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
columnNames: doi
constraintName: UQ_accession_doi
tableName: accession
rollback:
- dropUniqueConstraint:
tableName: accession
constraintName: UQ_accession_doi
- changeSet:
id: 1497558768000-4
......@@ -212,4 +216,4 @@ databaseChangeLog:
columns:
- column:
name: doi
type: varchar(255)
\ No newline at end of file
type: varchar(255)
......@@ -57,6 +57,23 @@
<spring:message code="accession.page.profile.title" arguments="${accession.accessionName}" argumentSeparator="|" /></h4>
<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="col-lg-6 col-md-6 col-sm-6 col-xs-12">
<p>
......@@ -341,23 +358,8 @@
</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>
<c:if test="${accession.acceUrl ne null}">
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
......
......@@ -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>
<c:forEach items="${selectedColumns}" var="col" varStatus="i">
<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'}">
<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>
......@@ -239,18 +248,6 @@
<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">
......@@ -821,7 +818,16 @@
<c:forEach items="${selectedColumns}" var="col" varStatus="i">
<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/>", {
dir: 'ltr',
'class': 'sci-name',
......@@ -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>"
}).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>"
......
......@@ -91,6 +91,11 @@
type="autocomplete"/>
</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:filter availableFilters="${availableFilters}" filterMap="${filters}" filterKey="acceNumb"
appliedFilters="${appliedFilters}" type="like"/>
......@@ -173,9 +178,4 @@
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
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