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

Merge branch '249-data-download' into 'master'

Resolve "Data download"

Closes #249

See merge request genesys-pgr/genesys-server!146
parents 0f77a4d3 fb366683
......@@ -243,7 +243,9 @@ public class GenesysLowlevelRepositoryCustomImpl implements GenesysLowlevelRepos
@Override
public PreparedStatement createPreparedStatement(final Connection con) throws SQLException {
final PreparedStatement stmt = con.prepareStatement(directQuery
.getQuery("a.id, acce.uuid, a.instCode, a.acceNumb, t.genus, t.species, t.taxonName, a.orgCty, a.acqSrc, a.acqDate, a.mlsStat, a.available, a.historic, a.storage, a.sampStat, a.duplSite, acce.createdBy, acce.createdDate, acce.lastModifiedBy, acce.lastModifiedDate, a.doi"));
.getQuery("a.id, acce.uuid, a.instCode, a.acceNumb, a.doi, t.genus, t.species, t.spAuthor, t.subtaxa, t.subtAuthor, t.taxonName, a.orgCty, " +
"a.acqSrc, a.acqDate, a.mlsStat, a.available, a.historic, a.storage, a.sampStat, a.duplSite, " +
"acce.createdBy, acce.createdDate, acce.lastModifiedBy, acce.lastModifiedDate"));
final ArgumentPreparedStatementSetter apss = new ArgumentPreparedStatementSetter(directQuery.getParameters());
apss.setValues(stmt);
......
......@@ -1328,8 +1328,8 @@ public class GenesysServiceImpl implements GenesysService, DatasetService {
private void writeAccessionsCore(final AppliedFilters filters, ZipOutputStream zos) throws IOException {
@SuppressWarnings("resource")
final CSVWriter csv = new CSVWriter(new BufferedWriter(new OutputStreamWriter(zos)), ',', '"', '\\', "\n");
csv.writeNext(new String[] { "genesysId", "uuid", "instCode", "acceNumb", "genus", "species", "fullTaxa", "orgCty", "acqSrc", "acqDate", "mlsStat", "available", "historic",
"storage", "sampStat", "duplSite", "createdBy", "createdDate", "lastModifiedBy", "lastModifiedDate", "doi" });
csv.writeNext(new String[] { "genesysId", "uuid", "instCode", "acceNumb", "doi", "genus", "species", "spAuthor", "subtaxa", "subtAuthor", "fullTaxa", "orgCty", "acqSrc", "acqDate", "mlsStat", "available", "historic",
"storage", "sampStat", "duplSite", "createdBy", "createdDate", "lastModifiedBy", "lastModifiedDate" });
final ResultSetHelper csvResultsetHelper = new CSVResultSetHelper();
......
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