use of org.molgenis.dataexplorer.negotiator.config.NegotiatorConfig in project molgenis by molgenis.
the class NegotiatorController method exportToNegotiator.
@PostMapping("/export")
@ResponseBody
public String exportToNegotiator(@RequestBody NegotiatorRequest request) {
LOG.info("Sending Negotiator request");
NegotiatorEntityConfig entityConfig = getNegotiatorEntityConfig(request.getEntityId());
NegotiatorConfig config = entityConfig.getNegotiatorConfig();
String expression = config.getString(ENABLED_EXPRESSION);
List<Collection> nonDisabledCollectionEntities = getCollectionEntities(request).stream().filter(entity -> expression == null || evaluateExpressionOnEntity(expression, entity)).map(entity -> getEntityCollection(entityConfig, entity)).collect(toList());
HttpEntity<NegotiatorQuery> queryHttpEntity = getNegotiatorQueryHttpEntity(request, config, nonDisabledCollectionEntities);
return postQueryToNegotiator(config, queryHttpEntity);
}
Aggregations