use of io.arlas.server.core.model.Inspire in project ARLAS-server by gisaia.
the class CollectionInjector method load.
public void load(long sleepAfter) throws ArlasException {
try {
getDataInjector(POSTGIS_SINK).loadDataSet();
} catch (UnknownHostException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
throw e;
}
CollectionReferenceParameters params = new CollectionReferenceParameters();
params.indexName = AbstractDataInjector.DATA_SINK_NAME;
params.idPath = AbstractDataInjector.DATASET_ID_PATH;
params.geometryPath = AbstractDataInjector.WKT_GEOMETRIES ? AbstractDataInjector.DATASET_WKT_GEOMETRY_PATH : AbstractDataInjector.DATASET_GEOMETRY_PATH;
params.centroidPath = AbstractDataInjector.DATASET_CENTROID_PATH;
params.timestampPath = AbstractDataInjector.DATASET_TIMESTAMP_PATH;
params.excludeFields = AbstractDataInjector.DATASET_EXCLUDE_FIELDS;
params.excludeWfsFields = AbstractDataInjector.DATASET_EXCLUDE_WFS_FIELDS;
params.rasterTileURL = AbstractDataInjector.DATASET_TILE_URL;
params.rasterTileWidth = 256;
params.rasterTileHeight = 256;
params.inspire = new Inspire();
params.inspire.lineage = AbstractDataInjector.DATASET_INSPIRE_LINEAGE;
params.inspire.topicCategories = Arrays.asList(AbstractDataInjector.DATASET_INSPIRE_TOPIC_CATEGORY);
params.dublinCoreElementName = new DublinCoreElementName();
params.dublinCoreElementName.title = AbstractDataInjector.DATASET_DUBLIN_CORE_TITLE;
params.dublinCoreElementName.description = AbstractDataInjector.DATASET_DUBLIN_CORE_DESCRIPTION;
params.dublinCoreElementName.language = AbstractDataInjector.DATASET_DUBLIN_CORE_LANGUAGE;
// PUT new collection
given().contentType("application/json").body(params).when().put(getUrlPath()).then().statusCode(200);
Filter filter = new Filter();
filter.f = Arrays.asList(new MultiValueFilter<>(new Expression("params.job", OperatorEnum.eq, AbstractDataInjector.jobs[0])));
params.filter = filter;
given().contentType("application/json").body(params).when().put(arlasPath + "collections/" + COLLECTION_NAME_ACTOR).then().statusCode(200);
try {
Thread.sleep(sleepAfter);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
Aggregations