Search in sources :

Example 1 with ExportErrorQuery

use of net.geoprism.registry.etl.export.ExportErrorQuery in project geoprism-registry by terraframe.

the class DHIS2SynchronizationManager method handleExportErrors.

private void handleExportErrors() {
    ExportErrorQuery query = new ExportErrorQuery(new QueryFactory());
    query.WHERE(query.getHistory().EQ(history));
    Boolean hasErrors = query.getCount() > 0;
    if (hasErrors) {
        ExportJobHasErrors ex = new ExportJobHasErrors();
        throw ex;
    }
}
Also used : QueryFactory(com.runwaysdk.query.QueryFactory) ExportErrorQuery(net.geoprism.registry.etl.export.ExportErrorQuery) ExportJobHasErrors(net.geoprism.registry.etl.ExportJobHasErrors)

Example 2 with ExportErrorQuery

use of net.geoprism.registry.etl.export.ExportErrorQuery in project geoprism-registry by terraframe.

the class ETLService method getExportErrors.

@Request(RequestType.SESSION)
public JsonObject getExportErrors(String sessionId, String historyId, int pageSize, int pageNumber) {
    JsonArray ja = new JsonArray();
    ExportErrorQuery query = new ExportErrorQuery(new QueryFactory());
    query.WHERE(query.getHistory().EQ(historyId));
    query.ORDER_BY(query.getRowIndex(), SortOrder.ASC);
    query.restrictRows(pageSize, pageNumber);
    try (OIterator<? extends ExportError> it = query.getIterator()) {
        List<ExportError> results = new LinkedList<>(it.getAll());
        return new Page<ExportError>(query.getCount(), query.getPageNumber(), query.getPageSize(), results).toJSON();
    }
}
Also used : JsonArray(com.google.gson.JsonArray) QueryFactory(com.runwaysdk.query.QueryFactory) ExportErrorQuery(net.geoprism.registry.etl.export.ExportErrorQuery) ExportError(net.geoprism.registry.etl.export.ExportError) LinkedList(java.util.LinkedList) Request(com.runwaysdk.session.Request)

Example 3 with ExportErrorQuery

use of net.geoprism.registry.etl.export.ExportErrorQuery in project geoprism-registry by terraframe.

the class FhirExportSynchronizationManager method handleExportErrors.

private void handleExportErrors() {
    ExportErrorQuery query = new ExportErrorQuery(new QueryFactory());
    query.WHERE(query.getHistory().EQ(history));
    Boolean hasErrors = query.getCount() > 0;
    if (hasErrors) {
        ExportJobHasErrors ex = new ExportJobHasErrors();
        throw ex;
    }
}
Also used : QueryFactory(com.runwaysdk.query.QueryFactory) ExportErrorQuery(net.geoprism.registry.etl.export.ExportErrorQuery) ExportJobHasErrors(net.geoprism.registry.etl.ExportJobHasErrors)

Example 4 with ExportErrorQuery

use of net.geoprism.registry.etl.export.ExportErrorQuery in project geoprism-registry by terraframe.

the class FhirImportSynchronizationManager method handleExportErrors.

private void handleExportErrors() {
    ExportErrorQuery query = new ExportErrorQuery(new QueryFactory());
    query.WHERE(query.getHistory().EQ(history));
    Boolean hasErrors = query.getCount() > 0;
    if (hasErrors) {
        ExportJobHasErrors ex = new ExportJobHasErrors();
        throw ex;
    }
}
Also used : QueryFactory(com.runwaysdk.query.QueryFactory) ExportErrorQuery(net.geoprism.registry.etl.export.ExportErrorQuery) ExportJobHasErrors(net.geoprism.registry.etl.ExportJobHasErrors)

Aggregations

QueryFactory (com.runwaysdk.query.QueryFactory)4 ExportErrorQuery (net.geoprism.registry.etl.export.ExportErrorQuery)4 ExportJobHasErrors (net.geoprism.registry.etl.ExportJobHasErrors)3 JsonArray (com.google.gson.JsonArray)1 Request (com.runwaysdk.session.Request)1 LinkedList (java.util.LinkedList)1 ExportError (net.geoprism.registry.etl.export.ExportError)1