Examples of IService


Examples of org.locationtech.udig.catalog.IService

        }
    }
   
    @Override
    public GeoTiffServiceImpl service(IProgressMonitor monitor) throws IOException {
      IService serv = super.service(monitor);
      return (serv != null && serv instanceof GeoTiffServiceImpl)
          ? (GeoTiffServiceImpl) serv : null;
    }
View Full Code Here

Examples of org.locationtech.udig.catalog.IService

            // get the layers of the map
            List<Layer> layers = ((MapImpl) projectElement).getLayersInternal();

            for( ILayer layer : layers ) {

                IService service = null;
                try {
                    service = layer.getGeoResource().service(null);
                    if (service.canResolve(ServiceMover.class)) {
                        ServiceMover tmp = service.resolve(ServiceMover.class, null);
                        String msg = tmp.move(projectDataFolder);
                        if (msg != null) {

                            MessageDialog.openError(PlatformUI.getWorkbench().getDisplay()
                                    .getActiveShell(), "Comsolidation Error", msg);
View Full Code Here

Examples of org.locationtech.udig.catalog.IService

        URL location = new File(url).toURI().toURL();

        JGrassServiceExtension creator = new JGrassServiceExtension();

        Map<String, Serializable> params = creator.createParams(location);
        IService service = creator.createService(location, params);
        service.getInfo(monitor); // load it

        jgrassServices = new ArrayList<IService>();
        jgrassServices.add(service);

        /*
 
View Full Code Here

Examples of org.locationtech.udig.catalog.IService

 
  @Override
  void makeAssertion(String assertionDescription, ICatalog catalog) throws Exception {
    super.makeAssertion(assertionDescription, catalog);
   
    IService service;
    try {
      service = (IService) catalog.members(null).get(0);
      assertTrue("All services must be WMSServices", service instanceof WMSServiceImpl); //$NON-NLS-1$
    }
    catch (IOException e) {
View Full Code Here

Examples of org.locationtech.udig.catalog.IService

  void makeAssertionMulti(String assertionDescription, ICatalog catalog) {
    super.makeAssertionMulti(assertionDescription, catalog);
   
    try {
      for (Iterator<IResolve> itr = catalog.members(null).iterator(); itr.hasNext();) {
        IService s = (IService)itr.next();
        assertTrue("All services must be WMSServices", s instanceof WMSServiceImpl); //$NON-NLS-1$
      }
    }
    catch (IOException e) {
      e.printStackTrace();
View Full Code Here

Examples of org.locationtech.udig.catalog.IService

     * @return
     * @throws IOException
     */
    @SuppressWarnings("unchecked")
    public Layer createLayer(IGeoResource resource) throws IOException {
        IService service = resource.service(ProgressManager.instance().get());

        if (service == null) {
            return null;
        }
        // check that the service is part of catalog... If not add
        ICatalog local = CatalogPlugin.getDefault().getLocalCatalog();
        if (local.getById(IService.class, service.getID(), new NullProgressMonitor()) == null) {
            local.add(resource.service(null));
        }

        LayerImpl layer = (LayerImpl) ProjectFactory.eINSTANCE.createLayer();

View Full Code Here

Examples of org.locationtech.udig.catalog.IService

        }));
       
        // add the diff shapefile as a udig resource
        URL url = tmp.toURI().toURL();
        IRepository local = CatalogPlugin.getDefault().getLocal();
        IService service = local.acquire( url, null );
       
        // List<IService> services = CatalogPlugin.getDefault().getServiceFactory().createService(tmp.toURL());
        // IService service = services.get(0);
        // CatalogPlugin.getDefault().getLocalCatalog().add(service);
        List< ? extends IGeoResource> resources = service.resources(null);
       
        IGeoResource resource = resources.get(0);
       
        Map map = ((Map)layers[0].getMap());
        LayerFactory factory = map.getLayerFactory();
View Full Code Here

Examples of org.locationtech.udig.catalog.IService

        assertNotNull("sample data found", target );
        Map<String, Serializable> params = serviceExtension.createParams( target );
       
        assertNotNull("canProcess", params );
       
        IService service = serviceExtension.createService( null, params );
        assertNotNull("connected", service );
       
        assertTrue("Datastore available", service.canResolve( DataStore.class));
       
        DataAccess dataStore = service.resolve( DataStore.class, null );
        assertNotNull("DataStore connected", dataStore );
       
        Name typeName = (Name) dataStore.getNames().get(0);;
        FeatureSource featureSource = dataStore.getFeatureSource( typeName );
       
        assertEquals( 4, featureSource.getCount( Query.ALL ) );
       
        //IServiceInfo info = service.getInfo(new NullProgressMonitor());
        IServiceInfo info = getInfo(service, new NullProgressMonitor());
        assertNotNull("Title available", info.getTitle());
        assertNotNull("Description available", info.getDescription());
       
        List<? extends IGeoResource> m = service.resources(new NullProgressMonitor());
        for(IGeoResource resource: m) {
            ID id = resource.getID();
            assertNotNull(id);
            //IGeoResourceInfo grinfo = resource.getInfo(new NullProgressMonitor());
            IGeoResourceInfo grinfo = getInfo(resource, new NullProgressMonitor());
View Full Code Here

Examples of org.locationtech.udig.catalog.IService

        // ensure the service was created
        assertNotNull(services);
        assertEquals(1, services.size());

        // ensure the right type of service was created
        IService service = services.get(0);
        assertNotNull(service);

        ICatalog catalog = CatalogPlugin.getDefault().getLocalCatalog();
        catalog.add(service); // we can now find this service!
View Full Code Here

Examples of org.locationtech.udig.catalog.IService

  protected void createResources(List<IGeoResource> resources,
      IProgressMonitor monitor) throws IOException {
   
    @SuppressWarnings("nls")
        URL url = FileLocator.resolve(FileLocator.find(Activator.getDefault().getBundle(), new Path("data/face.shp"), Collections.emptyMap()));
    IService r = CatalogPlugin.getDefault().getLocalCatalog().acquire(url, monitor);
    resources.add(r.resources(monitor).get(0));
  }
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.