Package org.geoserver.wfs

Examples of org.geoserver.wfs.WFSException


        }
        else if ( value instanceof MultiPolygon ) {
            encoder.encode( value, GML.MultiPolygon, output );
        }
        else {
            throw new WFSException( "Cannot encode geometry of type: " + value.getClass() );
        }
     }
View Full Code Here


     *
     * @generated modifiable
     */
    public Object parse(ElementInstance instance, Node node, Object value)
        throws Exception {
        throw new WFSException("Circle is not supported", "InvalidParameterValue");
    }
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

        try {
            if (node.hasAttribute("srsName")) {
                CRS.decode(node.getAttributeValue("srsName").toString());
            }
        } catch (NoSuchAuthorityCodeException e) {
            throw new WFSException("Invalid Authority Code: " + e.getAuthorityCode(),
                "InvalidParameterValue");
        }

        Geometry geometry = (Geometry) super.parse(instance, node, value);

        if (geometry != null) {
            //1. ensure a crs is set
            if (geometry.getUserData() == null) {
                //no crs set for the geometry, did we inherit one from a parent?
                if ( crs != null ) {
                    geometry.setUserData(crs);
                } else {
                    // for the moment we don't do anything since we miss the information
                    // to infer the CRS from the feature type
                }
            }

            //2. ensure the coordinates of the geometry fall into valid space defined by crs
            CoordinateReferenceSystem crs = (CoordinateReferenceSystem) geometry.getUserData();
            if(crs != null)
                try {
                    JTS.checkCoordinatesRange(geometry, crs);
                } catch(PointOutsideEnvelopeException e) {
                    throw new WFSException(e, "InvalidParameterValue");
                }
        }

        return geometry;
    }
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

                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

            rollback.setHandle((String) node.getAttributeValue("handle"));
        }

        rollback.setFilter((Filter) node.getChildValue(Filter.class));
        if (!node.hasAttribute("typeName"))
            throw new WFSException("The typeName attribute is mandatory");
        rollback.setTypeName((QName) node.getAttributeValue("typeName"));
        rollback.setToFeatureVersion((String) node.getAttributeValue("toFeatureVersion"));
        rollback.setVendorId((String) node.getAttributeValue("vendorId"));
        if (!node.hasAttribute("safeToIgnore"))
            throw new WFSException("The attribute safeToIgnore=true|false is mandatory");
        rollback.setSafeToIgnore(((Boolean) node.getAttributeValue("safeToIgnore")).booleanValue());
        rollback.setUser((String) node.getAttributeValue("user"));

        return rollback;
    }
View Full Code Here

        // valid request? this should definitley be a configuration option
        // TODO: HACK, disabling validation for transaction
        if (!"Transaction".equalsIgnoreCase(getElement().getLocalPart())) {
            if (!parser.getValidationErrors().isEmpty()) {
                WFSException exception = new WFSException("Invalid request",
                        "InvalidParameterValue");

                for (Iterator e = parser.getValidationErrors().iterator(); e.hasNext();) {
                    Exception error = (Exception) e.next();
                    exception.getExceptionText().add(error.getLocalizedMessage());
                }

                throw exception;
            }
        }
View Full Code Here

        Object parsed = parser.parse(source);

        //TODO: HACK, disabling validation for transaction
        if (!"Transaction".equalsIgnoreCase(getElement().getLocalPart())) {
            if (!parser.getValidationErrors().isEmpty()) {
                WFSException exception = new WFSException("Invalid request", "InvalidParameterValue");

                for (Iterator e = parser.getValidationErrors().iterator(); e.hasNext();) {
                    Exception error = (Exception) e.next();
                    exception.getExceptionText().add(error.getLocalizedMessage());
                }

                throw exception;
            }
        }
View Full Code Here

                    // get a feature type name from the query
                    Name featureTypeName = new NameImpl(name.getNamespaceURI(), name.getLocalPart());
                    FeatureTypeInfo meta = catalog.getFeatureTypeByName(featureTypeName);
                   
                    if (meta == null) {
                        throw new WFSException("Could not find feature type " + featureTypeName
                                + " in the GeoServer catalog");
                    }
                   
                    // add it to the map
                    Set<FeatureTypeInfo> metas = ns2metas.get(featureTypeName.getNamespaceURI());
                   
                    if (metas == null) {
                        metas = new HashSet<FeatureTypeInfo>();
                        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("Could not find feature type " + featureType.getName() + " in the GeoServer catalog");

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

                if (metas == null) {
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.