Revision 399

View differences:

org.gvsig.wfs.app/tags/org.gvsig.wfs.app-2.0.62/org.gvsig.wfs.app.mainplugin/pom.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2

  
3
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4

  
5
    <modelVersion>4.0.0</modelVersion>
6
    <artifactId>org.gvsig.wfs.app.mainplugin</artifactId>
7

  
8
    <packaging>jar</packaging>
9
    <name>${project.artifactId}</name>
10
    <description>Web Feature Service support</description>
11

  
12
    <parent>
13
        <groupId>org.gvsig</groupId>
14
        <artifactId>org.gvsig.wfs.app</artifactId>
15
        <version>2.0.62</version>
16
    </parent>
17

  
18

  
19

  
20
    <dependencies>
21
        <dependency>
22
            <groupId>org.gvsig</groupId>
23
            <artifactId>org.gvsig.app.mainplugin</artifactId>
24
            <scope>compile</scope>
25
        </dependency>
26
        <dependency>
27
            <groupId>org.gvsig</groupId>
28
            <artifactId>org.gvsig.utils</artifactId>
29
            <scope>compile</scope>
30
        </dependency>
31
        <dependency>
32
            <groupId>org.gvsig</groupId>
33
            <artifactId>org.gvsig.remoteclient</artifactId>
34
            <scope>compile</scope>
35
        </dependency>
36
        <dependency>
37
            <groupId>org.gvsig</groupId>
38
            <artifactId>org.gvsig.andami</artifactId>
39
            <scope>compile</scope>
40
        </dependency>
41
        <dependency>
42
            <groupId>org.gvsig</groupId>
43
            <artifactId>org.gvsig.projection.api</artifactId>
44
            <scope>compile</scope>
45
        </dependency>
46
        <dependency>
47
            <groupId>org.gvsig</groupId>
48
            <artifactId>org.gvsig.ui</artifactId>
49
            <scope>compile</scope>
50
        </dependency>
51
        <dependency>
52
            <groupId>org.gvsig</groupId>
53
            <artifactId>org.gvsig.gpe.extension</artifactId>
54
            <version>2.0</version>
55
            <classifier>store</classifier>
56
            <scope>compile</scope>
57
        </dependency>
58
        <dependency>
59
            <groupId>org.gvsig</groupId>
60
            <artifactId>org.gvsig.gpe.lib.api</artifactId>
61
            <scope>compile</scope>
62
        </dependency>
63
        <dependency>
64
            <groupId>org.gvsig</groupId>
65
            <artifactId>org.gvsig.xmlschema.lib.api</artifactId>
66
            <scope>compile</scope>
67
        </dependency>
68
        <dependency>
69
            <groupId>org.gvsig</groupId>
70
            <artifactId>org.gvsig.fmap.dal.api</artifactId>
71
            <scope>compile</scope>
72
        </dependency>
73
        <dependency>
74
            <groupId>org.gvsig</groupId>
75
            <artifactId>org.gvsig.fmap.dal.spi</artifactId>
76
            <scope>compile</scope>
77
        </dependency>
78
        <dependency>
79
            <groupId>org.gvsig</groupId>
80
            <artifactId>org.gvsig.tools.lib</artifactId>
81
            <scope>compile</scope>
82
        </dependency>
83
        <dependency>
84
            <groupId>org.gvsig</groupId>
85
            <artifactId>org.gvsig.tools.swing.api</artifactId>
86
            <scope>compile</scope>
87
        </dependency>
88
        <dependency>
89
            <groupId>org.gvsig</groupId>
90
            <artifactId>org.gvsig.fmap.mapcontext.api</artifactId>
91
            <scope>compile</scope>
92
        </dependency>
93
        <dependency>
94
            <groupId>org.gvsig</groupId>
95
            <artifactId>org.gvsig.fmap.geometry.api</artifactId>
96
        </dependency>
97
        <dependency>
98
            <groupId>org.gvsig</groupId>
99
            <artifactId>org.gvsig.fmap.control</artifactId>
100
            <scope>compile</scope>
101
        </dependency>
102
        <dependency>
103
            <groupId>org.gvsig</groupId>
104
            <artifactId>org.gvsig.metadata.lib.basic.api</artifactId>
105
            <scope>compile</scope>
106
        </dependency>
107

  
108
        <dependency>
109
            <groupId>org.gvsig</groupId>
110
            <artifactId>org.gvsig.tools.lib</artifactId>
111
            <type>test-jar</type>
112
            <scope>test</scope>
113
        </dependency>
114
        <dependency>
115
            <groupId>org.gvsig</groupId>
116
            <artifactId>org.gvsig.compat.se</artifactId>
117
            <scope>test</scope>
118
        </dependency>
119
        <dependency>
120
            <groupId>org.gvsig</groupId>
121
            <artifactId>org.gvsig.xmlpull.lib.impl</artifactId>
122
            <scope>runtime</scope>
123
        </dependency>
124
        <dependency>
125
            <groupId>org.gvsig</groupId>
126
            <artifactId>org.gvsig.xmlpull.prov.kxml</artifactId>
127
            <scope>runtime</scope>
128
        </dependency>
129
        <dependency>
130
            <groupId>org.gvsig</groupId>
131
            <artifactId>org.gvsig.xmlschema.lib.impl</artifactId>
132
            <scope>runtime</scope>
133
        </dependency>
134
        <dependency>
135
            <groupId>org.gvsig</groupId>
136
            <artifactId>org.gvsig.xmlschema.prov.kxml</artifactId>
137
            <scope>runtime</scope>
138
        </dependency>
139
        <dependency>
140
            <groupId>org.gvsig</groupId>
141
            <artifactId>org.gvsig.timesupport.lib.api</artifactId>
142
            <scope>compile</scope>
143
        </dependency>
144
        <dependency>
145
            <groupId>java3d</groupId>
146
            <artifactId>vecmath</artifactId>
147
            <scope>runtime</scope>
148
        </dependency>
149

  
150
        <!--
151
        <dependency>
152
            <groupId>org.geotools</groupId>
153
            <artifactId>gt2-main</artifactId>
154
            <scope>compile</scope>
155
        </dependency>
156
        -->
157

  
158
        <dependency>
159
            <groupId>org.slf4j</groupId>
160
            <artifactId>slf4j-api</artifactId>
161
            <scope>compile</scope>
162
        </dependency>
163
        <dependency>
164
            <groupId>zql</groupId>
165
            <artifactId>zql</artifactId>
166
            <scope>compile</scope>
167
        </dependency>
168
        <dependency>
169
            <groupId>org.gvsig</groupId>
170
            <artifactId>org.gvsig.i18n</artifactId>
171
            <scope>compile</scope>
172
        </dependency>
173

  
174
    </dependencies>
175

  
176
    <build>
177
        <plugins>
178
            <plugin>
179
                <groupId>org.apache.maven.plugins</groupId>
180
                <artifactId>maven-surefire-plugin</artifactId>
181
                <configuration>
182
                    <!-- TODO: MAKE TESTS WORK AND REMOVE THIS OPTION -->
183
                    <skipTests>true</skipTests>
184
                </configuration>
185
            </plugin>
186
      <plugin>
187
        <!-- Skip compilation tests -->
188
        <groupId>org.apache.maven.plugins</groupId>
189
        <artifactId>maven-compiler-plugin</artifactId>
190
        <executions>
191
          <execution>
192
            <id>default-testCompile</id>
193
            <phase>process-test-sources</phase>
194
            <goals>
195
              <goal>testCompile</goal>
196
            </goals>
197
            <configuration>
198
              <skip>true</skip>
199
            </configuration>
200
          </execution>
201
        </executions>
202
      </plugin>            
203
        </plugins>
204
    </build>
205

  
206
    <properties>
207
        <gvsig.package.info.name>Formats: WFS support</gvsig.package.info.name>
208
        <gvsig.package.info.dependencies>required: org.gvsig.app.mainplugin -ge 2,required: org.gvsig.gpe.app.mainplugin -ge 2</gvsig.package.info.dependencies>
209
        <gvsig.package.info.poolURL>https://devel.gvsig.org/download/projects/gvsig-wfs/pool</gvsig.package.info.poolURL>
210
        <gvsig.package.info.sourcesURL>https://devel.gvsig.org/svn/gvsig-wfs/org.gvsig.wfs.app</gvsig.package.info.sourcesURL>
211
        <gvsig.package.info.state>testing</gvsig.package.info.state>
212
        <!-- alpha-devel -->
213
        <gvsig.package.info.categories>Formats,Vector,OGC,Remote Services</gvsig.package.info.categories>
214
        <gvsig.package.info.official>true</gvsig.package.info.official>
215

  
216
    </properties>
217

  
218
</project>
org.gvsig.wfs.app/tags/org.gvsig.wfs.app-2.0.62/org.gvsig.wfs.app.mainplugin/buildNumber.properties
1
#Thu Aug 10 22:19:57 CEST 2017
2
buildNumber=2144
org.gvsig.wfs.app/tags/org.gvsig.wfs.app-2.0.62/org.gvsig.wfs.app.mainplugin/src/main/java/org/gvsig/remoteclient/wfs/edition/IWFSTOperation.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.remoteclient.wfs.edition;
25
/**
26
 * @author Jorge Piera LLodr? (jorge.piera@iver.es)
27
 */
28
public interface IWFSTOperation {
29

  
30
	/**
31
	 * @return the operation name
32
	 */
33
	public String getOperationName();
34
	
35
	public boolean hasTypeName();
36

  
37
}
0 38

  
org.gvsig.wfs.app/tags/org.gvsig.wfs.app-2.0.62/org.gvsig.wfs.app.mainplugin/src/main/java/org/gvsig/remoteclient/wfs/edition/WFSTTags.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.remoteclient.wfs.edition;
25
/**
26
 * @author Jorge Piera LLodr? (jorge.piera@iver.es)
27
 */
28
public class WFSTTags {
29
	public static final String XML_ROOT = "<?xml version=\"1.0\" ?>";
30
	public static final String XMLNS = "xmlns";
31
	public static final String XML_NAMESPACE_PREFIX = "xsi";
32
	public static final String XML_NAMESPACE = "http://www.w3.org/2001/XMLSchema-instance";
33
	public static final String XML_SCHEMALOCATION = "schemaLocation";
34
	public static final String WFS_NAMESPACE_PREFIX = "wfs";
35
	public static final String WFS_NAMESPACE = "http://www.opengis.net/wfs";
36
	public static final String OGC_NAMESPACE_PREFIX = "ogc";
37
	public static final String OGC_NAMESPACE = "http://www.opengis.net/ogc";
38
	public static final String GML_NAMESPACE_PREFIX = "gml";
39
	public static final String GML_NAMESPACE = "http://www.opengis.net/gml";
40
	
41
	public static final String WFST_LOCKID = "LockId";
42
	public static final String WFST_LOCK = "Lock";
43
	public static final String WFST_FEATURESLOCKED = "FeaturesLocked";
44
	public static final String WFST_FEATURESID = "FeatureId";	
45
	public static final String WFST_SERVICE = "service";
46
	public static final String WFST_TRANSACTIONRESULT = "TransactionResult";
47
	public static final String WFST_TRANSACTIONRESPONSE = "WFS_TransactionResponse";
48
	public static final String WFST_TRANSACTIONMESSAGE = "Message";
49
	public static final String WFST_STATUS = "Status";
50
	public static final String WFST_SUCCESS = "SUCCESS";
51
	public static final String WFST_FAILED = "FAILED";
52
	public static final String WFST_RELEASEACTION = "releaseAction";
53
	public static final String WFST_EXPIRYTIME = "expiry";	
54
	
55
	//Update operation
56
	public static final String WFST_PROPERTY = "Property";  
57
	public static final String WFST_NAME = "Name";  
58
	public static final String WFST_VALUE = "Value";  
59
	
60
	public static final String WFS_QUERY = "Query";
61
	public static final String WFS_FILTER = "Filter";
62
	public static final String WFS_RESULTTYPE = "resultType";
63
	public static final String WFS_HITS = "hits";
64
	public static final String WFS_NUMBER_OF_FEATURES = "numberOfFeatures";
65
	public static final String WFS_TIME_STAMP = "timeStamp";
66
}
0 67

  
org.gvsig.wfs.app/tags/org.gvsig.wfs.app-2.0.62/org.gvsig.wfs.app.mainplugin/src/main/java/org/gvsig/remoteclient/wfs/edition/WFSTOperation.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.remoteclient.wfs.edition;
25

  
26
import org.gvsig.remoteclient.wfs.WFSStatus;
27

  
28
/**
29
 * @author Jorge Piera LLodr? (jorge.piera@iver.es)
30
 */
31
public abstract class WFSTOperation implements IWFSTOperation{
32
    //The table to apply the operation
33
    protected WFSStatus wfsStatus = null;
34

  
35
    //Feature identifier
36
    protected String id = null;
37

  
38
    WFSTOperation(WFSStatus wfsStatus) {
39
        super();
40
        this.wfsStatus = wfsStatus;		      
41
    }
42

  
43
    WFSTOperation(WFSStatus wfsStatus, String id) {
44
        this(wfsStatus);
45
        this.id = id;
46
    }
47
    
48
    /**
49
     * @return the id
50
     */
51
    public String getId() {
52
        return id;
53
    }
54
}
0 55

  
org.gvsig.wfs.app/tags/org.gvsig.wfs.app-2.0.62/org.gvsig.wfs.app.mainplugin/src/main/java/org/gvsig/remoteclient/wfs/edition/WFSTDeleteOperation.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.remoteclient.wfs.edition;
25

  
26
import org.gvsig.remoteclient.wfs.WFSStatus;
27

  
28

  
29
/**
30
 * @author Jorge Piera LLodr? (jorge.piera@iver.es)
31
 */
32
public class WFSTDeleteOperation extends WFSTOperation {
33
			
34
	protected WFSTDeleteOperation(WFSStatus wfsStatus, String id) {
35
		super(wfsStatus, id);		
36
	}
37

  
38
	public String getOperationName() {
39
		return "Delete";
40
	}
41

  
42
	public boolean hasTypeName(){
43
		return true;
44
	}
45
}
0 46

  
org.gvsig.wfs.app/tags/org.gvsig.wfs.app-2.0.62/org.gvsig.wfs.app.mainplugin/src/main/java/org/gvsig/remoteclient/wfs/edition/WFSTUpdateOperation.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.remoteclient.wfs.edition;
25

  
26
import org.gvsig.remoteclient.wfs.WFSStatus;
27

  
28

  
29
/**
30
 * @author Jorge Piera LLodr? (jorge.piera@iver.es)
31
 */
32
public class WFSTUpdateOperation extends WFSTAttributesOperation {
33

  
34
    protected WFSTUpdateOperation(WFSStatus wfsStatus, String id) {
35
        super(wfsStatus, id);     
36
    }	
37

  
38
    public String getOperationName() {
39
        return "Update";
40
    }	
41

  
42
    public boolean hasTypeName(){
43
        return true;
44
    }
45
}
0 46

  
org.gvsig.wfs.app/tags/org.gvsig.wfs.app-2.0.62/org.gvsig.wfs.app.mainplugin/src/main/java/org/gvsig/remoteclient/wfs/edition/WFSTInsertOperation.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.remoteclient.wfs.edition;
25

  
26
import org.gvsig.remoteclient.wfs.WFSStatus;
27

  
28
/**
29
 * @author Jorge Piera LLodr? (jorge.piera@iver.es)
30
 */
31
public class WFSTInsertOperation extends WFSTAttributesOperation {
32
	
33
	protected WFSTInsertOperation(WFSStatus wfsStatus) {
34
		super(wfsStatus);		
35
	}
36

  
37
	public String getOperationName() {
38
		return "Insert";
39
	}	
40
	
41
	public boolean hasTypeName(){
42
	    return false;
43
	}
44
}
0 45

  
org.gvsig.wfs.app/tags/org.gvsig.wfs.app-2.0.62/org.gvsig.wfs.app.mainplugin/src/main/java/org/gvsig/remoteclient/wfs/edition/WFSTTransaction.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.remoteclient.wfs.edition;
25

  
26
import java.util.ArrayList;
27
import java.util.List;
28

  
29
import org.gvsig.remoteclient.wfs.WFSStatus;
30

  
31
/**
32
 * @author Jorge Piera LLodr? (jorge.piera@iver.es)
33
 */
34
public class WFSTTransaction {
35
    private List insertOperations = null;
36
    private List updateOperations = null;
37
    private List deleteOperations = null;
38
    private WFSStatus wfsStatus;
39

  
40
    public WFSTTransaction(WFSStatus wfsStatus){       
41
        insertOperations = new ArrayList();
42
        updateOperations = new ArrayList();
43
        deleteOperations = new ArrayList();
44
        this.wfsStatus = wfsStatus;	
45
    }
46

  
47
    /**
48
     * Adds a delete operation
49
     * @param ids
50
     * The identifiers of the features to delete
51
     */
52
    public WFSTDeleteOperation createDeleteOperation(String id){
53
        WFSTDeleteOperation deleteOperation = new WFSTDeleteOperation(wfsStatus, id);
54
        deleteOperations.add(deleteOperation);
55
        return deleteOperation;	
56
    }
57

  
58
    /**
59
     * Adds a insert operation
60
     * @param gml
61
     * The new Feature
62
     */
63
    public WFSTInsertOperation createInsertOperation(){
64
        WFSTInsertOperation insertOperation = new WFSTInsertOperation(wfsStatus);
65
        insertOperations.add(insertOperation);	
66
        return insertOperation;
67
    }
68

  
69
    /**
70
     * Adds a update operation
71
     * @param id
72
     * The identifier of the features to update
73
     * @param values
74
     * A map with key equals to the property and the value equals to the value to update
75
     * The update operation
76
     */
77
    public WFSTUpdateOperation createUpdateOperation(String id){
78
        WFSTUpdateOperation updateOperation = new WFSTUpdateOperation(wfsStatus, id);
79
        updateOperations.add(updateOperation);  
80
        return updateOperation;    
81
    }
82

  
83
    /**
84
     * Create the lockID request
85
     * @return
86
     */
87
    private Object getWFSTRequestLockID() {
88
        StringBuffer request = new StringBuffer();
89
        //		for (int i=0 ; i<featuresLocked.size() ; i++){
90
        //			request.append("<" + WFSTTags.WFS_NAMESPACE_PREFIX + ":" + WFSTTags.WFST_LOCKID + ">" );
91
        //			request.append(featuresLocked.get(i));
92
        //			request.append("</" + WFSTTags.WFS_NAMESPACE_PREFIX + ":" + WFSTTags.WFST_LOCKID + ">" );
93
        //		}
94
        return request.toString();
95
    }
96

  
97
    /**
98
     * @return the insert operations size
99
     */
100
    public int getInsertOperationSize() {
101
        return insertOperations.size();
102
    }
103

  
104
    /**
105
     * Gets an insert operation
106
     * @param i
107
     * Operation position
108
     * @return
109
     * A operation
110
     */
111
    public WFSTInsertOperation getInseOperationAt(int i){
112
        if (i >= insertOperations.size()){
113
            return null;
114
        }
115
        return (WFSTInsertOperation)insertOperations.get(i);
116
    }
117

  
118
    /**
119
     * @return the update operations size
120
     */
121
    public int getUpdateOperationSize() {
122
        return updateOperations.size();
123
    }
124

  
125
    /**
126
     * Gets an update operation
127
     * @param i
128
     * Operation position
129
     * @return
130
     * A operation
131
     */
132
    public WFSTUpdateOperation getUpdateOperationAt(int i){
133
        if (i >= updateOperations.size()){
134
            return null;
135
        }
136
        return (WFSTUpdateOperation)updateOperations.get(i);
137
    }
138

  
139
    /**
140
     * @return the delete operations size
141
     */
142
    public int getDeleteOperationSize() {
143
        return deleteOperations.size();
144
    }
145

  
146
    /**
147
     * Gets an delete operation
148
     * @param i
149
     * Operation position
150
     * @return
151
     * A operation
152
     */
153
    public WFSTDeleteOperation getDeleteOperationAt(int i){
154
        if (i >= deleteOperations.size()){
155
            return null;
156
        }
157
        return (WFSTDeleteOperation)deleteOperations.get(i);
158
    }      
159
}
0 160

  
org.gvsig.wfs.app/tags/org.gvsig.wfs.app-2.0.62/org.gvsig.wfs.app.mainplugin/src/main/java/org/gvsig/remoteclient/wfs/edition/WFSTAttributesOperation.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.remoteclient.wfs.edition;
25

  
26
import java.util.HashMap;
27
import java.util.Iterator;
28
import java.util.Map;
29

  
30
import org.gvsig.remoteclient.wfs.WFSStatus;
31

  
32

  
33
/**
34
 * @author gvSIG Team
35
 * @version $Id$
36
 *
37
 */
38
public abstract class WFSTAttributesOperation extends WFSTOperation{
39
    protected Map attributes = null;
40
    
41
    /**
42
     * @param wfsStatus
43
     */
44
    WFSTAttributesOperation(WFSStatus wfsStatus) {
45
        super(wfsStatus); 
46
        attributes = new HashMap();
47
    }
48

  
49
    WFSTAttributesOperation(WFSStatus wfsStatus, String id) {
50
        super(wfsStatus, id);   
51
        attributes = new HashMap();
52
    } 
53
    
54
    public void addAttribute(String name, Object value){
55
        attributes.put(name, value.toString());
56
    }  
57
    
58
    public String getValue(String attName){
59
        if (attributes.containsKey(attName)){
60
            return (String)attributes.get(attName);
61
        }
62
        return null;
63
    }
64
    
65
    public Iterator getKeysIterator(){
66
        return attributes.keySet().iterator();
67
    }
68

  
69
}
org.gvsig.wfs.app/tags/org.gvsig.wfs.app-2.0.62/org.gvsig.wfs.app.mainplugin/src/main/java/org/gvsig/remoteclient/wfs/WFSFeature.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.remoteclient.wfs;
25

  
26
import java.util.Hashtable;
27
import java.util.Vector;
28

  
29
import org.gvsig.remoteclient.utils.BoundaryBox;
30
import org.gvsig.remoteclient.wfs.schema.XMLNameSpace;
31

  
32
/**
33
 * @author Jorge Piera Llodr? (piera_jor@gva.es)
34
 */
35
public class WFSFeature extends WFSFeatureField {
36
    private String localName = null;
37
    private String	title = null;
38
    private String	_abstract = null;
39
    private Vector srs = new Vector();
40
    private String defaultSRS = null;
41
    private BoundaryBox latLonBbox = null;
42
    private Hashtable bBoxes = new Hashtable();
43
    private Vector keywords = new Vector();
44
    private XMLNameSpace namespace = null;
45
    private WFSServiceInformation serviceInformation;
46
    private boolean isCompleted = false;
47

  
48
    protected WFSFeature(WFSServiceInformation serviceInformation){
49
        super();
50
        this.serviceInformation = serviceInformation;
51
    }
52

  
53
    protected WFSFeature(WFSServiceInformation serviceInformation, String name){
54
        super();
55
        this.serviceInformation = serviceInformation;
56
        setName(name);
57
    }
58

  
59
    /**
60
     * @return Returns the _abstract.
61
     */
62
    public String getAbstract() {
63
        return _abstract;
64
    }
65
    /**
66
     * @param _abstract The _abstract to set.
67
     */
68
    public void setAbstract(String _abstract) {
69
        this._abstract = _abstract;
70
    }	
71

  
72
    /**
73
     * @param name The name to set.
74
     */
75
    public void setName(String name) {
76
        this.name = name;
77
        int index = name.indexOf(":");
78
        if (index > 0){
79
            String prefix = name.substring(0, index);
80
            localName = name.substring(index+1, name.length());
81
            String nameSpace = serviceInformation.getNamespace(prefix);
82
            this.setNamespace(new XMLNameSpace(prefix, nameSpace));
83
        }
84
    }
85

  
86
    /**
87
     * @return Returns the title.
88
     */
89
    public String getTitle() {
90
        if ((title == null) ||
91
            (title.equals(""))){
92
            return name;
93
        }
94
        return title;
95
    }
96

  
97
    /**
98
     * @param title The title to set.
99
     */
100
    public void setTitle(String title) {
101
        this.title = title;
102
    }
103

  
104
    /**
105
     * @return Returns the latLonBbox.
106
     */
107
    public BoundaryBox getLatLonBbox() {
108
        return latLonBbox;
109
    }
110
    /**
111
     * @param latLonBbox The latLonBbox to set.
112
     */
113
    public void setLatLonBbox(BoundaryBox latLonBbox) {
114
        this.latLonBbox = latLonBbox;
115
    }
116
    /**
117
     * @return Returns the keywords.
118
     */
119
    public Vector getKeywords() {
120
        return keywords;
121
    }
122

  
123
    public void addKeyword(String keyword){
124
        keywords.add(keyword);
125
    }
126
    /**
127
     * @return Returns the srs.
128
     */
129
    public Vector getSrs() {
130
        return srs;
131
    }
132

  
133
    public void addSRS(String key){
134
        String epsgCode = getEPSGCode(key);
135
        if (!this.srs.contains(epsgCode)){
136
            srs.add(epsgCode);
137
        }
138
        if (defaultSRS == null){
139
            defaultSRS = epsgCode;
140
        }
141
    }
142

  
143
    /**
144
     * <p>Adds a bbox to the Bboxes vector</p>
145
     * @param bbox
146
     */
147
    public void addBBox(BoundaryBox bbox) {
148
        bBoxes.put(bbox.getSrs(), bbox);
149
    } 
150

  
151
    /**
152
     * <p>returns the bbox with that id in the Bboxes vector</p> 
153
     * @param id 
154
     */
155
    public BoundaryBox getBbox(String id) {
156
        return (BoundaryBox)bBoxes.get(id);
157
    }
158
    /**
159
     * @return Returns the namespace.
160
     */
161
    public XMLNameSpace getNamespace() {
162
        return namespace;
163
    }
164
    /**
165
     * @param namespace The namespace to set.
166
     */
167
    public void setNamespace(XMLNameSpace namespace) {
168
        this.namespace = namespace;
169
    } 	
170

  
171
    /**
172
     * @return the localName
173
     */
174
    public String getLocalName() {
175
        return localName;
176
    }	    
177

  
178
    
179
    /**
180
     * @return the isCompleted
181
     */
182
    public boolean isCompleted() {
183
        return isCompleted;
184
    }
185
    
186
    /**
187
     * @param isCompleted the isCompleted to set
188
     */
189
    public void setCompleted(boolean isCompleted) {
190
        this.isCompleted = isCompleted;
191
    }
192
    
193
    /**
194
     * @return the defaultSRS
195
     */
196
    public String getDefaultSRS() {
197
        return defaultSRS;
198
    }
199

  
200
    
201
    /**
202
     * @param defaultSRS the defaultSRS to set
203
     */
204
    public void setDefaultSRS(String defaultSRS) {
205
        this.defaultSRS = getEPSGCode(defaultSRS);
206
        addSRS(defaultSRS);
207
    }
208
    
209
    private String getEPSGCode(String srs){
210
        if (srs == null){
211
            return null;
212
        }
213
        if ((srs.startsWith("urn:x-ogc:def:crs:")) || srs.startsWith("urn:ogc:def:crs:")){
214
            String newString = srs.substring(srs.lastIndexOf(":") + 1, srs.length());
215
            if (srs.indexOf("EPSG") > 0){
216
                if (newString.indexOf("EPSG") < 0){
217
                    newString = "EPSG:" + newString;
218
                }
219
            }
220
            return newString;           
221
        }
222
        if (srs.toLowerCase().startsWith("crs:")){
223
            return srs.substring(4, srs.length());
224
        }
225
        return srs;
226
    }       
227

  
228
}    
org.gvsig.wfs.app/tags/org.gvsig.wfs.app-2.0.62/org.gvsig.wfs.app.mainplugin/src/main/java/org/gvsig/remoteclient/wfs/WFSRequestInformation.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
 
25
package org.gvsig.remoteclient.wfs;
26
/**
27
 * This class is used like a container of all the properties
28
 * that the library is able to retrieve in the XML header of 
29
 * every WFS reply.
30
 * 
31
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera</a>
32
 */
33
public class WFSRequestInformation {
34
	/**
35
	 * The attribute may be used by a web 
36
	 * feature service to indicate the time and 
37
	 * date when a response was generated.
38
	 */
39
	private String timeStamp = null;
40
	
41
	public WFSRequestInformation() {
42
		super();
43
	}		
44

  
45
	/**
46
	 * @return the timeStamp
47
	 */
48
	public String getTimeStamp() {
49
		return timeStamp;
50
	}
51

  
52
	/**
53
	 * @param timeStamp the timeStamp to set
54
	 */
55
	public void setTimeStamp(String timeStamp) {
56
		this.timeStamp = timeStamp;
57
	}
58
}
59

  
org.gvsig.wfs.app/tags/org.gvsig.wfs.app-2.0.62/org.gvsig.wfs.app.mainplugin/src/main/java/org/gvsig/remoteclient/wfs/WFSFeatureField.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.remoteclient.wfs;
25

  
26
import java.util.Vector;
27

  
28
import org.gvsig.tools.ToolsLocator;
29
import org.gvsig.tools.dataTypes.DataType;
30
import org.gvsig.tools.dataTypes.DataTypes;
31
import org.gvsig.tools.dataTypes.DataTypesManager;
32

  
33

  
34
/**
35
 * @author gvSIG Team
36
 * @version $Id$
37
 *
38
 */
39
public class WFSFeatureField {
40
    protected String name;
41
    private String type;
42
    private DataType dataType = null;   
43
    private boolean isGeometry = false;
44
    private boolean isComplex = false;
45
    private int geometryType = -1;
46
    private static final DataTypesManager dataTypesManager = ToolsLocator.getDataTypesManager();
47
    private Vector fields = new Vector();
48
    
49
    public WFSFeatureField() {
50
        dataType = dataTypesManager.get(DataTypes.OBJECT);
51
    }
52
    
53
    public WFSFeatureField(String name, String type, DataType dataType) {
54
        super();
55
        this.name = name;
56
        this.type = type;
57
        if (dataType == null){
58
            dataType = dataTypesManager.get(DataTypes.OBJECT);
59
        }else{
60
            this.dataType = dataType;
61
            if (dataType.getType() == dataTypesManager.getType("Geometry")){
62
                isGeometry = true;
63
            }
64
        }
65
    }
66
    
67
    public WFSFeatureField(String name, String type, int geometryType) {
68
        super();
69
        this.name = name;
70
        this.type = type;
71
        this.dataType = dataTypesManager.get(dataTypesManager.getType("Geometry"));  
72
        this.geometryType = geometryType;
73
        isGeometry = true;
74
    }
75
    
76
    /**
77
     * @return the name
78
     */
79
    public String getName() {
80
        return name;
81
    }
82

  
83
    
84
    /**
85
     * @return the type
86
     */
87
    public String getType() {
88
        return type;
89
    }
90
    
91
    /**
92
     * @return the dataType
93
     */
94
    public DataType getDataType() {
95
        return dataType;
96
    }
97

  
98
    
99
    /**
100
     * @return the isGeometry
101
     */
102
    public boolean isGeometry() {
103
        return isGeometry;
104
    }
105

  
106
    public boolean isComplex(){
107
        return isComplex;
108
    }
109
    
110
    /**
111
     * @return the geometryType
112
     */
113
    public int getGeometryType() {
114
        return geometryType;
115
    }
116
    
117
    /**
118
     * @return Returns the fields.
119
     */
120
    public WFSFeatureField getFieldAt(int index) {
121
        if (index >= fields.size()){
122
            return null;
123
        }
124
        return (WFSFeatureField)fields.get(index);
125
    }
126
    
127
    public int getFieldSize(){
128
        return fields.size();
129
    }
130

  
131
    public void addField(String fieldName, String fieldType, DataType dataType){
132
        isComplex = true;
133
        fields.add(new WFSFeatureField(fieldName, fieldType, dataType));
134
    }
135
    
136
    public String toString() {
137
        return getName();
138
    }
139
    
140
    
141
}
org.gvsig.wfs.app/tags/org.gvsig.wfs.app-2.0.62/org.gvsig.wfs.app.mainplugin/src/main/java/org/gvsig/remoteclient/wfs/WFSProtocolHandler.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.remoteclient.wfs;
25

  
26
import java.io.File;
27
import java.net.URL;
28
import java.util.ArrayList;
29
import java.util.Hashtable;
30
import java.util.StringTokenizer;
31

  
32
import org.gvsig.compat.net.ICancellable;
33
import org.gvsig.remoteclient.ogc.OGCProtocolHandler;
34
import org.gvsig.remoteclient.ogc.OGCServiceInformation;
35
import org.gvsig.remoteclient.utils.CapabilitiesTags;
36
import org.gvsig.remoteclient.wfs.exceptions.WFSException;
37
import org.gvsig.remoteclient.wfs.request.WFSDescribeFeatureTypeRequest;
38
import org.gvsig.remoteclient.wfs.request.WFSGetFeatureRequest;
39
import org.gvsig.remoteclient.wfs.request.WFSTLockFeatureRequest;
40
import org.gvsig.remoteclient.wfs.request.WFSTransactionRequest;
41
import org.gvsig.remoteclient.wfs.schema.GMLTags;
42
import org.kxml2.io.KXmlParser;
43

  
44
/**
45
 * @author Jorge Piera Llodr? (piera_jor@gva.es)
46
 */
47
public abstract class WFSProtocolHandler extends OGCProtocolHandler {
48
	//protected static Logger LOG = LoggerFactory.getLogger(WFSProtocolHandler.class);
49
	
50
    /**
51
	 * WFS metadata
52
	 */
53
	protected WFSServiceInformation serviceInfo = new WFSServiceInformation();
54
	protected Hashtable features = new Hashtable();
55
	protected String currentFeature = null;
56
	private int numberOfErrors = 0;
57

  
58
	/**
59
	 * This class contains all the data that the library is able
60
	 * to retrieve of the server for all the requests. 
61
	 */
62
	protected ArrayList wfsRequestInformations = new ArrayList();
63

  
64
	/**
65
	 * Clear the connection
66
	 */
67
	private void clear() {
68
		features.clear();
69
		serviceInfo.clear();
70
	}
71

  
72
	/**
73
	 * <p>Builds a GetCapabilities request that is sent to the WFS
74
	 * the response will be parse to extract the data needed by the
75
	 * WFS client</p>
76
	 */
77
	public void getCapabilities(WFSStatus status,boolean override, ICancellable cancel) throws WFSException {
78
		URL request = null;
79
		try {
80
			request = new URL(buildCapabilitiesRequest(status));
81
			if (override){
82
			    downloader.removeURL(request);
83
			}
84
			File f = downloader.downloadFile(request,"wfs_capabilities.xml", cancel);
85
			if (f == null)
86
				return;
87
			clear();
88
			parseCapabilities(f);
89
		} catch (Exception e){
90
			throw new WFSException(e);
91
		}
92
	}    
93

  
94
	/**
95
	 * @return
96
	 */
97
	private String buildCapabilitiesRequest(WFSStatus status) {
98
		StringBuffer req = new StringBuffer();
99
		String symbol = null;
100

  
101
		String onlineResource;
102
		if (status == null || status.getOnlineResource() == null)
103
			onlineResource = getHost();
104
		else 
105
			onlineResource = status.getOnlineResource();
106
		symbol = getSymbol(onlineResource);
107

  
108
		req.append(onlineResource).append(symbol).append("REQUEST=GetCapabilities&SERVICE=WFS&");
109
		req.append("VERSION=").append(getVersion()).append("&EXCEPTIONS=XML");
110
		return req.toString();
111
	}   
112

  
113
	/**
114
	 * Builds the GetCapabilitiesRequest according to the OGC WFS Specifications
115
	 * without a VERSION, to get the highest version than a WFS supports.
116
	 */
117
	public static String buildCapabilitiesSuitableVersionRequest(String _host, String _version)
118
	{
119
		int index = _host.indexOf('?');
120

  
121
		if (index > -1) {
122
			String host = _host.substring(0, index + 1);
123
			String query = _host.substring(index + 1, _host.length());
124

  
125
			StringTokenizer tokens = new StringTokenizer(query, "&");
126
			String newQuery = "", token;
127

  
128
			// If there is a field or a value with spaces, (and then it's on different tokens) -> unify them
129
			while (tokens.hasMoreTokens()) {
130
				token = tokens.nextToken().trim();
131

  
132
				if (token.toUpperCase().compareTo("REQUEST=GETCAPABILITIES") == 0)
133
					continue;
134

  
135
				if (token.toUpperCase().compareTo("SERVICE=WFS") == 0)
136
					continue;
137

  
138
				if ((_version != null) && (_version.length() > 0)) {
139
					if (token.toUpperCase().compareTo("VERSION=" + _version) == 0)
140
						continue;
141
				}
142

  
143
				if (token.toUpperCase().compareTo("EXCEPTIONS=XML") == 0)
144
					continue;
145

  
146
				newQuery += token + "&";
147
			}
148

  
149
			_host = host + newQuery;
150
		}
151
		else {
152
			_host += "?";
153
		}
154

  
155
		if ((_version != null) && (_version.compareTo("") != 0))
156
			_host += "REQUEST=GetCapabilities&SERVICE=WFS&VERSION=" + _version + "&EXCEPTIONS=XML";
157
		else
158
			_host += "REQUEST=GetCapabilities&SERVICE=WFS&EXCEPTIONS=XML";
159

  
160
		return _host;    
161
	}
162

  
163
	/**
164
	 * <p>Builds a describeFeatureType request that is sent to the WFS
165
	 * the response will be parse to extract the data needed by the
166
	 * WFS client</p>
167
	 * @param status
168
	 * WFS client status. Contains all the information to create
169
	 * the query. In this case, the only the feature name is needed.
170
	 */
171
	public File describeFeatureType(WFSStatus status,boolean override, ICancellable cancel)throws WFSException {
172
		this.currentFeature = status.getFeatureFullName();
173
		//sets the namespace URI 	
174
		if ((status.getNamespacePrefix() != null) && (status.getNamespaceLocation() == null)){			
175
			String namespaceURI = serviceInfo.getNamespace(status.getNamespacePrefix());
176
			if (namespaceURI != null){
177
				status.setNamespaceLocation(namespaceURI);				
178
			}
179
		}
180
		try {
181
			WFSDescribeFeatureTypeRequest request = createDescribeFeatureTypeRequest(status);
182
                        request.setDeleted(override);
183
			File f = request.sendRequest(cancel);
184
			return f;
185
		} catch (Exception e){
186
			throw new WFSException(e);
187
		}
188
	}     	
189

  
190
	/**
191
	 * <p>Builds a getFeature request that is sent to the WFS
192
	 * the response will be parse to extract the data needed by the
193
	 * WFS client</p>
194
	 * @param status
195
	 * WFS client status. Contains all the information to create
196
	 * the query. 
197
	 * @return File
198
	 * GML file
199
	 */    
200
	public File getFeature(WFSStatus status,boolean override, ICancellable cancel) throws WFSException{
201
		try{		
202
			WFSGetFeatureRequest request = createGetFeatureRequest(status);
203
			File f = request.sendRequest(cancel);			
204
			parseGetFeature(f, status.getNamespacePrefix());
205
			return f;
206
		} catch (Exception e){
207
			throw new WFSException(e);
208
		}		
209
	}
210

  
211
	/**
212
	 * parses the data retrieved by the GetFeature XML document. It is
213
	 * used just to find errors
214
	 */
215
	protected abstract boolean parseGetFeature(File f,String nameSpace) throws WFSException;
216

  
217

  
218
	/**
219
	 * <p>Builds a transaction request that is sent to the WFS
220
	 * the response will be parse to extract the data needed by the
221
	 * WFS client</p>
222
	 * @param status
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff