Package org.vfny.geoserver.wfs

Examples of org.vfny.geoserver.wfs.WfsException


            String addTypeName = feature.getFeatureType().getTypeName();

            if (typeName.equals(addTypeName)) {
                features.add(feature);
            } else {
                throw new WfsException(
                    "features do not match- added typeName: " + addTypeName
                    + ", set typeName: " + typeName, handle);
            }
        }
    }
View Full Code Here


     * @param filter a filter.
     *
     * @throws WfsException if called at all.
     */
    public void setFilter(Filter filter) throws WfsException {
        throw new WfsException("Attempted to add filter (" + filter
            + ") to update request: " + handle);
    }
View Full Code Here

                 * Any exception other than WfsException will "hang up" the
                 * process - no client output, no log entries, only "Internal
                 * server error". So this is a little trick to make detector's
                 * exceptions "visible".
                 */
                throw new WfsException(e);
            }
//           
//            String req_enc = guessRequestEncoding(request);
//            BufferedReader disReader = new BufferedReader(
//                                        new InputStreamReader(
View Full Code Here

            }
            HttpSession session = request.getSession();
            ServletContext context = session.getServletContext();
            GeoServer geoServer = (GeoServer) context.getAttribute(GeoServer.WEB_CONTAINER_KEY);
           
            WfsException wfse = new WfsException(message);
            String tempResponse = wfse.getXmlResponse(geoServer.isVerboseExceptions(), request);

            response.setContentType(geoServer.getCharSet().toString());
            response.getWriter().write(tempResponse);
        }
    }
View Full Code Here

        if (typeList.size() == 0) {
            typeList = getTypesFromFids(getValue("FEATUREID"));

            if (typeList.size() == 0) {
                throw new WfsException("The typename element is mandatory if "
                    + "no FEATUREID is present");
            }
        }

        int featureSize = typeList.size();
        int filterSize = (filterList == null) ? 0 : filterList.size();

        // prepare the release action boolean for all delete transactions
        if (keyExists("RELEASEACTION")) {
            String lockAction = getValue("RELEASEACTION");
            parentRequest.setReleaseAction(lockAction);
        }

        // check for errors in the request
        if (((filterSize != featureSize) && (filterSize > 0))
                || ((filterSize > 0) && (featureSize == 0))) {
            throw new WfsException("Filter size does not match"
                + " feature types.  Filter size: " + filterSize
                + " Feature size: " + featureSize);
        } else if (filterSize == featureSize) {
            for (int i = 0, n = featureSize; i < n; i++) {
                DeleteRequest childRequest = new DeleteRequest();
                childRequest.setTypeName((String) typeList.get(i));
                childRequest.setFilter((Filter) filterList.get(i));
                childRequest.setReleaseAll(releaseAll);
                parentRequest.addSubRequest(childRequest);
            }
        } else if (filterSize == 0) {
            String message = "No filter found.  If you are sure you want to "
                + "wipe out your database, then use a filter that is always true"
                + ".  We just don't want you to inadvertantly wipe everything "
                + "out without intending to";
            throw new WfsException(message);
        }

        return parentRequest;
    }
View Full Code Here

            LOGGER.finest("calling parse on " + requestSource);
            adapter.parse(requestSource);
            LOGGER.fine("just parsed: " + requestSource);
        } catch (SAXException e) {
            e.printStackTrace(System.out);
            throw new WfsException(e,
                "XML getFeature request SAX parsing error",
                XmlRequestReader.class.getName());
        } catch (IOException e) {
            throw new WfsException(e, "XML get feature request input error",
                XmlRequestReader.class.getName());
        } catch (ParserConfigurationException e) {
            throw new WfsException(e, "Some sort of issue creating parser",
                XmlRequestReader.class.getName());
        }

        Request r = contentHandler.getRequest(req);
        return r;
View Full Code Here

            } else if (lockAction.toUpperCase().equals("ALL")) {
                currentRequest.setLockAll(true);
            } else if (lockAction.toUpperCase().equals("SOME")) {
                currentRequest.setLockAll(false);
            } else {
                throw new WfsException("Illegal lock action: " + lockAction);
            }
        }

        // declare tokenizers for repeating elements
        LOGGER.finer("setting query request parameters");

        List typeList = readFlat(getValue("TYPENAME"), INNER_DELIMETER);
        LOGGER.finer("type list size: " + typeList.size());

        List filterList = readFilters(getValue("FEATUREID"),
                getValue("FILTER"), getValue("BBOX"));

        if (typeList.size() == 0) {
            typeList = getTypesFromFids(getValue("FEATUREID"));

            if (typeList.size() == 0) {
                throw new WfsException("The typename element is mandatory if "
                    + "no FEATUREID is present");
            }
        }

        int featureSize = typeList.size();
        int filterSize = filterList.size();

        // check for errors in the request
        if (((filterSize != featureSize) && (filterSize > 0))
                || ((filterSize > 0) && (featureSize == 0))) {
            throw new WfsException("Filter size does not match"
                + " feature types.  Filter size: " + filterSize
                + " Feature size: " + featureSize);
        } else {
            currentRequest.setLocks(typeList, filterList);
View Full Code Here

        if (typeList.size() == 0) {
            typeList = getTypesFromFids(fidKvps);

            if (typeList.size() == 0) {
                throw new WfsException("The typename element is mandatory if "
                    + "no FEATUREID is present");
            }
        }

        int featureSize = typeList.size();

        // check for errors in the request
        if (((propertySize != featureSize) && (propertySize > 1))
                || ((filterSize != featureSize) && (filterSize > 1))) {
            throw new WfsException("Properties or filter sizes do not match"
                + " feature types.  Property size: " + propertySize
                + " Filter size: " + filterSize + " Feature size: "
                + featureSize);
        } else {
            // loops through feature types, and creates queries based on them
View Full Code Here

            adapter.setContentHandler(contentHandler);
            adapter.parse(requestSource);
            LOGGER.finer("just parsed: " + requestSource);
        } catch (SAXException e) {
            throw new WfsException(e, "XML describe request parsing error",
                getClass().getName());
        } catch (IOException e) {
            throw new WfsException(e, "XML describe request input error",
                getClass().getName());
        } catch (ParserConfigurationException e) {
            throw new WfsException(e, "Some sort of issue creating parser",
                getClass().getName());
        }

        LOGGER.finer("about to return ");
        LOGGER.finer("returning " + contentHandler.getRequest(req));
View Full Code Here

            adapter.setContentHandler(currentRequest);
            adapter.parse(requestSource);
            LOGGER.fine("just parsed: " + requestSource);
        } catch (SAXException e) {
            throw new WfsException(e, "XML capabilities request parsing error",
                getClass().getName());
        } catch (IOException e) {
            throw new WfsException(e, "XML capabilities request input error",
                getClass().getName());
        } catch (ParserConfigurationException e) {
            throw new WfsException(e, "Some sort of issue creating parser",
                getClass().getName());
        }
        Request r = currentRequest.getRequest(req);
        return r;
    }
View Full Code Here

TOP

Related Classes of org.vfny.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.