當前位置: 首頁>>代碼示例>>Java>>正文


Java GeoServerApplication類代碼示例

本文整理匯總了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);
        }
    });
}
 
開發者ID:geosolutions-it,項目名稱:soil_sealing,代碼行數:21,代碼來源:WicketTestApplication.java

示例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());
    }
}
 
開發者ID:ngageoint,項目名稱:elasticgeo,代碼行數:44,代碼來源:ElasticConfigurationPage.java

示例3: Harvester

import org.geoserver.web.GeoServerApplication; //導入依賴的package包/類
/**
 * 
 */
public Harvester() {
	catalog = GeoServerApplication.get().getCatalog();
}
 
開發者ID:geops,項目名稱:geoserver-documentor,代碼行數:7,代碼來源:Harvester.java


注:本文中的org.geoserver.web.GeoServerApplication類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。