Package org.locationtech.udig.catalog

Examples of org.locationtech.udig.catalog.IService


                    try {
                        if(text){
                          if(element instanceof IGeoResource) {
                            IGeoResource resource = (IGeoResource) element;
                            data.text = resource.getInfo(monitor).getTitle();
                            IService service = resource.service(monitor);
                            if( service != null ){
                                service.getPersistentProperties().put(resource.getID() + "_title", data.text);
                            }
                          } else if(element instanceof IService) {
                            IService service = (IService) element;
                            IServiceInfo info = service.getInfo(monitor);
                            if( info != null ){
                                data.text = info.getTitle();
                                service.getPersistentProperties().put("title", data.text);
                            }
                          } else if(element instanceof IProcess) {
                            IProcess proc = (IProcess) element;
                            data.text = proc.getInfo(monitor).getTitle();
                          } else if(element instanceof ISearch) {
View Full Code Here


                                LayerImpl layer = (LayerImpl) firstElement;
                                geoResource = layer.getGeoResource();

                            }
                            if (firstElement instanceof IService) {
                                IService service = (IService) firstElement;
                                List< ? extends IGeoResource> resources = service.resources(new NullProgressMonitor());
                                if (resources.size() > 0) {
                                    geoResource = resources.get(0);
                                }
                            }
                            if (geoResource != null) {
View Full Code Here

                        for( IService service : services ) {
                            Map<String, Serializable> params = new HashMap<String, Serializable>(service
                                    .getConnectionParams());
                            params.put(ShapefileDataStoreFactory.DBFCHARSET.key, newCharset.name());
                           
                            IService newService = extension.createService(service.getIdentifier(), params);
                            CatalogPlugin.getDefault().getLocalCatalog().replace(service.getID(), newService);
                        }
                    }
                   
                });
View Full Code Here

    private List< ? extends IGeoResource> members;
    private List< ? extends IGeoResource> members2;

    @Before
    public void setUp() throws Exception {
        IService service = createService(new URL("http://serviceWMSRenderMetricsTest"), true); //$NON-NLS-1$
        members = service.resources(new NullProgressMonitor());
        service = createService(new URL("http://serviceWMSRenderMetricsTest2"), true); //$NON-NLS-1$
        members2 = service.resources(new NullProgressMonitor());
        map = MapTests.createNonDynamicMapAndRenderer(members.get(0), null);
        map.getLayersInternal().add(map.getLayerFactory().createLayer(members.get(1)));
    }
View Full Code Here

        layer2.setSrs(BBOXES2.keySet());
        resolves.add(layer2);
        resourceResolveTos.add(resolves);
        if( make2Resources )
            resourceResolveTos.add(resolves2);
        IService service = DummyService.createService(string, null, resourceResolveTos);
        return service;
    }
View Full Code Here

    private ReferencedEnvelope viewport;
    private Map map;

    @Before
    public void setUp() throws Exception {
        IService service = WMSRenderMetricsTest.createService(new URL(
                "http://BasicWMSRenderer2Test"), false); //$NON-NLS-1$
        members = service.resources(new NullProgressMonitor());
        map = MapTests.createNonDynamicMapAndRenderer(members.get(0), new Dimension(1024, 1024));
        viewportBBox = new Envelope(-180, 180, -90, 90);
        viewportCRS = DefaultGeographicCRS.WGS84;
        viewport = new ReferencedEnvelope(viewportBBox, viewportCRS);
        wmsLayers = Arrays.asList(members.get(0).resolve(Layer.class, new NullProgressMonitor()));
View Full Code Here

        IProgressMonitor monitor=new NullProgressMonitor();
        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

    private void setInput( ResourceSelectionState state ) {
        grayedElements.clear();
        int checked=0;
        if (state.getWorkflow().getContext() instanceof IResolveFolder){
            IResolveFolder resolveFolder = (IResolveFolder) state.getWorkflow().getContext();
            IService service = resolveFolder.getService(new NullProgressMonitor());
            schemaSelected = resolveFolder.getTitle();
            viewer.setInput(service);
        }else {
            viewer.setInput(state.getServices()); // initialize viewer input to nothing
            Map<IGeoResource, IService> resources = state.getResources();
           
            if (resources != null) {
                Set<IService> expanded=new HashSet<IService>();
                for( Map.Entry<IGeoResource, IService> entry:resources.entrySet() ) {
                    checked++;
                    IGeoResource resource = entry.getKey();
                    IService service = entry.getValue();
                   
                    viewer.setChecked(resource, true);
                    viewer.setChecked(service, true);
                    expanded.add(service);
                }
View Full Code Here

            for( Map.Entry<ServiceExtension, Map<String, Serializable>> candidateEntry : available.entrySet() ) {
                String extentionIdentifier = candidateEntry.getKey().getClass().getName();
                ServiceExtension serviceExtension = candidateEntry.getKey();
                Map<String, Serializable> connectionParameters = candidateEntry.getValue();
                try {
                    IService sevice = serviceExtension.createService(null, connectionParameters);
                    CatalogImpl.runInterceptor(sevice, ServiceInterceptor.CREATED_ID);
                    candidates.add(sevice);
//                    List<IService> service = createService(connectionParameters);
//                    if (service != null && !service.isEmpty()) {
//                        for( IService created : service ){
//                            CatalogImpl.runInterceptor(created, ServiceInterceptor.CREATED_ID);
//                            candidates.add(created);
//                        }
//                    }
                } catch (Throwable deadService) {
                    CatalogPlugin.log(extentionIdentifier + " could not create service", deadService); //$NON-NLS-1$
                }
            }
        }
        if( candidates.isEmpty() && !generic.isEmpty()){
            // add generic entries if needed
            for(ServiceExtension serviceExtension : generic) {
                try {
                    Map<String, Serializable> connectionParameters = serviceExtension.createParams(targetUrl);
                    if (connectionParameters != null) {
                        IService service = serviceExtension.createService(null, connectionParameters);
                        CatalogImpl.runInterceptor(service, ServiceInterceptor.CREATED_ID);
                        candidates.add(service);
    //                    List<IService> service = createService(connectionParameters);
    //                    if (service != null && !service.isEmpty()) {                   
    //                        for( IService created : service ){
View Full Code Here

            }
            try {
                // Attempt to construct a service, and add to the list if available.
               
                // Put a break point here to watch every serviceExtension try and connect
                IService service = serviceExtension.createService(null, connectionParameters);
                if (service != null) {
                    CatalogImpl.runInterceptor(service, ServiceInterceptor.CREATED_ID);
                    services.add(service);                   
                }
            } catch (Throwable deadService) {
                CatalogPlugin.log(name + " could not create service", deadService); //$NON-NLS-1$
            }
        }
        if( services.isEmpty()){
            for( ServiceExtension serviceExtension : CatalogPlugin.getDefault().getServiceExtensions() ) {
                String name = serviceExtension.getClass().getName();
                if( !isGeneric(serviceExtension)){
                    continue; // only generic for this pass
                }
                try {
                    // Attempt to construct a service, and add to the list if available.
                    IService service = serviceExtension.createService(null, connectionParameters);
                    if (service != null) {
                        CatalogImpl.runInterceptor(service, ServiceInterceptor.CREATED_ID);
                        services.add(service);
                    }
                } catch (Throwable deadService) {
View Full Code Here

TOP

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

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.