Skip to content

Commit

Permalink
second iteration on #12
Browse files Browse the repository at this point in the history
  • Loading branch information
lfoppiano committed Jan 30, 2019
1 parent d865e37 commit 9d6089c
Showing 1 changed file with 45 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,51 @@ private void getByQuery(
if (isNotBlank(atitle) && isNotBlank(firstAuthor)) {
storage.retrieveByArticleMetadataAsync(atitle, firstAuthor, postValidate, matchingDocument -> {
if (matchingDocument.isException()) {

if (isNotBlank(jtitle) && isNotBlank(volume) && isNotBlank(firstPage)) {
storage.retrieveByJournalMetadataAsync(jtitle, volume, firstPage, matchingDocumentJournal -> {
if (matchingDocumentJournal.isException()) {
if (isNotBlank(biblio)) {
storage.retrieveByBiblioAsync(biblio, matchingDocument2 -> {
if (matchingDocument2.isException()) {
asyncResponse.resume(matchingDocument2.getException());
} else {
asyncResponse.resume(matchingDocument2.getFinalJsonObject());
}
});
return;
} else {
asyncResponse.resume(matchingDocument.getException());
}
} else {
asyncResponse.resume(matchingDocumentJournal.getFinalJsonObject());
}
});
return;
}

if (isNotBlank(jtitle) && isNotBlank(volume) && isNotBlank(firstPage) && isNotBlank(firstAuthor)) {
storage.retrieveByJournalMetadataAsync(jtitle, volume, firstPage, firstAuthor, matchingDocumentJournal -> {
if (matchingDocumentJournal.isException()) {
if (isNotBlank(biblio)) {
storage.retrieveByBiblioAsync(biblio, matchingDocument2 -> {
if (matchingDocument2.isException()) {
asyncResponse.resume(matchingDocument2.getException());
} else {
asyncResponse.resume(matchingDocument2.getFinalJsonObject());
}
});
return;
} else {
asyncResponse.resume(matchingDocument.getException());
}
} else {
asyncResponse.resume(matchingDocumentJournal.getFinalJsonObject());
}
});
return;
}

if (isNotBlank(biblio)) {
storage.retrieveByBiblioAsync(biblio, matchingDocument2 -> {
if (matchingDocument2.isException()) {
Expand Down

0 comments on commit 9d6089c

Please sign in to comment.