/** Reattaches a serialized {@link MapInfo} to the catalog */ public void attach(MapInfo mapInfo) { // hmmm... mapInfo has a list of layers inside? Not names? for (LayerInfo layer : mapInfo.getLayers()) { attach(layer); } }
/** Reattaches a serialized {@link LayerInfo} to the catalog */ public void attach(LayerInfo layerInfo) { attach(layerInfo.getResource()); }
/** Reattaches a serialized {@link LayerGroupInfo} to the catalog */ public void attach(LayerGroupInfo groupInfo) { if (groupInfo.getRootLayer() != null) { attach(groupInfo.getRootLayer()); } if (groupInfo.getRootLayerStyle() != null) { attach(groupInfo.getRootLayerStyle()); } for (PublishedInfo p : groupInfo.getLayers()) { if (p instanceof LayerInfo) { attach((LayerInfo) p); } else { attach((LayerGroupInfo) p); } } for (StyleInfo style : groupInfo.getStyles()) { if (style != null) attach(style); } }
public Object getObject() { if (resourceInfo.getCatalog() == null) new CatalogBuilder(GeoServerApplication.get().getCatalog()).attach(resourceInfo); return resourceInfo; }
public Object getObject() { if(resourceInfo.getCatalog() == null) new CatalogBuilder(GeoServerApplication.get().getCatalog()).attach(resourceInfo); return resourceInfo; }
public static NamespaceInfo localizeNamespace(final NamespaceInfo info, final Catalog catalog) { if (info==null || catalog==null) throw new NullArgumentException("Arguments may never be null"); final NamespaceInfo localObject=catalog.getNamespaceByURI(info.getURI()); if (localObject !=null){ return localObject; } final CatalogBuilder builder = new CatalogBuilder(catalog); builder.attach(info); return info; }
public static NamespaceInfo localizeNamespace(final NamespaceInfo info, final Catalog catalog) { if (info==null || catalog==null) throw new NullArgumentException("Arguments may never be null"); final NamespaceInfo localObject=catalog.getNamespaceByURI(info.getURI()); if (localObject !=null){ return localObject; } final CatalogBuilder builder = new CatalogBuilder(catalog); builder.attach(info); return info; }
public static MapInfo localizeMapInfo(final MapInfo info, final Catalog catalog) throws IllegalAccessException, InvocationTargetException { if (info==null || catalog==null) throw new NullArgumentException("Arguments may never be null"); final MapInfo localObject=catalog.getMapByName(info.getName()); if (localObject !=null){ return localObject; // else object is modified: continue with localization } info.getLayers().addAll(localizeLayers(info.getLayers(), catalog)); final CatalogBuilder builder = new CatalogBuilder(catalog); builder.attach(info); return info; }
@Override public LayerInfo getObject() { if (layerInfo.getResource().getCatalog() == null) new CatalogBuilder(GeoServerApplication.get().getCatalog()).attach(layerInfo); return layerInfo; }
public Object getObject() { if(layerInfo.getResource().getCatalog() == null) new CatalogBuilder(GeoServerApplication.get().getCatalog()).attach(layerInfo); return layerInfo; }
public static MapInfo localizeMapInfo(final MapInfo info, final Catalog catalog) throws IllegalAccessException, InvocationTargetException { if (info==null || catalog==null) throw new NullArgumentException("Arguments may never be null"); final MapInfo localObject=catalog.getMapByName(info.getName()); if (localObject !=null){ return localObject; // else object is modified: continue with localization } info.getLayers().addAll(localizeLayers(info.getLayers(), catalog)); final CatalogBuilder builder = new CatalogBuilder(catalog); builder.attach(info); return info; }
public Object getObject() { if (summary.getLayer() != null) { ResourceInfo resource = summary.getLayer().getResource(); if (resource != null) { if (resource.getCatalog() == null) { (new CatalogBuilder(GeoServerApplication.get().getCatalog())).attach(summary.getLayer()); } } } return summary; }
public static WMSStoreInfo localizeWMSStore(final WMSStoreInfo info, final Catalog catalog) throws IllegalAccessException, InvocationTargetException { if (info==null || catalog==null) throw new NullArgumentException("Arguments may never be null"); final WMSStoreInfo localObject=catalog.getStoreByName(info.getWorkspace(), info.getName(), WMSStoreInfo.class); final CatalogBuilder builder = new CatalogBuilder(catalog); if (localObject !=null){ return localObject; } final WMSStoreInfo createdObject = catalog.getFactory().createWebMapServer(); // let's using the created object (see getGridCoverageReader) BeanUtils.copyProperties(createdObject, info); createdObject.setWorkspace(localizeWorkspace(info.getWorkspace(), catalog)); builder.attach(createdObject); return createdObject; }
public static DataStoreInfo localizeDataStore(final DataStoreInfo info, final Catalog catalog) throws IllegalAccessException, InvocationTargetException { if (info==null || catalog==null) throw new NullArgumentException("Arguments may never be null"); final DataStoreInfo localObject=catalog.getDataStoreByName(info.getWorkspace(),info.getName()); final CatalogBuilder builder = new CatalogBuilder(catalog); if (localObject !=null){ return localObject; } final DataStoreInfo createdObject = catalog.getFactory().createDataStore(); // let's using the created object (see getGridCoverageReader) BeanUtils.copyProperties(createdObject, info); createdObject.setWorkspace(localizeWorkspace(info.getWorkspace(), catalog)); builder.attach(createdObject); return createdObject; }
public static DataStoreInfo localizeDataStore(final DataStoreInfo info, final Catalog catalog) throws IllegalAccessException, InvocationTargetException { if (info==null || catalog==null) throw new NullArgumentException("Arguments may never be null"); final DataStoreInfo localObject=catalog.getDataStoreByName(info.getWorkspace(),info.getName()); final CatalogBuilder builder = new CatalogBuilder(catalog); if (localObject !=null){ return localObject; } final DataStoreInfo createdObject = catalog.getFactory().createDataStore(); // let's using the created object (see getGridCoverageReader) BeanUtils.copyProperties(createdObject, info); createdObject.setWorkspace(localizeWorkspace(info.getWorkspace(), catalog)); builder.attach(createdObject); return createdObject; }
public static CoverageStoreInfo localizeCoverageStore(final CoverageStoreInfo info, final Catalog catalog) throws IllegalAccessException, InvocationTargetException { if (info==null || catalog==null) throw new NullArgumentException("Arguments may never be null"); final CoverageStoreInfo localObject=catalog.getCoverageStoreByName(info.getWorkspace(),info.getName()); final CatalogBuilder builder = new CatalogBuilder(catalog); if (localObject !=null){ return localObject; } final CoverageStoreInfo createdObject = catalog.getFactory() .createCoverageStore(); // let's using the created object (see getGridCoverageReader) BeanUtils.copyProperties(createdObject, info); createdObject.setWorkspace(localizeWorkspace(info.getWorkspace(), catalog)); builder.attach(createdObject); return createdObject; }
public static CoverageStoreInfo localizeCoverageStore(final CoverageStoreInfo info, final Catalog catalog) throws IllegalAccessException, InvocationTargetException { if (info==null || catalog==null) throw new NullArgumentException("Arguments may never be null"); final CoverageStoreInfo localObject=catalog.getCoverageStoreByName(info.getWorkspace(),info.getName()); final CatalogBuilder builder = new CatalogBuilder(catalog); if (localObject !=null){ return localObject; } final CoverageStoreInfo createdObject = catalog.getFactory() .createCoverageStore(); // let's using the created object (see getGridCoverageReader) BeanUtils.copyProperties(createdObject, info); createdObject.setWorkspace(localizeWorkspace(info.getWorkspace(), catalog)); builder.attach(createdObject); return createdObject; }
public static WMSStoreInfo localizeWMSStore(final WMSStoreInfo info, final Catalog catalog) throws IllegalAccessException, InvocationTargetException { if (info==null || catalog==null) throw new NullArgumentException("Arguments may never be null"); final WMSStoreInfo localObject=catalog.getStoreByName(info.getWorkspace(), info.getName(), WMSStoreInfo.class); final CatalogBuilder builder = new CatalogBuilder(catalog); if (localObject !=null){ return localObject; } final WMSStoreInfo createdObject = catalog.getFactory().createWebMapServer(); // let's using the created object (see getGridCoverageReader) BeanUtils.copyProperties(createdObject, info); createdObject.setWorkspace(localizeWorkspace(info.getWorkspace(), catalog)); builder.attach(createdObject); return createdObject; }
public static CoverageInfo localizeCoverage(final CoverageInfo info, final Catalog catalog) throws IllegalAccessException, InvocationTargetException { if (info==null || catalog==null) throw new NullArgumentException("Arguments may never be null"); final CoverageInfo localObject=catalog.getCoverageByName(info.getNamespace(),info.getName()); if (localObject !=null){ return localObject; } final CoverageInfo createdObject = catalog.getFactory().createCoverage(); // let's using the created object (see getGridCoverageReader) BeanUtils.copyProperties(createdObject, info); createdObject.setNamespace(localizeNamespace(info.getNamespace(), catalog)); createdObject.setStore(localizeCoverageStore(info.getStore(), catalog)); final CatalogBuilder builder = new CatalogBuilder(catalog); builder.attach(createdObject); return createdObject; }
public static CoverageInfo localizeCoverage(final CoverageInfo info, final Catalog catalog) throws IllegalAccessException, InvocationTargetException { if (info==null || catalog==null) throw new NullArgumentException("Arguments may never be null"); final CoverageInfo localObject=catalog.getCoverageByName(info.getNamespace(),info.getName()); if (localObject !=null){ return localObject; } final CoverageInfo createdObject = catalog.getFactory().createCoverage(); // let's using the created object (see getGridCoverageReader) BeanUtils.copyProperties(createdObject, info); createdObject.setNamespace(localizeNamespace(info.getNamespace(), catalog)); createdObject.setStore(localizeCoverageStore(info.getStore(), catalog)); final CatalogBuilder builder = new CatalogBuilder(catalog); builder.attach(createdObject); return createdObject; }