Package net.opengis.wfs

Examples of net.opengis.wfs.WfsFactory


            throws IOException {

        final QName typeName = query.getTypeName();
        final FeatureTypeInfo featureTypeInfo = getFeatureTypeInfo(typeName);

        final WfsFactory factory = WfsFactory.eINSTANCE;

        GetFeatureType getFeature = factory.createGetFeatureType();
        getFeature.setService("WFS");
        getFeature.setVersion(getVersion());

        String outputFormat = query.getOutputFormat();
        getFeature.setOutputFormat(outputFormat);

        getFeature.setHandle(query.getHandle());

        Integer maxFeatures = query.getMaxFeatures();
        if (maxFeatures != null) {
            getFeature.setMaxFeatures(BigInteger.valueOf(maxFeatures.intValue()));
        }

        ResultType resultType = query.getResultType();
        getFeature.setResultType(RESULTS == resultType ? ResultTypeType.RESULTS_LITERAL
                : ResultTypeType.HITS_LITERAL);

        QueryType wfsQuery = factory.createQueryType();
        wfsQuery.setTypeName(Collections.singletonList(typeName));

        final Filter supportedFilter;
        final Filter unsupportedFilter;
        {
View Full Code Here


    @Override
    protected DescribeFeatureTypeType createDescribeFeatureTypeRequestPost(
            DescribeFeatureTypeRequest request) {

        final WfsFactory factory = WfsFactory.eINSTANCE;

        DescribeFeatureTypeType dft = factory.createDescribeFeatureTypeType();

        Version version = getServiceVersion();
        dft.setService("WFS");
        dft.setVersion(version.toString());
        dft.setHandle(request.getHandle());
View Full Code Here

        return dft;
    }

    @Override
    protected EObject createTransactionRequest(TransactionRequest request) throws IOException {
        final WfsFactory factory = WfsFactory.eINSTANCE;

        TransactionType tx = factory.createTransactionType();
        tx.setService("WFS");
        tx.setHandle(request.getHandle());
        tx.setVersion(getVersion());

        List<TransactionElement> transactionElements = request.getTransactionElements();
View Full Code Here

    }

    @SuppressWarnings("unchecked")
    private String createTransactionResponseXml(List<String> added, int updated, int deleted)
            throws IOException {
        WfsFactory factory = WfsFactory.eINSTANCE;

        TransactionResponseType tr = factory.createTransactionResponseType();
        tr.setVersion(getStrategy().getVersion());

        tr.setTransactionSummary(factory.createTransactionSummaryType());
        tr.getTransactionSummary().setTotalInserted(BigInteger.valueOf(added.size()));
        tr.getTransactionSummary().setTotalUpdated(BigInteger.valueOf(updated));
        tr.getTransactionSummary().setTotalDeleted(BigInteger.valueOf(deleted));
        tr.setTransactionResults(factory.createTransactionResultsType());
        tr.setInsertResults(factory.createInsertResultsType());

        if (!added.isEmpty()) {
            FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();
            InsertedFeatureType inserted = factory.createInsertedFeatureType();
            tr.getInsertResults().getFeature().add(inserted);
            for (String addedId : added) {
                FeatureId featureId = ff.featureId(addedId);
                inserted.getFeatureId().add(featureId);
            }
View Full Code Here

     * @see WFSStrategy#createGetFeatureRequest(WFS_1_1_0_DataStore, WFSProtocol, Query, String)
     */
    @SuppressWarnings("unchecked")
    public RequestComponents createGetFeatureRequest(WFSProtocol wfs, GetFeature query)
            throws IOException {
        final WfsFactory factory = WfsFactory.eINSTANCE;

        GetFeatureType getFeature = factory.createGetFeatureType();
        getFeature.setService("WFS");
        getFeature.setVersion(wfs.getServiceVersion().toString());
        getFeature.setOutputFormat(query.getOutputFormat());

        getFeature.setHandle("GeoTools " + GeoTools.getVersion() + " WFS DataStore");
        Integer maxFeatures = query.getMaxFeatures();
        if (maxFeatures != null) {
            getFeature.setMaxFeatures(BigInteger.valueOf(maxFeatures.intValue()));
        }

        ResultType resultType = query.getResultType();
        getFeature.setResultType(RESULTS == resultType ? RESULTS_LITERAL : HITS_LITERAL);

        QueryType wfsQuery = factory.createQueryType();
        wfsQuery.setTypeName(Collections.singletonList(query.getTypeName()));

        Filter serverFilter = query.getFilter();
        if (!Filter.INCLUDE.equals(serverFilter)) {
            wfsQuery.setFilter(serverFilter);
View Full Code Here

        XMLUnit.setXpathNamespaceContext(new SimpleNamespaceContext(namespaces));
    }
   
    @Test
    public void encodeUpdate() throws IOException, SAXException, TransformerException, XpathException{
        WfsFactory wfsfac = WfsFactory.eINSTANCE;
        FilterFactory2 filterfac = CommonFactoryFinder.getFilterFactory2();
        GeometryFactory geomfac = new GeometryFactory(new PrecisionModel(10));
       
        UpdateElementType update = wfsfac.createUpdateElementType();
        PropertyType propertyType = wfsfac.createPropertyType();
        propertyType.setName(new QName("http://my.namespace","myproperty","mn"));
        update.getProperty().add(propertyType);
        update.setTypeName(new QName("http://my.namespace","mytypename","mn"));
        update.setFilter(filterfac.id( filterfac.featureId("someid")));
       
View Full Code Here

               
    }
   
    @Test
    public void encodeInsert() throws IOException, SAXException, TransformerException, XpathException{
        WfsFactory wfsfac = WfsFactory.eINSTANCE;
        FeatureFactory ff = CommonFactoryFinder.getFeatureFactory(null);
        FeatureTypeFactory ftf = new FeatureTypeFactoryImpl();
       
        AttributeDescriptor ad = ftf.createAttributeDescriptor(XSSchema.STRING_TYPE, new NameImpl("dummyAttribute"), 0, 1, true, null);
        SimpleFeatureType ft = ftf.createSimpleFeatureType(new NameImpl("dummyFeatureType"), Collections.singletonList(ad), null, false, null, null, null);
        SimpleFeature feature = ff.createSimpleFeature(new Object[] {"dummyValue"}, ft, "dummyId");
       
        InsertElementType insert = wfsfac.createInsertElementType();
        insert.getFeature().add(feature);       
       
        Encoder encoder = new Encoder(new WFSConfiguration());
        //System.out.println(encoder.encodeAsString(insert, WFS.Insert));
        Document doc = encoder.encodeAsDOM(insert, WFS.Insert);
View Full Code Here

       
    }
   
    @Test
    public void encodeDelete() throws IOException, SAXException, TransformerException, XpathException{
        WfsFactory wfsfac = WfsFactory.eINSTANCE;
        FilterFactory2 filterfac = CommonFactoryFinder.getFilterFactory2();
               
        DeleteElementType delete = wfsfac.createDeleteElementType();
        delete.setFilter(filterfac.id( filterfac.featureId("someid")));
       
        Encoder encoder = new Encoder(new WFSConfiguration());
        //System.out.println(encoder.encodeAsString(delete, WFS.Delete));
        Document doc = encoder.encodeAsDOM(delete, WFS.Delete);
View Full Code Here

        XMLUnit.setXpathNamespaceContext(new SimpleNamespaceContext(namespaces));
    }
   
    @Test
    public void encodeUpdate() throws IOException, SAXException, TransformerException, XpathException{
        WfsFactory wfsfac = WfsFactory.eINSTANCE;
        FilterFactory2 filterfac = CommonFactoryFinder.getFilterFactory2();
        GeometryFactory geomfac = new GeometryFactory(new PrecisionModel(10));
       
        UpdateElementType update = wfsfac.createUpdateElementType();
        PropertyType propertyType = wfsfac.createPropertyType();
        propertyType.setName(new QName("http://my.namespace","myproperty","mn"));
        update.getProperty().add(propertyType);
        update.setTypeName(new QName("http://my.namespace","mytypename","mn"));
        update.setFilter(filterfac.id( filterfac.featureId("someid")));
       
View Full Code Here

               
    }
   
    @Test
    public void encodeInsert() throws IOException, SAXException, TransformerException, XpathException{
        WfsFactory wfsfac = WfsFactory.eINSTANCE;
        FeatureFactory ff = CommonFactoryFinder.getFeatureFactory(null);
        FeatureTypeFactory ftf = new FeatureTypeFactoryImpl();
       
        AttributeDescriptor ad = ftf.createAttributeDescriptor(XSSchema.STRING_TYPE, new NameImpl("dummyAttribute"), 0, 1, true, null);
        SimpleFeatureType ft = ftf.createSimpleFeatureType(new NameImpl("dummyFeatureType"), Collections.singletonList(ad), null, false, null, null, null);
        SimpleFeature feature = ff.createSimpleFeature(new Object[] {"dummyValue"}, ft, "dummyId");
       
        InsertElementType insert = wfsfac.createInsertElementType();
        insert.getFeature().add(feature);       
       
        Encoder encoder = new Encoder(new WFSConfiguration());
        //System.out.println(encoder.encodeAsString(insert, WFS.Insert));
        Document doc = encoder.encodeAsDOM(insert, WFS.Insert);
View Full Code Here

TOP

Related Classes of net.opengis.wfs.WfsFactory

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.