Commit ddd27aeb authored by Matija Obreza's avatar Matija Obreza
Browse files

Display ACCENAME, DONORNUMB in explorer

parent c60f76d9
......@@ -11,6 +11,7 @@ import java.util.UUID;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import org.genesys2.server.model.genesys.AccessionAlias;
import org.genesys2.server.model.genesys.AccessionAlias.AliasType;
import org.genesys2.server.model.genesys.AccessionBreeding;
import org.genesys2.server.model.genesys.AccessionCollect;
import org.genesys2.server.model.genesys.AccessionData;
......@@ -105,6 +106,8 @@ public class AccessionDetails {
@Field(index = FieldIndex.not_analyzed, type = FieldType.String)
private Set<String> lists;
private String acceName;
public static AccessionDetails from(AccessionData accession) {
AccessionDetails ad = new AccessionDetails();
ad.version = accession.getVersion();
......@@ -153,6 +156,10 @@ public class AccessionDetails {
this.aliases = new ArrayList<Alias>();
for (AccessionAlias aa : listAccessionAliases) {
this.aliases.add(Alias.from(aa));
if (aa.getAliasType()==AliasType.ACCENAME) {
this.acceName = aa.getName();
}
}
}
......@@ -521,4 +528,12 @@ public class AccessionDetails {
public Float getPdciScore() {
return pdciScore;
}
public String getAcceName() {
return acceName;
}
public void setAcceName(String acceName) {
this.acceName = acceName;
}
}
......@@ -52,7 +52,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.elasticsearch.core.facet.result.Term;
import org.springframework.data.elasticsearch.core.facet.result.TermResult;
import org.springframework.jdbc.core.ArgumentPreparedStatementSetter;
......
......@@ -207,6 +207,8 @@ public class GenesysServiceImpl implements GenesysService, DatasetService {
columnList.add("taxonomy." + Api1Constants.Taxonomy.GENUS);
columnList.add("taxonomy." + Api1Constants.Taxonomy.SPECIES);
columnList.add("taxonomy." + Api1Constants.Taxonomy.SUBTAXA);
columnList.add(Api1Constants.Accession.ACCENAME);
columnList.add(Api1Constants.Accession.DONORNUMB);
columnList.add(Api1Constants.Accession.CROP_NAMES);
columnList.add(Api1Constants.Accession.CROPNAME);
columnList.add(Api1Constants.Accession.ORIGCTY);
......@@ -218,9 +220,9 @@ public class GenesysServiceImpl implements GenesysService, DatasetService {
availableDisplayColumns = Collections.unmodifiableList(columnList);
List<String> displayList = new ArrayList<String>();
displayList.add("taxonomy." + Api1Constants.Taxonomy.SCIENTIFIC_NAME);
displayList.add("taxonomy." + Api1Constants.Taxonomy.GENUS);
displayList.add("taxonomy." + Api1Constants.Taxonomy.SPECIES);
displayList.add(Api1Constants.Accession.ACCENAME);
displayList.add(Api1Constants.Accession.ORIGCTY);
displayList.add(Api1Constants.Accession.SAMPSTAT);
displayList.add("institute." + Api1Constants.Institute.INSTCODE);
......
......@@ -72,6 +72,9 @@ public class JsoupHtmlConverter implements HtmlConverter {
// holds the accumulated text
private StringBuilder accum = new StringBuilder();
public FormattingVisitor() {
}
/**
* hit when the node is first seen
*/
......
......@@ -16,13 +16,35 @@
package org.genesys2.server.servlet.controller;
import java.awt.Color;
import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.EOFException;
import java.io.IOException;
import java.io.OutputStream;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.ResourceBundle;
import javax.imageio.ImageIO;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.jhlabs.image.MapColorsFilter;
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.http.client.utils.URIBuilder;
import org.genesys2.server.model.elastic.AccessionDetails;
import org.genesys2.server.model.filters.CodedMethodFilter;
import org.genesys2.server.model.filters.GenesysFilter;
import org.genesys2.server.model.filters.I18nListFilter;
import org.genesys2.server.model.genesys.Method;
......@@ -30,7 +52,16 @@ import org.genesys2.server.model.genesys.Parameter;
import org.genesys2.server.model.genesys.ParameterCategory;
import org.genesys2.server.model.impl.Country;
import org.genesys2.server.model.impl.Crop;
import org.genesys2.server.service.*;
import org.genesys2.server.service.CropService;
import org.genesys2.server.service.DownloadService;
import org.genesys2.server.service.ElasticService;
import org.genesys2.server.service.FilterConstants;
import org.genesys2.server.service.GenesysFilterService;
import org.genesys2.server.service.GenesysService;
import org.genesys2.server.service.GeoService;
import org.genesys2.server.service.MappingService;
import org.genesys2.server.service.TraitService;
import org.genesys2.server.service.UrlShortenerService;
import org.genesys2.server.service.impl.FilterHandler;
import org.genesys2.server.service.impl.FilterHandler.AppliedFilter;
import org.genesys2.server.service.impl.FilterHandler.AppliedFilters;
......@@ -49,22 +80,14 @@ import org.springframework.http.MediaType;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.support.StringMultipartFileEditor;
import org.springframework.web.bind.annotation.CookieValue;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.support.RequestContextUtils;
import javax.imageio.ImageIO;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.*;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.*;
import java.util.List;
@Controller
public class ExplorerController extends BaseController implements InitializingBean {
......
......@@ -759,8 +759,9 @@ accession.pdci.independent-items=Independent of the population type
accession.pdci.dependent-items=Depending on the population type
accession.pdci.stats-text=Average PDCI score for {0} accessions is {1,number,0.00}, with minimum score of {2,number,0.00} and maximum score of {3,number,0.00}.
accession.donorNumb=Donor institute code
accession.donorNumb=Donor accession identifier
accession.acqDate=Acquisition date
accession.acceName=Accession name
accession.svalbard-data.url=Svalbard database URL
accession.svalbard-data.url-title=Deposit information in SGSV database
......
......@@ -207,6 +207,12 @@
<c:when test="${col eq 'sampStat'}">
<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><spring:message code="accession.sampleStatus.${accession.sampStat}"/></p></td>
</c:when>
<c:when test="${col eq 'acceName'}">
<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:out value="${accession.acceName}"/></p></td>
</c:when>
<c:when test="${col eq 'donorNumb'}">
<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:out value="${accession.donorNumb}"/></p></td>
</c:when>
<c:when test="${col eq 'institute.code'}">
<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><a href="<c:url value="/wiews/${accession.institute.code}" />"><c:out
value="${accession.institute.code}"/></a></p></td>
......@@ -766,6 +772,20 @@
'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 'acceName'}">
$("<p/>", {
text: pagedData.content[i].acceName
}).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 'donorNumb'}">
$("<p/>", {
text: pagedData.content[i].donorNumb
}).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 'sampStat'}">
$("<p/>", {
text: messages["accession.sampleStatus." + pagedData.content[i].sampStat]
......
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