Commit c619f269 authored by Matija Obreza's avatar Matija Obreza

SGSV import allowing for multiple deposits

parent 2b17d953
Genesys and Svalbard Global Seed Vault
======================================
September 2016: Documentation commit {buildNumber}
:revnumber: {projectVersion}
:doctype: book
:toc: left
:toclevels: 5
:icons: font
:numbered:
:source-highlighter: pygments
:pygments-css: class
:pygments-linenums-mode: table
Genesys periodically synchronizes data from the http://www.nordgen.org/sgsv/[Svalbard Global Seed Vault] (**SGSV**) to link Genesys accessions with accessions backed up at Svalbard.
== SGSV database
SGSV database is a publicly accessible resource available at http://www.nordgen.org/sgsv/.
=== Seed samples database
The information on samples stored in SGSV is provided in `CSV` format at accessible at http://www.nordgen.org/sgsv/download.php?file=/scope/sgsv/files/sgsv_templates.tab[Seed samples download] link.
[cols="1,4", options="header"]
.SGSV Seed samples CSV format
|===
|Column header|Description
|sgsv_id|ID of the seed sample record in SGSV database. Unique.
|institute_code|FAO WIEWS Institute code (`INSTCODE`)
|deposit_box_number|Deposit box number. Numeric.
|collection_name|Collection name
|accession_number|Accession Number (`ACCENUMB`)
|full_scientific_name|Full scientific name of the accession
|country_of_collection_or_source|MCPD `ORIGCTY`
|number_of_seeds|Number of seeds. Count.
|regeneration_month_and_year|Information about regeneration date of sample.
|other_accession_designations|MCPD `OTHERNUMB`
|provider_institute_code|...
|accession_url|URL to detailed accession information (`ACCEURL`)
|country_code|
|country_name|
|continent_name|
|seeds|
|genus|MCPD `GENUS`
|species_epithet|MCPD `SPECIES`
|species|
|taxon_name|
|date_of_deposit|Date of deposit
|date_of_dataset|Date of dataset
|sgsv_template_id|
|box_id|Box ID reference.
|sgsv_taxon_id|Reference to SGSV taxonomy table
|taxon_authority|MCPD `SPAUTHOR`
|infraspesific_epithet|MCPD `SUBTAXA`
|vernacular_name|Crop name (MCPD `CROPNAME`)
|itis_tsn|
|sgsv_genus_id|Reference to SGSV taxonomy table
|accession_name|Accession name (`ACCENAME`)
|===
== Linking SGSV records with Genesys
Genesys attempts to link records based on the institute code (`INSTCODE`) and
accession number (`ACCENUMB`). Genebanks **must** use their assigned `INSTCODE` and the correct `ACCENUMB` from their datasets when they publish data on SGSV and on Genesys in order to appropriately link the records.
== Multiple deposits
Genesys gracefully handles multiple deposits of seed to SGSV for a single accession. Information on all seed deposits is rendered on the accession details page.
package org.genesys2.server.model.elastic; package org.genesys2.server.model.elastic;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection;
import java.util.Date; import java.util.Date;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
...@@ -16,10 +17,11 @@ import org.genesys2.server.model.genesys.AccessionData; ...@@ -16,10 +17,11 @@ import org.genesys2.server.model.genesys.AccessionData;
import org.genesys2.server.model.genesys.AccessionExchange; import org.genesys2.server.model.genesys.AccessionExchange;
import org.genesys2.server.model.genesys.AccessionGeo; import org.genesys2.server.model.genesys.AccessionGeo;
import org.genesys2.server.model.genesys.AccessionRemark; import org.genesys2.server.model.genesys.AccessionRemark;
import org.genesys2.server.model.genesys.SvalbardData; import org.genesys2.server.model.genesys.SvalbardDeposit;
import org.genesys2.server.model.impl.AccessionList; import org.genesys2.server.model.impl.AccessionList;
import org.genesys2.server.model.impl.Crop; import org.genesys2.server.model.impl.Crop;
import org.genesys2.server.model.impl.Organization; import org.genesys2.server.model.impl.Organization;
import org.genesys2.server.service.IndexAliasConstants;
import org.genesys2.util.MCPDUtil; import org.genesys2.util.MCPDUtil;
import org.springframework.data.annotation.Id; import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.Version; import org.springframework.data.annotation.Version;
...@@ -31,7 +33,7 @@ import org.springframework.data.elasticsearch.annotations.FieldType; ...@@ -31,7 +33,7 @@ import org.springframework.data.elasticsearch.annotations.FieldType;
/** /**
* <code>AccessionDetails</code> is used in Elasticsearch mapping * <code>AccessionDetails</code> is used in Elasticsearch mapping
*/ */
@Document(indexName = "genesys", type = "mcpd", refreshInterval = "60s") @Document(indexName = IndexAliasConstants.INDEX_PASSPORT, type = IndexAliasConstants.PASSPORT_TYPE, refreshInterval = "60s")
public class AccessionDetails { public class AccessionDetails {
private static final Logger LOG = Logger.getLogger(AccessionDetails.class); private static final Logger LOG = Logger.getLogger(AccessionDetails.class);
...@@ -66,7 +68,8 @@ public class AccessionDetails { ...@@ -66,7 +68,8 @@ public class AccessionDetails {
private Taxonomy taxonomy; private Taxonomy taxonomy;
@Field(type = FieldType.Nested) @Field(type = FieldType.Nested)
private ArrayList<Alias> aliases; private ArrayList<Alias> aliases;
private Svalbard sgsv; @Field(type = FieldType.Nested)
private ArrayList<Svalbard> sgsvDeposits;
private boolean inSgsv; private boolean inSgsv;
@Field(type = FieldType.Nested, store = false) @Field(type = FieldType.Nested, store = false)
private ArrayList<Remark> remarks; private ArrayList<Remark> remarks;
...@@ -120,6 +123,7 @@ public class AccessionDetails { ...@@ -120,6 +123,7 @@ public class AccessionDetails {
ad.sampStat = accession.getSampleStatus(); ad.sampStat = accession.getSampleStatus();
ad.storage = new ArrayList<Integer>(accession.getStoRage()); ad.storage = new ArrayList<Integer>(accession.getStoRage());
ad.lists = new HashSet<String>(); ad.lists = new HashSet<String>();
ad.inSgsv = accession.getInSvalbard() != null && accession.getInSvalbard() == true ? true : false;
for (AccessionList al : accession.getAccessionId().getLists()) { for (AccessionList al : accession.getAccessionId().getLists()) {
ad.lists.add(al.getUuid().toString()); ad.lists.add(al.getUuid().toString());
} }
...@@ -142,9 +146,11 @@ public class AccessionDetails { ...@@ -142,9 +146,11 @@ public class AccessionDetails {
} }
} }
public void svalbard(SvalbardData svalbardData) { public void sgsvDeposits(Collection<SvalbardDeposit> deposits) {
this.sgsv = Svalbard.from(svalbardData); if (deposits != null) {
this.inSgsv = this.sgsv != null; this.sgsvDeposits = new ArrayList<>();
deposits.stream().forEach(deposit -> this.sgsvDeposits.add(Svalbard.from(deposit)));
}
} }
public void remarks(List<AccessionRemark> listAccessionRemarks) { public void remarks(List<AccessionRemark> listAccessionRemarks) {
...@@ -338,12 +344,12 @@ public class AccessionDetails { ...@@ -338,12 +344,12 @@ public class AccessionDetails {
this.aliases = aliases; this.aliases = aliases;
} }
public Svalbard getSgsv() { public ArrayList<Svalbard> getSgsvDeposits() {
return sgsv; return sgsvDeposits;
} }
public void setSgsv(Svalbard sgsv) { public void setSgsvDeposits(ArrayList<Svalbard> sgsvDeposits) {
this.sgsv = sgsv; this.sgsvDeposits = sgsvDeposits;
} }
public ArrayList<Remark> getRemarks() { public ArrayList<Remark> getRemarks() {
......
package org.genesys2.server.model.elastic; package org.genesys2.server.model.elastic;
import org.genesys2.server.model.genesys.SvalbardData; import java.util.Date;
import org.genesys2.server.model.genesys.SvalbardDeposit;
import org.springframework.data.elasticsearch.annotations.Field; import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldIndex; import org.springframework.data.elasticsearch.annotations.FieldIndex;
import org.springframework.data.elasticsearch.annotations.FieldType; import org.springframework.data.elasticsearch.annotations.FieldType;
/**
* One SGSV deposit
*/
public class Svalbard { public class Svalbard {
private Float qty; private Float qty;
@Field(index = FieldIndex.not_analyzed, type = FieldType.String) @Field(index = FieldIndex.not_analyzed, type = FieldType.String)
private String boxNo; private String boxNo;
@Field(index = FieldIndex.not_analyzed, type = FieldType.String) @Field(index = FieldIndex.not_analyzed, type = FieldType.Date)
private String depositDate; private Date depositDate;
public static Svalbard from(SvalbardData svalbardData) { public static Svalbard from(SvalbardDeposit svalbardData) {
if (svalbardData == null) if (svalbardData == null)
return null; return null;
Svalbard s = new Svalbard(); Svalbard s = new Svalbard();
...@@ -39,11 +44,11 @@ public class Svalbard { ...@@ -39,11 +44,11 @@ public class Svalbard {
this.boxNo = boxNo; this.boxNo = boxNo;
} }
public String getDepositDate() { public Date getDepositDate() {
return depositDate; return depositDate;
} }
public void setDepositDate(String depositDate) { public void setDepositDate(Date depositDate) {
this.depositDate = depositDate; this.depositDate = depositDate;
} }
......
/*
* Copyright 2016 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.model.genesys;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.Index;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.genesys2.server.model.impl.FaoInstitute;
import org.springframework.data.annotation.CreatedDate;
/**
* This is a copy of the SGVS seed samples record. An accession may be deposited to SGSV several times.
*/
@Entity
@Table(name = "sgsvdeposit", indexes = { @Index(name = "IX_sgsvAID3", unique = false, columnList = "instId,genus,accenumb") })
public class SvalbardDeposit implements AccessionRelated, java.io.Serializable {
private static final long serialVersionUID = -5015395025122055617L;
@Id
@Column(name = "id")
// SGSV record ID. This is not auto-generated as we mirror SGSV data
private Long id;
@ManyToOne(optional = true, cascade = {}, fetch = FetchType.LAZY)
@JoinColumn(name = "providerId")
private FaoInstitute provider;
@ManyToOne(optional = false, cascade = {}, fetch = FetchType.LAZY)
@JoinColumn(name = "instId")
private FaoInstitute institute;
@Column(name = "accenumb", nullable = false, length = 50)
private String acceNumb;
@Column(length = 50)
private String genus;
// Genesys accession reference
@ManyToOne(optional = true, cascade = {}, fetch = FetchType.LAZY)
@JoinColumn(name = "acceId")
private AccessionId accession;
private Float quantity;
@Temporal(TemporalType.DATE)
private Date depositDate;
@Column(length = 20)
private String boxNo;
@Column(name = "regen", length = 50)
private String regenerationInformation;
@CreatedDate
@Column(name = "createdDate")
private Date createdDate;
public String getAcceNumb() {
return acceNumb;
}
@Override
public AccessionId getAccession() {
return accession;
}
public String getBoxNo() {
return boxNo;
}
public String getBoxNumber() {
return boxNo;
}
public Long getId() {
return id;
}
public Float getQuantity() {
return quantity;
}
public void setAcceNumb(String acceNumb) {
this.acceNumb = acceNumb;
}
public void setAccession(AccessionId accession) {
this.accession = accession;
}
public void setBoxNo(String boxNo) {
this.boxNo = boxNo;
}
public void setBoxNumber(String boxNo) {
this.boxNo = boxNo;
}
public void setId(Long id) {
this.id = id;
}
public void setQuantity(Float quantity) {
this.quantity = quantity;
}
public String getGenus() {
return genus;
}
public void setGenus(String genus) {
this.genus = genus;
}
public Date getCreatedDate() {
return createdDate;
}
protected void setCreatedDate(Date createdDate) {
this.createdDate = createdDate;
}
public FaoInstitute getProvider() {
return provider;
}
public void setProvider(FaoInstitute provider) {
this.provider = provider;
}
public FaoInstitute getInstitute() {
return institute;
}
public void setInstitute(FaoInstitute institute) {
this.institute = institute;
}
public Date getDepositDate() {
return depositDate;
}
public void setDepositDate(Date depositDate) {
this.depositDate = depositDate;
}
public String getRegenerationInformation() {
return regenerationInformation;
}
public void setRegenerationInformation(String regenerationInformation) {
this.regenerationInformation = regenerationInformation;
}
}
...@@ -88,7 +88,7 @@ public interface AccessionRepository extends JpaRepository<Accession, Long> { ...@@ -88,7 +88,7 @@ public interface AccessionRepository extends JpaRepository<Accession, Long> {
@Query("select a from Accession a where a.institute.code = ?1 and a.accessionName = ?2") @Query("select a from Accession a where a.institute.code = ?1 and a.accessionName = ?2")
Accession findByInstituteCodeAndAccessionName(String instCode, String accessionName); Accession findByInstituteCodeAndAccessionName(String instCode, String accessionName);
@Query("select a from Accession a where a.accessionName=?2 and (a.institute.code=?1 or a.institute.codeSGSV=?1) and a.taxonomy.genus=?3") @Query("select distinct a from Accession a where a.accessionName=?2 and (a.institute.code=?1 or a.institute.codeSGSV=?1) and a.taxonomy.genus=?3")
Accession findOneSGSV(String instCode, String acceNumb, String genus); Accession findOneSGSV(String instCode, String acceNumb, String genus);
@Query("select a from Accession a where a.institute.code=:instCode and a.accessionName=:acceNumb and a.taxonomy.genus=:genus") @Query("select a from Accession a where a.institute.code=:instCode and a.accessionName=:acceNumb and a.taxonomy.genus=:genus")
...@@ -100,10 +100,6 @@ public interface AccessionRepository extends JpaRepository<Accession, Long> { ...@@ -100,10 +100,6 @@ public interface AccessionRepository extends JpaRepository<Accession, Long> {
@Query("select a.id from Accession a where a.id in ( ?1 ) and a.historic = false and (a.availability is null or a.availability = true) and a.institute.allowMaterialRequests = true") @Query("select a.id from Accession a where a.id in ( ?1 ) and a.historic = false and (a.availability is null or a.availability = true) and a.institute.allowMaterialRequests = true")
Set<Long> filterAvailableForDistribution(Set<Long> accessionIds); Set<Long> filterAvailableForDistribution(Set<Long> accessionIds);
@Modifying
@Query("update Accession a set a.inSvalbard = true where a in ?1")
void setInSvalbard(List<Accession> matching);
@Query("select distinct a.institute from Accession a where a.id in ( ?1 )") @Query("select distinct a.institute from Accession a where a.id in ( ?1 )")
List<FaoInstitute> findDistinctInstitutesFor(Set<Long> accessionIds); List<FaoInstitute> findDistinctInstitutesFor(Set<Long> accessionIds);
...@@ -126,4 +122,8 @@ public interface AccessionRepository extends JpaRepository<Accession, Long> { ...@@ -126,4 +122,8 @@ public interface AccessionRepository extends JpaRepository<Accession, Long> {
Stream<Accession> streamAll(); Stream<Accession> streamAll();
public long countByHistoric(boolean historic); public long countByHistoric(boolean historic);
@Query(nativeQuery=true, value="update accession a inner join sgsvdeposit sd on sd.acceId=a.id set a.inSGSV=true where sd.id in (?1)")
@Modifying
public void setInSvalbard(List<Long> sgsvId);
} }
...@@ -20,18 +20,52 @@ import java.util.Collection; ...@@ -20,18 +20,52 @@ import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import org.genesys2.server.model.genesys.SvalbardData; import org.genesys2.server.model.genesys.AccessionId;
import org.genesys2.server.model.genesys.SvalbardDeposit;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query; import org.springframework.data.jpa.repository.Query;
public interface SvalbardRepository extends JpaRepository<SvalbardData, Long> { public interface SvalbardRepository extends JpaRepository<SvalbardDeposit, Long> {
List<SvalbardDeposit> findByAccession(AccessionId accession);
@Query("from SvalbardDeposit sd where sd.accession.id in (?1)")
List<SvalbardDeposit> findAllFor(Collection<Long> accessionIds);
@Query("delete from SvalbardDeposit sd where sd.id in (?1)")
@Modifying
void deleteById(Set<Long> collect);
/*
* Based on: select sd.id, sd.accenumb svacce,a.accenumb acce, sd.genus svgenus, t.genus, sd.instId svinst,
* a.instituteId inst from sgsvdeposit sv left join accession a on a.instituteId=sd.instId and
* a.accenumb=sd.accenumb inner join taxonomy2 t on t.id=a.taxonomyId2 and t.genus=sd.genus limit 10
*/
@Query(nativeQuery = true, value = "update sgsvdeposit sd inner join accession a on a.instituteId=sd.instId and a.accenumb=sd.accenumb inner join taxonomy2 t on t.id=a.taxonomyId2 and t.genus=sd.genus set sd.acceId=a.id where sd.id in (?1)")
@Modifying @Modifying
@Query("delete from SvalbardData sd where sd.id in ?1") int linkDirectly(List<Long> sgsvIds);
void deleteForAccessions(Set<Long> accessionIds);
@Query("from SvalbardData sd where sd.id in ?1") /*
List<SvalbardData> findAllFor(Collection<Long> accessionIds); * Based on:
*
* select sd.*, i.code, ii.code, a.accenumb, t.genus from sgsvdeposit sd inner join faoinstitute i on i.id=sd.instId
* inner join accession a on a.accenumb=sd.accenumb inner join faoinstitute ii on ii.codeSGSV=i.code inner join
* taxonomy2 t on t.id=a.taxonomyId2 and t.genus=sd.genus limit 10;
*/
@Query(nativeQuery = true, value = "update sgsvdeposit sd inner join faoinstitute i on i.id=sd.instId inner join accession a on a.accenumb=sd.accenumb inner join faoinstitute ii on ii.codeSGSV=i.code inner join taxonomy2 t on t.id=a.taxonomyId2 and t.genus=sd.genus set sd.acceId=a.id where sd.id in (?1)")
@Modifying
int linkInDirectly(List<Long> sgsvIds);
/*
* Link accessions to SGSV data by their alternate names.
*
* select sd.accenumb svnumb, a.acceNumb, aa.name alias, i.code svinst, aa.usedBy instcode, sd.genus svgenus,
* t.genus from sgsvdeposit sd inner join faoinstitute i on i.id=sd.instId inner join accessionalias aa on
* aa.name=sd.accenumb and (aa.usedBy=i.code or aa.usedBy=i.codeSGSV) inner join accession a on a.id=aa.accessionId
* inner join taxonomy2 t on t.id=a.taxonomyId2 and t.genus=sd.genus limit 100;
*/
@Query(nativeQuery = true, value = "update sgsvdeposit sd inner join faoinstitute i on i.id=sd.instId inner join accessionalias aa on aa.name=sd.accenumb and (aa.usedBy=i.code or aa.usedBy=i.codeSGSV) inner join accession a on a.id=aa.accessionId inner join taxonomy2 t on t.id=a.taxonomyId2 and t.genus=sd.genus set sd.acceId=a.id where sd.id in (?1)")
@Modifying
int linkByAlternativeName(List<Long> sgsvIds);
} }
...@@ -42,7 +42,7 @@ import org.genesys2.server.model.genesys.Method; ...@@ -42,7 +42,7 @@ import org.genesys2.server.model.genesys.Method;
import org.genesys2.server.model.genesys.PDCI; import org.genesys2.server.model.genesys.PDCI;
import org.genesys2.server.model.genesys.PDCIStatistics; import org.genesys2.server.model.genesys.PDCIStatistics;
import org.genesys2.server.model.genesys.PhenoStatistics; import org.genesys2.server.model.genesys.PhenoStatistics;
import org.genesys2.server.model.genesys.SvalbardData; import org.genesys2.server.model.genesys.SvalbardDeposit;
import org.genesys2.server.model.genesys.Taxonomy2; import org.genesys2.server.model.genesys.Taxonomy2;
import org.genesys2.server.model.impl.AccessionIdentifier3; import org.genesys2.server.model.impl.AccessionIdentifier3;
import org.genesys2.server.model.impl.Country; import org.genesys2.server.model.impl.Country;
...@@ -110,8 +110,6 @@ public interface GenesysService { ...@@ -110,8 +110,6 @@ public interface GenesysService {
Page<Accession> listAccessions(Collection<Long> accessionIds, Pageable pageable); Page<Accession> listAccessions(Collection<Long> accessionIds, Pageable pageable);
List<Accession> listAccessionsSGSV(List<? extends AccessionIdentifier3> accns);
Accession getAccession(AccessionIdentifier3 aid3) throws NonUniqueAccessionException; Accession getAccession(AccessionIdentifier3 aid3) throws NonUniqueAccessionException;
Accession getAccession(String instCode, String acceNumb, String genus) throws NonUniqueAccessionException; Accession getAccession(String instCode, String acceNumb, String genus) throws NonUniqueAccessionException;
...@@ -135,8 +133,6 @@ public interface GenesysService { ...@@ -135,8 +133,6 @@ public interface GenesysService {
List<Accession> saveAccessions(FaoInstitute institute, List<Accession> matching); List<Accession> saveAccessions(FaoInstitute institute, List<Accession> matching);
List<SvalbardData> saveSvalbards(List<SvalbardData> svalbards);
long countAvailableForDistribution(Set<Long> accessionIds); long countAvailableForDistribution(Set<Long> accessionIds);
Set<Long> filterAvailableForDistribution(Set<Long> accessionIds); Set<Long> filterAvailableForDistribution(Set<Long> accessionIds);
...@@ -147,7 +143,7 @@ public interface GenesysService { ...@@ -147,7 +143,7 @@ public interface GenesysService {
void updateAccessionCount(FaoInstitute institute); void updateAccessionCount(FaoInstitute institute);
SvalbardData getSvalbardData(AccessionId accession); List<SvalbardDeposit> getSvalbardData(AccessionId accession);
List<AccessionCollect> saveCollecting(List<AccessionCollect> all); List<AccessionCollect> saveCollecting(List<AccessionCollect> all);
...@@ -175,8 +171,6 @@ public interface GenesysService { ...@@ -175,8 +171,6 @@ public interface GenesysService {
List<AccessionHistoric> removeAccessions(FaoInstitute institute, List<Accession> toDelete); List<AccessionHistoric> removeAccessions(FaoInstitute institute, List<Accession> toDelete);
void setInSvalbard(List<Accession> matching);
void addAccessions(List<Accession> accessions); void addAccessions(List<Accession> accessions);
long countAll(); long countAll();
...@@ -239,7 +233,7 @@ public interface GenesysService { ...@@ -239,7 +233,7 @@ public interface GenesysService {
public List<AccessionAlias> names = null; public List<AccessionAlias> names = null;
public AccessionExchange exch = null; public AccessionExchange exch = null;
public List<AccessionRemark> remarks = null; public List<AccessionRemark> remarks = null;
public SvalbardData svalbard = null; public List<SvalbardDeposit> sgsvDeposits = null;
} }
List<AllStuff> loadAllStuff(Collection<Long> accessionIds); List<AllStuff> loadAllStuff(Collection<Long> accessionIds);
...@@ -266,5 +260,6 @@ public interface GenesysService { ...@@ -266,5 +260,6 @@ public interface GenesysService {
void regenerateAccessionSequentialNumber(); void regenerateAccessionSequentialNumber();
List<SvalbardDeposit> saveSvalbards(List<SvalbardDeposit> svalbards);
} }
...@@ -321,7 +321,9 @@ public class ElasticsearchSearchServiceImpl implements ElasticService, Initializ ...@@ -321,7 +321,9 @@ public class ElasticsearchSearchServiceImpl implements ElasticService, Initializ
} }
if (ids.isEmpty()) { if (ids.isEmpty()) {
LOG.info("Skipping empty updateAll."); if (LOG.isTraceEnabled()) {
LOG.trace("Skipping empty updateAll.");
}
return; return;
} }
......
...@@ -32,6 +32,7 @@ import java.util.List; ...@@ -32,6 +32,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.UUID; import java.util.UUID;
import java.util.stream.Collectors;
import java.util.zip.ZipEntry; import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream; import java.util.zip.ZipOutputStream;
...@@ -64,7 +65,7 @@ import org.genesys2.server.model.genesys.PDCI; ...@@ -64,7 +65,7 @@ import org.genesys2.server.model.genesys.PDCI;
import org.genesys2.server.model.genesys.PDCIStatistics; import org.genesys2.server.model.genesys.PDCIStatistics;
import org.genesys2.server.model.genesys.PhenoStatistics; import org.genesys2.server.model.genesys.PhenoStatistics;
import org.genesys2.server.model.genesys.SelfCopy; import org.genesys2.server.model.genesys.SelfCopy;
import org.genesys2.server.model.genesys.SvalbardData; import org.genesys2.server.model.genesys.SvalbardDeposit;
import org.genesys2.server.model.genesys.Taxonomy2; import org.genesys2.server.model.genesys.Taxonomy2;
import org.genesys2.server.model.genesys.TraitCode; import org.genesys2.server.model.genesys.TraitCode;
import org.genesys2.server.model.impl.AccessionIdentifier3; import org.genesys2.server.model.impl.AccessionIdentifier3;
...@@ -117,6 +118,8 @@ import org.springframework.jdbc.core.RowCallbackHandler; ...@@ -117,6 +118,8 @@ import org.springframework.jdbc.core.RowCallbackHandler;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.acls.domain.BasePermission; import org.springframework.security.acls.domain.BasePermission;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import com.opencsv.CSVWriter; import com.opencsv.CSVWriter;
...@@ -269,52 +272,6 @@ public class GenesysServiceImpl implements GenesysService, DatasetService { ...@@ -269,52 +272,6 @@ public class GenesysServiceImpl implements GenesysService, DatasetService {
return accessionRepository.findById(accessionIds, pageable); return accessionRepository.findById(accessionIds, pageable);
} }
@Override
public List<Accession> listAccessionsSGSV(List<? extends AccessionIdentifier3> accns) {