Revision 34101

View differences:

tags/v2_0_0_Build_2021/libraries/libRemoteServices/src/org/gvsig/remoteclient/RasterClient.java
1

  
2
package org.gvsig.remoteclient;
3

  
4
/**
5
 * <p></p>
6
 * 
7
 */
8
public abstract class RasterClient extends org.gvsig.remoteclient.RemoteClient implements org.gvsig.remoteclient.IRasterClient {
9
 }
0 10

  
tags/v2_0_0_Build_2021/libraries/libRemoteServices/src/org/gvsig/remoteclient/wfs/WFSFeature.java
1
package org.gvsig.remoteclient.wfs;
2

  
3
import java.util.Hashtable;
4
import java.util.Vector;
5

  
6
import org.gvsig.remoteclient.utils.BoundaryBox;
7
import org.gvsig.remoteclient.wfs.schema.XMLNameSpace;
8

  
9
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
10
 *
11
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
12
 *
13
 * This program is free software; you can redistribute it and/or
14
 * modify it under the terms of the GNU General Public License
15
 * as published by the Free Software Foundation; either version 2
16
 * of the License, or (at your option) any later version.
17
 *
18
 * This program is distributed in the hope that it will be useful,
19
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
 * GNU General Public License for more details.
22
 *
23
 * You should have received a copy of the GNU General Public License
24
 * along with this program; if not, write to the Free Software
25
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
26
 *
27
 * For more information, contact:
28
 *
29
 *  Generalitat Valenciana
30
 *   Conselleria d'Infraestructures i Transport
31
 *   Av. Blasco Ib??ez, 50
32
 *   46010 VALENCIA
33
 *   SPAIN
34
 *
35
 *      +34 963862235
36
 *   gvsig@gva.es
37
 *      www.gvsig.gva.es
38
 *
39
 *    or
40
 *
41
 *   IVER T.I. S.A
42
 *   Salamanca 50
43
 *   46005 Valencia
44
 *   Spain
45
 *
46
 *   +34 963163400
47
 *   dac@iver.es
48
 */
49
/* CVS MESSAGES:
50
 *
51
 * $Id$
52
 * $Log$
53
 * Revision 1.7  2007-09-20 09:30:12  jaume
54
 * removed unnecessary imports
55
 *
56
 * Revision 1.6  2007/02/09 14:11:01  jorpiell
57
 * Primer piloto del soporte para WFS 1.1 y para WFS-T
58
 *
59
 * Revision 1.5  2006/06/15 09:05:06  jorpiell
60
 * Actualizados los WFS
61
 *
62
 * Revision 1.4  2006/05/23 13:23:22  jorpiell
63
 * Se ha cambiado el final del bucle de parseado y se tiene en cuenta el online resource
64
 *
65
 * Revision 1.2  2006/04/20 16:39:16  jorpiell
66
 * A?adida la operacion de describeFeatureType y el parser correspondiente.
67
 *
68
 * Revision 1.1  2006/04/19 12:51:35  jorpiell
69
 * A?adidas algunas de las clases del servicio WFS
70
 *
71
 *
72
 */
73
/**
74
 * @author Jorge Piera Llodr? (piera_jor@gva.es)
75
 */
76
public class WFSFeature {
77
	 private String	name = null;
78
	 private String	title = null;
79
	 private String	_abstract = null;
80
	 private Vector srs = new Vector();
81
	 private BoundaryBox latLonBbox = null;
82
	 private Hashtable bBoxes = new Hashtable();
83
	 private Vector fields = new Vector();
84
	 private Vector keywords = new Vector();
85
	 private XMLNameSpace namespace = null;
86
	 
87
	 public WFSFeature(){
88
		
89
	 }
90
	 
91
	 public WFSFeature(String name){
92
		 this.name = name;
93
	 }
94
	 
95
	/**
96
	 * @return Returns the fields.
97
	 */
98
	public Vector getFields() {
99
		return fields;
100
	}
101
	/**
102
	 * @param fields The fields to set.
103
	 */
104
	public void setFields(Vector fields) {
105
		this.fields = fields;
106
	}
107
	/**
108
	 * @return Returns the _abstract.
109
	 */
110
	public String getAbstract() {
111
		return _abstract;
112
	}
113
	/**
114
	 * @param _abstract The _abstract to set.
115
	 */
116
	public void setAbstract(String _abstract) {
117
		this._abstract = _abstract;
118
	}	
119
	
120
	/**
121
	 * @return Returns the name.
122
	 */
123
	public String getName() {
124
		return name;
125
	}
126
	
127
	/**
128
	 * @param name The name to set.
129
	 */
130
	public void setName(String name) {
131
		this.name = name;
132
	}
133
	
134
	/**
135
	 * @return Returns the title.
136
	 */
137
	public String getTitle() {
138
		if ((title == null) ||
139
		(title.equals(""))){
140
			return name;
141
		}
142
		return title;
143
	}
144
	
145
	/**
146
	 * @param title The title to set.
147
	 */
148
	public void setTitle(String title) {
149
		this.title = title;
150
	}
151
	
152
	/**
153
	 * @return Returns the latLonBbox.
154
	 */
155
	public BoundaryBox getLatLonBbox() {
156
		return latLonBbox;
157
	}
158
	/**
159
	 * @param latLonBbox The latLonBbox to set.
160
	 */
161
	public void setLatLonBbox(BoundaryBox latLonBbox) {
162
		this.latLonBbox = latLonBbox;
163
	}
164
	/**
165
	 * @return Returns the keywords.
166
	 */
167
	public Vector getKeywords() {
168
		return keywords;
169
	}
170
	
171
	public void addKeyword(String keyword){
172
		keywords.add(keyword);
173
	}
174
	/**
175
	 * @return Returns the srs.
176
	 */
177
	public Vector getSrs() {
178
		return srs;
179
	}
180
	
181
	public void addSRS(String key){
182
		if (!this.srs.contains(key))
183
    		srs.add(key);
184
	}
185
	
186
	 /**
187
     * <p>Adds a bbox to the Bboxes vector</p>
188
     * @param bbox
189
     */
190
    public void addBBox(BoundaryBox bbox) {
191
        bBoxes.put(bbox.getSrs(), bbox);
192
    } 
193
    
194
    /**
195
     * <p>returns the bbox with that id in the Bboxes vector</p> 
196
     * @param id 
197
     */
198
    public BoundaryBox getBbox(String id) {
199
    	return (BoundaryBox)bBoxes.get(id);
200
    }
201
	/**
202
	 * @return Returns the namespace.
203
	 */
204
	public XMLNameSpace getNamespace() {
205
		return namespace;
206
	}
207
	/**
208
	 * @param namespace The namespace to set.
209
	 */
210
	public void setNamespace(XMLNameSpace namespace) {
211
		this.namespace = namespace;
212
	} 
213
	
214
}    
0 215

  
tags/v2_0_0_Build_2021/libraries/libRemoteServices/src/org/gvsig/remoteclient/wfs/edition/WFSTTags.java
1
package org.gvsig.remoteclient.wfs.edition;
2
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
3
 *
4
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
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 2
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., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
19
 *
20
 * For more information, contact:
21
 *
22
 *  Generalitat Valenciana
23
 *   Conselleria d'Infraestructures i Transport
24
 *   Av. Blasco Ib??ez, 50
25
 *   46010 VALENCIA
26
 *   SPAIN
27
 *
28
 *      +34 963862235
29
 *   gvsig@gva.es
30
 *      www.gvsig.gva.es
31
 *
32
 *    or
33
 *
34
 *   IVER T.I. S.A
35
 *   Salamanca 50
36
 *   46005 Valencia
37
 *   Spain
38
 *
39
 *   +34 963163400
40
 *   dac@iver.es
41
 */
42
/* CVS MESSAGES:
43
 *
44
 * $Id$
45
 * $Log$
46
 *
47
 */
48
/**
49
 * @author Jorge Piera LLodr? (jorge.piera@iver.es)
50
 */
51
public class WFSTTags {
52
	public static final String XML_ROOT = "<?xml version=\"1.0\" ?>";
53
	public static final String XMLNS = "xmlns";
54
	public static final String XML_NAMESPACE_PREFIX = "xsi";
55
	public static final String XML_NAMESPACE = "http://www.w3.org/2001/XMLSchema-instance";
56
	public static final String XML_SCHEMALOCATION = "schemaLocation";
57
	public static final String WFS_NAMESPACE_PREFIX = "wfs";
58
	public static final String WFS_NAMESPACE = "http://www.opengis.net/wfs";
59
	public static final String OGC_NAMESPACE_PREFIX = "ogc";
60
	public static final String OGC_NAMESPACE = "http://www.opengis.net/ogc";
61
	public static final String GML_NAMESPACE_PREFIX = "gml";
62
	public static final String GML_NAMESPACE = "http://www.opengis.net/gml";
63
	
64
	public static final String WFST_LOCKID = "LockId";
65
	public static final String WFST_LOCK = "Lock";
66
	public static final String WFST_FEATURESLOCKED = "FeaturesLocked";
67
	public static final String WFST_FEATURESID = "FeatureId";	
68
	public static final String WFST_SERVICE = "service";
69
	public static final String WFST_TRANSACTIONRESULT = "TransactionResult";
70
	public static final String WFST_TRANSACTIONRESPONSE = "WFS_TransactionResponse";
71
	public static final String WFST_TRANSACTIONMESSAGE = "Message";
72
	public static final String WFST_STATUS = "Status";
73
	public static final String WFST_SUCCESS = "SUCCESS";
74
	public static final String WFST_FAILED = "FAILED";
75
	public static final String WFST_RELEASEACTION = "releaseAction";
76
	public static final String WFST_EXPIRYTIME = "expiry";	
77
	
78
	public static final String WFS_QUERY = "Query";
79
	public static final String WFS_FILTER = "Filter";
80
	public static final String WFS_RESULTTYPE = "resultType";
81
	public static final String WFS_HITS = "hits";
82
	public static final String WFS_NUMBER_OF_FEATURES = "numberOfFeatures";
83
	public static final String WFS_TIME_STAMP = "timeStamp";
84
}
0 85

  
tags/v2_0_0_Build_2021/libraries/libRemoteServices/src/org/gvsig/remoteclient/wfs/edition/WFSTOperation.java
1
package org.gvsig.remoteclient.wfs.edition;
2

  
3
import org.gvsig.remoteclient.utils.CapabilitiesTags;
4

  
5
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
6
 *
7
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
8
 *
9
 * This program is free software; you can redistribute it and/or
10
 * modify it under the terms of the GNU General Public License
11
 * as published by the Free Software Foundation; either version 2
12
 * of the License, or (at your option) any later version.
13
 *
14
 * This program is distributed in the hope that it will be useful,
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 * GNU General Public License for more details.
18
 *
19
 * You should have received a copy of the GNU General Public License
20
 * along with this program; if not, write to the Free Software
21
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
22
 *
23
 * For more information, contact:
24
 *
25
 *  Generalitat Valenciana
26
 *   Conselleria d'Infraestructures i Transport
27
 *   Av. Blasco Ib??ez, 50
28
 *   46010 VALENCIA
29
 *   SPAIN
30
 *
31
 *      +34 963862235
32
 *   gvsig@gva.es
33
 *      www.gvsig.gva.es
34
 *
35
 *    or
36
 *
37
 *   IVER T.I. S.A
38
 *   Salamanca 50
39
 *   46005 Valencia
40
 *   Spain
41
 *
42
 *   +34 963163400
43
 *   dac@iver.es
44
 */
45
/* CVS MESSAGES:
46
 *
47
 * $Id$
48
 * $Log$
49
 *
50
 */
51
/**
52
 * @author Jorge Piera LLodr? (jorge.piera@iver.es)
53
 */
54
public abstract class WFSTOperation implements IWFSTOperation{
55
	//The table to apply the operation
56
	private String namespace = null;
57
	private String typename = null;
58
	//The filter to apply the operation
59
	private boolean isfiltered = true;
60
	private String filterEncoding = null;	
61

  
62
	WFSTOperation(String typename) {
63
		super();
64
		this.typename = typename;		
65
		isfiltered = false;
66
	}
67

  
68
	WFSTOperation(String typename, String filterEncoding) {
69
		super();
70
		this.typename = typename;
71
		this.filterEncoding = filterEncoding;
72
		isfiltered = true;
73
	}	
74

  
75
	/*
76
	 * (non-Javadoc)
77
	 * @see org.gvsig.remoteClient.wfs.edition.IWFSTOperation#getRequest()
78
	 */
79
	public String getRequest() {
80
		StringBuffer request = new StringBuffer();
81
		request.append("<" + CapabilitiesTags.WFS_NAMESPACE_PREFIX + ":");
82
		request.append(getOperationName());
83
		if (hasTypeName()){
84
			request.append(" typeName=\"" + typename + "\"");
85
		}
86
		request.append(">");
87
		request.append(getGml());
88
		request.append(getFilter());
89
		request.append("</" + CapabilitiesTags.WFS_NAMESPACE_PREFIX + ":");
90
		request.append(getOperationName() + ">");
91
		return request.toString();
92
	}
93
	
94
	/**
95
	 * @return if the opartion has a typename
96
	 */
97
	protected boolean hasTypeName(){
98
		return false;
99
	}
100

  
101
	/**
102
	 * @return the GML
103
	 */
104
	protected String getGml(){
105
		return "";
106
	}
107

  
108
	/**
109
	 * @return the filter where the operation is applied
110
	 */
111
	private String getFilter(){
112
		StringBuffer filter = new StringBuffer();
113
		if (isfiltered){
114
			filter.append(filterEncoding);			
115
		}
116
		return filter.toString();
117
	}
118
}
0 119

  
tags/v2_0_0_Build_2021/libraries/libRemoteServices/src/org/gvsig/remoteclient/wfs/edition/WFSTDeleteOperation.java
1
package org.gvsig.remoteclient.wfs.edition;
2

  
3

  
4
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
5
 *
6
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
7
 *
8
 * This program is free software; you can redistribute it and/or
9
 * modify it under the terms of the GNU General Public License
10
 * as published by the Free Software Foundation; either version 2
11
 * of the License, or (at your option) any later version.
12
 *
13
 * This program is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 * GNU General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU General Public License
19
 * along with this program; if not, write to the Free Software
20
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
21
 *
22
 * For more information, contact:
23
 *
24
 *  Generalitat Valenciana
25
 *   Conselleria d'Infraestructures i Transport
26
 *   Av. Blasco Ib??ez, 50
27
 *   46010 VALENCIA
28
 *   SPAIN
29
 *
30
 *      +34 963862235
31
 *   gvsig@gva.es
32
 *      www.gvsig.gva.es
33
 *
34
 *    or
35
 *
36
 *   IVER T.I. S.A
37
 *   Salamanca 50
38
 *   46005 Valencia
39
 *   Spain
40
 *
41
 *   +34 963163400
42
 *   dac@iver.es
43
 */
44
/* CVS MESSAGES:
45
 *
46
 * $Id$
47
 * $Log$
48
 *
49
 */
50
/**
51
 * @author Jorge Piera LLodr? (jorge.piera@iver.es)
52
 */
53
public class WFSTDeleteOperation extends WFSTOperation {
54
			
55
	WFSTDeleteOperation(String typename, String filterEncoding) {
56
		super(typename, filterEncoding);		
57
	}
58

  
59
	/*
60
	 * (non-Javadoc)
61
	 * @see org.gvsig.remoteClient.wfs.edition.IWFSTOperation#getOperationName()
62
	 */
63
	public String getOperationName() {
64
		return "Delete";
65
	}
66
	
67
	/*
68
	 * (non-Javadoc)
69
	 * @see org.gvsig.remoteClient.wfs.edition.WFSTOperation#hasTypeName()
70
	 */
71
	protected boolean hasTypeName(){
72
		return true;
73
	}
74
}
0 75

  
tags/v2_0_0_Build_2021/libraries/libRemoteServices/src/org/gvsig/remoteclient/wfs/edition/WFSTTransaction_1_0_0.java
1
package org.gvsig.remoteclient.wfs.edition;
2

  
3
import java.util.ArrayList;
4

  
5
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
6
 *
7
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
8
 *
9
 * This program is free software; you can redistribute it and/or
10
 * modify it under the terms of the GNU General Public License
11
 * as published by the Free Software Foundation; either version 2
12
 * of the License, or (at your option) any later version.
13
 *
14
 * This program is distributed in the hope that it will be useful,
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 * GNU General Public License for more details.
18
 *
19
 * You should have received a copy of the GNU General Public License
20
 * along with this program; if not, write to the Free Software
21
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
22
 *
23
 * For more information, contact:
24
 *
25
 *  Generalitat Valenciana
26
 *   Conselleria d'Infraestructures i Transport
27
 *   Av. Blasco Ib??ez, 50
28
 *   46010 VALENCIA
29
 *   SPAIN
30
 *
31
 *      +34 963862235
32
 *   gvsig@gva.es
33
 *      www.gvsig.gva.es
34
 *
35
 *    or
36
 *
37
 *   IVER T.I. S.A
38
 *   Salamanca 50
39
 *   46005 Valencia
40
 *   Spain
41
 *
42
 *   +34 963163400
43
 *   dac@iver.es
44
 */
45
/* CVS MESSAGES:
46
 *
47
 * $Id$
48
 * $Log$
49
 *
50
 */
51
/**
52
 * @author Jorge Piera LLodr? (jorge.piera@iver.es)
53
 */
54
public class WFSTTransaction_1_0_0 extends WFSTTransaction{
55
	
56
	public WFSTTransaction_1_0_0(String typename, String namespaceprefix,
57
			String namespace, ArrayList featuresLocked) {
58
		super(typename, namespaceprefix, namespace, featuresLocked);
59
	}
60

  
61
	public WFSTTransaction_1_0_0() {
62
		super();
63
	}
64

  
65
	/*
66
	 * (non-Javadoc)
67
	 * @see org.gvsig.remoteClient.wfs.edition.WFSTTransaction#getSchemaLocation()
68
	 */
69
	protected String getSchemaLocation() {
70
		return "../wfs/1.0.0/WFS-transaction.xsd";
71
	}
72

  
73
	/*
74
	 * (non-Javadoc)
75
	 * @see org.gvsig.remoteClient.wfs.edition.WFSTTransaction#getVersion()
76
	 */
77
	protected String getVersion() {
78
		return "1.0.0";
79
	}
80

  
81
}
0 82

  
tags/v2_0_0_Build_2021/libraries/libRemoteServices/src/org/gvsig/remoteclient/wfs/edition/WFSTUpdateOperation.java
1
package org.gvsig.remoteclient.wfs.edition;
2

  
3

  
4
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
5
 *
6
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
7
 *
8
 * This program is free software; you can redistribute it and/or
9
 * modify it under the terms of the GNU General Public License
10
 * as published by the Free Software Foundation; either version 2
11
 * of the License, or (at your option) any later version.
12
 *
13
 * This program is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 * GNU General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU General Public License
19
 * along with this program; if not, write to the Free Software
20
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
21
 *
22
 * For more information, contact:
23
 *
24
 *  Generalitat Valenciana
25
 *   Conselleria d'Infraestructures i Transport
26
 *   Av. Blasco Ib??ez, 50
27
 *   46010 VALENCIA
28
 *   SPAIN
29
 *
30
 *      +34 963862235
31
 *   gvsig@gva.es
32
 *      www.gvsig.gva.es
33
 *
34
 *    or
35
 *
36
 *   IVER T.I. S.A
37
 *   Salamanca 50
38
 *   46005 Valencia
39
 *   Spain
40
 *
41
 *   +34 963163400
42
 *   dac@iver.es
43
 */
44
/* CVS MESSAGES:
45
 *
46
 * $Id$
47
 * $Log$
48
 *
49
 */
50
/**
51
 * @author Jorge Piera LLodr? (jorge.piera@iver.es)
52
 */
53
public class WFSTUpdateOperation extends WFSTOperation {
54
	private String gml = null;
55
	
56
	WFSTUpdateOperation(String typename, String filterEncoding, String gml) {
57
		super(typename, filterEncoding);
58
		this.gml = gml;
59
	}
60
	
61
	/*
62
	 * (non-Javadoc)
63
	 * @see org.gvsig.remoteClient.wfs.edition.WFSTOperation#getGml()
64
	 */
65
	protected String getGml(){
66
		return gml;
67
	}
68

  
69
	/*
70
	 * (non-Javadoc)
71
	 * @see org.gvsig.remoteClient.wfs.edition.IWFSTOperation#getOperationName()
72
	 */
73
	public String getOperationName() {
74
		return "Update";
75
	}	
76
	
77
	/*
78
	 * (non-Javadoc)
79
	 * @see org.gvsig.remoteClient.wfs.edition.WFSTOperation#hasTypeName()
80
	 */
81
	protected boolean hasTypeName(){
82
		return true;
83
	}
84
}
0 85

  
tags/v2_0_0_Build_2021/libraries/libRemoteServices/src/org/gvsig/remoteclient/wfs/edition/WFSTTransaction_1_1_0.java
1
package org.gvsig.remoteclient.wfs.edition;
2

  
3
import java.util.ArrayList;
4

  
5
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
6
 *
7
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
8
 *
9
 * This program is free software; you can redistribute it and/or
10
 * modify it under the terms of the GNU General Public License
11
 * as published by the Free Software Foundation; either version 2
12
 * of the License, or (at your option) any later version.
13
 *
14
 * This program is distributed in the hope that it will be useful,
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 * GNU General Public License for more details.
18
 *
19
 * You should have received a copy of the GNU General Public License
20
 * along with this program; if not, write to the Free Software
21
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
22
 *
23
 * For more information, contact:
24
 *
25
 *  Generalitat Valenciana
26
 *   Conselleria d'Infraestructures i Transport
27
 *   Av. Blasco Ib??ez, 50
28
 *   46010 VALENCIA
29
 *   SPAIN
30
 *
31
 *      +34 963862235
32
 *   gvsig@gva.es
33
 *      www.gvsig.gva.es
34
 *
35
 *    or
36
 *
37
 *   IVER T.I. S.A
38
 *   Salamanca 50
39
 *   46005 Valencia
40
 *   Spain
41
 *
42
 *   +34 963163400
43
 *   dac@iver.es
44
 */
45
/* CVS MESSAGES:
46
 *
47
 * $Id$
48
 * $Log$
49
 *
50
 */
51
/**
52
 * @author Jorge Piera LLodr? (jorge.piera@iver.es)
53
 */
54
public class WFSTTransaction_1_1_0 extends WFSTTransaction{
55

  
56
	public WFSTTransaction_1_1_0(String typename, String namespaceprefix,
57
			String namespace, ArrayList featuresLocked) {
58
		super(typename, namespaceprefix, namespace, featuresLocked);
59
	}
60
	
61
	public WFSTTransaction_1_1_0() {
62
		super();
63
	}
64
	
65
	/*
66
	 * (non-Javadoc)
67
	 * @see org.gvsig.remoteClient.wfs.edition.WFSTTransaction#getSchemaLocation()
68
	 */
69
	protected String getSchemaLocation() {
70
		return "../wfs/1.1.0/WFS-transaction.xsd";
71
	}
72

  
73
	/*
74
	 * (non-Javadoc)
75
	 * @see org.gvsig.remoteClient.wfs.edition.WFSTTransaction#getVersion()
76
	 */
77
	protected String getVersion() {
78
		return "1.1.0";
79
	}
80

  
81
}
0 82

  
tags/v2_0_0_Build_2021/libraries/libRemoteServices/src/org/gvsig/remoteclient/wfs/edition/WFSTInsertOperation.java
1
package org.gvsig.remoteclient.wfs.edition;
2
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
3
 *
4
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
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 2
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., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
19
 *
20
 * For more information, contact:
21
 *
22
 *  Generalitat Valenciana
23
 *   Conselleria d'Infraestructures i Transport
24
 *   Av. Blasco Ib??ez, 50
25
 *   46010 VALENCIA
26
 *   SPAIN
27
 *
28
 *      +34 963862235
29
 *   gvsig@gva.es
30
 *      www.gvsig.gva.es
31
 *
32
 *    or
33
 *
34
 *   IVER T.I. S.A
35
 *   Salamanca 50
36
 *   46005 Valencia
37
 *   Spain
38
 *
39
 *   +34 963163400
40
 *   dac@iver.es
41
 */
42
/* CVS MESSAGES:
43
 *
44
 * $Id$
45
 * $Log$
46
 *
47
 */
48
/**
49
 * @author Jorge Piera LLodr? (jorge.piera@iver.es)
50
 */
51
public class WFSTInsertOperation extends WFSTOperation {
52
	private String gml = null;
53
	
54
	WFSTInsertOperation(String typename, String gml) {
55
		super(typename);
56
		this.gml = gml;
57
	}
58

  
59
	/*
60
	 * (non-Javadoc)
61
	 * @see org.gvsig.remoteClient.wfs.edition.WFSTOperation#getGml()
62
	 */
63
	protected String getGml(){
64
		return gml;
65
	}
66
	
67
	/*
68
	 * (non-Javadoc)
69
	 * @see org.gvsig.remoteClient.wfs.edition.IWFSTOperation#getOperationName()
70
	 */
71
	public String getOperationName() {
72
		return "Insert";
73
	}	
74
}
0 75

  
tags/v2_0_0_Build_2021/libraries/libRemoteServices/src/org/gvsig/remoteclient/wfs/edition/WFSTTransaction.java
1
package org.gvsig.remoteclient.wfs.edition;
2

  
3
import java.util.ArrayList;
4

  
5
import org.gvsig.remoteclient.utils.CapabilitiesTags;
6
import org.gvsig.remoteclient.wfs.WFSOperation;
7
import org.gvsig.remoteclient.wfs.filters.filterencoding.FilterEncoding;
8

  
9
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
10
 *
11
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
12
 *
13
 * This program is free software; you can redistribute it and/or
14
 * modify it under the terms of the GNU General Public License
15
 * as published by the Free Software Foundation; either version 2
16
 * of the License, or (at your option) any later version.
17
 *
18
 * This program is distributed in the hope that it will be useful,
19
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
 * GNU General Public License for more details.
22
 *
23
 * You should have received a copy of the GNU General Public License
24
 * along with this program; if not, write to the Free Software
25
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
26
 *
27
 * For more information, contact:
28
 *
29
 *  Generalitat Valenciana
30
 *   Conselleria d'Infraestructures i Transport
31
 *   Av. Blasco Ib??ez, 50
32
 *   46010 VALENCIA
33
 *   SPAIN
34
 *
35
 *      +34 963862235
36
 *   gvsig@gva.es
37
 *      www.gvsig.gva.es
38
 *
39
 *    or
40
 *
41
 *   IVER T.I. S.A
42
 *   Salamanca 50
43
 *   46005 Valencia
44
 *   Spain
45
 *
46
 *   +34 963163400
47
 *   dac@iver.es
48
 */
49
/* CVS MESSAGES:
50
 *
51
 * $Id$
52
 * $Log$
53
 *
54
 */
55
/**
56
 * @author Jorge Piera LLodr? (jorge.piera@iver.es)
57
 */
58
public abstract class WFSTTransaction {
59
	private ArrayList operations = null;
60
	private String typename = null;
61
	private String namespace = null;
62
	private String namespaceprefix = null;
63
	
64
	//Features Locked
65
	private ArrayList featuresLocked = null;	
66
	
67
	//Transaction message
68
	public String message = null;
69
	
70
	//Status
71
	public static final int STATUS_NO_EXECUTED = 0;
72
	public static final int STATUS_FAILED = 1;
73
	public static final int STATUS_SUCCESS = 2;
74
	private int status = 0;
75
		
76
	WFSTTransaction(){
77
		status = STATUS_NO_EXECUTED;	
78
		operations = new ArrayList();	
79
		featuresLocked = new ArrayList();
80
	}
81
	
82
	WFSTTransaction(String typename, String namespaceprefix, String namespace, ArrayList featuresLocked){
83
		status = STATUS_NO_EXECUTED;	
84
		operations = new ArrayList();
85
		this.typename = typename;
86
		this.namespaceprefix = namespaceprefix;
87
		this.namespace = namespace;
88
		this.featuresLocked = featuresLocked;
89
	}
90
	
91
	/**
92
	 * Adds a delete operation
93
	 * @param ids
94
	 * The identifiers of the features to delete
95
	 */
96
	public void addDeleteOperation(ArrayList ids){
97
		FilterEncoding fe = new FilterEncoding();
98
		fe.setQualified(true);
99
		for (int i=0 ; i<ids.size() ; i++){
100
			fe.addFeatureById(ids.get(i));
101
		}
102
		operations.add(new WFSTDeleteOperation(typename, fe.toString()));		
103
	}
104
	
105
	/**
106
	 * Adds a delete operation
107
	 * @param id
108
	 * The identifies of the feature to delete
109
	 */
110
	public void addDeleteOperation(String id){
111
		ArrayList ids = new ArrayList();
112
		ids.add(id);
113
		addDeleteOperation(ids);		
114
	}
115
	
116
	/**
117
	 * Adds a delete operation
118
	  * @param gml
119
	 * The new Feature
120
	 */
121
	public void addInsertOperation(String gml){
122
		operations.add(new WFSTInsertOperation(typename, gml));		
123
	}
124
	
125
	/**
126
	 * Adds a update operation
127
	 * @param ids
128
	 * The identifiers of the features to update
129
	 * @param gml
130
	 * The update operation
131
	 */
132
	public void addUpdateOperation(ArrayList ids, String gml){
133
		FilterEncoding fe = new FilterEncoding();
134
		fe.setQualified(true);
135
		for (int i=0 ; i<ids.size() ; i++){
136
			fe.addFeatureById(ids.get(i));
137
		}
138
		operations.add(new WFSTUpdateOperation(typename, fe.toString(), gml));		
139
	}
140
	
141
	/**
142
	 * Adds a update operation
143
	 * @param ids
144
	 * The identifier of the feature to update
145
	 * @param gml
146
	 * The update operation
147
	 */
148
	public void addUpdateOperation(String id, String gml){
149
		ArrayList ids = new ArrayList();
150
		ids.add(id);
151
		addUpdateOperation(ids,gml);			
152
	}
153

  
154
	/**
155
	 * @return the WFS version
156
	 */
157
	protected abstract String getVersion();
158
	
159
	/**
160
	 * @return the transaction schema location
161
	 */
162
	protected abstract String getSchemaLocation();
163
	
164
	/**
165
	 * @return the WFS-T request to execute
166
	 * the transaction
167
	 */
168
	public String getWFSTRequest(){
169
		StringBuffer request = new StringBuffer();
170
		request.append(getWFSTRequestStartHeader());
171
		request.append(getWFSTRequestLockID());
172
		for (int i=0 ; i<getOperationSize() ; i++){
173
			WFSTOperation operation = getOperationAt(i);
174
			request.append(operation.getRequest());
175
		}
176
		request.append(getWFSTRequestEndHeader());
177
		return request.toString();
178
	}	
179
	
180
	/**
181
	 * Create the lockID request
182
	 * @return
183
	 */
184
	private Object getWFSTRequestLockID() {
185
		StringBuffer request = new StringBuffer();
186
//		for (int i=0 ; i<featuresLocked.size() ; i++){
187
//			request.append("<" + WFSTTags.WFS_NAMESPACE_PREFIX + ":" + WFSTTags.WFST_LOCKID + ">" );
188
//			request.append(featuresLocked.get(i));
189
//			request.append("</" + WFSTTags.WFS_NAMESPACE_PREFIX + ":" + WFSTTags.WFST_LOCKID + ">" );
190
//		}
191
		return request.toString();
192
	}
193

  
194
	/**
195
	 * @return the XML header of the WFS Transaction 
196
	 * request
197
	 */
198
	private String getWFSTRequestStartHeader(){
199
		StringBuffer request = new StringBuffer();
200
		request.append(WFSTTags.XML_ROOT);
201
		request.append("<" + WFSTTags.WFS_NAMESPACE_PREFIX + ":");
202
		request.append(CapabilitiesTags.WFS_TRANSACTION + " ");
203
		request.append(CapabilitiesTags.VERSION + "=\"" + getVersion() + "\" ");
204
		request.append(WFSTTags.WFST_RELEASEACTION + "=\"ALL\" ");
205
		request.append(WFSTTags.WFST_SERVICE + "=\"WFS\" ");
206
		request.append(WFSTTags.XMLNS + ":" + WFSTTags.OGC_NAMESPACE_PREFIX);
207
		request.append("=\"" + WFSTTags.OGC_NAMESPACE + "\" ");
208
		request.append(WFSTTags.XMLNS + ":" + WFSTTags.WFS_NAMESPACE_PREFIX);
209
		request.append("=\"" + WFSTTags.WFS_NAMESPACE + "\" ");
210
		request.append(WFSTTags.XMLNS + ":" + WFSTTags.XML_NAMESPACE_PREFIX);
211
		request.append("=\"" + WFSTTags.XML_NAMESPACE + "\" ");
212
		request.append(WFSTTags.XMLNS + ":" + WFSTTags.GML_NAMESPACE_PREFIX);
213
		request.append("=\"" + WFSTTags.GML_NAMESPACE + "\" ");
214
		request.append(WFSTTags.XMLNS + ":" + namespaceprefix);
215
		request.append("=\"" + namespace + "\" ");
216
		request.append(WFSTTags.XML_NAMESPACE_PREFIX + ":" + WFSTTags.XML_SCHEMALOCATION);
217
		request.append("=\"" + WFSTTags.WFS_NAMESPACE + " ");
218
		request.append(getSchemaLocation());
219
		request.append("\">");
220
		return request.toString();
221
	}	
222
	
223
	/**
224
	 * @return the end of the WFS Transaction request header
225
	 */
226
	private String getWFSTRequestEndHeader(){
227
		StringBuffer request = new StringBuffer();
228
		request.append("</" + WFSTTags.WFS_NAMESPACE_PREFIX + ":");
229
		request.append(CapabilitiesTags.WFS_TRANSACTION + ">");
230
		return request.toString();
231
	}	
232
	
233
	/**
234
	 * @return the operation size
235
	 */
236
	public int getOperationSize() {
237
		return operations.size();
238
	}
239

  
240
	/**
241
	 * Gets an operation
242
	 * @param i
243
	 * Operation position
244
	 * @return
245
	 * A operation
246
	 */
247
	public WFSTOperation getOperationAt(int i){
248
		if (i>getOperationSize()){
249
			return null;
250
		}
251
		return (WFSTOperation)operations.get(i);
252
	}
253
	
254
	/**
255
	 * Adds a new operation
256
	 * @param operation the operation to add
257
	 */
258
	public void addOperation(WFSOperation operation) {
259
		operations.add(operation);
260
	}
261

  
262
	/**
263
	 * @return the status
264
	 */
265
	public int getStatus() {
266
		return status;
267
	}
268

  
269
	/**
270
	 * @param status the status to set
271
	 */
272
	public void setStatus(int status) {
273
		this.status = status;
274
	}
275

  
276
	/**
277
	 * @return the message
278
	 */
279
	public String getMessage() {
280
		return message;
281
	}
282

  
283
	/**
284
	 * @param message the message to set
285
	 */
286
	public void setMessage(String message) {
287
		this.message = message;
288
	}	
289
}
0 290

  
tags/v2_0_0_Build_2021/libraries/libRemoteServices/src/org/gvsig/remoteclient/wfs/edition/IWFSTOperation.java
1
package org.gvsig.remoteclient.wfs.edition;
2
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
3
 *
4
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
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 2
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., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
19
 *
20
 * For more information, contact:
21
 *
22
 *  Generalitat Valenciana
23
 *   Conselleria d'Infraestructures i Transport
24
 *   Av. Blasco Ib??ez, 50
25
 *   46010 VALENCIA
26
 *   SPAIN
27
 *
28
 *      +34 963862235
29
 *   gvsig@gva.es
30
 *      www.gvsig.gva.es
31
 *
32
 *    or
33
 *
34
 *   IVER T.I. S.A
35
 *   Salamanca 50
36
 *   46005 Valencia
37
 *   Spain
38
 *
39
 *   +34 963163400
40
 *   dac@iver.es
41
 */
42
/* CVS MESSAGES:
43
 *
44
 * $Id$
45
 * $Log$
46
 *
47
 */
48
/**
49
 * @author Jorge Piera LLodr? (jorge.piera@iver.es)
50
 */
51
public interface IWFSTOperation {
52

  
53
	/**
54
	 * @return the operation name
55
	 */
56
	public String getOperationName();
57
	
58
	/**
59
	 * @return the request to send to the server
60
	 */
61
	public String getRequest();
62

  
63
}
0 64

  
tags/v2_0_0_Build_2021/libraries/libRemoteServices/src/org/gvsig/remoteclient/wfs/edition/WFSTransactionFactory.java
1
package org.gvsig.remoteclient.wfs.edition;
2

  
3
import java.util.ArrayList;
4

  
5
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
6
 *
7
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
8
 *
9
 * This program is free software; you can redistribute it and/or
10
 * modify it under the terms of the GNU General Public License
11
 * as published by the Free Software Foundation; either version 2
12
 * of the License, or (at your option) any later version.
13
 *
14
 * This program is distributed in the hope that it will be useful,
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 * GNU General Public License for more details.
18
 *
19
 * You should have received a copy of the GNU General Public License
20
 * along with this program; if not, write to the Free Software
21
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
22
 *
23
 * For more information, contact:
24
 *
25
 *  Generalitat Valenciana
26
 *   Conselleria d'Infraestructures i Transport
27
 *   Av. Blasco Ib??ez, 50
28
 *   46010 VALENCIA
29
 *   SPAIN
30
 *
31
 *      +34 963862235
32
 *   gvsig@gva.es
33
 *      www.gvsig.gva.es
34
 *
35
 *    or
36
 *
37
 *   IVER T.I. S.A
38
 *   Salamanca 50
39
 *   46005 Valencia
40
 *   Spain
41
 *
42
 *   +34 963163400
43
 *   dac@iver.es
44
 */
45
/* CVS MESSAGES:
46
 *
47
 * $Id$
48
 * $Log$
49
 *
50
 */
51
/**
52
 * @author Jorge Piera LLodr? (jorge.piera@iver.es)
53
 */
54
public class WFSTransactionFactory {
55
	private static ArrayList transactions = null;
56
	
57
	static{
58
		transactions = new ArrayList();
59
		transactions.add(new WFSTTransaction_1_0_0());
60
		transactions.add(new WFSTTransaction_1_1_0());
61
	}
62
	
63
	/**
64
	 * Cretates a transaction. By default it returns a WFS 1.0.0
65
	 * transaction
66
	 * @param version
67
	 * The WFS version
68
	 * @return
69
	 * A WFS transaction
70
	 */
71
	public static WFSTTransaction createTransaction(String version, 
72
			String typename,
73
			String namespaceprefix,
74
			String namespace,
75
			ArrayList featuresLocked){
76
		if (version == null){
77
			return new WFSTTransaction_1_0_0(typename,namespaceprefix, namespace, featuresLocked);
78
		}
79
		for (int i=0 ; i<transactions.size() ; i++){
80
			WFSTTransaction transaction = (WFSTTransaction)transactions.get(i);
81
			if (transaction.getVersion().compareTo(version) == 0){
82
				try{
83
					Class[] args = new Class[4];
84
					args[0] = String.class;
85
					args[1] = String.class;
86
					args[2] = String.class;
87
					args[3] = ArrayList.class;
88
					Object[] params = new Object[4];
89
					params[0] = typename;
90
					params[1] = namespaceprefix;
91
					params[2] = namespace;
92
					params[3] = featuresLocked;
93
					return (WFSTTransaction)transaction.getClass().getConstructor(args).newInstance(params);
94
				}catch(Exception e){
95
					return new WFSTTransaction_1_0_0(typename,namespaceprefix,namespace,featuresLocked);
96
				}
97
			}
98
		}
99
		return new WFSTTransaction_1_0_0(typename,namespaceprefix,namespace,featuresLocked);
100
	}
101
}
0 102

  
tags/v2_0_0_Build_2021/libraries/libRemoteServices/src/org/gvsig/remoteclient/wfs/WFSRequestInformation.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
*
3
* Copyright (C) 2007-2008 Infrastructures and Transports Department
4
* of the Valencian Government (CIT)
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 2
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
*/
22

  
23
/*
24
* AUTHORS (In addition to CIT):
25
* 2009 {Iver T.I.}   {Task}
26
*/
27
 
28
package org.gvsig.remoteclient.wfs;
29
/**
30
 * This class is used like a container of all the properties
31
 * that the library is able to retrieve in the XML header of 
32
 * every WFS reply.
33
 * 
34
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera</a>
35
 */
36
public class WFSRequestInformation {
37
	/**
38
	 * The attribute may be used by a web 
39
	 * feature service to indicate the time and 
40
	 * date when a response was generated.
41
	 */
42
	private String timeStamp = null;
43
	
44
	public WFSRequestInformation() {
45
		super();
46
	}		
47

  
48
	/**
49
	 * @return the timeStamp
50
	 */
51
	public String getTimeStamp() {
52
		return timeStamp;
53
	}
54

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

  
0 63

  
tags/v2_0_0_Build_2021/libraries/libRemoteServices/src/org/gvsig/remoteclient/wfs/WFSProtocolHandler.java
1
package org.gvsig.remoteclient.wfs;
2

  
3
import java.io.File;
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff