/** * Convenience method for pages to get access to the catalog. */ protected Catalog getCatalog() { return getGeoServerApplication().getCatalog(); }
/** * Provides catalog access for the provider (cannot be stored as a field, this class is going to * be serialized) * * @return */ protected Catalog getCatalog() { return getApplication().getCatalog(); }
/** * Provides catalog access for the provider (cannot be stored as a field, this class is going to * be serialized) */ protected Catalog getCatalog() { return getApplication().getCatalog(); }
@Override public Object getPropertyValue(WorkspaceInfo item) { Catalog catalog = GeoServerApplication.get().getCatalog(); WorkspaceInfo defaultWorkspace = catalog.getDefaultWorkspace(); return Boolean.valueOf(defaultWorkspace != null && defaultWorkspace.equals(item)); } };
@Override protected List<WorkspaceInfo> load() { Catalog catalog = GeoServerApplication.get().getCatalog(); List<WorkspaceInfo> workspaces = new ArrayList<WorkspaceInfo>(catalog.getWorkspaces()); Collections.sort(workspaces, new WorkspaceComparator()); return workspaces; }
@Override public void setObject(LayerInfo object) { // workaround for dbconfig, by "dettaching" we force hibernate to reload the object // fully initialized with no lazy lists or proxies this.layerInfo = GeoServerApplication.get().getCatalog().detach((LayerInfo) object); }
@Override protected NamespaceInfo load() { return GeoServerApplication.get().getCatalog().getNamespace(id); } }
@Override protected LayerGroupInfo load() { if (id != null) { return GeoServerApplication.get().getCatalog().getLayerGroup(id); } else { return layerGroup; } } }
public PublishedInfo getLayer() { if (layerGroupId != null) { return GeoServerApplication.get().getCatalog().getLayerGroup(layerGroupId); } else if (layerId != null) { return GeoServerApplication.get().getCatalog().getLayer(layerId); } else { return null; } }
@Override protected LayerInfo load() { return GeoServerApplication.get().getCatalog().getLayer(id); } }
public WorkspaceInfo getObject() { if (workspace == null) { workspace = id != null ? GeoServerApplication.get().getCatalog().getWorkspace(id) : null; } return workspace; }
@Override protected Object load() { return GeoServerApplication.get().getCatalog().getLayer(id); } }
@Override public Object getObject() { String nsUri = (String) super.getObject(); NamespaceInfo namespaceInfo = GeoServerApplication.get().getCatalog().getNamespaceByURI(nsUri); return namespaceInfo; }
@Override protected Object load() { if (group) { return new PreviewLayer(GeoServerApplication.get().getCatalog().getLayerGroup(id)); } else { return new PreviewLayer(GeoServerApplication.get().getCatalog().getLayer(id)); } } }
@Override protected StyleInfo load() { StyleInfo style = GeoServerApplication.get().getCatalog().getStyle(id); // Make sure the legend object isn't null if (null == style.getLegend()) { style.setLegend(GeoServerApplication.get().getCatalog().getFactory().createLegend()); } return style; }
public Object getObject() { if (resourceInfo.getCatalog() == null) new CatalogBuilder(GeoServerApplication.get().getCatalog()).attach(resourceInfo); return resourceInfo; }
@Override protected void onClick(AjaxRequestTarget target, Form form) { GeoServerApplication app = (GeoServerApplication) getApplication(); FeatureTypeInfo ft = (FeatureTypeInfo) getResourceInfo(); app.getCatalog().getResourcePool().clear(ft); app.getCatalog().getResourcePool().clear(ft.getStore()); target.add(attributePanel); } };
protected boolean onSubmit(AjaxRequestTarget target, Component contents) { // cascade delete the whole selection Catalog catalog = GeoServerApplication.get().getCatalog(); CascadeDeleteVisitor visitor = new CascadeDeleteVisitor(catalog); for (CatalogInfo ci : selection) { ci.accept(visitor); } // the deletion will have changed what we see in the page // so better clear out the selection catalogObjects.clearSelection(); return true; }
public Object getObject() { if(resourceInfo.getCatalog() == null) new CatalogBuilder(GeoServerApplication.get().getCatalog()).attach(resourceInfo); return resourceInfo; }
@Override protected void onSubmit(AjaxRequestTarget target, Form<?> form) { LOGGER.log(Level.FINE, "Computing bounds from native CRS"); ResourceInfo resource = (ResourceInfo) BasicResourceConfig.this.getDefaultModelObject(); CatalogBuilder cb = new CatalogBuilder(GeoServerApplication.get().getCatalog()); ReferencedEnvelope nativeBBox = cb.getBoundsFromCRS(resource); if (nativeBBox != null) { nativeBoundsPanel.setModelObject(nativeBBox); } target.add(nativeBoundsPanel); }