Package org.geoserver.catalog

Examples of org.geoserver.catalog.ResourceInfo


    /**
     * @see LayerInfo#enabled()
     */
    public boolean enabled() {
        ResourceInfo resource = getResource();
        boolean resourceEnabled = resource != null && resource.enabled();
        boolean thisEnabled = this.isEnabled();
        return resourceEnabled && thisEnabled;
    }
View Full Code Here


        return resourceEnabled && thisEnabled;
    }

    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
        ResourceInfo resource = getResource();
        if (resource != null) {
            resource.setEnabled(enabled);
        }
    }
View Full Code Here

      return new ArrayList();
    }

    LayerInfo layerInfo = catalog.getLayerByName(layer);
    if (layerInfo != null) {
      ResourceInfo obj = layerInfo.getResource();
      Collection<PropertyDescriptor> attributes = null;
      /* Check if it's feature type or coverage */
      if (obj instanceof FeatureTypeInfo) {
        FeatureTypeInfo fTpInfo;
        fTpInfo = (FeatureTypeInfo) obj;
View Full Code Here

    int classes = parameters.getFirstValue("classes") != null ? Integer.parseInt(parameters.getFirstValue("classes")) : DEFAULT_CLASSES;
    COLORRAMP_TYPE ramp = parameters.getFirstValue("ramp") != null ? COLORRAMP_TYPE.valueOf(parameters.getFirstValue("ramp").toUpperCase()) : COLORRAMP_TYPE.RED;
   
    LayerInfo layerInfo = catalog.getLayerByName(layer);
    if (layerInfo != null) {
      ResourceInfo obj = layerInfo.getResource();
      /* Check if it's feature type or coverage */
      if (obj instanceof CoverageInfo) {
        CoverageInfo cvInfo;
        cvInfo = (CoverageInfo) obj;
       
View Full Code Here

    }

    private String findTitle(MapLayer layer, Catalog catalog) {
        String[] nameparts = layer.getTitle().split(":");

        ResourceInfo resource = nameparts.length > 1
            ? catalog.getResourceByName(nameparts[0], nameparts[1], ResourceInfo.class)
            : catalog.getResourceByName(nameparts[0], ResourceInfo.class);

        return resource != null
            ? resource.getTitle()
            : layer.getTitle();
    }
View Full Code Here

        for (int i = 0; i < results.getFeature().size(); i++) {
            //FeatureResults features = (FeatureResults) f.next();
            SimpleFeatureCollection features = (SimpleFeatureCollection) results.getFeature().get(i);
            SimpleFeatureType featureType = features.getSchema();

            ResourceInfo meta = catalog.getResourceByName(featureType.getName(), ResourceInfo.class);

            String prefix = meta.getNamespace().getPrefix();
            String uri = meta.getNamespace().getURI();

            ftNames.declareNamespace(features.getSchema(), prefix, uri);

            if (ftNamespaces.containsKey(uri)) {
                String location = (String) ftNamespaces.get(uri);
                ftNamespaces.put(uri, location + "," + urlEncode(meta.getPrefixedName()));
            } else {
                // don't blindly assume it's a feature type, this class is used also by WMS FeatureInfo
                // meaning it might be a coverage or a remote wms layer
                if(meta instanceof FeatureTypeInfo) {
                    String location = typeSchemaLocation(geoServer.getGlobal(), (FeatureTypeInfo) meta, request.getBaseUrl());
                    ftNamespaces.put(uri, location);
                }
            }

            //JD: wfs reprojection: should not set srs form metadata but from
            // the request
            //srs = Integer.parseInt(meta.getSRS());
            QueryType query = (QueryType) request.getQuery().get(i);
            try {
                String srsName = query.getSrsName() != null ? query.getSrsName().toString() : null;
                if ( srsName == null ) {
                    //no SRS in query...asking for the default?
                    srsName = meta.getSRS();
                }
                if ( srsName != null ) {
                    CoordinateReferenceSystem crs = CRS.decode(srsName);
                    String epsgCode = GML2EncodingUtils.epsgCode(crs);
                    srs = Integer.parseInt(epsgCode);
View Full Code Here

            Envelope layerBbox = null;

            LOGGER.finer("Collecting summarized latlonbbox and common SRS...");

            for (LayerInfo layer : layers) {
                ResourceInfo resource = layer.getResource();
                layerBbox = resource.getLatLonBoundingBox();
                latlonBbox.expandToInclude(layerBbox);
            }

            if (LOGGER.isLoggable(Level.FINE)) {
                LOGGER.fine("Summarized LatLonBBox is " + latlonBbox);
View Full Code Here

    }
   
    public <T extends ResourceInfo> T getResource(String id, Class<T> clazz) {
        List l = lookup(clazz, resources);
        for (Iterator i = l.iterator(); i.hasNext();) {
            ResourceInfo resource = (ResourceInfo) i.next();
            if (id.equals(resource.getId())) {
                return ModificationProxy.create((T) resource, clazz );
            }
        }

        return null;
View Full Code Here

       
        if (namespace == ANY_NAMESPACE) {
            //do an exhaustive lookup
            List matches = new ArrayList();
            for (Iterator i = l.iterator(); i.hasNext();) {
                ResourceInfo resource = (ResourceInfo) i.next();
                if (name.equals(resource.getName())) {
                    matches.add( resource );
                }
            }
           
            if ( matches.size() == 1 ) {
                return ModificationProxy.create( (T) matches.get( 0 ), clazz );
            }
        }
        else {
            for (Iterator i = l.iterator(); i.hasNext();) {
                ResourceInfo resource = (ResourceInfo) i.next();
                if (name.equals(resource.getName())) {
                    NamespaceInfo namespace1 = resource.getNamespace();
                    if (namespace1 != null && namespace1.equals( namespace )) {
                            return ModificationProxy.create( (T) resource, clazz );
                    }
                }
            }
View Full Code Here

        if ( namespace == null ) {
            namespace = getDefaultNamespace();
        }

        for (Iterator r = all.iterator(); r.hasNext();) {
            ResourceInfo resource = (ResourceInfo) r.next();
            if (namespace != null ) {
                if (namespace.equals(resource.getNamespace())) {
                    matches.add( resource );
                }
            }
            else if ( resource.getNamespace() == null ) {
                matches.add(resource);
            }
        }

        return ModificationProxy.createList( matches, clazz );
View Full Code Here

TOP

Related Classes of org.geoserver.catalog.ResourceInfo

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.