Package org.locationtech.udig.catalog

Examples of org.locationtech.udig.catalog.IService.resolve()


                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


        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 );
       
View Full Code Here

    private boolean error = false;

    public void op( final Display display, final Object target, final IProgressMonitor monitor )
            throws Exception {
        final IService service = (IService) target;
        final DataStore ds = service.resolve(DataStore.class, monitor);
        if (!(ds instanceof ShapefileDataStore)) {
            try {
                ds.createSchema(null);
            } catch (UnsupportedOperationException e) {
                if (testing) {
View Full Code Here

            try {
                IGeoResource geoResource = layer.findGeoResource(FeatureSource.class);
                IService service = geoResource.service(ProgressManager.instance().get());
               
                if (service != null) {
                    DataStore ds = service.resolve(DataStore.class,
                            ProgressManager.instance().get());
                    if (ds == null){
                        return resource; // not a datastore give up!
                    }
                    String typeName = resource.getSchema().getTypeName();
View Full Code Here

        try {
            MemoryServiceExtensionImpl ext = new MemoryServiceExtensionImpl();
            URL id = new URL("http://localhost/scratch"); //$NON-NLS-1$
            params = ext.createParams(id);
            IService service = ext.createService(id, params);
            DataStore ds = service.resolve(DataStore.class, monitor);
            int i=0;
            String typename="New_Type_"; //$NON-NLS-1$
            List<String> typenames = Arrays.asList(ds.getTypeNames());
            while( typenames.contains(typename+i)){
                i++;
View Full Code Here

      IGeoResource resource = (IGeoResource) resolve;
        IService service;
        try {
            service = resource.service(new NullProgressMonitor());
        if (service.canResolve(ShapefileDataStore.class)) {
            return service.resolve(File.class, new NullProgressMonitor());
        }
        } catch (IOException e) {
            RasteringsPlugin.log("Error obtaining shapefile file", e); //$NON-NLS-1$
            return null;
        }
View Full Code Here

    public IGeoResource createResource( Object param ) throws IOException {
        SimpleFeatureType featureType = (SimpleFeatureType) param;

        IService service = getMemoryService();

        MemoryDataStore ds = service.resolve(MemoryDataStore.class, new NullProgressMonitor());
        List<String> typeNamesList = Arrays.asList(ds.getTypeNames());
        String localPart = featureType.getName().getLocalPart();
        if (typeNamesList.contains(localPart)) {
            try {
                ds.updateSchema(localPart, featureType);
View Full Code Here

          }else if (resolve instanceof IService) {
            service=(IService) services.get(0);       
          }
        }
        if( deleteService ){
                if( service.resolve(MemoryDataStore.class, null) instanceof ActiveMemoryDataStore ){
                  ActiveMemoryDataStore ds=(ActiveMemoryDataStore) service.resolve(MemoryDataStore.class, null);
                    ds.removeSchema(features[0].getFeatureType().getTypeName());
                } else {
                    List< ? extends IGeoResource> members = service.resources(new NullProgressMonitor());
                    for( IGeoResource resource : members ) {
View Full Code Here

            service=(IService) services.get(0);       
          }
        }
        if( deleteService ){
                if( service.resolve(MemoryDataStore.class, null) instanceof ActiveMemoryDataStore ){
                  ActiveMemoryDataStore ds=(ActiveMemoryDataStore) service.resolve(MemoryDataStore.class, null);
                    ds.removeSchema(features[0].getFeatureType().getTypeName());
                } else {
                    List< ? extends IGeoResource> members = service.resources(new NullProgressMonitor());
                    for( IGeoResource resource : members ) {
                        FeatureStore<SimpleFeatureType, SimpleFeature> s = resource
View Full Code Here

                            s.removeFeatures(Filter.INCLUDE);
                    }
                }
        }
       
        MemoryDataStore ds=service.resolve(MemoryDataStore.class, null);
        try{
          ds.getSchema(features[0].getFeatureType().getTypeName());
    //      if( deleteService)
    //        throw new IOException("SimpleFeatureType already exists in Service"); //$NON-NLS-1$
        }catch( SchemaNotFoundException exception){
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.