Commit 04ffcdfd authored by Viacheslav Pavlov's avatar Viacheslav Pavlov Committed by Matija Obreza

Accession details URL from `/acn/id/id` to `/a/uuid`

- Replaced all accession links to use uuid
- Using permanent redirect
parent 00713f54
...@@ -19,41 +19,28 @@ package org.genesys2.server.mvc; ...@@ -19,41 +19,28 @@ package org.genesys2.server.mvc;
import java.io.EOFException; import java.io.EOFException;
import java.io.IOException; import java.io.IOException;
import java.io.OutputStreamWriter; import java.io.OutputStreamWriter;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.genesys.blocks.auditlog.service.AuditTrailService;
import org.genesys.catalog.service.DatasetService;
import org.genesys.filerepository.InvalidRepositoryPathException;
import org.genesys.filerepository.model.ImageGallery;
import org.genesys2.server.exception.NotFoundElement; import org.genesys2.server.exception.NotFoundElement;
import org.genesys2.server.model.elastic.AccessionDetails; import org.genesys2.server.model.elastic.AccessionDetails;
import org.genesys2.server.model.genesys.Accession; import org.genesys2.server.model.genesys.Accession;
import org.genesys2.server.model.genesys.AccessionCollect;
import org.genesys2.server.model.genesys.AccessionGeo;
import org.genesys2.server.model.genesys.AccessionId;
import org.genesys2.server.model.genesys.Taxonomy2; import org.genesys2.server.model.genesys.Taxonomy2;
import org.genesys2.server.model.impl.Crop;
import org.genesys2.server.model.impl.FaoInstitute; import org.genesys2.server.model.impl.FaoInstitute;
import org.genesys2.server.service.AccessionService; import org.genesys2.server.service.AccessionService;
import org.genesys2.server.service.ClimateDataService;
import org.genesys2.server.service.DownloadService; import org.genesys2.server.service.DownloadService;
import org.genesys2.server.service.FilterConstants; import org.genesys2.server.service.FilterConstants;
import org.genesys2.server.service.GenesysService; import org.genesys2.server.service.GenesysService;
import org.genesys2.server.service.InstituteFilesService;
import org.genesys2.server.service.InstituteService; import org.genesys2.server.service.InstituteService;
import org.genesys2.server.service.TaxonomyService; import org.genesys2.server.service.TaxonomyService;
import org.genesys2.server.service.TraitService;
import org.genesys2.server.service.impl.NonUniqueAccessionException; import org.genesys2.server.service.impl.NonUniqueAccessionException;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap; import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -77,26 +64,13 @@ public class AccessionController extends BaseController { ...@@ -77,26 +64,13 @@ public class AccessionController extends BaseController {
@Autowired @Autowired
private GenesysService genesysService; private GenesysService genesysService;
@Autowired
private TraitService traitService;
@Autowired @Autowired
private TaxonomyService taxonomyService; private TaxonomyService taxonomyService;
@Autowired
private InstituteFilesService instituteFilesService;
@Autowired
private ClimateDataService climateDataService;
@Autowired @Autowired
private DownloadService downloadService; private DownloadService downloadService;
@Autowired
private AuditTrailService auditService;
@Autowired
private DatasetService datasetService;
@Autowired @Autowired
private AccessionService accessionService; private AccessionService accessionService;
...@@ -104,8 +78,9 @@ public class AccessionController extends BaseController { ...@@ -104,8 +78,9 @@ public class AccessionController extends BaseController {
@Value("${base.url}") @Value("${base.url}")
private String baseUrl; private String baseUrl;
@RequestMapping(value = "/id/{accessionId}", produces = { MediaType.APPLICATION_JSON_VALUE }) @RequestMapping(value = "/id/{accessionId}", produces = {MediaType.APPLICATION_JSON_VALUE})
public @ResponseBody AccessionDetails viewJson(ModelMap model, @PathVariable(value = "accessionId") long accessionId) { public @ResponseBody
AccessionDetails viewJson(ModelMap model, @PathVariable(value = "accessionId") long accessionId) {
AccessionDetails ad = genesysService.getAccessionDetails(accessionId); AccessionDetails ad = genesysService.getAccessionDetails(accessionId);
if (ad == null) { if (ad == null) {
throw new NotFoundElement(); throw new NotFoundElement();
...@@ -116,94 +91,24 @@ public class AccessionController extends BaseController { ...@@ -116,94 +91,24 @@ public class AccessionController extends BaseController {
@RequestMapping(value = "/id/{accessionId}") @RequestMapping(value = "/id/{accessionId}")
public ModelAndView view(ModelMap model, @PathVariable(value = "accessionId") long accessionId) { public ModelAndView view(ModelMap model, @PathVariable(value = "accessionId") long accessionId) {
LOG.debug("Viewing ACN {}", accessionId); LOG.debug("Viewing ACN {}", accessionId);
final Accession accession = genesysService.getAccession(accessionId); final Accession accession = genesysService.getAccession(accessionId);
if (accession == null) { if (accession == null) {
throw new NotFoundElement(); throw new NotFoundElement();
} }
if (accession.getDoi() != null) { RedirectView rv = new RedirectView();
// Permanent HTTP redirect to the DOI URL rv.setStatusCode(HttpStatus.MOVED_PERMANENTLY);
RedirectView rv = new RedirectView(); if (StringUtils.isNotEmpty(accession.getDoi())) {
rv.setStatusCode(HttpStatus.MOVED_PERMANENTLY); rv.setUrl("/" + accession.getDoi());
rv.setUrl(baseUrl + "/" + accession.getDoi());
return new ModelAndView(rv);
}
return displayAccession(model, accession);
}
/**
* Load the details to display full accession details page
*
* @param accession
* @return
*/
public ModelAndView displayAccession(ModelMap model, Accession accession) {
AccessionId accessionId = accession.getAccessionId();
model.addAttribute("accession", accession);
model.addAttribute("accessionNames", genesysService.listAccessionNames(accessionId));
model.addAttribute("accessionAliases", accessionId.getAliases());
model.addAttribute("accessionDatasets", datasetService.listByAccession(accession));
model.addAttribute("accessionExchange", accession);
AccessionCollect accessionCollect = accessionId.getColl();
model.addAttribute("accessionCollect", accessionCollect);
model.addAttribute("accessionBreeding", accession);
AccessionGeo accessionGeo = accessionId.getGeo();
model.addAttribute("accessionGeo", accessionGeo);
if (SecurityContextHolder.getContext().getAuthentication().isAuthenticated()) {
// only for authenticated users
model.addAttribute("auditAccession", auditService.auditLogs(accession));
model.addAttribute("auditAccessionId", auditService.auditLogs(accessionId));
model.addAttribute("auditAccessionCollect", auditService.auditLogs(accessionCollect));
model.addAttribute("auditAccessionGeo", auditService.auditLogs(accessionGeo));
}
model.addAttribute("svalbardDeposits", genesysService.getSvalbardData(accessionId));
model.addAttribute("accessionRemarks", accessionId.getRemarks());
model.addAttribute("metadatas", genesysService.listMetadata(accessionId));
model.addAttribute("methods", traitService.listMethods(accessionId));
model.addAttribute("methodValues", genesysService.getAccessionTraitValues(accessionId));
if (accession.getCrop() != null) {
List<Crop> crops = new ArrayList<Crop>();
crops.add(accession.getCrop());
model.addAttribute("crops", crops);
} else { } else {
// TODO Remove rv.setUrl("/a/" + accession.getUuid().toString());
// model.addAttribute("crops", cropService.getCrops(accession.getTaxonomy()));
}
// Worldclim data
if (accessionGeo != null && accessionGeo.getTileIndex() != null) {
model.addAttribute("worldclimJson", climateDataService.jsonForTile(accessionGeo.getTileIndex()));
} }
return new ModelAndView(rv);
model.addAttribute("pdci", accessionId.getPdci());
model.addAttribute("institutePDCI", accession.getInstitute().getStatisticsPDCI());
ImageGallery imageGallery = null;
try {
imageGallery = this.instituteFilesService.loadImageGallery(accession.getInstitute(), accession);
} catch (InvalidRepositoryPathException e) {
LOG.warn("Error loading image gallery for accession={}. {}", accession.getAccessionNumber(), e.getMessage());
}
if (imageGallery != null) {
model.addAttribute("thumbnailFormat", "200x200");
model.addAttribute("imageGallery", imageGallery);
}
return new ModelAndView("/accession/details", model);
} }
@RequestMapping("/{holdingInstitute}/{genus}/{accessionName:.+}") @RequestMapping("/{holdingInstitute}/{genus}/{accessionName:.+}")
public String viewInstituteAccession(ModelMap model, @PathVariable(value = "holdingInstitute") String holdingInstitute, public String viewInstituteAccession(ModelMap model, @PathVariable(value = "holdingInstitute") String holdingInstitute,
@PathVariable(value = "genus") String genus, @PathVariable(value = "accessionName") String accessionName) { @PathVariable(value = "genus") String genus, @PathVariable(value = "accessionName") String accessionName) {
...@@ -218,7 +123,7 @@ public class AccessionController extends BaseController { ...@@ -218,7 +123,7 @@ public class AccessionController extends BaseController {
if (accession == null) { if (accession == null) {
throw new NotFoundElement(); throw new NotFoundElement();
} else { } else {
return "redirect:/acn/id/" + accession.getId(); return "redirect:/a/" + accession.getUuid();
} }
} catch (NonUniqueAccessionException e) { } catch (NonUniqueAccessionException e) {
return "redirect:/acn/" + holdingInstitute + "/" + accessionName; return "redirect:/acn/" + holdingInstitute + "/" + accessionName;
...@@ -238,7 +143,7 @@ public class AccessionController extends BaseController { ...@@ -238,7 +143,7 @@ public class AccessionController extends BaseController {
throw new NotFoundElement(); throw new NotFoundElement();
} }
if (accessions.size() == 1) { if (accessions.size() == 1) {
return "redirect:/acn/id/" + accessions.get(0).getId(); return "redirect:/a/" + accessions.get(0).getUuid();
} }
model.addAttribute("faoInstitute", faoInstitute); model.addAttribute("faoInstitute", faoInstitute);
...@@ -249,17 +154,21 @@ public class AccessionController extends BaseController { ...@@ -249,17 +154,21 @@ public class AccessionController extends BaseController {
} }
@GetMapping(value = "/{uuid:\\w{8}\\-\\w{4}.+}") @GetMapping(value = "/{uuid:\\w{8}\\-\\w{4}.+}")
public String viewAccessionByUUID(final ModelMap model, @PathVariable("uuid") final UUID uuid) { public ModelAndView viewAccessionByUUID(final ModelMap model, @PathVariable("uuid") final UUID uuid) {
final Accession accession = accessionService.getByUuid(uuid); final Accession accession = accessionService.getByUuid(uuid);
if (accession == null) { if (accession == null) {
throw new NotFoundElement(); throw new NotFoundElement();
} }
RedirectView rv = new RedirectView();
rv.setStatusCode(HttpStatus.MOVED_PERMANENTLY);
if (StringUtils.isNotEmpty(accession.getDoi())) { if (StringUtils.isNotEmpty(accession.getDoi())) {
return "redirect:/" + accession.getDoi(); rv.setUrl("/" + accession.getDoi());
} else { } else {
return "redirect:/acn/id/" + accession.getId(); rv.setUrl("/a/" + accession.getUuid().toString());
} }
return new ModelAndView(rv);
} }
/** /**
......
/*
* Copyright 2019 Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.genesys2.server.mvc;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import org.genesys.blocks.auditlog.service.AuditTrailService;
import org.genesys.catalog.service.DatasetService;
import org.genesys.filerepository.InvalidRepositoryPathException;
import org.genesys.filerepository.model.ImageGallery;
import org.genesys2.server.exception.NotFoundElement;
import org.genesys2.server.model.genesys.Accession;
import org.genesys2.server.model.genesys.AccessionCollect;
import org.genesys2.server.model.genesys.AccessionGeo;
import org.genesys2.server.model.genesys.AccessionId;
import org.genesys2.server.model.impl.Crop;
import org.genesys2.server.service.AccessionService;
import org.genesys2.server.service.ClimateDataService;
import org.genesys2.server.service.GenesysService;
import org.genesys2.server.service.InstituteFilesService;
import org.genesys2.server.service.TraitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.view.RedirectView;
/**
* Handles accession display on `/a/...` URL prefix using UUID
*/
@Controller
@RequestMapping("/a")
public class AcnController extends BaseController {
@Autowired
private GenesysService genesysService;
@Autowired
private TraitService traitService;
@Autowired
private AuditTrailService auditService;
@Autowired
private DatasetService datasetService;
@Autowired
private InstituteFilesService instituteFilesService;
@Autowired
private ClimateDataService climateDataService;
@Autowired
private AccessionService accessionService;
@RequestMapping(value = "/{uuid:\\w{8}\\-\\w{4}.+}")
public ModelAndView view(ModelMap model, @PathVariable(value = "uuid") UUID uuid) {
final Accession accession = accessionService.getByUuid(uuid);
if (accession == null) {
throw new NotFoundElement();
}
if (accession.getDoi() != null) {
// Permanent HTTP redirect to the DOI URL
RedirectView rv = new RedirectView();
rv.setStatusCode(HttpStatus.MOVED_PERMANENTLY);
rv.setUrl("/" + accession.getDoi());
return new ModelAndView(rv);
}
return displayAccession(model, accession);
}
/**
* Load the details to display full accession details page
*
* @param accession
* @return
*/
public ModelAndView displayAccession(ModelMap model, Accession accession) {
AccessionId accessionId = accession.getAccessionId();
model.addAttribute("accession", accession);
model.addAttribute("accessionNames", genesysService.listAccessionNames(accessionId));
model.addAttribute("accessionAliases", accessionId.getAliases());
model.addAttribute("accessionDatasets", datasetService.listByAccession(accession));
model.addAttribute("accessionExchange", accession);
AccessionCollect accessionCollect = accessionId.getColl();
model.addAttribute("accessionCollect", accessionCollect);
model.addAttribute("accessionBreeding", accession);
AccessionGeo accessionGeo = accessionId.getGeo();
model.addAttribute("accessionGeo", accessionGeo);
if (SecurityContextHolder.getContext().getAuthentication().isAuthenticated()) {
// only for authenticated users
model.addAttribute("auditAccession", auditService.auditLogs(accession));
model.addAttribute("auditAccessionId", auditService.auditLogs(accessionId));
model.addAttribute("auditAccessionCollect", auditService.auditLogs(accessionCollect));
model.addAttribute("auditAccessionGeo", auditService.auditLogs(accessionGeo));
}
model.addAttribute("svalbardDeposits", genesysService.getSvalbardData(accessionId));
model.addAttribute("accessionRemarks", accessionId.getRemarks());
model.addAttribute("metadatas", genesysService.listMetadata(accessionId));
model.addAttribute("methods", traitService.listMethods(accessionId));
model.addAttribute("methodValues", genesysService.getAccessionTraitValues(accessionId));
if (accession.getCrop() != null) {
List<Crop> crops = new ArrayList<Crop>();
crops.add(accession.getCrop());
model.addAttribute("crops", crops);
}
// Worldclim data
if (accessionGeo != null && accessionGeo.getTileIndex() != null) {
model.addAttribute("worldclimJson", climateDataService.jsonForTile(accessionGeo.getTileIndex()));
}
model.addAttribute("pdci", accessionId.getPdci());
model.addAttribute("institutePDCI", accession.getInstitute().getStatisticsPDCI());
ImageGallery imageGallery = null;
try {
imageGallery = this.instituteFilesService.loadImageGallery(accession.getInstitute(), accession);
} catch (InvalidRepositoryPathException e) {
LOG.warn("Error loading image gallery for accession={}. {}", accession.getAccessionNumber(), e.getMessage());
}
if (imageGallery != null) {
model.addAttribute("thumbnailFormat", "200x200");
model.addAttribute("imageGallery", imageGallery);
}
return new ModelAndView("/accession/details", model);
}
}
\ No newline at end of file
...@@ -44,7 +44,7 @@ public class DoiController extends BaseController { ...@@ -44,7 +44,7 @@ public class DoiController extends BaseController {
private GenesysService genesysService; private GenesysService genesysService;
@Autowired @Autowired
private AccessionController accessionController; private AcnController accessionController;
@RequestMapping(value = "/10.{dummy:[0-9]+}/**") @RequestMapping(value = "/10.{dummy:[0-9]+}/**")
public ModelAndView view(HttpServletRequest request, ModelMap model) { public ModelAndView view(HttpServletRequest request, ModelMap model) {
......
...@@ -75,7 +75,7 @@ public class ResolverController { ...@@ -75,7 +75,7 @@ public class ResolverController {
} }
if (resolved instanceof Accession) { if (resolved instanceof Accession) {
return "redirect:/acn/id/" + ((Accession) resolved).getId(); return "redirect:/a/" + uuid;
} }
if (resolved instanceof AccessionHistoric) { if (resolved instanceof AccessionHistoric) {
......
...@@ -259,6 +259,7 @@ public class SelectionController extends BaseController { ...@@ -259,6 +259,7 @@ public class SelectionController extends BaseController {
g.lat = acnGeo.getLatitude(); g.lat = acnGeo.getLatitude();
g.lng = acnGeo.getLongitude(); g.lng = acnGeo.getLongitude();
AccessionData a = genesysService.getAccession(g.id); AccessionData a = genesysService.getAccession(g.id);
g.uuid = a.getUuid().toString();
g.accessionName = a.getAccessionNumber(); g.accessionName = a.getAccessionNumber();
g.instCode = a.getInstituteCode(); g.instCode = a.getInstituteCode();
geo.add(g); geo.add(g);
...@@ -294,6 +295,7 @@ public class SelectionController extends BaseController { ...@@ -294,6 +295,7 @@ public class SelectionController extends BaseController {
} }
public static class AccessionGeoJson { public static class AccessionGeoJson {
public String uuid;
public long id; public long id;
public Double lat; public Double lat;
public Double lng; public Double lng;
......
...@@ -434,7 +434,7 @@ public class GenesysFilterServiceImpl implements GenesysFilterService { ...@@ -434,7 +434,7 @@ public class GenesysFilterServiceImpl implements GenesysFilterService {
@Override @Override
public PreparedStatement createPreparedStatement(Connection con) throws SQLException { public PreparedStatement createPreparedStatement(Connection con) throws SQLException {
final PreparedStatement stmt = con.prepareStatement(directQuery.getQuery(distinct ? "distinct geo.longitude, geo.latitude" final PreparedStatement stmt = con.prepareStatement(directQuery.getQuery(distinct ? "distinct geo.longitude, geo.latitude"
: "a.id, a.acceNumb, a.instCode, geo.longitude, geo.latitude, geo.datum, geo.uncertainty ")); : "a.id, acce.uuid, a.acceNumb, a.instCode, geo.longitude, geo.latitude, geo.datum, geo.uncertainty "));
// Set mysql JConnector to stream results // Set mysql JConnector to stream results
stmt.setFetchSize(Integer.MIN_VALUE); stmt.setFetchSize(Integer.MIN_VALUE);
new ArgumentPreparedStatementSetter(directQuery.getParameters()).setValues(stmt); new ArgumentPreparedStatementSetter(directQuery.getParameters()).setValues(stmt);
......
...@@ -22,10 +22,12 @@ import java.io.ByteArrayOutputStream; ...@@ -22,10 +22,12 @@ import java.io.ByteArrayOutputStream;
import java.io.IOException; import java.io.IOException;
import java.io.OutputStream; import java.io.OutputStream;
import java.io.OutputStreamWriter; import java.io.OutputStreamWriter;
import java.nio.ByteBuffer;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.UUID;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import javax.imageio.ImageIO; import javax.imageio.ImageIO;
...@@ -143,6 +145,8 @@ public class MappingServiceImpl implements MappingService, InitializingBean { ...@@ -143,6 +145,8 @@ public class MappingServiceImpl implements MappingService, InitializingBean {
ObjectNode properties; ObjectNode properties;
feature.set("properties", properties = feature.objectNode()); feature.set("properties", properties = feature.objectNode());
ByteBuffer bb = ByteBuffer.wrap(rs.getBytes("uuid"));
properties.put("uuid", new UUID(bb.getLong(), bb.getLong()).toString());
properties.put("acceNumb", rs.getString("acceNumb")); properties.put("acceNumb", rs.getString("acceNumb"));
properties.put("instCode", rs.getString("instCode")); properties.put("instCode", rs.getString("instCode"));
properties.put("datum", rs.getString("datum")); properties.put("datum", rs.getString("datum"));
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<c:set var = "accessionDetailUrl" value = "/${accession.doi}"/> <c:set var = "accessionDetailUrl" value = "/${accession.doi}"/>
</c:when> </c:when>
<c:otherwise> <c:otherwise>
<c:set var = "accessionDetailUrl" value = "/acn/id/${accession.id}"/> <c:set var = "accessionDetailUrl" value = "/a/${accession.uuid}"/>
</c:otherwise> </c:otherwise>
</c:choose> </c:choose>
<${baseUrl}<c:out value="${fn:trim(accessionDetailUrl)}" />> <${baseUrl}<c:out value="${fn:trim(accessionDetailUrl)}" />>
......
...@@ -1038,7 +1038,7 @@ ...@@ -1038,7 +1038,7 @@
text: pagedData.content[i].acceNumb text: pagedData.content[i].acceNumb
}).appendTo( }).appendTo(
$("<a/>", { $("<a/>", {
href: '<c:url value="/acn/id/" />' + pagedData.content[i].id href: '<c:url value="/" />' + (pagedData.content[i].doi ? pagedData.content[i].doi : 'a/' + pagedData.content[i].uuid)
}).appendTo($("<p/>").appendTo($("<td/>").appendTo(row)))); }).appendTo($("<p/>").appendTo($("<td/>").appendTo(row))));
<c:forEach items="${selectedColumns}" var="col" varStatus="i"> <c:forEach items="${selectedColumns}" var="col" varStatus="i">
......
...@@ -783,7 +783,7 @@ ...@@ -783,7 +783,7 @@
var c = ""; var c = "";
parsedRespObject.features.forEach(function (a, b) { parsedRespObject.features.forEach(function (a, b) {
if (b < 10) if (b < 10)
c += "<a href='<c:url value="/acn/id/" />" + a.id + "'>" + a.properties.acceNumb + " " + a.properties.instCode + "</a><br />"; c += "<a href='<c:url value="/a/" />" + a.properties.uuid + "'>" + a.properties.acceNumb + " " + a.properties.instCode + "</a><br />";
else else
c += "..."; c += "...";
}); });
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
respObject.forEach(function(acn) { respObject.forEach(function(acn) {
if (acn.lat!=null && acn.lng!=null) { if (acn.lat!=null && acn.lng!=null) {
var marker = L.marker([acn.lat, acn.lng]).addTo(map); var marker = L.marker([acn.lat, acn.lng]).addTo(map);
marker.bindPopup("<a href='<c:url value="/acn/id/" />" + acn.id +"'>"+acn.accessionName+"</a>"); marker.bindPopup("<a href='<c:url value="/a/" />" + acn.uuid +"'>"+acn.accessionName+"</a>");
bounds.add([acn.lat, acn.lng]); bounds.add([acn.lat, acn.lng]);
} }
}); });
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<c:if test="${accession ne null}"> <c:if test="${accession ne null}">
<c:if test="${accession.doi eq null}"> <c:if test="${accession.doi eq null}">
<c:url value="/acn/id/${accession.id}" /> <c:url value="/a/${accession.uuid}" />
</c:if> </c:if>
<c:if test="${accession.doi ne null}"> <c:if test="${accession.doi ne null}">
<c:url value="/${accession.doi}" /> <c:url value="/${accession.doi}" />
......
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