use of org.folio.repository.RecordKey in project mod-kb-ebsco-java by folio-org.
the class EholdingsResourcesImpl method loadRelatedEntities.
private CompletableFuture<ResourceResult> loadRelatedEntities(ResourceResult result, RMAPITemplateContext context) {
CustomerResources resource = result.getTitle().getCustomerResourcesList().get(0);
RecordKey recordKey = RecordKey.builder().recordId(getResourceId(resource)).recordType(RecordType.RESOURCE).build();
return CompletableFuture.allOf(relatedEntitiesLoader.loadAccessType(result, recordKey, context), relatedEntitiesLoader.loadTags(result, recordKey, context)).thenApply(aVoid -> result);
}
use of org.folio.repository.RecordKey in project mod-kb-ebsco-java by folio-org.
the class EholdingsPackagesImpl method getEholdingsPackagesByPackageId.
@Override
@HandleValidationErrors
public void getEholdingsPackagesByPackageId(String packageId, String include, Map<String, String> okapiHeaders, Handler<AsyncResult<Response>> asyncResultHandler, Context vertxContext) {
PackageId parsedPackageId = parsePackageId(packageId);
List<String> includedObjects = parseByComma(include);
templateFactory.createTemplate(okapiHeaders, asyncResultHandler).requestAction((context -> context.getPackagesService().retrievePackage(parsedPackageId, includedObjects).thenCompose(packageResult -> {
RecordKey recordKey = RecordKey.builder().recordId(packageIdToString(parsedPackageId)).recordType(RecordType.PACKAGE).build();
return CompletableFuture.allOf(relatedEntitiesLoader.loadAccessType(packageResult, recordKey, context), relatedEntitiesLoader.loadTags(packageResult, recordKey, context)).thenApply(aVoid -> packageResult);
}))).executeWithResult(Package.class);
}
Aggregations