001: /* Copyright (c) 2001 - 2007 TOPP - www.openplans.org. All rights reserved.
002: * This code is licensed under the GPL 2.0 license, availible at the root
003: * application directory.
004: */
005: package org.geoserver.wfs.xml.v1_1_0;
006:
007: import net.opengis.wfs.GetFeatureWithLockType;
008: import net.opengis.wfs.QueryType;
009: import net.opengis.wfs.ResultTypeType;
010: import net.opengis.wfs.WfsFactory;
011: import org.geotools.xml.AbstractComplexBinding;
012: import org.geotools.xml.ElementInstance;
013: import org.geotools.xml.Node;
014: import java.math.BigInteger;
015: import javax.xml.namespace.QName;
016:
017: /**
018: * Binding object for the type http://www.opengis.net/wfs:GetFeatureWithLockType.
019: *
020: * <p>
021: * <pre>
022: * <code>
023: * <xsd:complexType name="GetFeatureWithLockType">
024: * <xsd:annotation>
025: * <xsd:documentation>
026: * A GetFeatureWithLock request operates identically to a
027: * GetFeature request expect that it attempts to lock the
028: * feature instances in the result set and includes a lock
029: * identifier in its response to a client. A lock identifier
030: * is an identifier generated by a Web Feature Service that
031: * a client application can use, in subsequent operations,
032: * to reference the locked set of feature instances.
033: * </xsd:documentation>
034: * </xsd:annotation>
035: * <xsd:complexContent>
036: * <xsd:extension base="wfs:BaseRequestType">
037: * <xsd:sequence>
038: * <xsd:element maxOccurs="unbounded" ref="wfs:Query"/>
039: * </xsd:sequence>
040: * <xsd:attribute default="5" name="expiry"
041: * type="xsd:positiveInteger" use="optional">
042: * <xsd:annotation>
043: * <xsd:documentation>
044: * The expiry attribute is used to set the length
045: * of time (expressed in minutes) that features will
046: * remain locked as a result of a GetFeatureWithLock
047: * request. After the expiry period elapses, the
048: * locked resources must be released. If the
049: * expiry attribute is not set, then the default
050: * value of 5 minutes will be enforced.
051: * </xsd:documentation>
052: * </xsd:annotation>
053: * </xsd:attribute>
054: * <xsd:attribute default="results" name="resultType"
055: * type="wfs:ResultTypeType" use="optional">
056: * <xsd:annotation>
057: * <xsd:documentation>
058: * See definition of wfs:GetFeatureType.
059: * </xsd:documentation>
060: * </xsd:annotation>
061: * </xsd:attribute>
062: * <xsd:attribute default="text/xml; subtype=gml/3.1.1"
063: * name="outputFormat" type="xsd:string" use="optional">
064: * <xsd:annotation>
065: * <xsd:documentation>
066: * See definition of wfs:GetFeatureType.
067: * </xsd:documentation>
068: * </xsd:annotation>
069: * </xsd:attribute>
070: * <xsd:attribute name="maxFeatures" type="xsd:positiveInteger" use="optional">
071: * <xsd:annotation>
072: * <xsd:documentation>
073: * See definition of wfs:GetFeatureType.
074: * </xsd:documentation>
075: * </xsd:annotation>
076: * </xsd:attribute>
077: * <xsd:attribute name="traverseXlinkDepth" type="xsd:string" use="optional">
078: * <xsd:annotation>
079: * <xsd:documentation>
080: * See definition of wfs:GetFeatureType.
081: * </xsd:documentation>
082: * </xsd:annotation>
083: * </xsd:attribute>
084: * <xsd:attribute name="traverseXlinkExpiry"
085: * type="xsd:positiveInteger" use="optional">
086: * <xsd:annotation>
087: * <xsd:documentation>
088: * See definition of wfs:GetFeatureType.
089: * </xsd:documentation>
090: * </xsd:annotation>
091: * </xsd:attribute>
092: * </xsd:extension>
093: * </xsd:complexContent>
094: * </xsd:complexType>
095: *
096: * </code>
097: * </pre>
098: * </p>
099: *
100: * @generated
101: */
102: public class GetFeatureWithLockTypeBinding extends
103: AbstractComplexBinding {
104: WfsFactory wfsfactory;
105:
106: public GetFeatureWithLockTypeBinding(WfsFactory wfsfactory) {
107: this .wfsfactory = wfsfactory;
108: }
109:
110: /**
111: * @generated
112: */
113: public QName getTarget() {
114: return WFS.GETFEATUREWITHLOCKTYPE;
115: }
116:
117: /**
118: * <!-- begin-user-doc -->
119: * <!-- end-user-doc -->
120: *
121: * @generated modifiable
122: */
123: public Class getType() {
124: return GetFeatureWithLockType.class;
125: }
126:
127: /**
128: * <!-- begin-user-doc -->
129: * <!-- end-user-doc -->
130: *
131: * @generated modifiable
132: */
133: public Object parse(ElementInstance instance, Node node,
134: Object value) throws Exception {
135: GetFeatureWithLockType getFeatureWithLock = wfsfactory
136: .createGetFeatureWithLockType();
137:
138: //<xsd:element maxOccurs="unbounded" ref="wfs:Query"/>
139: getFeatureWithLock.getQuery().addAll(
140: node.getChildValues(QueryType.class));
141:
142: //<xsd:attribute default="5" name="expiry" type="xsd:positiveInteger" use="optional">
143: if (node.hasAttribute("expiry")) {
144: getFeatureWithLock.setExpiry((BigInteger) node
145: .getChildValue("expiry"));
146: }
147:
148: //<xsd:attribute default="results" name="resultType" type="wfs:ResultTypeType" use="optional">
149: if (node.hasAttribute("resultType")) {
150: getFeatureWithLock.setResultType((ResultTypeType) node
151: .getAttributeValue("resultType"));
152: }
153:
154: //<xsd:attribute default="text/xml; subtype=gml/3.1.1"
155: // name="outputFormat" type="xsd:string" use="optional">
156: if (node.hasAttribute("outputFormat")) {
157: getFeatureWithLock.setOutputFormat((String) node
158: .getAttributeValue("outputFormat"));
159: }
160:
161: //<xsd:attribute name="maxFeatures" type="xsd:positiveInteger" use="optional">
162: if (node.hasAttribute("maxFeatures")) {
163: getFeatureWithLock.setMaxFeatures((BigInteger) node
164: .getAttributeValue("maxFeatures"));
165: }
166:
167: //<xsd:attribute name="traverseXlinkDepth" type="xsd:string" use="optional">
168: if (node.hasAttribute("traverseXlinkDepth")) {
169: getFeatureWithLock.setTraverseXlinkDepth((String) node
170: .getAttributeValue("traverseXlinkDepth"));
171: }
172:
173: //<xsd:attribute name="traverseXlinkExpiry"
174: // type="xsd:positiveInteger" use="optional">
175: if (node.hasAttribute("traverseXlinkExpiry")) {
176: getFeatureWithLock.setTraverseXlinkExpiry((BigInteger) node
177: .getAttributeValue("traverseXlinkExpiry"));
178: }
179:
180: return getFeatureWithLock;
181: }
182: }
|