Package org.geotools.data.wfs.v1_0_0

Examples of org.geotools.data.wfs.v1_0_0.Action$InsertAction


        out.append( txt );
        out.append("\n");//$NON-NLS-1$
    }  
    private static FeatureSetDescription find( WFSCapabilities caps, String typeName ){
        for( Object obj : caps.getFeatureTypes() ){
            FeatureSetDescription description = (FeatureSetDescription) obj;
            if( typeName.equals( description.getName() )){
                return description;
            }
        }
        return null;
    }
View Full Code Here


            if (validation && value.length < 2) {
                throw new SAXException(
                    "Missing child element for FeatureTypeType");
            }

            FeatureSetDescription fsd = new FeatureSetDescription();
            List llbb = new LinkedList();

            for (int i = 0; i < value.length; i++) {
                if (value[i].getElement() == null) {
                    throw new SAXException(
                        "Internal error -- a value object representing a child element was missing an element declaration");
                }

                if (elements[0].getName().equals(value[i].getElement().getName())) {
                    // Name
                    fsd.setName((String) value[i].getValue());
                    if(fsd.getName()!=null){
                        int j = fsd.getName().indexOf(":");
                        if(j>0){
                            // we have a ns prefix
                            String prefix = fsd.getName().substring(0,j);
                        }
                    }
                } else {
                    if (elements[1].getName().equals(value[i].getElement()
                                                                 .getName())) {
                        // Title
                        fsd.setTitle((String) value[i].getValue());
                    } else {
                        if (elements[2].getName().equals(value[i].getElement()
                                                                     .getName())) {
                            // Abstract
                            String t = (String) value[i].getValue();
                            t = "NONE".equals(t) ? "" : t;
                            fsd.setAbstract(t);
                        } else {
                            if (elements[3].getName().equals(value[i].getElement()
                                                                         .getName())) {
                                // Keywords
                                String t = (String) value[i].getValue();
                                t = (t == null) ? "" : t;
                                fsd.setKeywords(Arrays.asList(t.split(" ")));
                            } else {
                                if (elements[4].getName().equals(value[i].getElement()
                                                                             .getName())) {
                                    // SRS
                                    fsd.setSRS((String) value[i].getValue());
                                } else {
                                    if (elements[5].getName().equals(value[i].getElement()
                                                                                 .getName())) {
                                        // Operations
                                        fsd.setOperations(((Integer) value[i]
                                            .getValue()).intValue());
                                    } else {
                                        if (elements[6].getName().equals(value[i].getElement()
                                                                                     .getName())) {
                                            // LatLongBoundingBox
                                            llbb.add(value[i].getValue());
                                        } else {
                                            if (elements[7].getName().equals(value[i].getElement()
                                                                                         .getName())) {
                                                // MetadataURL
                                                //                                                mdurl.add((MetadataURL) value[i]
                                                //                                                    .getValue());
                                            } else {
                                                // error
                                                throw new SAXException(
                                                    "Unknown child element within a FeatureTypeType: "
                                                    + ((value[i].getElement()
                                                                .getName() == null)
                                                    ? "null"
                                                    : value[i].getElement()
                                                              .getName()));
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }

            if (llbb.size() > 0) {
                Envelope e = (Envelope) llbb.get(0);

                for (int i = 1; i < llbb.size(); i++)
                    e.expandToInclude((Envelope) llbb.get(i));

                fsd.setLatLongBoundingBox(e);
            }
            if ((fsd.getName() == null) || (fsd.getSRS() == null)) {
                throw new SAXException(
                    "Missing child element for FeatureTypeType");
            }

            return fsd;
View Full Code Here

            attributes.addAttribute(WFSSchema.NAMESPACE.toString(),
                attrs[1].getName(), null, "string", attrs[1].getFixed());
            attributes.addAttribute(WFSSchema.NAMESPACE.toString(),
                attrs[3].getName(), null, "string", "ALL");

            LockRequest lockRequest = (LockRequest) value;

            if ((lockRequest != null) && (lockRequest.getDuration() > 0)) {
                attributes.addAttribute(WFSSchema.NAMESPACE.toString(),
                    elems[2].getName(), null, "integer",
                    "" + lockRequest.getDuration());
            }

            output.startElement(element.getNamespace(), element.getName(),
                attributes);

            Object[] t = new Object[2];

            for (int i = 0; i < lockRequest.getTypeNames().length; i++) {
                t[0] = lockRequest.getTypeNames()[i];
                t[1] = lockRequest.getFilters()[i];
                elems[0].getType().encode(elems[0], t, output, hints);
            }

            output.endElement(element.getNamespace(), element.getName());
        }
View Full Code Here

            Object[] t = (Object[]) value;
            AttributesImpl attributes = new AttributesImpl();
            attributes.addAttribute(WFSSchema.NAMESPACE.toString(),
                attrs[1].getName(), null, "string", (String) t[0]);

            LockRequest lockRequest = (LockRequest) value;

            if ((lockRequest != null) && (lockRequest.getDuration() > 0)) {
                attributes.addAttribute(WFSSchema.NAMESPACE.toString(),
                    elems[2].getName(), null, "integer",
                    "" + lockRequest.getDuration());
            }

            output.startElement(element.getNamespace(), element.getName(),
                attributes);
            elems[0].getType().encode(elems[0], t[1], output, hints);
View Full Code Here

                                                                       .getType()
                                                                       .getName())) {
                out = (Id) value[i++];
            }

            return new LockResult(lockId, in, out);
        }
View Full Code Here

            }
            Object[] t = (Object[]) value[value.length - 1].getValue();
            int status = ((Integer) t[0]).intValue();
            SAXException error = (SAXException) ((t.length < 2) ? null : t[1]);

            return new TransactionResult(status, fidSet, error);
        }
View Full Code Here

        if (Version.v1_0_0 == version) {
            final ConnectionFactory connectionFac = new DefaultConnectionFactory(tryGZIP, user,
                    pass, defaultEncoding, timeoutMillis);
            InputStream reader = new ByteArrayInputStream(wfsCapabilitiesRawData);
            final WFS100ProtocolHandler protocolHandler = new WFS100ProtocolHandler(reader,
                    connectionFac);

            try {
                HttpMethod prefferredProtocol = Boolean.TRUE.equals(protocol) ? POST : GET;
                dataStore = new WFS_1_0_0_DataStore(prefferredProtocol, protocolHandler,
View Full Code Here

            if (validation && ((value == null) || (value.length != 4))) {
                throw new SAXException(
                    "The WFS Capabilites document has the wrong number of children");
            }

            WFSCapabilities result = new WFSCapabilities();

            for (int i = 0; i < 4 && i < value.length; i++) {
                if (elements[0].getName().equals(value[i].getElement().getName())) {
                    // service
                    result.setService((Service) value[i].getValue());
                } else {
                    if (elements[1].getName().equals(value[i].getElement()
                                                                 .getName())) {
                        // capability
                        Object[] temp = (Object[]) value[i].getValue();

                        if (temp.length != 2) {
                            throw new SAXException(
                                "The WFS Capabilites document has an invalid capability child");
                        }

                        result.setVendorSpecificCapabilities((String) temp[0]);

                        OperationType[] tmp = (OperationType[]) temp[1];

                        if (tmp != null) {
                            result.setGetCapabilities(tmp[0]);
                            result.setDescribeFeatureType(tmp[1]);
                            result.setTransaction(tmp[2]);
                            result.setGetFeature(tmp[3]);
                            result.setGetFeatureWithLock(tmp[4]);
                            result.setLockFeature(tmp[5]);
                        }
                    } else {
                        if (elements[2].getName().equals(value[i].getElement()
                                                                     .getName())) {
                            // FeatureTypeList
                            result.setFeatureTypes((List) value[i].getValue());
                        } else {
                            if (elements[3].getName().equals(value[i].getElement()
                                                                         .getName())) {
                                // Filter_Capabilities
                                result.setFilterCapabilities((FilterCapabilities) value[i]
                                    .getValue());
                            } else {
                                if(validation){
                                    // error
                                    throw new SAXException("The element "
View Full Code Here

            if (handle != null) {
                attributes.addAttribute(WFSSchema.NAMESPACE.toASCIIString(), "handle", null,
                        "string", handle);
            }           
           
            WFSTransactionState transactionRequest = (WFSTransactionState) value;

            output.startElement(element.getNamespace(), element.getName(),
                attributes);

            if (transactionRequest.getLockId() != null) {
                elems[0].getType().encode(elems[0],
                    transactionRequest.getLockId(), output, hints);
            }

            Iterator actions = transactionRequest.getAllActions().iterator();

            while (actions.hasNext()) {
                Action a = (Action) actions.next();

                switch (a.getType()) {
View Full Code Here

            final WFS100ProtocolHandler protocolHandler = new WFS100ProtocolHandler(reader,
                    connectionFac);

            try {
                HttpMethod prefferredProtocol = Boolean.TRUE.equals(protocol) ? POST : GET;
                dataStore = new WFS_1_0_0_DataStore(prefferredProtocol, protocolHandler,
                        timeoutMillis, buffer, lenient, wfsStrategy, filterCompliance);
            } catch (SAXException e) {
                logger.warning(e.toString());
                throw new IOException(e.toString());
            }
View Full Code Here

TOP

Related Classes of org.geotools.data.wfs.v1_0_0.Action$InsertAction

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.