Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,14 @@ public HttpResponse<BrAPIPedigreeListResponse> pedigreeGet(@PathVariable("progra
try {
List<BrAPIPedigreeNode> pedigree = pedigreeDAO.getPedigree(
program.get(),
Optional.ofNullable(includeParents),
Optional.ofNullable(includeSiblings),
Optional.ofNullable(includeProgeny),
Optional.ofNullable(includeFullTree),
Optional.ofNullable(pedigreeDepth),
Optional.ofNullable(progenyDepth),
Optional.ofNullable(germplasmName));
includeParents,
includeSiblings,
includeProgeny,
includeFullTree,
pedigreeDepth,
progenyDepth,
germplasmName,
accessionNumber);

return HttpResponse.ok(
new BrAPIPedigreeListResponse()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,14 @@ public BrAPIPedigreeDAO(ProgramDAO programDAO, BrAPIDAOUtil brAPIDAOUtil,
*/
public List<BrAPIPedigreeNode> getPedigree(
Program program,
Optional<Boolean> includeParents,
Optional<Boolean> includeSiblings,
Optional<Boolean> includeProgeny,
Optional<Boolean> includeFullTree,
Optional<Integer> pedigreeDepth,
Optional<Integer> progenyDepth,
Optional<String> germplasmName
Boolean includeParents,
Boolean includeSiblings,
Boolean includeProgeny,
Boolean includeFullTree,
Integer pedigreeDepth,
Integer progenyDepth,
String germplasmName,
String accessionNumber
) throws ApiException {

PedigreeQueryParams pedigreeRequest = new PedigreeQueryParams();
Expand All @@ -94,13 +95,14 @@ public List<BrAPIPedigreeNode> getPedigree(
pedigreeRequest.externalReferenceId(extRefId);
pedigreeRequest.externalReferenceSource(extRefSrc);

includeParents.ifPresent(pedigreeRequest::includeParents);
includeSiblings.ifPresent(pedigreeRequest::includeSiblings);
includeProgeny.ifPresent(pedigreeRequest::includeProgeny);
includeFullTree.ifPresent(pedigreeRequest::includeFullTree);
pedigreeDepth.ifPresent(pedigreeRequest::pedigreeDepth);
progenyDepth.ifPresent(pedigreeRequest::progenyDepth);
germplasmName.ifPresent(pedigreeRequest::germplasmName);
if (includeParents != null) pedigreeRequest.includeParents(includeParents);
if (includeSiblings != null) pedigreeRequest.includeSiblings(includeSiblings);
if (includeProgeny != null) pedigreeRequest.includeProgeny(includeProgeny);
if (includeFullTree != null) pedigreeRequest.includeFullTree(includeFullTree);
if (pedigreeDepth != null) pedigreeRequest.pedigreeDepth(pedigreeDepth);
if (progenyDepth != null) pedigreeRequest.progenyDepth(progenyDepth);
if (germplasmName != null) pedigreeRequest.germplasmName(germplasmName);
if (accessionNumber != null) pedigreeRequest.accessionNumber(accessionNumber);
// TODO: other parameters

// TODO: write utility to do paging instead of hardcoding
Expand Down