Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Genesys PGR
Genesys Backend
Commits
47f4ef38
Commit
47f4ef38
authored
Apr 17, 2015
by
Matija Obreza
Browse files
UUID and HISTORIC included in Excel download file
parent
4b2a725e
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/genesys2/server/service/impl/DownloadServiceImpl.java
View file @
47f4ef38
...
...
@@ -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
,
3
7
,
r
);
createCell
(
row
,
3
9
,
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
;
...
...
src/main/resources/template/download/MCPD.xlsx
View file @
47f4ef38
No preview for this file type
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment