Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,5 @@ TRIAL_START_DELAY=15s
TRAIT_START_DELAY=20s
OBSERVATION_START_DELAY=25s
OBSERVATION_UNIT_START_DELAY=30s

DATA_TABLE_MAX_SIZE=200
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ private void setDbIds(BrAPIObservationUnit ou) {
ou.programDbId(Utilities.getExternalReference(ou.getExternalReferences(), Utilities.generateReferenceSource(referenceSource, ExternalReferenceSource.PROGRAMS))
.orElseThrow(() -> new IllegalStateException("No BI external reference found"))
.getReferenceID());
// TODO: Remove this as part of [BI-3006]
if (ou.getAdditionalInfo().has(BrAPIAdditionalInfoFields.GERMPLASM_UUID)) {
ou.setGermplasmDbId(ou.getAdditionalInfo()
.get(BrAPIAdditionalInfoFields.GERMPLASM_UUID)
Expand Down
143 changes: 127 additions & 16 deletions src/main/java/org/breedinginsight/brapi/v2/dao/BrAPIGermplasmDAO.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ public List<BrAPIObservationUnit> getObservationUnits(Program program,
.orElse(true);

//adding filter for germplasmDbId because we can't easily search that in the stored data object
// TODO: Add search on accessionNumber once it's been added to prod server and brapi client [BI-2978]
// TODO: Add search on germplasmDbId directly in search request [BI-3006]
return matches && germplasmId.map(id -> id.equals(ou.getAdditionalInfo().get(BrAPIAdditionalInfoFields.GERMPLASM_UUID).getAsString())).orElse(true);
}).collect(Collectors.toList());
}
Expand Down Expand Up @@ -382,7 +382,7 @@ private void processObservationUnits(Program program, List<BrAPIObservationUnit>

HashMap<String, BrAPIGermplasm> germplasmByDbId = new HashMap<>();
if( withGID ){
// TODO: Optimize this to use germplasm information directly in BrAPIObservationUnit by adding accession num/GID there via the prodserver/client [BI-2978]
// TODO: Optimize this to use germplasm information directly in BrAPIObservationUnit by searching on ou.germplasmDbIds in a GermplasmSearchRequest [BI-3006]
this.germplasmService.getGermplasm(program.getId()).forEach((germplasm -> germplasmByDbId.put(germplasm.getGermplasmDbId(), germplasm)));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public List<BrAPIPedigreeNode> getPedigree(

PedigreeQueryParams pedigreeRequest = new PedigreeQueryParams();

// TODO: Issue with BrAPI server programDbId filtering, think germplasm are linked to program through observation
// TODO: Issue with BrAPI server programDbId filtering, think germplasm are linked to program through observation [BI-
// units and doesn't work if don't have any loaded
// use external refs instead for now
//pedigreeSearchRequest.programDbIds(List.of(program.getBrapiProgram().getProgramDbId()));
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -237,3 +237,5 @@ startup:
trait: ${TRAIT_START_DELAY:2s}
observation: ${OBSERVATION_START_DELAY:3s}
observation_unit: ${OBSERVATION_UNIT_START_DELAY:3s}
data-table:
max-size: ${DATA_TABLE_MAX_SIZE:200}
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ public void getGermplasmListExport() {
when(programDAO.getProgramBrAPI(any())).thenReturn(brapiProgram);
when(brAPIDAOUtil.get(any(Function.class),
any(GermplasmQueryParams.class))).thenReturn(germplasm);
when(brAPIDAOUtil.getBrAPIProgramDbId(any())).thenReturn(brapiProgramDbId);

//Create germplasm cache of stub data
Method setupMethod = BrAPIGermplasmDAO.class.getDeclaredMethod("setup");
Expand Down
Loading