Package org.locationtech.udig.catalog

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


    @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)));
    }

    static IService createService(URL string, boolean make2Resources) throws MalformedURLException {
View Full Code Here


    @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

       
        //Set the resources on the state and press finish
        IService service=currentState.getServices().iterator().next();
        Map<IGeoResource, IService> resources=new HashMap<IGeoResource, IService>();
       
        for (IResolve resolve : service.resources(new NullProgressMonitor())) {
      resources.put((IGeoResource) resolve, service);
    }
       
       
        currentState.setResources(resources);
View Full Code Here

            }
        }
       
        if( s==null )
            throw new AssertionError();
        if( !(s.resources(null).size()>0))
            throw new AssertionError();
       
      CatalogPlugin.getDefault().getLocalCatalog().add(s);
      List<IResolve> resources = CatalogPlugin.getDefault().getLocalCatalog().find(new URL(resourceURL), null);
      if( !(resources.size()>0) )
View Full Code Here

        final IService service = getServiceById(id);
        List<IResolveDelta> changes = new ArrayList<IResolveDelta>();
        List<IResolveDelta> childChanges = new ArrayList<IResolveDelta>();
        try {
            List< ? extends IGeoResource> newChildren = replacement.resources(null);
            List< ? extends IGeoResource> oldChildren = service.resources(null);
            if (oldChildren != null)
                for( IGeoResource oldChild : oldChildren ) {
                    String oldName = oldChild.getIdentifier().toString();

                    for( IGeoResource child : newChildren ) {
View Full Code Here

        } else {
            ds.createSchema(featureType);
        }

        IGeoResource resource = null;
        for( IResolve resolve : service.resources(new NullProgressMonitor()) ) {
            if (resolve instanceof IGeoResource) {
                IGeoResource r = (IGeoResource) resolve;
                if (r.resolve(SimpleFeatureType.class, new NullProgressMonitor()).getName().getLocalPart()
                        .equals(featureType.getName().getLocalPart())) {
                    resource = r;
View Full Code Here

     * Calls createService and finds the georesource containing the features.
     */
    public static IGeoResource createGeoResource(SimpleFeature [] features, boolean deleteService) throws IOException{
      IService service = getService(features, deleteService);
     
      List<? extends IGeoResource> resources = service.resources(null);
      for (IGeoResource resource : resources) {
        if( resource.resolve(FeatureSource.class, null).getSchema().getName().getLocalPart().
            equals(features[0].getFeatureType().getTypeName()))
          return resource;
      }
View Full Code Here

        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
                                .resolve(FeatureStore.class, new NullProgressMonitor());
                        if (s.getSchema().getTypeName().equals(
                                features[0].getName().getLocalPart()))
View Full Code Here

     * @throws IOException
     */
    public static IGeoResource createResource( URL id, Object resolveTo ) throws IOException {
        IService service=DummyService.createService(id, null, Collections.singletonList(Collections.singletonList(resolveTo)));
       
        IGeoResource resource = service.resources(null).get(0);
        return resource;
    }

}
View Full Code Here

  }
  private void addAlertsMapgraphic(IProgressMonitor monitor,
      List<IGeoResource> resources) throws IOException {
    IService service = CatalogPlugin.getDefault().getLocalCatalog().acquire(MapGraphicService.SERVICE_URL,monitor);
    String desiredIdString = MapGraphicService.SERVICE_URL+"#"+ShowAlertsMapGraphic.EXTENSION_ID;
    for (IGeoResource resource : service.resources(null)) {
      String idString = resource.getID().toString();
      if(idString.equals(desiredIdString)) {
        resources.add(resource);
        return;
      }
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.