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.wfsv.xml.v1_1_0;
006:
007: import java.math.BigInteger;
008:
009: import net.opengis.wfs.ResultTypeType;
010: import net.opengis.wfsv.DifferenceQueryType;
011: import net.opengis.wfsv.GetLogType;
012: import net.opengis.wfsv.WfsvFactory;
013: import org.geotools.xml.AbstractComplexBinding;
014: import org.geotools.xml.ElementInstance;
015: import org.geotools.xml.Node;
016: import javax.xml.namespace.QName;
017:
018: /**
019: * Binding object for the type http://www.opengis.net/wfsv:GetLogType.
020: *
021: * <p>
022: * <pre>
023: * <code>
024: * <xsd:complexType name="GetLogType">
025: * <xsd:annotation>
026: * <xsd:documentation>
027: * A GetLog element contains one or more DifferenceQuery elements
028: * that describe a diffence query operation on one feature type.
029: * In response to a GetLog request, a Web Feature Service
030: * must be able to generate a list of logs entries for features matched
031: * by the DifferenceQuery parameters. Each log entry is an instance
032: * of the ChangeSet feature type.
033: * In response to a GetFeature request, a Versioning Web Feature Service
034: * must be able to generate a GML3 response that validates
035: * using a schema generated by the DescribeFeatureType request against
036: * the ChangeSets feature type.
037: * A Web Feature Service may support other possibly non-XML
038: * (and even binary) output formats as long as those formats
039: * are advertised in the capabilities document.
040: * </xsd:documentation>
041: * </xsd:annotation>
042: * <xsd:complexContent>
043: * <xsd:extension base="wfs:BaseRequestType">
044: * <xsd:sequence>
045: * <xsd:element maxOccurs="unbounded" ref="wfsv:DifferenceQuery"/>
046: * </xsd:sequence>
047: * <xsd:attribute default="results" name="resultType"
048: * type="wfs:ResultTypeType" use="optional">
049: * <xsd:annotation>
050: * <xsd:documentation>
051: * The resultType attribute is used to indicate
052: * what response a wfsv should return to user once
053: * a GetFeature request is processed.
054: * Possible values are:
055: * results - meaning that the full response set
056: * (i.e. all the feature instances)
057: * should be returned.
058: * hits - meaning that an empty response set
059: * should be returned (i.e. no feature
060: * instances should be returned) but
061: * the "numberOfFeatures" attribute
062: * should be set to the number of feature
063: * instances that would be returned.
064: * </xsd:documentation>
065: * </xsd:annotation>
066: * </xsd:attribute>
067: * <xsd:attribute default="text/xml; subtype=gml/3.1.1"
068: * name="outputFormat" type="xsd:string" use="optional">
069: * <xsd:annotation>
070: * <xsd:documentation>
071: * The outputFormat attribute is used to specify the output
072: * format that the Versioning Web Feature Service should generate in
073: * response to a GetLog element.
074: * The default value of 'text/xml; subtype=gml/3.1.1'
075: * indicates that the output is an XML document that
076: * conforms to the Geography Markup Language (GML)
077: * Implementation Specification V3.1.1.
078: * For the purposes of experimentation, vendor extension,
079: * or even extensions that serve a specific community of
080: * interest, other acceptable output format values may be
081: * used to specify other formats as long as those values
082: * are advertised in the capabilities document.
083: * </xsd:documentation>
084: * </xsd:annotation>
085: * </xsd:attribute>
086: * <xsd:attribute name="maxFeatures" type="xsd:positiveInteger" use="optional">
087: * <xsd:annotation>
088: * <xsd:documentation>
089: * The maxFeatures attribute is used to specify the maximum
090: * number of features that a GetFeature operation should
091: * generate (regardless of the actual number of query hits).
092: * </xsd:documentation>
093: * </xsd:annotation>
094: * </xsd:attribute>
095: * </xsd:extension>
096: * </xsd:complexContent>
097: * </xsd:complexType>
098: *
099: * </code>
100: * </pre>
101: * </p>
102: *
103: * @generated
104: */
105: public class GetLogTypeBinding extends AbstractComplexBinding {
106: private WfsvFactory wfsvFactory;
107:
108: public GetLogTypeBinding(WfsvFactory wfsvFactory) {
109: this .wfsvFactory = wfsvFactory;
110: }
111:
112: /**
113: * @generated
114: */
115: public QName getTarget() {
116: return WFSV.GetLogType;
117: }
118:
119: /**
120: * <!-- begin-user-doc -->
121: * <!-- end-user-doc -->
122: *
123: * @generated modifiable
124: */
125: public Class getType() {
126: return GetLogType.class;
127: }
128:
129: /**
130: * <!-- begin-user-doc -->
131: * <!-- end-user-doc -->
132: *
133: * @generated modifiable
134: */
135: public Object parse(ElementInstance instance, Node node,
136: Object value) throws Exception {
137: GetLogType result = wfsvFactory.createGetLogType();
138: result.getDifferenceQuery().addAll(
139: node.getChildValues(DifferenceQueryType.class));
140:
141: if (node.hasAttribute("resultType")) {
142: result.setResultType((ResultTypeType) node
143: .getAttributeValue("resultType"));
144: }
145: if (node.hasAttribute("version"))
146: result.setVersion((String) node
147: .getAttributeValue("version"));
148: else
149: result.setVersion("1.1.0");
150:
151: if (node.hasAttribute("outputFormat")) {
152: result.setOutputFormat((String) node
153: .getAttributeValue("outputFormat"));
154: } else {
155: if ("1.0.0".equals(result.getVersion()))
156: result.setOutputFormat("GML2");
157: else
158: result.setOutputFormat("text/xml; subtype=gml/3.1.1");
159: }
160:
161: if (node.hasAttribute("maxFeatures")) {
162: result.setMaxFeatures((BigInteger) node
163: .getAttributeValue("maxFeatures"));
164: }
165:
166: return result;
167: }
168:
169: }
|