本文整理匯總了Java中org.geoserver.web.GeoServerApplication類的典型用法代碼示例。如果您正苦於以下問題:Java GeoServerApplication類的具體用法?Java GeoServerApplication怎麽用?Java GeoServerApplication使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
GeoServerApplication類屬於org.geoserver.web包,在下文中一共展示了GeoServerApplication類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: init
import org.geoserver.web.GeoServerApplication; //導入依賴的package包/類
@Override
protected void init() {
// JD: override some resource settings to allow for custom i18n lookups
getResourceSettings().setResourceStreamLocator(new GeoServerResourceStreamLocator());
getResourceSettings().addStringResourceLoader(new GeoServerStringResourceLoader());
getResourceSettings().addStringResourceLoader(new ComponentStringResourceLoader());
getResourceSettings().addStringResourceLoader(
new ClassStringResourceLoader(this.getClass()));
getResourceSettings().setPropertiesFactory(new PropertiesFactory(this) {
@Override
public Properties load(Class clazz, String path) {
if (clazz == WicketTestApplication.class && path.startsWith(wtapath)) {
String newPath = path.replace(wtapath, gsapath);
return super.load(GeoServerApplication.class, newPath);
}
return super.load(clazz, path);
}
});
}
示例2: onSave
import org.geoserver.web.GeoServerApplication; //導入依賴的package包/類
/**
* Validates Elasticsearch attributes configuration and stores the
* Elasticsearch layer configuration into feature type metadata as
* {@link ElasticLayerConfiguration#KEY} <br>
* Validation include the follow rules <li>One attribute must be a GEOMETRY.
*
* @see {@link ElasticLayerConfiguration}
* @see {@link FeatureTypeInfo#getMetadata}
*/
protected void onSave(AjaxRequestTarget target) {
try {
ResourceInfo ri = (ResourceInfo) getDefaultModel().getObject();
ElasticLayerConfiguration layerConfig = fillElasticAttributes(ri);
Boolean geomSet = false;
// Validate configuration
for (ElasticAttribute att : layerConfig.getAttributes()) {
if (Geometry.class.isAssignableFrom(att.getType()) && att.isUse()) {
geomSet = true;
}
}
if (!geomSet) {
error(new ParamResourceModel("geomEmptyFailure", ElasticConfigurationPage.this)
.getString());
}
Catalog catalog = ((GeoServerApplication) this.getPage().getApplication()).getCatalog();
FeatureTypeInfo typeInfo;
DataStoreInfo dsInfo = catalog.getStore(ri.getStore().getId(), DataStoreInfo.class);
ElasticDataStore ds = (ElasticDataStore) dsInfo.getDataStore(null);
CatalogBuilder builder = new CatalogBuilder(catalog);
builder.setStore(dsInfo);
typeInfo = builder.buildFeatureType(ds.getFeatureSource(ri.getQualifiedName()));
typeInfo.setName(ri.getName());
typeInfo.getMetadata().put(ElasticLayerConfiguration.KEY, layerConfig);
LayerInfo layerInfo = builder.buildLayer(typeInfo);
layerInfo.setName(ri.getName());
done(target, layerInfo, layerConfig);
} catch (Exception e) {
LOGGER.log(Level.SEVERE, e.getMessage(), e);
error(new ParamResourceModel("creationFailure", this, e).getString());
}
}
示例3: Harvester
import org.geoserver.web.GeoServerApplication; //導入依賴的package包/類
/**
*
*/
public Harvester() {
catalog = GeoServerApplication.get().getCatalog();
}