Package org.locationtech.udig.catalog

Examples of org.locationtech.udig.catalog.IRepository


        File file = new File( "C:\\data\\cities.shp" );
        URL url = file.toURI().toURL();
       
        IProgressMonitor monitor = ProgressManager.instance().get();
       
        IRepository local = CatalogPlugin.getDefault().getLocal();
        IService service = local.acquire( url, monitor );       
    }
View Full Code Here


    URL url = file.toURI().toURL();
   
    IServiceFactory serviceFactory = CatalogPlugin.getDefault().getServiceFactory();
    List<IService> created = serviceFactory.createService( url );
   
    IRepository local = CatalogPlugin.getDefault().getLocal();
    for( IService service : created ){
        IService registered = local.add(service);
        //...
    }
  }
View Full Code Here

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

public class CatalogIntegrationTest {

    @Test
    public void testAquire() throws Exception {
        IRepository local = CatalogPlugin.getDefault().getLocal();
        local.acquire(MapGraphicService.SERVICE_URL, null);
       
        // Test ScaleBar
        final ID SCALE_BAR = new ID("mapgraphic:/localhost/mapgraphic#scalebar", null); //$NON-NLS-1$
        IGeoResource scalebarResource = local.getById(IGeoResource.class, SCALE_BAR,
                new NullProgressMonitor());
        assertNotNull(scalebarResource);
       
        // Test Graticule
        final ID GRATICULE = new ID("mapgraphic:/localhost/mapgraphic#graticule", null); //$NON-NLS-1$
        IGeoResource graticuleResource = local.getById(IGeoResource.class, GRATICULE,
                new NullProgressMonitor());
        assertNotNull(graticuleResource);
       
    }
View Full Code Here

     * Retrieves the an IGeoResource reference of the grid map graphic from the catalog.
     *
     * @return grid map graphic, returns null if service is not up or service does not hold the resource
     */
    public static IGeoResource getGridMapGraphic() {
        final IRepository local = CatalogPlugin.getDefault().getLocal();
        final IGeoResource gridResource = local.getById(IGeoResource.class, GRID_ID, new NullProgressMonitor());
        if (gridResource == null) {
            System.out.println("[LegendViewUtils] Grid resource not found. Either service is not up or it does not hold the resource."); //$NON-NLS-1$
        }
        return gridResource;
    }
View Full Code Here

*
*/
public class MapDecoratorExamples {

    public void lookupExample() {
        IRepository local = CatalogPlugin.getDefault().getLocal();

        final ID GRID_ID = new ID("mapgraphic:///localhost/mapgraphic#grid", null);
        IGeoResource gridResource = local.getById(IGeoResource.class, GRID_ID, new NullProgressMonitor());
        // You can then use this with the AddLayersCommand
    }
View Full Code Here

    @Override
    public boolean performDrop( Object data ) {

        IServiceFactory serviceFactory = CatalogPlugin.getDefault().getServiceFactory();
        IRepository local = CatalogPlugin.getDefault().getLocal();
       
        if (data instanceof URL) {
            URL url = (URL) data;
            try {
                local.acquire( url, null )// add to catalog if needed
               
            } catch (IOException e) {
                CatalogUIPlugin.log( "Drag and Drop "+url, e);
            }
            //List<IService> candidates = serviceFactory.createService((URL) data);
        } else if (data instanceof java.util.Map) {
            java.util.Map<String, Serializable> connectionParams = (java.util.Map<String, Serializable>) data;
            try {
                local.acquire(connectionParams, null);
            } catch (IOException e) {
                CatalogUIPlugin.log( "Drag and Drop "+connectionParams, e);
            }
            //List<IService> candidates = serviceFactory.createService( connectionParams );           
        } else if (data instanceof String || data instanceof String[]) {
View Full Code Here

TOP

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

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.