Commit 47f4ef38 authored by Matija Obreza's avatar Matija Obreza

UUID and HISTORIC included in Excel download file

parent 4b2a725e
......@@ -29,12 +29,14 @@ import javax.persistence.EntityManager;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.poi.common.usermodel.Hyperlink;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.xssf.streaming.SXSSFSheet;
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
import org.apache.poi.xssf.usermodel.XSSFHyperlink;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.genesys2.server.model.genesys.AccessionAlias;
import org.genesys2.server.model.genesys.AccessionBreeding;
......@@ -260,6 +262,16 @@ public class DownloadServiceImpl implements DownloadService {
// row.createCell(32).setCellValue(exch.getAccNumbDonor());
}
if (accession.getUuid() != null) {
XSSFHyperlink hypr=(XSSFHyperlink) sheet.getWorkbook().getCreationHelper().createHyperlink(Hyperlink.LINK_URL);
hypr.setAddress("http://purl.org/germplasm/id/" + accession.getUuid());
Cell cell = createCell(row, 37, accession.getUuid().toString());
cell.setHyperlink(hypr);
}
if (accession.getHistoric()) {
createCell(row, 38, accession.getHistoric());
}
if (remarks != null && remarks.size() > 0) {
String r = "";
for (AccessionRemark remark : remarks) {
......@@ -272,7 +284,7 @@ public class DownloadServiceImpl implements DownloadService {
}
}
createCell(row, 37, r);
createCell(row, 39, r);
}
}
......@@ -299,7 +311,7 @@ public class DownloadServiceImpl implements DownloadService {
c.setCellValue(value);
return c;
}
private String addName(String otherNames, String name, String usedBy) {
if (StringUtils.isBlank(name)) {
return otherNames;
......
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