Revision 526
org.gvsig.oracle/tags/org.gvsig.oracle-2.0.81/org.gvsig.oracle.app/org.gvsig.oracle.app.mainplugin/buildNumber.properties | ||
---|---|---|
1 |
#Sun Mar 06 21:12:20 CET 2022 |
|
2 |
buildNumber=81 |
org.gvsig.oracle/tags/org.gvsig.oracle-2.0.81/org.gvsig.oracle.app/org.gvsig.oracle.app.mainplugin/src/main/java/org/gvsig/oracle/HostPortPanelView.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
|
|
3 |
<object classname="com.jeta.forms.store.memento.FormPackage"> |
|
4 |
<at name="fileversion"> |
|
5 |
<object classname="com.jeta.forms.store.memento.FormsVersion2"> |
|
6 |
<at name="major">2</at> |
|
7 |
<at name="minor">0</at> |
|
8 |
<at name="sub">0</at> |
|
9 |
</object> |
|
10 |
</at> |
|
11 |
<at name="form"> |
|
12 |
<object classname="com.jeta.forms.store.memento.FormMemento"> |
|
13 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
14 |
<at name="cellconstraints"> |
|
15 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
16 |
<at name="column">1</at> |
|
17 |
<at name="row">1</at> |
|
18 |
<at name="colspan">1</at> |
|
19 |
<at name="rowspan">1</at> |
|
20 |
<at name="halign">default</at> |
|
21 |
<at name="valign">default</at> |
|
22 |
<at name="insets" object="insets">0,0,0,0</at> |
|
23 |
</object> |
|
24 |
</at> |
|
25 |
<at name="componentclass">com.jeta.forms.gui.form.FormComponent</at> |
|
26 |
</super> |
|
27 |
<at name="id">/home/jjdelcerro/datos/devel/org.gvsig.oracle/org.gvsig.oracle.app/org.gvsig.oracle.app.mainplugin/src/main/java/org/gvsig/oracle/HostPortPanelView.xml</at> |
|
28 |
<at name="rowspecs">CENTER:4DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:4DLU:NONE</at> |
|
29 |
<at name="colspecs">FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE</at> |
|
30 |
<at name="components"> |
|
31 |
<object classname="java.util.LinkedList"> |
|
32 |
<item > |
|
33 |
<at name="value"> |
|
34 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
35 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
36 |
<at name="cellconstraints"> |
|
37 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
38 |
<at name="column">2</at> |
|
39 |
<at name="row">2</at> |
|
40 |
<at name="colspan">1</at> |
|
41 |
<at name="rowspan">1</at> |
|
42 |
<at name="halign">default</at> |
|
43 |
<at name="valign">default</at> |
|
44 |
<at name="insets" object="insets">0,0,0,0</at> |
|
45 |
</object> |
|
46 |
</at> |
|
47 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
48 |
</super> |
|
49 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
50 |
<at name="beanclass">com.jeta.forms.components.label.JETALabel</at> |
|
51 |
<at name="beanproperties"> |
|
52 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
53 |
<at name="classname">com.jeta.forms.components.label.JETALabel</at> |
|
54 |
<at name="properties"> |
|
55 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
56 |
<at name="border"> |
|
57 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
58 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
59 |
<at name="name">border</at> |
|
60 |
</super> |
|
61 |
<at name="borders"> |
|
62 |
<object classname="java.util.LinkedList"> |
|
63 |
<item > |
|
64 |
<at name="value"> |
|
65 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
66 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
67 |
<at name="name">border</at> |
|
68 |
</super> |
|
69 |
</object> |
|
70 |
</at> |
|
71 |
</item> |
|
72 |
</object> |
|
73 |
</at> |
|
74 |
</object> |
|
75 |
</at> |
|
76 |
<at name="name"></at> |
|
77 |
<at name="width">38</at> |
|
78 |
<at name="text">Server</at> |
|
79 |
<at name="fill"> |
|
80 |
<object classname="com.jeta.forms.store.properties.effects.PaintProperty"> |
|
81 |
<at name="name">fill</at> |
|
82 |
</object> |
|
83 |
</at> |
|
84 |
<at name="height">14</at> |
|
85 |
</object> |
|
86 |
</at> |
|
87 |
</object> |
|
88 |
</at> |
|
89 |
</object> |
|
90 |
</at> |
|
91 |
</item> |
|
92 |
<item > |
|
93 |
<at name="value"> |
|
94 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
95 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
96 |
<at name="cellconstraints"> |
|
97 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
98 |
<at name="column">2</at> |
|
99 |
<at name="row">4</at> |
|
100 |
<at name="colspan">1</at> |
|
101 |
<at name="rowspan">1</at> |
|
102 |
<at name="halign">default</at> |
|
103 |
<at name="valign">default</at> |
|
104 |
<at name="insets" object="insets">0,0,0,0</at> |
|
105 |
</object> |
|
106 |
</at> |
|
107 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
108 |
</super> |
|
109 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
110 |
<at name="beanclass">com.jeta.forms.components.label.JETALabel</at> |
|
111 |
<at name="beanproperties"> |
|
112 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
113 |
<at name="classname">com.jeta.forms.components.label.JETALabel</at> |
|
114 |
<at name="properties"> |
|
115 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
116 |
<at name="border"> |
|
117 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
118 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
119 |
<at name="name">border</at> |
|
120 |
</super> |
|
121 |
<at name="borders"> |
|
122 |
<object classname="java.util.LinkedList"> |
|
123 |
<item > |
|
124 |
<at name="value"> |
|
125 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
126 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
127 |
<at name="name">border</at> |
|
128 |
</super> |
|
129 |
</object> |
|
130 |
</at> |
|
131 |
</item> |
|
132 |
</object> |
|
133 |
</at> |
|
134 |
</object> |
|
135 |
</at> |
|
136 |
<at name="name"></at> |
|
137 |
<at name="width">38</at> |
|
138 |
<at name="text">Port</at> |
|
139 |
<at name="fill"> |
|
140 |
<object classname="com.jeta.forms.store.properties.effects.PaintProperty"> |
|
141 |
<at name="name">fill</at> |
|
142 |
</object> |
|
143 |
</at> |
|
144 |
<at name="height">14</at> |
|
145 |
</object> |
|
146 |
</at> |
|
147 |
</object> |
|
148 |
</at> |
|
149 |
</object> |
|
150 |
</at> |
|
151 |
</item> |
|
152 |
<item > |
|
153 |
<at name="value"> |
|
154 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
155 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
156 |
<at name="cellconstraints"> |
|
157 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
158 |
<at name="column">4</at> |
|
159 |
<at name="row">2</at> |
|
160 |
<at name="colspan">1</at> |
|
161 |
<at name="rowspan">1</at> |
|
162 |
<at name="halign">default</at> |
|
163 |
<at name="valign">default</at> |
|
164 |
<at name="insets" object="insets">0,0,0,0</at> |
|
165 |
</object> |
|
166 |
</at> |
|
167 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
168 |
</super> |
|
169 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
170 |
<at name="beanclass">javax.swing.JTextField</at> |
|
171 |
<at name="beanproperties"> |
|
172 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
173 |
<at name="classname">javax.swing.JTextField</at> |
|
174 |
<at name="properties"> |
|
175 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
176 |
<at name="border"> |
|
177 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
178 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
179 |
<at name="name">border</at> |
|
180 |
</super> |
|
181 |
<at name="borders"> |
|
182 |
<object classname="java.util.LinkedList"> |
|
183 |
<item > |
|
184 |
<at name="value"> |
|
185 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
186 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
187 |
<at name="name">border</at> |
|
188 |
</super> |
|
189 |
</object> |
|
190 |
</at> |
|
191 |
</item> |
|
192 |
</object> |
|
193 |
</at> |
|
194 |
</object> |
|
195 |
</at> |
|
196 |
<at name="name">txtServer</at> |
|
197 |
<at name="width">475</at> |
|
198 |
<at name="height">20</at> |
|
199 |
</object> |
|
200 |
</at> |
|
201 |
</object> |
|
202 |
</at> |
|
203 |
</object> |
|
204 |
</at> |
|
205 |
</item> |
|
206 |
<item > |
|
207 |
<at name="value"> |
|
208 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
209 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
210 |
<at name="cellconstraints"> |
|
211 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
212 |
<at name="column">4</at> |
|
213 |
<at name="row">4</at> |
|
214 |
<at name="colspan">1</at> |
|
215 |
<at name="rowspan">1</at> |
|
216 |
<at name="halign">default</at> |
|
217 |
<at name="valign">default</at> |
|
218 |
<at name="insets" object="insets">0,0,0,0</at> |
|
219 |
</object> |
|
220 |
</at> |
|
221 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
222 |
</super> |
|
223 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
224 |
<at name="beanclass">javax.swing.JTextField</at> |
|
225 |
<at name="beanproperties"> |
|
226 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
227 |
<at name="classname">javax.swing.JTextField</at> |
|
228 |
<at name="properties"> |
|
229 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
230 |
<at name="border"> |
|
231 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
232 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
233 |
<at name="name">border</at> |
|
234 |
</super> |
|
235 |
<at name="borders"> |
|
236 |
<object classname="java.util.LinkedList"> |
|
237 |
<item > |
|
238 |
<at name="value"> |
|
239 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
240 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
241 |
<at name="name">border</at> |
|
242 |
</super> |
|
243 |
</object> |
|
244 |
</at> |
|
245 |
</item> |
|
246 |
</object> |
|
247 |
</at> |
|
248 |
</object> |
|
249 |
</at> |
|
250 |
<at name="selectionStart">4</at> |
|
251 |
<at name="name">txtPort</at> |
|
252 |
<at name="width">475</at> |
|
253 |
<at name="selectionEnd">4</at> |
|
254 |
<at name="text">5500</at> |
|
255 |
<at name="height">20</at> |
|
256 |
</object> |
|
257 |
</at> |
|
258 |
</object> |
|
259 |
</at> |
|
260 |
</object> |
|
261 |
</at> |
|
262 |
</item> |
|
263 |
</object> |
|
264 |
</at> |
|
265 |
<at name="properties"> |
|
266 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
267 |
<at name="classname">com.jeta.forms.gui.form.GridView</at> |
|
268 |
<at name="properties"> |
|
269 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
270 |
<at name="border"> |
|
271 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
272 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
273 |
<at name="name">border</at> |
|
274 |
</super> |
|
275 |
<at name="borders"> |
|
276 |
<object classname="java.util.LinkedList"/> |
|
277 |
</at> |
|
278 |
</object> |
|
279 |
</at> |
|
280 |
<at name="name"></at> |
|
281 |
<at name="fill"> |
|
282 |
<object classname="com.jeta.forms.store.properties.effects.PaintProperty"> |
|
283 |
<at name="name">fill</at> |
|
284 |
</object> |
|
285 |
</at> |
|
286 |
<at name="scollBars"> |
|
287 |
<object classname="com.jeta.forms.store.properties.ScrollBarsProperty"> |
|
288 |
<at name="name">scollBars</at> |
|
289 |
<at name="verticalpolicy">21</at> |
|
290 |
<at name="horizontalpolicy">31</at> |
|
291 |
<at name="border"> |
|
292 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
293 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
294 |
<at name="name">border</at> |
|
295 |
</super> |
|
296 |
<at name="borders"> |
|
297 |
<object classname="java.util.LinkedList"> |
|
298 |
<item > |
|
299 |
<at name="value"> |
|
300 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
301 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
302 |
<at name="name">border</at> |
|
303 |
</super> |
|
304 |
</object> |
|
305 |
</at> |
|
306 |
</item> |
|
307 |
</object> |
|
308 |
</at> |
|
309 |
</object> |
|
310 |
</at> |
|
311 |
</object> |
|
312 |
</at> |
|
313 |
</object> |
|
314 |
</at> |
|
315 |
</object> |
|
316 |
</at> |
|
317 |
<at name="cellpainters"> |
|
318 |
<object classname="com.jeta.forms.store.support.Matrix"> |
|
319 |
<at name="rows"> |
|
320 |
<object classname="[Ljava.lang.Object;" size="5"> |
|
321 |
<at name="item" index="0"> |
|
322 |
<object classname="[Ljava.lang.Object;" size="5"/> |
|
323 |
</at> |
|
324 |
<at name="item" index="1"> |
|
325 |
<object classname="[Ljava.lang.Object;" size="5"/> |
|
326 |
</at> |
|
327 |
<at name="item" index="2"> |
|
328 |
<object classname="[Ljava.lang.Object;" size="5"/> |
|
329 |
</at> |
|
330 |
<at name="item" index="3"> |
|
331 |
<object classname="[Ljava.lang.Object;" size="5"/> |
|
332 |
</at> |
|
333 |
<at name="item" index="4"> |
|
334 |
<object classname="[Ljava.lang.Object;" size="5"/> |
|
335 |
</at> |
|
336 |
</object> |
|
337 |
</at> |
|
338 |
</object> |
|
339 |
</at> |
|
340 |
<at name="rowgroups"> |
|
341 |
<object classname="com.jeta.forms.store.memento.FormGroupSet"> |
|
342 |
<at name="groups"> |
|
343 |
<object classname="java.util.HashMap"/> |
|
344 |
</at> |
|
345 |
</object> |
|
346 |
</at> |
|
347 |
<at name="colgroups"> |
|
348 |
<object classname="com.jeta.forms.store.memento.FormGroupSet"> |
|
349 |
<at name="groups"> |
|
350 |
<object classname="java.util.HashMap"/> |
|
351 |
</at> |
|
352 |
</object> |
|
353 |
</at> |
|
354 |
</object> |
|
355 |
</at> |
|
356 |
</object> |
org.gvsig.oracle/tags/org.gvsig.oracle-2.0.81/org.gvsig.oracle.app/org.gvsig.oracle.app.mainplugin/src/main/java/org/gvsig/oracle/HostPortPanelView.java | ||
---|---|---|
1 |
package org.gvsig.oracle; |
|
2 |
|
|
3 |
import com.jeta.open.i18n.I18NUtils; |
|
4 |
import com.jgoodies.forms.layout.CellConstraints; |
|
5 |
import com.jgoodies.forms.layout.FormLayout; |
|
6 |
import java.awt.BorderLayout; |
|
7 |
import java.awt.ComponentOrientation; |
|
8 |
import java.awt.Container; |
|
9 |
import java.awt.Dimension; |
|
10 |
import javax.swing.Box; |
|
11 |
import javax.swing.ImageIcon; |
|
12 |
import javax.swing.JFrame; |
|
13 |
import javax.swing.JLabel; |
|
14 |
import javax.swing.JPanel; |
|
15 |
import javax.swing.JTextField; |
|
16 |
|
|
17 |
|
|
18 |
public class HostPortPanelView extends JPanel |
|
19 |
{ |
|
20 |
JTextField txtServer = new JTextField(); |
|
21 |
JTextField txtPort = new JTextField(); |
|
22 |
|
|
23 |
/** |
|
24 |
* Default constructor |
|
25 |
*/ |
|
26 |
public HostPortPanelView() |
|
27 |
{ |
|
28 |
initializePanel(); |
|
29 |
} |
|
30 |
|
|
31 |
/** |
|
32 |
* Adds fill components to empty cells in the first row and first column of the grid. |
|
33 |
* This ensures that the grid spacing will be the same as shown in the designer. |
|
34 |
* @param cols an array of column indices in the first row where fill components should be added. |
|
35 |
* @param rows an array of row indices in the first column where fill components should be added. |
|
36 |
*/ |
|
37 |
void addFillComponents( Container panel, int[] cols, int[] rows ) |
|
38 |
{ |
|
39 |
Dimension filler = new Dimension(10,10); |
|
40 |
|
|
41 |
boolean filled_cell_11 = false; |
|
42 |
CellConstraints cc = new CellConstraints(); |
|
43 |
if ( cols.length > 0 && rows.length > 0 ) |
|
44 |
{ |
|
45 |
if ( cols[0] == 1 && rows[0] == 1 ) |
|
46 |
{ |
|
47 |
/** add a rigid area */ |
|
48 |
panel.add( Box.createRigidArea( filler ), cc.xy(1,1) ); |
|
49 |
filled_cell_11 = true; |
|
50 |
} |
|
51 |
} |
|
52 |
|
|
53 |
for( int index = 0; index < cols.length; index++ ) |
|
54 |
{ |
|
55 |
if ( cols[index] == 1 && filled_cell_11 ) |
|
56 |
{ |
|
57 |
continue; |
|
58 |
} |
|
59 |
panel.add( Box.createRigidArea( filler ), cc.xy(cols[index],1) ); |
|
60 |
} |
|
61 |
|
|
62 |
for( int index = 0; index < rows.length; index++ ) |
|
63 |
{ |
|
64 |
if ( rows[index] == 1 && filled_cell_11 ) |
|
65 |
{ |
|
66 |
continue; |
|
67 |
} |
|
68 |
panel.add( Box.createRigidArea( filler ), cc.xy(1,rows[index]) ); |
|
69 |
} |
|
70 |
|
|
71 |
} |
|
72 |
|
|
73 |
/** |
|
74 |
* Helper method to load an image file from the CLASSPATH |
|
75 |
* @param imageName the package and name of the file to load relative to the CLASSPATH |
|
76 |
* @return an ImageIcon instance with the specified image file |
|
77 |
* @throws IllegalArgumentException if the image resource cannot be loaded. |
|
78 |
*/ |
|
79 |
public ImageIcon loadImage( String imageName ) |
|
80 |
{ |
|
81 |
try |
|
82 |
{ |
|
83 |
ClassLoader classloader = getClass().getClassLoader(); |
|
84 |
java.net.URL url = classloader.getResource( imageName ); |
|
85 |
if ( url != null ) |
|
86 |
{ |
|
87 |
ImageIcon icon = new ImageIcon( url ); |
|
88 |
return icon; |
|
89 |
} |
|
90 |
} |
|
91 |
catch( Exception e ) |
|
92 |
{ |
|
93 |
e.printStackTrace(); |
|
94 |
} |
|
95 |
throw new IllegalArgumentException( "Unable to load image: " + imageName ); |
|
96 |
} |
|
97 |
|
|
98 |
/** |
|
99 |
* Method for recalculating the component orientation for |
|
100 |
* right-to-left Locales. |
|
101 |
* @param orientation the component orientation to be applied |
|
102 |
*/ |
|
103 |
public void applyComponentOrientation( ComponentOrientation orientation ) |
|
104 |
{ |
|
105 |
// Not yet implemented... |
|
106 |
// I18NUtils.applyComponentOrientation(this, orientation); |
|
107 |
super.applyComponentOrientation(orientation); |
|
108 |
} |
|
109 |
|
|
110 |
public JPanel createPanel() |
|
111 |
{ |
|
112 |
JPanel jpanel1 = new JPanel(); |
|
113 |
FormLayout formlayout1 = new FormLayout("FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE","CENTER:4DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:4DLU:NONE"); |
|
114 |
CellConstraints cc = new CellConstraints(); |
|
115 |
jpanel1.setLayout(formlayout1); |
|
116 |
|
|
117 |
JLabel jlabel1 = new JLabel(); |
|
118 |
jlabel1.setText("Server"); |
|
119 |
jpanel1.add(jlabel1,cc.xy(2,2)); |
|
120 |
|
|
121 |
JLabel jlabel2 = new JLabel(); |
|
122 |
jlabel2.setText("Port"); |
|
123 |
jpanel1.add(jlabel2,cc.xy(2,4)); |
|
124 |
|
|
125 |
txtServer.setName("txtServer"); |
|
126 |
jpanel1.add(txtServer,cc.xy(4,2)); |
|
127 |
|
|
128 |
txtPort.setName("txtPort"); |
|
129 |
txtPort.setSelectionEnd(4); |
|
130 |
txtPort.setSelectionStart(4); |
|
131 |
txtPort.setText("5500"); |
|
132 |
jpanel1.add(txtPort,cc.xy(4,4)); |
|
133 |
|
|
134 |
addFillComponents(jpanel1,new int[]{ 1,2,3,4,5 },new int[]{ 1,2,3,4,5 }); |
|
135 |
return jpanel1; |
|
136 |
} |
|
137 |
|
|
138 |
/** |
|
139 |
* Initializer |
|
140 |
*/ |
|
141 |
protected void initializePanel() |
|
142 |
{ |
|
143 |
setLayout(new BorderLayout()); |
|
144 |
add(createPanel(), BorderLayout.CENTER); |
|
145 |
} |
|
146 |
|
|
147 |
|
|
148 |
} |
org.gvsig.oracle/tags/org.gvsig.oracle-2.0.81/org.gvsig.oracle.app/org.gvsig.oracle.app.mainplugin/src/main/java/org/gvsig/oracle/OracleExtension.java | ||
---|---|---|
1 |
|
|
2 |
package org.gvsig.oracle; |
|
3 |
|
|
4 |
import java.awt.event.ActionEvent; |
|
5 |
import java.awt.event.ActionListener; |
|
6 |
import org.gvsig.andami.IconThemeHelper; |
|
7 |
import org.gvsig.andami.plugins.Extension; |
|
8 |
import org.gvsig.fmap.mapcontext.MapContextLocator; |
|
9 |
import org.gvsig.fmap.mapcontext.MapContextManager; |
|
10 |
import org.gvsig.tools.ToolsLocator; |
|
11 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
|
12 |
import org.gvsig.tools.swing.api.windowmanager.Dialog; |
|
13 |
import org.gvsig.tools.swing.api.windowmanager.WindowManager_v2; |
|
14 |
import org.gvsig.webbrowser.WebBrowserPanel; |
|
15 |
import org.gvsig.webbrowser.WebBrowserFactory; |
|
16 |
|
|
17 |
public class OracleExtension extends Extension { |
|
18 |
|
|
19 |
@Override |
|
20 |
public void initialize() { |
|
21 |
} |
|
22 |
|
|
23 |
@Override |
|
24 |
public boolean canQueryByAction() { |
|
25 |
return true; |
|
26 |
} |
|
27 |
|
|
28 |
@Override |
|
29 |
public void postInitialize() { |
|
30 |
MapContextManager mapContextMgr = MapContextLocator.getMapContextManager(); |
|
31 |
|
|
32 |
IconThemeHelper.registerIcon("layer", "layer-icon-oracle", this); |
|
33 |
mapContextMgr.registerIconLayer("Oracle", "layer-icon-oracle"); |
|
34 |
} |
|
35 |
|
|
36 |
@Override |
|
37 |
public void execute(String actionCommand) { |
|
38 |
if( "tools-oracle-show-admintool".equalsIgnoreCase(actionCommand) ) { |
|
39 |
startbrowser(); |
|
40 |
return; |
|
41 |
} |
|
42 |
} |
|
43 |
|
|
44 |
@Override |
|
45 |
public boolean isEnabled() { |
|
46 |
return true; |
|
47 |
} |
|
48 |
|
|
49 |
@Override |
|
50 |
public boolean isVisible() { |
|
51 |
return true; |
|
52 |
} |
|
53 |
|
|
54 |
@Override |
|
55 |
public boolean isEnabled(String action) { |
|
56 |
if( "tools-oracle-show-admintool".equalsIgnoreCase(action) ) { |
|
57 |
return true; |
|
58 |
} |
|
59 |
return false; |
|
60 |
} |
|
61 |
|
|
62 |
@Override |
|
63 |
public boolean isVisible(String action) { |
|
64 |
return true; |
|
65 |
} |
|
66 |
|
|
67 |
private void startbrowser() { |
|
68 |
final WindowManager_v2 winmanager = (WindowManager_v2) ToolsSwingLocator.getWindowManager(); |
|
69 |
final HostPortPanelView panel = new HostPortPanelView(); |
|
70 |
final Dialog dlg = winmanager.createDialog( |
|
71 |
panel, |
|
72 |
"Oracle Server", |
|
73 |
null, |
|
74 |
WindowManager_v2.BUTTONS_OK_CANCEL |
|
75 |
); |
|
76 |
dlg.addActionListener(new ActionListener() { |
|
77 |
@Override |
|
78 |
public void actionPerformed(ActionEvent e) { |
|
79 |
if( dlg.getAction()==WindowManager_v2.BUTTON_OK ) { |
|
80 |
String url = "http://"+panel.txtServer.getText().trim() + ":" + panel.txtPort.getText().trim() + "/em"; |
|
81 |
WebBrowserPanel webbrowser = WebBrowserFactory.createWebBrowserPanel(); |
|
82 |
winmanager.showWindow( |
|
83 |
webbrowser.asJComponent(), |
|
84 |
ToolsLocator.getI18nManager().getTranslation("_Oracle_administration_tool"), |
|
85 |
WindowManager_v2.MODE.WINDOW |
|
86 |
); |
|
87 |
webbrowser.setPage(url); |
|
88 |
} |
|
89 |
} |
|
90 |
}); |
|
91 |
dlg.show(WindowManager_v2.MODE.WINDOW); |
|
92 |
|
|
93 |
} |
|
94 |
|
|
95 |
} |
org.gvsig.oracle/tags/org.gvsig.oracle-2.0.81/org.gvsig.oracle.app/org.gvsig.oracle.app.mainplugin/src/main/resources-plugin/config.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="ISO-8859-1"?> |
|
2 |
<plugin-config> |
|
3 |
<libraries library-dir="lib/"/> |
|
4 |
<depends plugin-name="org.gvsig.app.mainplugin"/> |
|
5 |
<resourceBundle name="text"/> |
|
6 |
<extensions> |
|
7 |
<extension class-name="org.gvsig.oracle.OracleExtension" |
|
8 |
description="" |
|
9 |
active="true"> |
|
10 |
|
|
11 |
<action |
|
12 |
name="tools-oracle-show-admintool" |
|
13 |
label="_Oracle_administration_tool" |
|
14 |
position="902000200" |
|
15 |
icon="tools-oracle-show-admintool" |
|
16 |
tooltip="_Show_Oracle_administration_tool" |
|
17 |
action-command="tools-oracle-show-admintool" |
|
18 |
accelerator="" |
|
19 |
/> |
|
20 |
|
|
21 |
<menu |
|
22 |
name="tools-oracle-show-admintool" |
|
23 |
text="tools/Oracle/_Show_Oracle_administration_tool" |
|
24 |
/> |
|
25 |
|
|
26 |
</extension> |
|
27 |
</extensions> |
|
28 |
</plugin-config> |
org.gvsig.oracle/tags/org.gvsig.oracle-2.0.81/org.gvsig.oracle.app/org.gvsig.oracle.app.mainplugin/src/main/resources-plugin/srids/oracle2epsg.properties | ||
---|---|---|
1 |
83030=25830 |
|
2 |
|
|
3 |
81920=4202 |
|
4 |
81921=4203 |
|
5 |
81922=20248 |
|
6 |
81923=20348 |
|
7 |
81924=20249 |
|
8 |
81925=20349 |
|
9 |
81926=20250 |
|
10 |
81927=20350 |
|
11 |
81928=20251 |
|
12 |
81929=20351 |
|
13 |
81930=20252 |
|
14 |
81931=20352 |
|
15 |
81932=20253 |
|
16 |
81933=20353 |
|
17 |
81934=20254 |
|
18 |
81935=20354 |
|
19 |
81936=20255 |
|
20 |
81937=20355 |
|
21 |
81938=20256 |
|
22 |
81939=20356 |
|
23 |
81940=20257 |
|
24 |
81941=20357 |
|
25 |
81942=20258 |
|
26 |
81943=20358 |
|
27 |
82323=23028 |
|
28 |
82328=23029 |
|
29 |
82337=23030 |
|
30 |
82340=23031 |
|
31 |
82343=23032 |
|
32 |
82346=23033 |
|
33 |
82349=23034 |
|
34 |
82352=23035 |
|
35 |
82355=23036 |
|
36 |
82358=23037 |
|
37 |
82361=23038 |
|
38 |
524288=4326 |
org.gvsig.oracle/tags/org.gvsig.oracle-2.0.81/org.gvsig.oracle.app/org.gvsig.oracle.app.mainplugin/src/main/resources-plugin/readme_es.md | ||
---|---|---|
1 |
|
|
2 |
## Oracle en gvSIG |
|
3 |
|
|
4 |
### Limitaciones |
|
5 |
|
|
6 |
- gvSIG convierte a mayúsculas los nombres de las tablas creadas con él. |
|
7 |
|
|
8 |
- gvSIG convierte a mayúsculas los nombres de las columnas de tipo geometría de tablas creadas con él. |
|
9 |
|
|
10 |
- Cuando el índice espacial no está en estado "VALID", no se utilizará éste para el cálculo del "envelope" de la capa |
org.gvsig.oracle/tags/org.gvsig.oracle-2.0.81/org.gvsig.oracle.app/org.gvsig.oracle.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 |
<fileSets> |
|
18 |
<fileSet> |
|
19 |
<directory>src/main/resources-plugin</directory> |
|
20 |
<outputDirectory>.</outputDirectory> |
|
21 |
</fileSet> |
|
22 |
</fileSets> |
|
23 |
|
|
24 |
<dependencySets> |
|
25 |
|
|
26 |
<dependencySet> |
|
27 |
<useProjectArtifact>false</useProjectArtifact> |
|
28 |
<useTransitiveDependencies>false</useTransitiveDependencies> |
|
29 |
<outputDirectory>lib</outputDirectory> |
|
30 |
<includes> |
|
31 |
<include>org.gvsig:org.gvsig.oracle.provider</include> |
|
32 |
<include>com.oracle:ojdbc</include> |
|
33 |
<include>commons-dbcp:commons-dbcp</include> |
|
34 |
<include>commons-pool:commons-pool</include> |
|
35 |
</includes> |
|
36 |
</dependencySet> |
|
37 |
|
|
38 |
</dependencySets> |
|
39 |
|
|
40 |
</assembly> |
|
41 |
|
|
42 |
|
|
43 |
|
|
44 |
|
org.gvsig.oracle/tags/org.gvsig.oracle-2.0.81/org.gvsig.oracle.app/org.gvsig.oracle.app.mainplugin/pom.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
|
|
3 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
4 |
|
|
5 |
<modelVersion>4.0.0</modelVersion> |
|
6 |
<artifactId>org.gvsig.oracle.app.mainplugin</artifactId> |
|
7 |
<packaging>jar</packaging> |
|
8 |
<name>${project.artifactId}</name> |
|
9 |
<description> |
|
10 |
Oracle support for DAL and gvSIG. |
|
11 |
Provides viewing, editing and export/import capabilities for spatial data stored in an Oracle database. |
|
12 |
Works on Oracle Spatial and Oracle Locator. |
|
13 |
</description> |
|
14 |
|
|
15 |
<parent> |
|
16 |
<groupId>org.gvsig</groupId> |
|
17 |
<artifactId>org.gvsig.oracle.app</artifactId> |
|
18 |
<version>2.0.81</version> |
|
19 |
</parent> |
|
20 |
|
|
21 |
<dependencies> |
|
22 |
<dependency> |
|
23 |
<groupId>org.gvsig</groupId> |
|
24 |
<artifactId>org.gvsig.tools.lib</artifactId> |
|
25 |
<scope>compile</scope> |
|
26 |
</dependency> |
|
27 |
<dependency> |
|
28 |
<groupId>org.gvsig</groupId> |
|
29 |
<artifactId>org.gvsig.andami</artifactId> |
|
30 |
<scope>compile</scope> |
|
31 |
</dependency> |
|
32 |
<dependency> |
|
33 |
<groupId>org.gvsig</groupId> |
|
34 |
<artifactId>org.gvsig.app.mainplugin</artifactId> |
|
35 |
<scope>compile</scope> |
|
36 |
</dependency> |
|
37 |
<dependency> |
|
38 |
<groupId>org.gvsig</groupId> |
|
39 |
<artifactId>org.gvsig.ui</artifactId> |
|
40 |
<scope>compile</scope> |
|
41 |
</dependency> |
|
42 |
<dependency> |
|
43 |
<groupId>org.gvsig</groupId> |
|
44 |
<artifactId>org.gvsig.fmap.mapcontext.api</artifactId> |
|
45 |
<scope>compile</scope> |
|
46 |
</dependency> |
|
47 |
<dependency> |
|
48 |
<groupId>org.gvsig</groupId> |
|
49 |
<artifactId>org.gvsig.oracle.provider</artifactId> |
|
50 |
<scope>compile</scope> |
|
51 |
</dependency> |
|
52 |
|
|
53 |
<dependency> |
|
54 |
<groupId>com.oracle</groupId> |
|
55 |
<artifactId>ojdbc</artifactId> |
|
56 |
<scope>runtime</scope> |
|
57 |
</dependency> |
|
58 |
|
|
59 |
<dependency> |
|
60 |
<groupId>commons-dbcp</groupId> |
|
61 |
<artifactId>commons-dbcp</artifactId> |
|
62 |
<scope>runtime</scope> |
|
63 |
</dependency> |
|
64 |
<dependency> |
|
65 |
<groupId>commons-pool</groupId> |
|
66 |
<artifactId>commons-pool</artifactId> |
|
67 |
<scope>runtime</scope> |
|
68 |
</dependency> |
|
69 |
</dependencies> |
|
70 |
|
|
71 |
<properties> |
|
72 |
<!-- Package info property values --> |
|
73 |
<!-- Default values in org.gvsig.desktop --> |
|
74 |
<gvsig.package.info.name>Formats: Oracle support</gvsig.package.info.name> |
|
75 |
<gvsig.package.info.state>testing</gvsig.package.info.state> |
|
76 |
<gvsig.package.info.official>true</gvsig.package.info.official> |
|
77 |
<gvsig.package.info.dependencies>required: org.gvsig.app.mainplugin -ge 2.0.1</gvsig.package.info.dependencies> |
|
78 |
<gvsig.package.info.categories>Formats,Vector,Database</gvsig.package.info.categories> |
|
79 |
<gvsig.package.info.poolURL>https://devel.gvsig.org/download/projects/gvsig-oracle/pool/</gvsig.package.info.poolURL> |
|
80 |
</properties> |
|
81 |
|
|
82 |
|
|
83 |
</project> |
|
0 | 84 |
org.gvsig.oracle/tags/org.gvsig.oracle-2.0.81/org.gvsig.oracle.app/pom.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
|
|
3 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
4 |
|
|
5 |
<modelVersion>4.0.0</modelVersion> |
|
6 |
<artifactId>org.gvsig.oracle.app</artifactId> |
|
7 |
<packaging>pom</packaging> |
|
8 |
<name>${project.artifactId}</name> |
|
9 |
<parent> |
|
10 |
<groupId>org.gvsig</groupId> |
|
11 |
<artifactId>org.gvsig.oracle</artifactId> |
|
12 |
<version>2.0.81</version> |
|
13 |
</parent> |
|
14 |
|
|
15 |
<modules> |
|
16 |
<module>org.gvsig.oracle.app.mainplugin</module> |
|
17 |
</modules> |
|
18 |
|
|
19 |
</project> |
org.gvsig.oracle/tags/org.gvsig.oracle-2.0.81/pom.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
|
|
3 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
4 |
|
|
5 |
<modelVersion>4.0.0</modelVersion> |
|
6 |
<artifactId>org.gvsig.oracle</artifactId> |
|
7 |
<version>2.0.81</version> |
|
8 |
<packaging>pom</packaging> |
|
9 |
<name>${project.artifactId}</name> |
|
10 |
<description> |
|
11 |
Oracle support fort DAL and gvSIG. |
|
12 |
Provides viewing and editing capabilities for spatial data stored in an Oracle database. |
|
13 |
Works on Oracle Spatial and Oracle Locator. |
|
14 |
</description> |
|
15 |
<parent> |
|
16 |
<groupId>org.gvsig</groupId> |
|
17 |
<artifactId>org.gvsig.desktop</artifactId> |
|
18 |
<version>2.0.365</version> |
|
19 |
</parent> |
|
20 |
|
|
21 |
<url>https://devel.gvsig.org/redmine/projects/gvsig-oracle</url> |
|
22 |
<scm> |
|
23 |
<connection>scm:svn:https://devel.gvsig.org/svn/gvsig-oracle/org.gvsig.oracle/tags/org.gvsig.oracle-2.0.81</connection> |
|
24 |
<developerConnection>scm:svn:https://devel.gvsig.org/svn/gvsig-oracle/org.gvsig.oracle/tags/org.gvsig.oracle-2.0.81</developerConnection> |
|
25 |
<url>https://devel.gvsig.org/redmine/projects/gvsig-oracle/repository/show/org.gvsig.oracle/tags/org.gvsig.oracle-2.0.81</url> |
|
26 |
</scm> |
|
27 |
|
|
28 |
<repositories> |
|
29 |
<repository> |
|
30 |
<id>gvsig-public-http-repository</id> |
|
31 |
<name>gvSIG maven public HTTP repository</name> |
|
32 |
<url>http://devel.gvsig.org/m2repo/j2se</url> |
|
33 |
<releases> |
|
34 |
<enabled>true</enabled> |
|
35 |
<updatePolicy>daily</updatePolicy> |
|
36 |
<checksumPolicy>warn</checksumPolicy> |
|
37 |
</releases> |
|
38 |
<snapshots> |
|
39 |
<enabled>true</enabled> |
|
40 |
<updatePolicy>daily</updatePolicy> |
|
41 |
<checksumPolicy>warn</checksumPolicy> |
|
42 |
</snapshots> |
|
43 |
</repository> |
|
44 |
</repositories> |
|
45 |
|
|
46 |
<build> |
|
47 |
<plugins> |
|
48 |
<plugin> |
|
49 |
<groupId>org.apache.maven.plugins</groupId> |
|
50 |
<artifactId>maven-release-plugin</artifactId> |
|
51 |
<configuration> |
|
52 |
<tagBase>https://devel.gvsig.org/svn/gvsig-oracle/org.gvsig.oracle/tags/</tagBase> |
|
53 |
<goals>deploy</goals> |
|
54 |
</configuration> |
|
55 |
</plugin> |
|
56 |
<!-- <plugin> |
|
57 |
<groupId>org.apache.maven.plugins</groupId> |
|
58 |
<artifactId>maven-surefire-plugin</artifactId> |
|
59 |
<version>3.0.0-M4</version> |
|
60 |
<configuration> |
|
61 |
<excludes> |
|
62 |
<exclude>**/TestCreate.java</exclude> |
|
63 |
</excludes> |
|
64 |
</configuration> |
|
65 |
</plugin>--> |
|
66 |
</plugins> |
|
67 |
</build> |
|
68 |
|
|
69 |
<dependencyManagement> |
|
70 |
<dependencies> |
|
71 |
<dependency> |
|
72 |
<groupId>org.gvsig</groupId> |
|
73 |
<artifactId>org.gvsig.oracle.provider</artifactId> |
|
74 |
<version>2.0.81</version> |
|
75 |
</dependency> |
|
76 |
<dependency> |
|
77 |
<groupId>org.gvsig</groupId> |
|
78 |
<artifactId>org.gvsig.oracle.app.mainplugin</artifactId> |
|
79 |
<version>2.0.81</version> |
|
80 |
</dependency> |
|
81 |
<dependency> |
|
82 |
<groupId>com.oracle</groupId> |
|
83 |
<artifactId>ojdbc</artifactId> |
|
84 |
<version>11.2.0.4.0</version> |
|
85 |
<!-- |
|
86 |
<version>12.2.0.1.0</version> |
|
87 |
--> |
|
88 |
</dependency> |
|
89 |
</dependencies> |
|
90 |
</dependencyManagement> |
|
91 |
|
|
92 |
<modules> |
|
93 |
<module>org.gvsig.oracle.app</module> |
|
94 |
<module>org.gvsig.oracle.provider</module> |
|
95 |
</modules> |
|
96 |
|
|
97 |
</project> |
org.gvsig.oracle/tags/org.gvsig.oracle-2.0.81/org.gvsig.oracle.provider/src/test/java/org/gvsig/oracle/dal/TestUtils.java | ||
---|---|---|
1 |
package org.gvsig.oracle.dal; |
|
2 |
|
|
3 |
import java.io.File; |
|
4 |
import java.io.FileInputStream; |
|
5 |
import java.io.FileOutputStream; |
|
6 |
import java.net.URL; |
|
7 |
import java.util.ArrayList; |
|
8 |
import java.util.List; |
|
9 |
import java.util.Properties; |
|
10 |
import org.apache.commons.io.FileUtils; |
|
11 |
import org.apache.commons.io.FilenameUtils; |
|
12 |
import org.apache.commons.lang3.StringUtils; |
|
13 |
import org.gvsig.fmap.dal.DALLocator; |
|
14 |
import org.gvsig.fmap.dal.DataManager; |
|
15 |
import org.gvsig.fmap.dal.DataStore; |
|
16 |
import org.gvsig.fmap.dal.feature.Feature; |
|
17 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
18 |
import org.gvsig.fmap.dal.feature.impl.DefaultFeature; |
|
19 |
import org.gvsig.fmap.dal.feature.spi.FeatureProvider; |
|
20 |
import org.gvsig.fmap.dal.store.jdbc.JDBCStoreParameters; |
|
21 |
import org.gvsig.fmap.dal.store.jdbc2.JDBCHelper; |
|
22 |
import org.gvsig.fmap.dal.store.jdbc2.JDBCServerExplorer; |
|
23 |
import org.gvsig.fmap.dal.store.jdbc2.spi.FakeConnectionProvider; |
|
24 |
import org.gvsig.tools.resourcesstorage.ResourcesStorage; |
|
25 |
import org.slf4j.Logger; |
|
26 |
import org.slf4j.LoggerFactory; |
|
27 |
|
|
28 |
public class TestUtils { |
|
29 |
|
|
30 |
public static final Logger LOGGER = LoggerFactory.getLogger(TestUtils.class); |
|
31 |
|
|
32 |
public static final String PROVIDER_NAME = OracleLibrary.NAME; |
|
33 |
public static final String TEST_USER = "dba"; |
|
34 |
public static final String TEST_SCHEMA = "public"; |
|
35 |
public static final String TEST_DB_NAME = "dbtest"; |
|
36 |
|
|
37 |
public static OracleConnectionParameters buildDBConnection() throws Exception { |
|
38 |
DataManager dataManager = DALLocator.getDataManager(); |
|
39 |
OracleConnectionParameters conn = (OracleConnectionParameters) |
|
40 |
dataManager.createServerExplorerParameters(OracleLibrary.NAME); |
|
41 |
|
|
42 |
Properties p = new Properties(); |
|
43 |
File userDirectory = FileUtils.getUserDirectory(); |
|
44 |
String properties = FilenameUtils.concat( |
|
45 |
userDirectory.getCanonicalPath(), |
|
46 |
".gvSIG_Oracle_testDBConnection.properties"); |
|
47 |
File fileProperties = new File(properties); |
|
48 |
if(!fileProperties.exists()) { |
|
49 |
p.setProperty("host", "127.0.0.1"); |
|
50 |
p.setProperty("port", "1521"); |
|
51 |
p.setProperty("dbuser", TEST_USER); |
|
52 |
p.setProperty("schema", TEST_SCHEMA); |
|
53 |
p.setProperty("password", "PASSWD"); |
|
54 |
p.setProperty("dbname", TEST_DB_NAME); |
|
55 |
p.setProperty("mode", "service"); |
|
56 |
p.store(new FileOutputStream(properties), "Oracle test DB connection"); |
|
57 |
} else { |
|
58 |
FileInputStream fis = new FileInputStream(properties); |
|
59 |
p.load(fis); |
|
60 |
} |
|
61 |
|
|
62 |
conn.setDynValue("host", p.getProperty("host", null)); |
|
63 |
conn.setDynValue("port", p.getProperty("port", null)); |
|
64 |
conn.setDynValue("dbuser", p.getProperty("dbuser", null)); |
|
65 |
conn.setDynValue("schema", p.getProperty("schema", null)); |
|
66 |
conn.setDynValue("password", p.getProperty("password", null)); |
|
67 |
conn.setDynValue("dbname", p.getProperty("dbname", null)); |
|
68 |
conn.setDynValue("mode", p.getProperty("mode", null)); |
|
69 |
|
|
70 |
return conn; |
|
71 |
} |
|
72 |
|
|
73 |
public static JDBCServerExplorer openServerExplorer() throws Exception { |
|
74 |
DataManager dataManager = DALLocator.getDataManager(); |
|
75 |
OracleConnectionParameters conn = buildDBConnection(); |
|
76 |
JDBCServerExplorer explorer = (JDBCServerExplorer) dataManager.openServerExplorer( |
|
77 |
PROVIDER_NAME, conn |
|
78 |
); |
|
79 |
return explorer; |
|
80 |
} |
|
81 |
|
|
82 |
public static File getTargetFolder() throws Exception { |
|
83 |
URL url = TestUtils.class.getResource("/"); |
|
84 |
File x = new File(url.toURI()); |
|
85 |
File target = x.getParentFile(); |
|
86 |
return target; |
|
87 |
} |
|
88 |
|
|
89 |
public static File getResource(String name) throws Exception { |
|
90 |
File x = new File(getTargetFolder(), name); |
|
91 |
return x; |
|
92 |
} |
|
93 |
|
|
94 |
public static File getResourceAsFile(String pathname) throws Exception { |
|
95 |
URL url = TestUtils.class.getResource(pathname); |
|
96 |
File x = new File(url.toURI()); |
|
97 |
return x; |
|
98 |
} |
|
99 |
|
|
100 |
public static void removeDALResource(String tableName) throws Exception { |
|
101 |
// OracleConnectionParameters connection = buildDBConnection(dbname); |
|
102 |
// DatabaseWorkspaceManager workspace = DALLocator.getDataManager().createDatabaseWorkspaceManager( |
|
103 |
// (DataServerExplorerParameters) connection |
|
104 |
// ); |
|
105 |
|
|
106 |
JDBCServerExplorer explorer = openServerExplorer(); |
|
107 |
JDBCStoreParameters params = explorer.get(tableName); |
|
108 |
|
|
109 |
ResourcesStorage resources = explorer.getResourcesStorage(params); |
|
110 |
|
|
111 |
resources.remove("dal"); |
|
112 |
} |
|
113 |
|
|
114 |
public static FeatureStore openSourceStore1() throws Exception { |
|
115 |
DataManager dataManager = DALLocator.getDataManager(); |
|
116 |
File f = getResourceAsFile("/org/gvsig/oracle/dal/testCreateSource1.csv"); |
|
117 |
FeatureStore store = (FeatureStore) dataManager.openStore( |
|
118 |
DataStore.CSV_PROVIDER_NAME, |
|
119 |
"file=",f, |
|
120 |
"automaticTypesDetection=", false, |
|
121 |
"locale=","en" |
|
122 |
); |
|
123 |
return store; |
|
124 |
} |
|
125 |
|
|
126 |
public static FeatureStore openSourceStoreShort() throws Exception { |
|
127 |
DataManager dataManager = DALLocator.getDataManager(); |
|
128 |
File f = getResourceAsFile("/org/gvsig/oracle/dal/testCreateSource_short.csv"); |
|
129 |
FeatureStore store = (FeatureStore) dataManager.openStore( |
|
130 |
DataStore.CSV_PROVIDER_NAME, |
|
131 |
"file=",f, |
|
132 |
"automaticTypesDetection=", false, |
|
133 |
"locale=","en" |
|
134 |
); |
|
135 |
return store; |
|
136 |
} |
|
137 |
|
|
138 |
|
|
139 |
public static List<String> getSQLs(String name) throws Exception { |
|
140 |
File f = getResourceAsFile("/org/gvsig/oracle/dal/"+name); |
|
141 |
List<String> SQLs = new ArrayList<>(); |
|
142 |
List<String> lines = FileUtils.readLines(f); |
|
143 |
StringBuilder sb = new StringBuilder(); |
|
144 |
for (String line : lines) { |
|
145 |
line = StringUtils.stripStart(line, null); |
|
146 |
if( line.startsWith("--") ) { |
|
147 |
continue; |
|
148 |
} |
|
149 |
if( line.endsWith(";") ) { |
|
150 |
sb.append(line.substring(0, line.length()-1)); |
|
151 |
SQLs.add(sb.toString()); |
|
152 |
sb.setLength(0); |
|
153 |
} else { |
|
154 |
sb.append(line); |
|
155 |
} |
|
156 |
} |
|
157 |
return SQLs; |
|
158 |
} |
|
159 |
|
|
160 |
public static FeatureProvider getFeatureProvider(Feature feature) { |
|
161 |
return ((DefaultFeature)feature).getData(); |
|
162 |
} |
|
163 |
|
|
164 |
public static JDBCHelper getJDBCHelper() { |
|
165 |
return getJDBCHelper(TEST_SCHEMA, TEST_USER); |
|
166 |
} |
|
167 |
|
|
168 |
public static JDBCHelper getJDBCHelper(String schema, String user) { |
|
169 |
OracleExplorerParameters params = new OracleExplorerParameters(); |
|
170 |
params.setSchema(schema); |
|
171 |
params.setUser(user); |
|
172 |
params.setDBName(TEST_DB_NAME); |
|
173 |
OracleHelper helper = new OracleHelper(params, new FakeConnectionProvider(params)); |
|
174 |
return helper; |
|
175 |
} |
|
176 |
|
|
177 |
} |
org.gvsig.oracle/tags/org.gvsig.oracle-2.0.81/org.gvsig.oracle.provider/src/test/java/org/gvsig/oracle/dal/TestCreate.java | ||
---|---|---|
1 |
package org.gvsig.oracle.dal; |
|
2 |
|
|
3 |
import java.util.Date; |
|
4 |
import java.util.List; |
|
5 |
import junit.framework.TestCase; |
|
6 |
import static junit.framework.TestCase.assertEquals; |
|
7 |
import org.gvsig.fmap.dal.DALLocator; |
|
8 |
import org.gvsig.fmap.dal.DataManager; |
|
9 |
import org.gvsig.fmap.dal.DataTypes; |
|
10 |
import org.gvsig.fmap.dal.exception.ValidateDataParametersException; |
|
11 |
import org.gvsig.fmap.dal.feature.EditableFeature; |
|
12 |
import org.gvsig.fmap.dal.feature.EditableFeatureType; |
|
13 |
import org.gvsig.fmap.dal.feature.Feature; |
|
14 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
|
15 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
16 |
import org.gvsig.fmap.dal.feature.FeatureType; |
|
17 |
import org.gvsig.fmap.dal.feature.NewFeatureStoreParameters; |
|
18 |
import org.gvsig.fmap.dal.store.jdbc.JDBCStoreParameters; |
|
19 |
import org.gvsig.fmap.dal.store.jdbc2.JDBCServerExplorer; |
|
20 |
import org.gvsig.fmap.geom.Geometry; |
|
21 |
import org.gvsig.tools.library.impl.DefaultLibrariesInitializer; |
|
22 |
import org.slf4j.Logger; |
|
23 |
import org.slf4j.LoggerFactory; |
|
24 |
|
|
25 |
public class TestCreate extends TestCase { |
|
26 |
|
|
27 |
private static final Logger LOGGER = LoggerFactory.getLogger(TestCreate.class); |
|
28 |
|
|
29 |
public static final String DBNAME = "testCreate"; |
|
30 |
|
|
31 |
public static final int ZERO_DEFAULT_DISPLAY_SIZE = 0; |
|
32 |
public static final int BYTE_DEFAULT_DISPLAY_SIZE = 4; |
|
33 |
public static final int FLOAT_DEFAULT_DISPLAY_SIZE = 4; |
|
34 |
public static final int DOUBLE_DEFAULT_DISPLAY_SIZE = 8; |
|
35 |
|
|
36 |
public TestCreate(String testName) { |
|
37 |
super(testName); |
|
38 |
} |
|
39 |
|
|
40 |
@Override |
|
41 |
protected void setUp() throws Exception { |
|
42 |
super.setUp(); |
|
43 |
new DefaultLibrariesInitializer().fullInitialize(); |
|
44 |
} |
|
45 |
|
|
46 |
@Override |
|
47 |
protected void tearDown() throws Exception { |
|
48 |
super.tearDown(); |
|
49 |
} |
|
50 |
|
|
51 |
// TODO add test methods here. The name must begin with 'test'. For example: |
|
52 |
// public void testHello() {} |
|
53 |
protected String getProviderName() { |
|
54 |
return OracleLibrary.NAME; |
|
55 |
} |
|
56 |
|
|
57 |
protected String getTargetName() { |
|
58 |
return "testCreateTarget6".toUpperCase(); |
|
59 |
} |
|
60 |
|
|
61 |
protected FeatureStore openTargetStore1(JDBCServerExplorer explorer) throws Exception { |
|
62 |
JDBCStoreParameters params = explorer.get(getTargetName()); |
|
63 |
|
|
64 |
DataManager dataManager = DALLocator.getDataManager(); |
|
65 |
FeatureStore store; |
|
66 |
try { |
|
67 |
store = (FeatureStore) dataManager.openStore( |
|
68 |
getProviderName(), |
|
69 |
params |
|
70 |
); |
|
71 |
} catch (ValidateDataParametersException ex) { |
|
72 |
LOGGER.warn(ex.getLocalizedMessageStack()); |
|
73 |
throw ex; |
|
74 |
} |
|
75 |
return store; |
|
76 |
} |
|
77 |
|
|
78 |
protected void createFrom(JDBCServerExplorer explorer, FeatureStore sourceStore) throws Exception { |
|
79 |
NewFeatureStoreParameters params = (NewFeatureStoreParameters) explorer.getAddParameters( |
|
80 |
getTargetName() |
|
81 |
); |
|
82 |
EditableFeatureType ft = params.getDefaultFeatureType(); |
|
83 |
ft.addAll(sourceStore.getDefaultFeatureType()); |
|
84 |
explorer.add(getProviderName(), params, true); |
|
85 |
} |
|
86 |
|
|
87 |
protected void checkTypes(JDBCServerExplorer explorer, FeatureType sourceFeatureType, boolean withDalResource) throws Exception { |
|
88 |
FeatureStore targetStore = openTargetStore1(explorer); |
|
89 |
FeatureType targetFeatureType = targetStore.getDefaultFeatureType(); |
|
90 |
|
|
91 |
assertEquals("Feature type size", sourceFeatureType.size(), targetFeatureType.size()); |
|
92 |
for (int i = 0; i < sourceFeatureType.size(); i++) { |
|
93 |
FeatureAttributeDescriptor sourceAttr = sourceFeatureType.get(i); |
|
94 |
FeatureAttributeDescriptor targetAttr = targetFeatureType.get(i); |
|
95 |
if (withDalResource) { |
|
96 |
if (sourceAttr.getType() == DataTypes.GEOMETRY) { |
|
97 |
assertEquals( |
|
98 |
String.format("Field %s name mismatch", sourceAttr.getName()), |
|
99 |
sourceAttr.getName().toUpperCase(), |
|
100 |
targetAttr.getName() |
|
101 |
); |
|
102 |
} else { |
|
103 |
assertEquals( |
|
104 |
String.format("Field %s name mismatch", sourceAttr.getName()), |
|
105 |
sourceAttr.getName(), |
|
106 |
targetAttr.getName() |
|
107 |
); |
|
108 |
} |
|
109 |
|
|
110 |
assertEquals( |
|
111 |
String.format("Field %s type mismatch", sourceAttr.getName()), |
|
112 |
sourceAttr.getDataTypeName(), |
|
113 |
targetAttr.getDataTypeName() |
|
114 |
); |
|
115 |
assertEquals( |
|
116 |
String.format("Field %s display size mismatch", sourceAttr.getName()), |
|
117 |
sourceAttr.getDisplaySize(), |
|
118 |
targetAttr.getDisplaySize() |
|
119 |
); |
|
120 |
assertEquals( |
|
121 |
String.format("Field %s size mismatch", sourceAttr.getName()), |
|
122 |
sourceAttr.getSize(), |
|
123 |
targetAttr.getSize() |
|
124 |
); |
|
125 |
assertEquals( |
|
126 |
String.format("Field %s precision mismatch", sourceAttr.getName()), |
|
127 |
sourceAttr.getPrecision(), |
|
128 |
targetAttr.getPrecision() |
|
129 |
); |
|
130 |
assertEquals( |
|
131 |
String.format("Field %s scale mismatch", sourceAttr.getName()), |
|
132 |
sourceAttr.getScale(), |
|
133 |
targetAttr.getScale() |
|
134 |
); |
|
135 |
|
|
136 |
if (sourceAttr.getType() == DataTypes.GEOMETRY) { |
|
137 |
assertEquals( |
|
138 |
String.format("Field %s geometry type mismatch", sourceAttr.getName()), |
|
139 |
sourceAttr.getGeomType().getName(), |
|
140 |
targetAttr.getGeomType().getName() |
|
141 |
); |
|
142 |
assertEquals( |
|
143 |
String.format("Field %s geometry SRS mismatch", sourceAttr.getName()), |
|
144 |
sourceAttr.getSRS().getAbrev(), |
|
145 |
targetAttr.getSRS().getAbrev() |
|
146 |
); |
|
147 |
|
|
148 |
} |
|
149 |
|
|
150 |
} else { |
|
151 |
switch (sourceAttr.getType()) { |
|
152 |
case DataTypes.BYTE: |
|
153 |
assertEquals( |
|
154 |
String.format("Field %s name mismatch", sourceAttr.getName()), |
|
155 |
sourceAttr.getName(), |
|
156 |
targetAttr.getName() |
|
157 |
); |
|
158 |
assertEquals( |
|
159 |
String.format("Field %s type mismatch", sourceAttr.getName()), |
|
160 |
DataTypes.DECIMAL, |
|
161 |
targetAttr.getDataType().getType() |
|
162 |
); |
|
163 |
assertEquals( |
|
164 |
String.format("Field %s display size mismatch", sourceAttr.getName()), |
|
165 |
BYTE_DEFAULT_DISPLAY_SIZE, |
|
166 |
targetAttr.getDisplaySize() |
|
167 |
); |
|
168 |
assertEquals( |
|
169 |
String.format("Field %s size mismatch", sourceAttr.getName()), |
|
170 |
sourceAttr.getSize(), |
|
171 |
targetAttr.getSize() |
|
172 |
); |
|
173 |
assertEquals( |
|
174 |
String.format("Field %s precision mismatch", sourceAttr.getName()), |
|
175 |
sourceAttr.getPrecision(), |
|
176 |
targetAttr.getPrecision() |
|
177 |
); |
|
178 |
assertEquals( |
|
179 |
String.format("Field %s scale mismatch", sourceAttr.getName()), |
|
180 |
sourceAttr.getScale(), |
|
181 |
targetAttr.getScale() |
|
182 |
); |
|
183 |
break; |
|
184 |
case DataTypes.BOOLEAN: |
|
185 |
assertEquals( |
|
186 |
String.format("Field %s name mismatch", sourceAttr.getName()), |
|
187 |
sourceAttr.getName(), |
|
188 |
targetAttr.getName() |
|
189 |
); |
|
190 |
assertEquals( |
|
191 |
String.format("Field %s type mismatch", sourceAttr.getName()), |
|
192 |
DataTypes.STRING_NAME, |
|
193 |
targetAttr.getDataTypeName() |
|
194 |
); |
|
195 |
assertEquals(String.format("Field %s display size mismatch", sourceAttr.getName()), |
|
196 |
ZERO_DEFAULT_DISPLAY_SIZE, |
|
197 |
targetAttr.getDisplaySize() |
|
198 |
); |
|
199 |
assertEquals(String.format("Field %s size mismatch", sourceAttr.getName()), |
|
200 |
OracleSQLBuilder.BOOLEAN_STRING_DEFAULT_LENGTH, |
|
201 |
targetAttr.getSize() |
|
202 |
); |
|
203 |
assertEquals( |
|
204 |
String.format("Field %s precision mismatch", sourceAttr.getName()), |
|
205 |
sourceAttr.getPrecision(), |
|
206 |
targetAttr.getPrecision() |
|
207 |
); |
|
208 |
assertEquals( |
|
209 |
String.format("Field %s scale mismatch", sourceAttr.getName()), |
|
210 |
sourceAttr.getScale(), |
|
211 |
targetAttr.getScale() |
|
212 |
); |
|
213 |
break; |
|
214 |
case DataTypes.STRING: |
|
215 |
assertEquals( |
|
216 |
String.format("Field %s name mismatch", sourceAttr.getName()), |
|
217 |
sourceAttr.getName(), |
|
218 |
targetAttr.getName() |
|
219 |
); |
|
220 |
assertEquals( |
|
221 |
String.format("Field %s type mismatch", sourceAttr.getName()), |
|
222 |
sourceAttr.getDataTypeName(), |
|
223 |
targetAttr.getDataTypeName() |
|
224 |
); |
|
225 |
assertEquals(String.format("Field %s display size mismatch", sourceAttr.getName()), |
|
226 |
ZERO_DEFAULT_DISPLAY_SIZE, |
|
227 |
targetAttr.getDisplaySize() |
|
228 |
); |
|
229 |
assertEquals( |
|
230 |
String.format("Field %s size mismatch", sourceAttr.getName()), |
|
231 |
sourceAttr.getSize(), |
|
232 |
targetAttr.getSize() |
|
233 |
); |
|
234 |
assertEquals( |
|
235 |
String.format("Field %s precision mismatch", sourceAttr.getName()), |
|
236 |
sourceAttr.getPrecision(), |
|
237 |
targetAttr.getPrecision() |
|
238 |
); |
|
239 |
assertEquals( |
|
240 |
String.format("Field %s scale mismatch", sourceAttr.getName()), |
|
241 |
sourceAttr.getScale(), |
|
242 |
targetAttr.getScale() |
|
243 |
); |
|
244 |
break; |
|
245 |
case DataTypes.TIME: |
|
246 |
case DataTypes.DATE: |
|
247 |
assertEquals( |
|
248 |
String.format("Field %s name mismatch", sourceAttr.getName()), |
|
249 |
sourceAttr.getName(), |
|
250 |
targetAttr.getName() |
|
251 |
); |
|
252 |
assertEquals( |
|
253 |
String.format("Field %s type mismatch", sourceAttr.getName()), |
|
254 |
DataTypes.TIMESTAMP_NAME, |
|
255 |
targetAttr.getDataTypeName() |
|
256 |
); |
|
257 |
assertEquals(String.format("Field %s display size mismatch", sourceAttr.getName()), |
|
258 |
ZERO_DEFAULT_DISPLAY_SIZE, |
|
259 |
targetAttr.getDisplaySize() |
|
260 |
); |
|
261 |
assertEquals( |
|
262 |
String.format("Field %s size mismatch", sourceAttr.getName()), |
|
263 |
sourceAttr.getSize(), |
|
264 |
targetAttr.getSize() |
|
265 |
); |
|
266 |
assertEquals( |
|
267 |
String.format("Field %s precision mismatch", sourceAttr.getName()), |
|
268 |
sourceAttr.getPrecision(), |
|
269 |
targetAttr.getPrecision() |
|
270 |
); |
|
271 |
assertEquals( |
|
272 |
String.format("Field %s scale mismatch", sourceAttr.getName()), |
|
273 |
sourceAttr.getScale(), |
|
274 |
targetAttr.getScale() |
|
275 |
); |
|
276 |
break; |
|
277 |
|
|
278 |
case DataTypes.DOUBLE: |
|
279 |
assertEquals( |
|
280 |
String.format("Field %s name mismatch", sourceAttr.getName()), |
|
281 |
sourceAttr.getName(), |
|
282 |
targetAttr.getName() |
|
283 |
); |
|
284 |
assertEquals( |
|
285 |
String.format("Field %s type mismatch", sourceAttr.getName()), |
|
286 |
sourceAttr.getDataTypeName(), |
|
287 |
targetAttr.getDataTypeName() |
|
288 |
); |
|
289 |
assertEquals( |
|
290 |
String.format("Field %s display size mismatch", sourceAttr.getName()), |
|
291 |
DOUBLE_DEFAULT_DISPLAY_SIZE, |
|
292 |
targetAttr.getDisplaySize() |
|
293 |
); |
|
294 |
assertEquals( |
|
295 |
String.format("Field %s size mismatch", sourceAttr.getName()), |
|
296 |
sourceAttr.getSize(), |
|
297 |
targetAttr.getSize() |
|
298 |
); |
|
299 |
assertEquals( |
|
300 |
String.format("Field %s precision mismatch", sourceAttr.getName()), |
|
301 |
sourceAttr.getPrecision(), |
|
302 |
targetAttr.getPrecision() |
|
303 |
); |
|
304 |
assertEquals( |
|
305 |
String.format("Field %s scale mismatch", sourceAttr.getName()), |
|
306 |
sourceAttr.getScale(), |
|
307 |
targetAttr.getScale() |
|
308 |
); |
|
309 |
break; |
|
310 |
case DataTypes.FLOAT: |
|
311 |
assertEquals( |
|
312 |
String.format("Field %s name mismatch", sourceAttr.getName()), |
|
313 |
sourceAttr.getName(), |
|
314 |
targetAttr.getName() |
|
315 |
); |
|
316 |
assertEquals( |
|
317 |
String.format("Field %s type mismatch", sourceAttr.getName()), |
|
318 |
sourceAttr.getDataTypeName(), |
|
319 |
targetAttr.getDataTypeName() |
|
320 |
); |
|
321 |
assertEquals( |
|
322 |
String.format("Field %s display size mismatch", sourceAttr.getName()), |
Also available in: Unified diff