Package org.locationtech.udig.catalog

Examples of org.locationtech.udig.catalog.ICatalog


        }
    }

    private void getCoverageResources() throws IOException {
        itemsMap.clear();
        ICatalog catalog = CatalogPlugin.getDefault().getLocalCatalog();
        List< ? extends IResolve> allCatalogMembers = catalog.members(null);
        for( IResolve catalogMember : allCatalogMembers ) {
            if (catalogMember instanceof IGeoResource && catalogMember.canResolve(GridCoverage.class)) {
                itemsMap.put(catalogMember.getTitle(), (IGeoResource) catalogMember);
            }
View Full Code Here


    }
  }

  private IGeoResource obtainResource(
      Pair<URL, Map<String, Serializable>> params) throws IOException {
    ICatalog localCatalog = CatalogPlugin.getDefault().getLocalCatalog();
    List<IGeoResource> resource = localCatalog.find(IGeoResource.class, params.getLeft(), new NullProgressMonitor());
   
    if( resource.isEmpty() ){
      List<IService> services = CatalogPlugin.getDefault().getServiceFactory().createService(params.getRight());
      if ( !services.isEmpty() ){
        for (IService service : services) {
View Full Code Here

     * @param url URL used to start searching in the catalog
     * @param type The returned service must resolve to this type
     * @return URL of resulting service
     */
    static final private URL service( URL url, Class<?> type ) {
        ICatalog local = CatalogPlugin.getDefault().getLocalCatalog();
        List<IResolve> services = local.find(url, ProgressManager.instance().get());
        for( IResolve service : services ) {
            if (service.canResolve(type)) {
                return service.getIdentifier();
            }
        }
        IServiceFactory serviceFactory = CatalogPlugin.getDefault().getServiceFactory();
        List<IService> candidates = serviceFactory.createService(url);
        try {
            for( Iterator<IService> i=candidates.iterator(); i.hasNext();){
                IService service = i.next();
                if (service.canResolve(type)) {
                    IService registered = local.add(service);
                    i.remove(); // don't clean this one up
                    return registered.getIdentifier();
                }
            }
        }
View Full Code Here

        map.getLayersInternal().add(layer);
    }

    private static IGeoResource findResource( URL url, String name ) throws IOException {
        URL appended = new URL(url.toString() + "#" + name); //$NON-NLS-1$
        ICatalog localCatalog = CatalogPlugin.getDefault().getLocalCatalog();
        List<IResolve> results = localCatalog.find(appended, null);
        if (results.isEmpty()) {
            List<IService> services = CatalogPlugin.getDefault().getServiceFactory().createService(url);
            for( IService service : services ) {
                localCatalog.add(service);
                for( IGeoResource resource : service.resources(null) ) {
                    if( resource.getIdentifier().getRef().equals(name) ){
                        return resource;
                    }
                }
View Full Code Here

* @since 1.1.0
*/
public class AddToCatalog implements IStartup {

    public void earlyStartup() {
        ICatalog localCatalog = CatalogPlugin.getDefault().getLocalCatalog();
        ID serviceUrl = new ID(MapGraphicService.SERVICE_URL);
        IService service = localCatalog.getById(IService.class, serviceUrl, ProgressManager.instance().get());
        if( service !=null )
            return;
       
        service=new MapGraphicService();
        localCatalog.add(service);
    }
View Full Code Here

            }
        }
        if (!mapsetMembers.contains(resource)) {
            mapsetMembers.add(resource);

            ICatalog catalog = parent(null);
            if (catalog instanceof CatalogImpl) {
                IResolveDelta delta = new ResolveDelta(resource, Kind.ADDED);
                IResolveChangeEvent event = new ResolveChangeEvent(this, Type.POST_CHANGE, delta);
                ((CatalogImpl) catalog).fire(event);
            }
View Full Code Here

    /**
       * Creates a MemoryDatastore service from an array of features.  Does not add to catalog.
       * @param deleteService
       */
      public static IService getService(SimpleFeature[] features, boolean deleteService) throws IOException {
        ICatalog catalog = CatalogPlugin.getDefault().getLocalCatalog();
        List<IResolve> services = catalog.find(MemoryServiceExtensionImpl.URL, new NullProgressMonitor());
        IService service=null;
        if( services.isEmpty() ){
          service = createService(catalog);
        }else{
          IResolve resolve=services.get(0);
View Full Code Here

      final SimpleFeatureType featureType) {

    assert featureType != null;

    // new resourece is required because new layer was selected
    final ICatalog catalog = AppGISAdapter.getCatalog();
    assert catalog != null;

    IGeoResource resource = catalog.createTemporaryResource(featureType);

    return resource;
  }
View Full Code Here

            }
        }
        ID id = shapefile.getID();
    IServiceFactory serviceFactory = CatalogPlugin.getDefault().getServiceFactory();
    IService newService = serviceFactory.createService(parametersMap).iterator().next();
    ICatalog localCatalog = CatalogPlugin.getDefault().getLocalCatalog();
    localCatalog.replace(id, newService );
        return null;
    }
View Full Code Here

        }
        return ds;
    }

    private void fire( ResolveChangeEvent event ) {
        ICatalog catalog = parent(new NullProgressMonitor());
        if (catalog instanceof CatalogImpl) {
            ((CatalogImpl) catalog).fire(event);
        }
    }
View Full Code Here

TOP

Related Classes of org.locationtech.udig.catalog.ICatalog

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.