use of org.polymap.service.geoserver.GeoServerServlet in project polymap4-core by Polymap4.
the class GeoServerLoader method loadGeoServer.
protected void loadGeoServer(GeoServerServlet service) {
IMap map = service.map;
log.info("Loading GeoServer...");
GeoServerInfoImpl gsInfo = new GeoServerInfoImpl(geoserver);
gsInfo.setTitle("GeoServer powered by mapzone.io");
gsInfo.setId(simpleName(map.id()) + "-gs");
// XXX alias is added by ArenaConfig when running in mapzone (see comment there)
String proxyBaseUrl = GeoServerPlugin.instance().baseUrl.map(s -> !s.contains(service.alias) ? s + service.alias : s).get();
gsInfo.setProxyBaseUrl(proxyBaseUrl);
log.info("Proxy base URL: " + gsInfo.getProxyBaseUrl());
gsInfo.setVerbose(true);
gsInfo.setVerboseExceptions(true);
geoserver.setGlobal(gsInfo);
log.info("GeoServer: " + gsInfo);
createWMSInfo(map);
createWFSInfo(map);
}
use of org.polymap.service.geoserver.GeoServerServlet in project polymap4-core by Polymap4.
the class P4ImageStoreInfo method canHandle.
/**
* Returns a newly created {@link P4DataStoreInfo}, or null if the layer is not
* connected to a {@link FeatureStore}.
*
* @throws Exception
*/
public static P4ImageStoreInfo canHandle(Catalog catalog, ILayer layer) throws Exception {
GeoServerServlet server = GeoServerServlet.instance.get();
Optional<Pipeline> pipeline = server.getOrCreatePipeline(layer, ImageProducer.class);
if (pipeline.isPresent()) {
if (!(pipeline.get().getLast().processor() instanceof WmsRenderProcessor)) {
return null;
}
return new P4ImageStoreInfo(catalog, layer, pipeline.get());
} else {
return null;
}
}
use of org.polymap.service.geoserver.GeoServerServlet in project polymap4-core by Polymap4.
the class P4DataStoreInfo method canHandle.
/**
* Returns a newly created {@link P4DataStoreInfo}, or null if the layer is not
* connected to a {@link FeatureStore}.
*
* @throws Exception
*/
public static P4DataStoreInfo canHandle(Catalog catalog, ILayer layer) throws Exception {
GeoServerServlet server = GeoServerServlet.instance.get();
Optional<Pipeline> pipeline = server.getOrCreatePipeline(layer, FeaturesProducer.class);
if (pipeline.isPresent()) {
PipelineFeatureSource fs = new PipelineDataStore(pipeline.get()).getFeatureSource();
// check with P4FeatureTypeInfo
Name name = new NameImpl(GeoServerUtils.defaultNsInfo.get().getName(), GeoServerUtils.simpleName(layer.label.get()));
Params params = new Params();
FeatureRenameProcessor.NAME.rawput(params, name);
PipelineProcessorSite procSite = new PipelineProcessorSite(params);
ProcessorDescriptor proc = new ProcessorDescriptor(FeatureRenameProcessor.class, params);
proc.processor().init(procSite);
fs.pipeline().addFirst(proc);
return new P4DataStoreInfo(catalog, layer, fs);
} else {
return null;
}
}
Aggregations