Package org.geoserver.wfs

Examples of org.geoserver.wfs.WFSException


            // zip file will be empty and the zip output stream will break
            boolean shapefileCreated = false;
            for (SimpleFeatureCollection curCollection : collections) {
               
                if(curCollection.getSchema().getGeometryDescriptor() == null) {
                    throw new WFSException(request, "Cannot write geometryless shapefiles, yet "
                            + curCollection.getSchema() + " has no geometry field");
                }
                Class geomType = curCollection.getSchema().getGeometryDescriptor().getType().getBinding();
                if(GeometryCollection.class.equals(geomType) || Geometry.class.equals(geomType)) {
                    // in this case we fan out the output to multiple shapefiles
View Full Code Here


                    if(fos != null)
                        fos.close();
                }
            }
        } catch(IOException e) {
            throw new WFSException(gft, "Failed to dump the WFS request");
        }
       
    }
View Full Code Here

        GetFeatureRequest request = GetFeatureRequest.adapt(operation.getParameters()[0]);
        String outputFormat = request.getOutputFormat();
       
        OgrFormat format = formats.get(outputFormat);
        if (format == null) {
            throw new WFSException("Unknown output format " + outputFormat);
        } else if (format.singleFile && request.getQueries().size() <= 1) {
            if(format.mimeType != null) {
                return format.mimeType;
            } else {
                // use a default binary blob
View Full Code Here

        String outputFormat = request.getOutputFormat();
       
        OgrFormat format = formats.get(outputFormat);
        List<Query> queries = request.getQueries();
        if (format == null) {
            throw new WFSException("Unknown output format " + outputFormat);
        } else if (!format.singleFile || queries.size() > 1) {
            String outputFileName = queries.get(0).getTypeNames().get(0).getLocalPart();
            return outputFileName + ".zip";
        } else {
            return null;
View Full Code Here

        GetFeatureRequest request = GetFeatureRequest.adapt(getFeature.getParameters()[0]);
        String outputFormat = request.getOutputFormat();

        OgrFormat format = formats.get(outputFormat);
        if (format == null)
            throw new WFSException("Unknown output format " + outputFormat);

        // create the first temp directory, used for dumping gs generated
        // content
        File tempGS = org.geoserver.data.util.IOUtils.createTempDirectory("ogrtmpin");
        File tempOGR = org.geoserver.data.util.IOUtils.createTempDirectory("ogrtmpout");
View Full Code Here

            String namespaceURI = namespaceSupport.getURI(prefix);

            //only accept if its an application schema namespace, or gml
            if (!GML.NAMESPACE.equals(namespaceURI)
                    && (catalog.getNamespaceByURI(namespaceURI) == null)) {
                throw new WFSException("Illegal attribute namespace: " + namespaceURI);
            }
        }
       
        if (factory instanceof FilterFactory2) {
            return ((FilterFactory2) factory).property(propertyName.getPropertyName(), namespaceSupport);
View Full Code Here

            //load the metadata for the feature type
            String namespaceURI = featureType.getName().getNamespaceURI();
            FeatureTypeInfo meta = catalog.getFeatureTypeByName( namespaceURI, featureType.getTypeName() );
            if(meta == null)
                throw new WFSException(gft, "Could not find feature type " + namespaceURI + ":"
                    + featureType.getTypeName() + " in the GeoServer catalog");

            NamespaceInfo ns = catalog.getNamespaceByURI( namespaceURI );
            ns2metas.put( ns, meta );
        }
View Full Code Here

                    // get a feature type name from the query
                    Name featureTypeName = new NameImpl(name.getNamespaceURI(), name.getLocalPart());
                    ResourceInfo meta = catalog.getResourceByName(featureTypeName, ResourceInfo.class);
                   
                    if (meta == null) {
                        throw new WFSException(request, "Could not find feature type " + featureTypeName
                                + " in the GeoServer catalog");
                    }
                   
                    // add it to the map
                    Set<ResourceInfo> metas = ns2metas.get(featureTypeName.getNamespaceURI());
                   
                    if (metas == null) {
                        metas = new HashSet<ResourceInfo>();
                        ns2metas.put(featureTypeName.getNamespaceURI(), metas);
                    }
                    metas.add(meta);
                }
            } else {
                FeatureType featureType = ((FeatureCollection) featureCollections.get(fcIndex)).getSchema();

                //load the metadata for the feature type
                String namespaceURI = featureType.getName().getNamespaceURI();
                FeatureTypeInfo meta = catalog.getFeatureTypeByName(featureType.getName());
               
                if(meta == null)
                    throw new WFSException(request, "Could not find feature type " +
                        featureType.getName() + " in the GeoServer catalog");

                //add it to the map
                Set metas = (Set) ns2metas.get(namespaceURI);
View Full Code Here

                Properties props = new Properties();
                props.load(new ByteArrayInputStream(sw.toString().getBytes()));
               
                return props;
            } catch(Exception e) {
                throw new WFSException("Failed to process the file name template", e);
            }
        }
View Full Code Here

                CoordinateReferenceSystem crs = GML2ParsingUtils.crs(node);
                if ( crs != null ) {
                    context.registerComponentInstance(CoordinateReferenceSystem.class, crs);
                }
            } catch(Exception e) {
                throw new WFSException(e, "InvalidParameterValue");
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.geoserver.wfs.WFSException

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.