Revision 304
org.gvsig.wfs.app/tags/org.gvsig.wfs.app-2.0.44/org.gvsig.wfs.app.mainplugin/buildNumber.properties | ||
---|---|---|
1 |
#Mon Jul 25 00:11:56 CEST 2016 |
|
2 |
buildNumber=2126 |
org.gvsig.wfs.app/tags/org.gvsig.wfs.app-2.0.44/org.gvsig.wfs.app.mainplugin/src/main/assembly/gvsig-plugin-package.xml | ||
---|---|---|
1 |
<assembly> |
|
2 |
<id>gvsig-plugin-package</id> |
|
3 |
<formats> |
|
4 |
<format>zip</format> |
|
5 |
</formats> |
|
6 |
<baseDirectory>${project.artifactId}</baseDirectory> |
|
7 |
<includeBaseDirectory>true</includeBaseDirectory> |
|
8 |
<files> |
|
9 |
<file> |
|
10 |
<source>target/${project.artifactId}-${project.version}.jar</source> |
|
11 |
<outputDirectory>lib</outputDirectory> |
|
12 |
</file> |
|
13 |
<file> |
|
14 |
<source>target/package.info</source> |
|
15 |
</file> |
|
16 |
</files> |
|
17 |
|
|
18 |
<fileSets> |
|
19 |
<fileSet> |
|
20 |
<directory>src/main/resources-plugin</directory> |
|
21 |
<outputDirectory>.</outputDirectory> |
|
22 |
</fileSet> |
|
23 |
</fileSets> |
|
24 |
|
|
25 |
<!-- |
|
26 |
<dependencySets> |
|
27 |
<dependencySet> |
|
28 |
<useProjectArtifact>false</useProjectArtifact> |
|
29 |
<useTransitiveDependencies>false</useTransitiveDependencies> |
|
30 |
<outputDirectory>lib</outputDirectory> |
|
31 |
<includes> |
|
32 |
<include>org.gvsig:org.gvsig.wfs.app.mainplugin</include> |
|
33 |
</includes> |
|
34 |
</dependencySet> |
|
35 |
</dependencySets> |
|
36 |
--> |
|
37 |
|
|
38 |
</assembly> |
org.gvsig.wfs.app/tags/org.gvsig.wfs.app-2.0.44/org.gvsig.wfs.app.mainplugin/src/main/java/org/gvsig/remoteclient/wfs/request/WFSGetFeatureRequest.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.request; |
|
25 |
|
|
26 |
import org.gvsig.remoteclient.utils.CapabilitiesTags; |
|
27 |
import org.gvsig.remoteclient.wfs.WFSProtocolHandler; |
|
28 |
import org.gvsig.remoteclient.wfs.WFSRequestInformation; |
|
29 |
import org.gvsig.remoteclient.wfs.WFSStatus; |
|
30 |
import org.gvsig.remoteclient.wfs.edition.WFSTTags; |
|
31 |
import org.gvsig.remoteclient.wfs.filters.filterencoding.FilterEncoding; |
|
32 |
|
|
33 |
/** |
|
34 |
* The GetFeature operation allows retrieval of features from a |
|
35 |
* web feature service. A GetFeature request is processed by |
|
36 |
* a WFS and when the value of the outputFormat attribute is |
|
37 |
* set to text/gml a GML instance document, containing the |
|
38 |
* result set, is returned to the client. |
|
39 |
* @see http://www.opengeospatial.org/standards/wfs |
|
40 |
* @author Jorge Piera Llodrá (jorge.piera@iver.es) |
|
41 |
*/ |
|
42 |
public abstract class WFSGetFeatureRequest extends WFSRequest{ |
|
43 |
|
|
44 |
public WFSGetFeatureRequest(WFSStatus status, |
|
45 |
WFSProtocolHandler protocolHandler) { |
|
46 |
super(status, protocolHandler); |
|
47 |
} |
|
48 |
|
|
49 |
/* |
|
50 |
* (non-Javadoc) |
|
51 |
* @see org.gvsig.remoteClient.wfs.requests.WFSRequest#getHttpPostRequest(java.lang.String) |
|
52 |
*/ |
|
53 |
protected String getHttpPostRequest(String onlineResource) { |
|
54 |
StringBuffer request = new StringBuffer(); |
|
55 |
request.append(WFSTTags.XML_ROOT); |
|
56 |
request.append("<" + WFSTTags.WFS_NAMESPACE_PREFIX + ":"); |
|
57 |
request.append(CapabilitiesTags.WFS_GETFEATURE + " "); |
|
58 |
request.append(CapabilitiesTags.VERSION + "=\"" + protocolHandler.getVersion() + "\" "); |
|
59 |
request.append(WFSTTags.WFST_SERVICE + "=\"WFS\" "); |
|
60 |
if (status.getMaxFeatures().longValue() > 0){ |
|
61 |
request.append(CapabilitiesTags.MAXFEATURES + "=\"" + status.getMaxFeatures() + "\" "); |
|
62 |
} |
|
63 |
if (status.getResultType() == WFSStatus.RESULTYPE_HITS){ |
|
64 |
request.append(WFSTTags.WFS_RESULTTYPE + "=\"" + WFSTTags.WFS_HITS + "\" "); |
|
65 |
} |
|
66 |
request.append(WFSTTags.XMLNS + ":" + WFSTTags.OGC_NAMESPACE_PREFIX); |
|
67 |
request.append("=\"" + WFSTTags.OGC_NAMESPACE + "\" "); |
|
68 |
request.append(WFSTTags.XMLNS + ":" + WFSTTags.WFS_NAMESPACE_PREFIX); |
|
69 |
request.append("=\"" + WFSTTags.WFS_NAMESPACE + "\" "); |
|
70 |
request.append(WFSTTags.XMLNS + ":" + WFSTTags.XML_NAMESPACE_PREFIX); |
|
71 |
request.append("=\"" + WFSTTags.XML_NAMESPACE + "\" "); |
|
72 |
request.append(WFSTTags.XMLNS + ":" + WFSTTags.GML_NAMESPACE_PREFIX); |
|
73 |
request.append("=\"" + WFSTTags.GML_NAMESPACE + "\" "); |
|
74 |
request.append(WFSTTags.XMLNS + ":" + status.getNamespacePrefix()); |
|
75 |
request.append("=\"" + status.getNamespaceLocation() + "\" "); |
|
76 |
request.append(WFSTTags.XML_NAMESPACE_PREFIX + ":" + WFSTTags.XML_SCHEMALOCATION); |
|
77 |
request.append("=\"" + WFSTTags.WFS_NAMESPACE + " "); |
|
78 |
request.append(getSchemaLocation()); |
|
79 |
request.append("\">"); |
|
80 |
request.append("<" + WFSTTags.WFS_NAMESPACE_PREFIX + ":"); |
|
81 |
request.append(WFSTTags.WFS_QUERY); |
|
82 |
request.append(" typeName=\"" + status.getFeatureFullName() + "\""); |
|
83 |
request.append(">"); |
|
84 |
if ((status.getFilterByAttribute() != null) || (status.getFilterByArea() != null)){ |
|
85 |
FilterEncoding filterEncoding = new FilterEncoding(status); |
|
86 |
request.append(filterEncoding.toString(protocolHandler.getVersion())); |
|
87 |
} |
|
88 |
request.append("</" + WFSTTags.WFS_NAMESPACE_PREFIX + ":"); |
|
89 |
request.append(WFSTTags.WFS_QUERY); |
|
90 |
request.append(">"); |
|
91 |
request.append("</" + WFSTTags.WFS_NAMESPACE_PREFIX + ":"); |
|
92 |
request.append(CapabilitiesTags.WFS_GETFEATURE + ">"); |
|
93 |
return request.toString(); |
|
94 |
} |
|
95 |
|
|
96 |
/* |
|
97 |
* (non-Javadoc) |
|
98 |
* @see org.gvsig.remoteClient.wfs.requests.WFSRequest#getOperationCode() |
|
99 |
*/ |
|
100 |
protected String getOperationName() { |
|
101 |
return CapabilitiesTags.WFS_GETFEATURE; |
|
102 |
} |
|
103 |
|
|
104 |
/* |
|
105 |
* (non-Javadoc) |
|
106 |
* @see org.gvsig.remoteClient.wfs.requests.WFSRequest#getSchemaLocation() |
|
107 |
*/ |
|
108 |
protected String getSchemaLocation() { |
|
109 |
return null; |
|
110 |
} |
|
111 |
|
|
112 |
/* |
|
113 |
* (non-Javadoc) |
|
114 |
* @see org.gvsig.remoteClient.wfs.requests.WFSRequest#getTempFilePrefix() |
|
115 |
*/ |
|
116 |
protected String getTempFilePrefix() { |
|
117 |
return "wfs_getFeature.gml"; |
|
118 |
} |
|
119 |
|
|
120 |
/* |
|
121 |
* (non-Javadoc) |
|
122 |
* @see org.gvsig.remoteclient.wfs.request.WFSRequest#createRequestInformation() |
|
123 |
*/ |
|
124 |
public WFSRequestInformation createRequestInformation() { |
|
125 |
return new WFSGetFeatureRequestInformation(); |
|
126 |
} |
|
127 |
|
|
128 |
|
|
129 |
} |
org.gvsig.wfs.app/tags/org.gvsig.wfs.app-2.0.44/org.gvsig.wfs.app.mainplugin/src/main/java/org/gvsig/remoteclient/wfs/request/WFSTransactionRequestInformation.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.request; |
|
25 |
|
|
26 |
import org.gvsig.remoteclient.wfs.WFSRequestInformation; |
|
27 |
|
|
28 |
|
|
29 |
/** |
|
30 |
* @author gvSIG Team |
|
31 |
* @version $Id$ |
|
32 |
* |
|
33 |
*/ |
|
34 |
public class WFSTransactionRequestInformation extends WFSRequestInformation{ |
|
35 |
//Transaction message |
|
36 |
public String message = null; |
|
37 |
|
|
38 |
//Status |
|
39 |
public static final int STATUS_NO_EXECUTED = 0; |
|
40 |
public static final int STATUS_FAILED = 1; |
|
41 |
public static final int STATUS_SUCCESS = 2; |
|
42 |
private int status = 0; |
|
43 |
|
|
44 |
public WFSTransactionRequestInformation() { |
|
45 |
super(); |
|
46 |
} |
|
47 |
|
|
48 |
/** |
|
49 |
* @return the status |
|
50 |
*/ |
|
51 |
public int getStatus() { |
|
52 |
return status; |
|
53 |
} |
|
54 |
|
|
55 |
/** |
|
56 |
* @param status the status to set |
|
57 |
*/ |
|
58 |
public void setStatus(int status) { |
|
59 |
this.status = status; |
|
60 |
} |
|
61 |
|
|
62 |
/** |
|
63 |
* @return the message |
|
64 |
*/ |
|
65 |
public String getMessage() { |
|
66 |
return message; |
|
67 |
} |
|
68 |
|
|
69 |
/** |
|
70 |
* @param message the message to set |
|
71 |
*/ |
|
72 |
public void setMessage(String message) { |
|
73 |
this.message = message; |
|
74 |
} |
|
75 |
} |
org.gvsig.wfs.app/tags/org.gvsig.wfs.app-2.0.44/org.gvsig.wfs.app.mainplugin/src/main/java/org/gvsig/remoteclient/wfs/request/WFSDescribeFeatureTypeRequest.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.request; |
|
25 |
|
|
26 |
import org.gvsig.remoteclient.utils.CapabilitiesTags; |
|
27 |
import org.gvsig.remoteclient.wfs.WFSProtocolHandler; |
|
28 |
import org.gvsig.remoteclient.wfs.WFSStatus; |
|
29 |
|
|
30 |
/** |
|
31 |
* The function of the DescribeFeatureType operation is to |
|
32 |
* generate a schema description of feature types serviced |
|
33 |
* by a WFS implementation. The schema descriptions define |
|
34 |
* how a WFS implementation expects feature instances to |
|
35 |
* be encoded on input (via Insert and Update requests) |
|
36 |
* and how feature instances will be generated on output |
|
37 |
* (in response to GetFeature and GetGmlObject requests). |
|
38 |
* @see http://www.opengeospatial.org/standards/wfs |
|
39 |
* @author Jorge Piera Llodr? (jorge.piera@iver.es) |
|
40 |
*/ |
|
41 |
public abstract class WFSDescribeFeatureTypeRequest extends WFSRequest{ |
|
42 |
|
|
43 |
public WFSDescribeFeatureTypeRequest(WFSStatus status, |
|
44 |
WFSProtocolHandler protocolHandler) { |
|
45 |
super(status, protocolHandler); |
|
46 |
} |
|
47 |
|
|
48 |
/* |
|
49 |
* (non-Javadoc) |
|
50 |
* @see org.gvsig.remoteClient.wfs.requests.WFSRequest#getHttpPostRequest(java.lang.String) |
|
51 |
*/ |
|
52 |
protected String getHttpPostRequest(String onlineResource) { |
|
53 |
// TODO Auto-generated method stub |
|
54 |
return null; |
|
55 |
} |
|
56 |
|
|
57 |
/* |
|
58 |
* (non-Javadoc) |
|
59 |
* @see org.gvsig.remoteClient.wfs.requests.WFSRequest#getOperationCode() |
|
60 |
*/ |
|
61 |
protected String getOperationName() { |
|
62 |
return CapabilitiesTags.WFS_DESCRIBEFEATURETYPE; |
|
63 |
} |
|
64 |
|
|
65 |
/* |
|
66 |
* (non-Javadoc) |
|
67 |
* @see org.gvsig.remoteClient.wfs.requests.WFSRequest#getSchemaLocation() |
|
68 |
*/ |
|
69 |
protected String getSchemaLocation() { |
|
70 |
return null; |
|
71 |
} |
|
72 |
|
|
73 |
/* |
|
74 |
* (non-Javadoc) |
|
75 |
* @see org.gvsig.remoteClient.wfs.requests.WFSRequest#getTempFilePrefix() |
|
76 |
*/ |
|
77 |
protected String getTempFilePrefix() { |
|
78 |
return "wfs_describeFeatureType.xml"; |
|
79 |
} |
|
80 |
} |
org.gvsig.wfs.app/tags/org.gvsig.wfs.app-2.0.44/org.gvsig.wfs.app.mainplugin/src/main/java/org/gvsig/remoteclient/wfs/request/WFSRequest.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.request; |
|
25 |
|
|
26 |
import java.io.File; |
|
27 |
import java.io.IOException; |
|
28 |
import java.net.ConnectException; |
|
29 |
import java.net.UnknownHostException; |
|
30 |
|
|
31 |
import org.gvsig.compat.net.ICancellable; |
|
32 |
import org.gvsig.remoteclient.ogc.request.OGCRequest; |
|
33 |
import org.gvsig.remoteclient.wfs.WFSProtocolHandler; |
|
34 |
import org.gvsig.remoteclient.wfs.WFSRequestInformation; |
|
35 |
import org.gvsig.remoteclient.wfs.WFSStatus; |
|
36 |
|
|
37 |
/** |
|
38 |
* This class sends a WFS request and returns the |
|
39 |
* reply in a local File. It tries if the server |
|
40 |
* supports both HTTP Get and Post requests. |
|
41 |
* @author Jorge Piera LLodr? (jorge.piera@iver.es) |
|
42 |
*/ |
|
43 |
public abstract class WFSRequest extends OGCRequest{ |
|
44 |
protected WFSStatus status = null; |
|
45 |
|
|
46 |
public WFSRequest(WFSStatus status, WFSProtocolHandler protocolHandler) { |
|
47 |
super(status, protocolHandler); |
|
48 |
this.status = status; |
|
49 |
} |
|
50 |
|
|
51 |
/* |
|
52 |
* (non-Javadoc) |
|
53 |
* @see org.gvsig.remoteclient.ogc.request.OGCRequest#sendRequest() |
|
54 |
*/ |
|
55 |
public File sendRequest(ICancellable cancel) throws ConnectException, UnknownHostException, |
|
56 |
IOException { |
|
57 |
if (status != null){ |
|
58 |
((WFSProtocolHandler)protocolHandler).addLastWfsRequestInformation(createRequestInformation()); |
|
59 |
} |
|
60 |
return super.sendRequest(cancel); |
|
61 |
} |
|
62 |
|
|
63 |
/** |
|
64 |
* Creates a request information |
|
65 |
* @return a request information |
|
66 |
*/ |
|
67 |
public WFSRequestInformation createRequestInformation(){ |
|
68 |
return new WFSRequestInformation(); |
|
69 |
} |
|
70 |
} |
org.gvsig.wfs.app/tags/org.gvsig.wfs.app-2.0.44/org.gvsig.wfs.app.mainplugin/src/main/java/org/gvsig/remoteclient/wfs/request/WFSGetFeatureRequestInformation.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.request; |
|
26 |
|
|
27 |
import org.gvsig.remoteclient.wfs.WFSRequestInformation; |
|
28 |
|
|
29 |
/** |
|
30 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera</a> |
|
31 |
*/ |
|
32 |
public class WFSGetFeatureRequestInformation extends WFSRequestInformation{ |
|
33 |
|
|
34 |
public WFSGetFeatureRequestInformation() { |
|
35 |
super(); |
|
36 |
} |
|
37 |
|
|
38 |
/** |
|
39 |
* The optional numberOfFeatures attribute is used to |
|
40 |
* indicate the number of features that are in the |
|
41 |
* response document. |
|
42 |
*/ |
|
43 |
private int numberOfFeatures = -1; |
|
44 |
|
|
45 |
/** |
|
46 |
* @return the numberOfFeatures |
|
47 |
*/ |
|
48 |
public int getNumberOfFeatures() { |
|
49 |
return numberOfFeatures; |
|
50 |
} |
|
51 |
|
|
52 |
/** |
|
53 |
* @param numberOfFeatures the numberOfFeatures to set |
|
54 |
*/ |
|
55 |
public void setNumberOfFeatures(int numberOfFeatures) { |
|
56 |
this.numberOfFeatures = numberOfFeatures; |
|
57 |
} |
|
58 |
} |
|
59 |
|
org.gvsig.wfs.app/tags/org.gvsig.wfs.app-2.0.44/org.gvsig.wfs.app.mainplugin/src/main/java/org/gvsig/remoteclient/wfs/request/WFSTransactionRequest.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.request; |
|
25 |
|
|
26 |
import org.gvsig.remoteclient.utils.CapabilitiesTags; |
|
27 |
import org.gvsig.remoteclient.wfs.WFSProtocolHandler; |
|
28 |
import org.gvsig.remoteclient.wfs.WFSRequestInformation; |
|
29 |
import org.gvsig.remoteclient.wfs.WFSStatus; |
|
30 |
import org.gvsig.remoteclient.wfs.edition.WFSTTags; |
|
31 |
|
|
32 |
|
|
33 |
/** |
|
34 |
* @author gvSIG Team |
|
35 |
* @version $Id$ |
|
36 |
* |
|
37 |
*/ |
|
38 |
public abstract class WFSTransactionRequest extends WFSRequest{ |
|
39 |
protected static final String UPDATE_PROPERTY_TAG = WFSTTags.WFS_NAMESPACE_PREFIX + ":" + WFSTTags.WFST_PROPERTY; |
|
40 |
protected static final String UPDATE_NAME_TAG = WFSTTags.WFS_NAMESPACE_PREFIX + ":" + WFSTTags.WFST_NAME;; |
|
41 |
protected static final String UPDATE_VALUE_TAG = WFSTTags.WFS_NAMESPACE_PREFIX + ":" + WFSTTags.WFST_VALUE; |
|
42 |
|
|
43 |
/** |
|
44 |
* @param status |
|
45 |
* @param protocolHandler |
|
46 |
*/ |
|
47 |
public WFSTransactionRequest(WFSStatus status, |
|
48 |
WFSProtocolHandler protocolHandler) { |
|
49 |
super(status, protocolHandler); |
|
50 |
} |
|
51 |
|
|
52 |
protected String getTempFilePrefix() { |
|
53 |
return "wfs_transaction.xml"; |
|
54 |
} |
|
55 |
|
|
56 |
protected String getOperationName() { |
|
57 |
return CapabilitiesTags.WFS_TRANSACTION; |
|
58 |
} |
|
59 |
|
|
60 |
public WFSRequestInformation createRequestInformation(){ |
|
61 |
return new WFSTransactionRequestInformation(); |
|
62 |
} |
|
63 |
} |
org.gvsig.wfs.app/tags/org.gvsig.wfs.app-2.0.44/org.gvsig.wfs.app.mainplugin/src/main/java/org/gvsig/remoteclient/wfs/request/WFSTLockFeatureRequest.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.request; |
|
25 |
|
|
26 |
import org.gvsig.remoteclient.utils.CapabilitiesTags; |
|
27 |
import org.gvsig.remoteclient.wfs.WFSProtocolHandler; |
|
28 |
import org.gvsig.remoteclient.wfs.WFSStatus; |
|
29 |
|
|
30 |
/** |
|
31 |
* Web connections are inherently stateless. As a consequence |
|
32 |
* of this, the semantics of serializable transactions are not |
|
33 |
* preserved. To understand the issue, consider an update operation. |
|
34 |
* The client fetches a feature instance. The feature is then |
|
35 |
* modified on the client side, and submitted back to the database |
|
36 |
* via a Transaction request for update. Serializability is lost |
|
37 |
* since there is nothing to guarantee that while the feature was |
|
38 |
* being modified on the client side, another client did not come |
|
39 |
* along and update that same feature in the database. |
|
40 |
* One way to ensure serializability is to require that access to |
|
41 |
* data be done in a mutually exclusive manner; that is while one |
|
42 |
* transaction accesses a data item, no other transaction can modify |
|
43 |
* the same data item. This can be accomplished by using locks that |
|
44 |
* control access to the data. |
|
45 |
* The purpose of the LockFeature operation is to expose a long |
|
46 |
* term feature locking mechanism to ensure consistency. The lock |
|
47 |
* is considered long term because network latency would make |
|
48 |
* feature locks last relatively longer than native commercial |
|
49 |
* database locks. |
|
50 |
* The LockFeature operation is optional and does not need to be |
|
51 |
* implemented for a WFS implementation to conform to this |
|
52 |
* specification. If a WFS implements the LockFeature operation, |
|
53 |
* this fact must be advertised in the capabilities document |
|
54 |
* @see http://www.opengeospatial.org/standards/wfs |
|
55 |
* @author Jorge Piera LLodr? (jorge.piera@iver.es) |
|
56 |
*/ |
|
57 |
public abstract class WFSTLockFeatureRequest extends WFSRequest{ |
|
58 |
|
|
59 |
public WFSTLockFeatureRequest(WFSStatus status, |
|
60 |
WFSProtocolHandler protocolHandler) { |
|
61 |
super(status, protocolHandler); |
|
62 |
setDeleted(true); |
|
63 |
} |
|
64 |
|
|
65 |
/* |
|
66 |
* (non-Javadoc) |
|
67 |
* @see org.gvsig.remoteClient.wfs.requests.WFSRequest#getTempFilePrefix() |
|
68 |
*/ |
|
69 |
protected String getTempFilePrefix() { |
|
70 |
return "wfs_lockFeature.xml"; |
|
71 |
} |
|
72 |
|
|
73 |
/* |
|
74 |
* (non-Javadoc) |
|
75 |
* @see org.gvsig.remoteClient.wfs.requests.WFSRequest#getOperationCode() |
|
76 |
*/ |
|
77 |
protected String getOperationName() { |
|
78 |
return CapabilitiesTags.WFS_LOCKFEATURE; |
|
79 |
} |
|
80 |
|
|
81 |
/* |
|
82 |
* (non-Javadoc) |
|
83 |
* @see org.gvsig.remoteClient.wfs.requests.WFSRequest#getSchemaLocation() |
|
84 |
*/ |
|
85 |
protected String getSchemaLocation() { |
|
86 |
return "../wfs/1.0.0/WFS-transaction.xsd"; |
|
87 |
} |
|
88 |
} |
org.gvsig.wfs.app/tags/org.gvsig.wfs.app-2.0.44/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.44/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.44/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.44/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.44/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.44/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.44/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.44/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.44/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.44/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 |
Also available in: Unified diff