Package org.vfny.geoserver.global

Examples of org.vfny.geoserver.global.GeoServer


        // And allways remember to release locks if we are failing:
        // - if we fail to aquire all the locks we will need to fail and
        //   itterate through the the FeatureSources to release the locks
        //
        WFS wfs = request.getWFS();
        GeoServer config = wfs.getGeoServer();
        Data catalog = wfs.getData();
        FeatureTypeInfo meta = null;
        NameSpaceInfo namespace;
        Query query;
View Full Code Here


        throws IOException {
        this.compressOutput = formatNameCompressed.equalsIgnoreCase(outputFormat);
        this.results = results;

        GetNearestRequest request = results.getRequest();
        GeoServer config = request.getWFS().getGeoServer();
        transformer = new FeatureTransformer();

        FeatureTypeNamespaces ftNames = transformer.getFeatureTypeNamespaces();
        int maxFeatures = 999;
        int serverMaxFeatures = config.getMaxFeatures();

        if (maxFeatures > serverMaxFeatures) {
            maxFeatures = serverMaxFeatures;
        }

        StringBuffer typeNames = new StringBuffer();
        FeatureResults features;
        FeatureTypeInfo meta = null;
        NameSpaceInfo namespace;
        int resCount = results.getResultsetsCount();
        Map ftNamespaces = new HashMap(resCount);

        for (int resIndex = 0; resIndex < resCount; resIndex++) {
            features = results.getFeatures(resIndex);
            meta = results.getTypeInfo(resIndex);
            namespace = meta.getDataStoreInfo().getNameSpace();

            String uri = namespace.getUri();
            ftNames.declareNamespace(features.getSchema(), namespace.getPrefix(), uri);

            if (ftNamespaces.containsKey(uri)) {
                String location = (String) ftNamespaces.get(uri);
                ftNamespaces.put(uri, location + "," + meta.getName());
            } else {
                ftNamespaces.put(uri,
                    request.getBaseUrl() + "wfs/" + "DescribeFeatureType?typeName="
                    + meta.getName());
            }
        }

        System.setProperty("javax.xml.transform.TransformerFactory",
            "org.apache.xalan.processor.TransformerFactoryImpl");

        transformer.setIndentation(config.isVerbose() ? INDENT_SIZE : (NO_FORMATTING));
        transformer.setNumDecimals(config.getNumDecimals());
        transformer.setFeatureBounding(request.getWFS().isFeatureBounding());
        transformer.setEncoding(request.getWFS().getGeoServer().getCharSet());

        String wfsSchemaLoc = request.getSchemaBaseUrl() + "wfs/1.0.0/WFS-basic.xsd";
View Full Code Here

            KMLGeometryTransformer geometryTransformer = new KMLGeometryTransformer();
            //geometryTransformer.setUseDummyZ( true );
            geometryTransformer.setOmitXMLDeclaration(true);
            geometryTransformer.setNamespaceDeclarationEnabled(true);

            GeoServer config = mapContext.getRequest().getGeoServer();
            geometryTransformer.setNumDecimals(config.getNumDecimals());

            geometryTranslator = geometryTransformer.createTranslator(contentHandler);
           
//            GML3 outputting transformer
//            OWS5GeometryTransformer geometryTransformer = new OWS5GeometryTransformer();
View Full Code Here

        throws IOException {
        this.compressOutput = formatNameCompressed.equalsIgnoreCase(outputFormat);
        this.results = results;

        FeatureRequest request = results.getRequest();
        GeoServer config = request.getWFS().getGeoServer();
        transformer = new FeatureTransformer();

        FeatureTypeNamespaces ftNames = transformer.getFeatureTypeNamespaces();
        int maxFeatures = request.getMaxFeatures();
        int serverMaxFeatures = config.getMaxFeatures();

        if (maxFeatures > serverMaxFeatures) {
            maxFeatures = serverMaxFeatures;
        }

        StringBuffer typeNames = new StringBuffer();
        FeatureResults features;
        FeatureTypeInfo meta = null;
        NameSpaceInfo namespace;
        int resCount = results.getResultsetsCount();
        Map ftNamespaces = new HashMap(resCount);

        for (int resIndex = 0; resIndex < resCount; resIndex++) {
            features = results.getFeatures(resIndex);
            meta = results.getTypeInfo(resIndex);
            namespace = meta.getDataStoreInfo().getNameSpace();

            String uri = namespace.getUri();
            ftNames.declareNamespace(features.getSchema(),
                namespace.getPrefix(), uri);

            if (ftNamespaces.containsKey(uri)) {
                String location = (String) ftNamespaces.get(uri);
                ftNamespaces.put(uri, location + "," + meta.getName());
            } else {
                ftNamespaces.put(uri,
                    request.getBaseUrl() + "wfs/"
                    + "DescribeFeatureType?typeName=" + meta.getName());
            }
        }

        System.setProperty("javax.xml.transform.TransformerFactory",
            "org.apache.xalan.processor.TransformerFactoryImpl");

        transformer.setIndentation(config.isVerbose() ? INDENT_SIZE
                                                      : (NO_FORMATTING));
        transformer.setNumDecimals(config.getNumDecimals());
        transformer.setFeatureBounding(request.getWFS().isFeatureBounding());
        transformer.setEncoding(request.getWFS().getGeoServer().getCharSet());

        String wfsSchemaLoc = request.getSchemaBaseUrl()
            + "wfs/1.0.0/WFS-basic.xsd";
View Full Code Here

        boolean lockAll = request.getLockAll();

        FeatureLock fLock = request.toFeatureLock();
        Set lockedFids = new HashSet();
        Set lockFailedFids = new HashSet();
        GeoServer config = request.getGeoServer();
        Data catalog = request.getWFS().getData();
        FilterFactory filterFactory = FilterFactory.createFilterFactory();
        LOGGER.info("locks size is " + locks.size());

        if (locks.size() == 0) {
View Full Code Here

        Data catalog = gs.getData();

        // I think we need to release and fail when lockAll fails
        //
        try {
            GeoServer config = gs.getGeoServer();

            for (Iterator i = request.getLocks().iterator(); i.hasNext();) {
                LockRequest.Lock curLock = (LockRequest.Lock) i.next();

                String curTypeName = curLock.getFeatureType();
View Full Code Here

        //
        // And allways remember to release locks if we are failing:
        // - if we fail to aquire all the locks we will need to fail and
        //   itterate through the the FeatureSources to release the locks
        //
        GeoServer config = request.getWFS().getGeoServer();
        Data catalog = request.getWFS().getData();
        FeatureTypeInfo meta = null;
        NameSpaceInfo namespace;
        Query query;
        int maxFeatures = request.getMaxFeatures();
        int serverMaxFeatures = config.getMaxFeatures();

        if (maxFeatures > serverMaxFeatures) {
            maxFeatures = serverMaxFeatures;
        }
View Full Code Here

    public WFSRequest(String requestType) {
        super(WFS_SERVICE_TYPE, requestType);
    }

    public GeoServer getGeoServer(){
      GeoServer gs = getWFS().getGeoServer();
      return gs;
    }
View Full Code Here

            doResponse(requestReader, request, response, targetRequest);
        } catch (WfsException wfs) {
            HttpSession session = request.getSession();
            ServletContext context = session.getServletContext();
            GeoServer geoServer = (GeoServer) context.getAttribute(GeoServer.WEB_CONTAINER_KEY);
            String tempResponse = wfs.getXmlResponse(geoServer.isVerboseExceptions(), request);

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

                    + "request must be one of GetFeature, GetFeatureWithLock, "
                    + "DescribeFeatureType, LockFeature, or Transaction";
            }
            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

TOP

Related Classes of org.vfny.geoserver.global.GeoServer

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.