Package net.opengis.wfs

Examples of net.opengis.wfs.GetFeatureType


    /**
     * We abuse this method to pre-discover the query typenames so we know what to set in the
     * content-disposition header.
     */
    protected boolean canHandleInternal(Operation operation) {
        GetFeatureType request = (GetFeatureType) OwsUtils.parameter(operation.getParameters(),
                GetFeatureType.class);
        outputFileName = ((QName) ((QueryType) request.getQuery().get(0)).getTypeName().get(0))
            .getLocalPart();

        return true;
    }
View Full Code Here


     * @return the found charset, or the platform's default one if none was specified
     */
    private Charset getShapefileCharset(Operation getFeature) {
        Charset result = null;
       
        GetFeatureType gft = (GetFeatureType) getFeature.getParameters()[0];
        if(gft.getFormatOptions() != null && gft.getFormatOptions().get("CHARSET") != null) {
           result = (Charset) gft.getFormatOptions().get("CHARSET");
        } else {
            final String charsetName = GeoServerExtensions.getProperty("GS-SHAPEFILE-CHARSET", applicationContext);
            if(charsetName != null)
                result = Charset.forName(charsetName);
        }
View Full Code Here

        return "text/csv";
    }
   
    @Override
    public String[][] getHeaders(Object value, Operation operation) throws ServiceException {
        GetFeatureType request = (GetFeatureType) OwsUtils.parameter(operation.getParameters(),
                GetFeatureType.class);
        String outputFileName = ((QName) ((QueryType) request.getQuery().get(0)).getTypeName().get(0))
            .getLocalPart();
        return (String[][]) new String[][] {
                { "Content-Disposition", "attachment; filename=" + outputFileName + ".csv" }
            };
    }
View Full Code Here

        }
    }

    protected void write(FeatureCollectionType featureCollection, OutputStream output,
        Operation getFeature) throws IOException, ServiceException {
        GetFeatureType request = (GetFeatureType) getFeature.getParameters()[0];
       
        prepare(request.getOutputFormat(), featureCollection, request);
        encode(output, featureCollection, request );
    }
View Full Code Here

    public boolean canHandle(Operation operation) {
        //GetFeature operation?
        if ("GetFeature".equalsIgnoreCase(operation.getId())
                || "GetFeatureWithLock".equalsIgnoreCase(operation.getId())) {
            //also check that the resultType is "results"
            GetFeatureType request = (GetFeatureType) OwsUtils.parameter(operation.getParameters(),
                    GetFeatureType.class);

            if (request.getResultType() == ResultTypeType.RESULTS_LITERAL) {
                //call subclass hook
                return canHandleInternal(operation);
            }
        }
View Full Code Here

     *
     * @generated modifiable
     */
    public Object parse(ElementInstance instance, Node node, Object value)
        throws Exception {
        GetFeatureType getFeature = wfsfactory.createGetFeatureType();

        //lt;xsd:element maxOccurs="unbounded" ref="wfs:Query"/>
        getFeature.getQuery().addAll(node.getChildValues(QueryType.class));

        //<xsd:attribute default="results" name="resultType"
        //      type="wfs:ResultTypeType" use="optional">
        if (node.hasAttribute("resultType")) {
            getFeature.setResultType((ResultTypeType) node.getAttributeValue("resultType"));
        }

        //<xsd:attribute default="text/xml; subtype=gml/3.1.1"
        //    name="outputFormat" type="xsd:string" use="optional">
        if (node.hasAttribute("outputFormat")) {
            getFeature.setOutputFormat((String) node.getAttributeValue("outputFormat"));
        }

        //<xsd:attribute name="maxFeatures" type="xsd:positiveInteger" use="optional">
        if (node.hasAttribute("maxFeatures")) {
            getFeature.setMaxFeatures((BigInteger) node.getAttributeValue("maxFeatures"));
        }

        //<xsd:attribute name="traverseXlinkDepth" type="xsd:string" use="optional">
        if (node.hasAttribute("traverseXlinkDepth")) {
            getFeature.setTraverseXlinkDepth((String) node.getAttributeValue("traverseXlinkDepth"));
        }

        //<xsd:attribute name="traverseXlinkExpiry"
        //    type="xsd:positiveInteger" use="optional">
        if (node.hasAttribute("traverseXlinkExpiry")) {
            getFeature.setTraverseXlinkExpiry((BigInteger) node.getAttributeValue(
                    "traverseXlinkExpiry"));
        }

        return getFeature;
    }
View Full Code Here

     *
     * @generated modifiable
     */
    public Object parse(ElementInstance instance, Node node, Object value)
        throws Exception {
        GetFeatureType getFeature = wfsfactory.createGetFeatureType();

        WFSBindingUtils.service(getFeature, node);
        WFSBindingUtils.version(getFeature, node);
        WFSBindingUtils.outputFormat(getFeature, node, "GML2");

        if (node.getAttributeValue("handle") != null) {
            getFeature.setHandle((String) node.getAttributeValue("handle"));
        }

        //get the max features
        BigInteger maxFeatures = null;
        Number number = (Number) node.getAttributeValue("maxFeatures");

        if (number != null) {
            if (number instanceof BigInteger) {
                maxFeatures = (BigInteger) number;
            } else {
                maxFeatures = BigInteger.valueOf(number.longValue());
            }

            getFeature.setMaxFeatures(maxFeatures);
        }

        //queries
        getFeature.getQuery().addAll(node.getChildValues(QueryType.class));

        return getFeature;
    }
View Full Code Here

   
    public boolean canHandle(Operation operation) {
        // GetVersionedFeature operation?
        if ("GetVersionedFeature".equalsIgnoreCase(operation.getId())) {
            // also check that the resultType is "results"
            GetFeatureType request = (GetFeatureType) OwsUtils.parameter(
                    operation.getParameters(), GetFeatureType.class);

            if (request.getResultType() == ResultTypeType.RESULTS_LITERAL) {
                return true;
            }
        }

        return false;
View Full Code Here

    }

    public String getMimeType(Object value, Operation operation)
    throws ServiceException {
        // let's check if a callback has been set, in that case, we need to return a different mime type
        GetFeatureType gft = (GetFeatureType) operation.getParameters()[0];
        String callback = (String) gft.getFormatOptions().get("CALLBACK");
        if(callback != null && !"".equals(callback)) {
            return "text/javascript";
        } else {
            return "application/json";
        }
View Full Code Here

        // it's part of the constructor, just need to hook it up.
        Writer outWriter = new BufferedWriter(
            new OutputStreamWriter(output,wfs.getGeoServer().getGlobal().getCharset()));
       
        // let's check if a callback has been set
        GetFeatureType gft = (GetFeatureType) getFeature.getParameters()[0];
        String callback = (String) gft.getFormatOptions().get("CALLBACK");
        if(callback != null && !"".equals(callback)) {
            outWriter.write(callback + "(");
        }

        GeoJSONBuilder jsonWriter = new GeoJSONBuilder(outWriter);
View Full Code Here

TOP

Related Classes of net.opengis.wfs.GetFeatureType

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.