Examples of ICatalog


Examples of org.locationtech.udig.catalog.ICatalog

         * @param arg0 the input data
         * @return Object[]
         */
        public Object[] getElements( Object arg0 ) {
            // add the service to the catalog
            ICatalog catalog = CatalogPlugin.getDefault().getLocalCatalog();
            ArrayList<IResolve> neededCatalogMembers = null;
            try {
                List< ? extends IResolve> allCatalogMembers = catalog.members(null);
                // for jgrass locations add the service
                neededCatalogMembers = new ArrayList<IResolve>();
                for( IResolve catalogMember : allCatalogMembers ) {
                    if (catalogMember.canResolve(DataStore.class)) {
                        neededCatalogMembers.add(catalogMember);
View Full Code Here

Examples of org.locationtech.udig.catalog.ICatalog

    @Ignore
    @Test
    public void testNormal() throws Exception {
        Object context = getContext();
       
        ICatalog catalog = CatalogPlugin.getDefault().getLocalCatalog();
       
        List members = catalog.members(new DummyMonitor());
        if (!members.isEmpty()) {
            //clear the catalog
            for (Iterator itr = members.iterator(); itr.hasNext();) {
                IService service = (IService)itr.next();
                catalog.remove(service);
            }
        }
        members = catalog.members(new DummyMonitor());
        assertTrue(members.isEmpty());

        runMapImport(context);
       
        IMap map = ApplicationGIS.getActiveMap();
View Full Code Here

Examples of org.locationtech.udig.catalog.ICatalog

    @Ignore
    @Test
    public void testMultiResource() throws Exception {
        Object context = DummyMultiResourceService.url;
       
        ICatalog catalog = CatalogPlugin.getDefault().getLocalCatalog();
       
        List members = catalog.members(new DummyMonitor());
        if (!members.isEmpty()) {
            //clear the catalog
            for (Iterator itr = members.iterator(); itr.hasNext();) {
                IService service = (IService)itr.next();
                catalog.remove(service);
            }
        }
        members = catalog.members(new DummyMonitor());
        assertTrue(members.isEmpty());
       

        final WorkflowWizard workflowWizard = mapImport.getDialog().getWorkflowWizard();
    workflowWizard.getWorkflow()
View Full Code Here

Examples of org.locationtech.udig.catalog.ICatalog

          if (result != null) {
            for (ShapefileDataStore ds : allDatastores) {
              CoordinateReferenceSystem crs = ds.getSchema().getCoordinateReferenceSystem();
              if (!CRS.equalsIgnoreMetadata(result, crs))
                ds.forceSchemaCRS(result);
              ICatalog catalog = CatalogPlugin.getDefault()
                  .getLocalCatalog();
              List<IResolve> members = catalog
                  .members(new NullProgressMonitor());
              for (IResolve resolve : members) {
                ShapefileDataStore store = resolve.resolve(
                    ShapefileDataStore.class,
                    new NullProgressMonitor());
                if (store != null) {
                  if (ds.getSchema().getTypeName().equals(
                      store.getSchema().getTypeName())) {
                    ShpServiceExtension fac = new ShpServiceExtension();
                    Map<String, Serializable> params = fac
                        .createParams(resolve
                            .getIdentifier());
                    IService replacement = fac
                        .createService(resolve
                            .getIdentifier(),
                            params);
                    catalog.replace(
                        resolve.getID(),
                        replacement);
                  }
                }
              }
View Full Code Here

Examples of org.locationtech.udig.catalog.ICatalog

        for( Resource r : resources ) {
            File file=new File(r.getURI().toFileString());
            deleteFile(file);
        }
       
        ICatalog localCatalog = CatalogPlugin.getDefault().getLocalCatalog();
        List< ? extends IResolve> services = localCatalog.members(null);
        for( IResolve resolve : services ) {
            localCatalog.remove((IService) resolve);
        }
       
       
    }
View Full Code Here

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

Examples of org.locationtech.udig.catalog.ICatalog

    }
  }

  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

Examples of org.locationtech.udig.catalog.ICatalog

     * @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

Examples of org.locationtech.udig.catalog.ICatalog

        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

Examples of org.locationtech.udig.catalog.ICatalog

* @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
TOP
Copyright © 2018 www.massapi.com. 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.