Search in sources :

Example 6 with JoinQuery

use of org.obiba.mica.spi.search.support.JoinQuery in project mica2 by obiba.

the class SpecificStudyReportGenerator method report.

public void report(String rqlQuery, OutputStream outputStream) throws IOException {
    JoinQuery joinQuery = searcher.makeJoinQuery(rqlQuery);
    List<String> studyIds = joinQueryExecutor.query(QueryType.STUDY, joinQuery).getStudyResultDto().getExtension(MicaSearch.StudyResultDto.result).getSummariesList().stream().map(Mica.StudySummaryDto::getId).collect(toList());
    Translator translator = JsonTranslator.buildSafeTranslator(() -> micaConfigService.getTranslations(joinQuery.getLocale(), false));
    report(translator, studyIds, joinQuery.getLocale(), outputStream);
}
Also used : JoinQuery(org.obiba.mica.spi.search.support.JoinQuery) JsonTranslator(org.obiba.core.translator.JsonTranslator) Translator(org.obiba.core.translator.Translator) LocalizedString(org.obiba.mica.core.domain.LocalizedString) Mica(org.obiba.mica.web.model.Mica)

Aggregations

JoinQuery (org.obiba.mica.spi.search.support.JoinQuery)6 Mica (org.obiba.mica.web.model.Mica)3 MicaSearch (org.obiba.mica.web.model.MicaSearch)3 StreamingOutput (javax.ws.rs.core.StreamingOutput)2 JoinQueryReportGenerator (org.obiba.mica.search.reports.JoinQueryReportGenerator)2 ReportGenerator (org.obiba.mica.search.reports.ReportGenerator)2 Lists (com.google.common.collect.Lists)1 Maps (com.google.common.collect.Maps)1 IOException (java.io.IOException)1 Collection (java.util.Collection)1 Collections (java.util.Collections)1 List (java.util.List)1 Map (java.util.Map)1 Matcher (java.util.regex.Matcher)1 Pattern (java.util.regex.Pattern)1 Collectors (java.util.stream.Collectors)1 Nullable (javax.annotation.Nullable)1 Inject (javax.inject.Inject)1 NotNull (javax.validation.constraints.NotNull)1 JsonTranslator (org.obiba.core.translator.JsonTranslator)1