Revision 33898
tags/v2_0_0_Build_2020/libraries/libFMap_dalfile/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" |
|
4 |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 |
|
5 |
http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
6 |
|
|
7 |
<modelVersion>4.0.0</modelVersion> |
|
8 |
<groupId>org.gvsig</groupId> |
|
9 |
<artifactId>org.gvsig.fmap.dal.file</artifactId> |
|
10 |
<packaging>jar</packaging> |
|
11 |
<version>2.0-SNAPSHOT</version> |
|
12 |
<name>libFMap_dalfile</name> |
|
13 |
<url>http://gvsig.org</url> |
|
14 |
<parent> |
|
15 |
<groupId>org.gvsig</groupId> |
|
16 |
<artifactId>gvsig-base-library-pom</artifactId> |
|
17 |
<version>2.0-SNAPSHOT</version> |
|
18 |
</parent> |
|
19 |
<distributionManagement> |
|
20 |
<site> |
|
21 |
<id>gvsig-repository</id> |
|
22 |
<url>${site-repository}/</url> |
|
23 |
</site> |
|
24 |
</distributionManagement> |
|
25 |
|
|
26 |
|
|
27 |
<properties> |
|
28 |
<!-- dbf --> |
|
29 |
<dbf-jarIncludes>org/gvsig/fmap/dal/store/dbf/**/**</dbf-jarIncludes> |
|
30 |
<dbf-jarExcludes>NONE</dbf-jarExcludes> |
|
31 |
|
|
32 |
<!-- dgn --> |
|
33 |
<dgn-jarIncludes>org/gvsig/fmap/dal/store/dgn/**/**</dgn-jarIncludes> |
|
34 |
<dgn-legend-jarIncludes>org/gvsig/fmap/dal/store/dgn/legend/**/**</dgn-legend-jarIncludes> |
|
35 |
<dgn-jarExcludes>${dgn-legend-jarIncludes}</dgn-jarExcludes> |
|
36 |
<dgn-legend-jarExcludes>NONE</dgn-legend-jarExcludes> |
|
37 |
|
|
38 |
<!-- dxf --> |
|
39 |
<dxf-jarIncludes>org/gvsig/fmap/dal/store/dxf/**/**</dxf-jarIncludes> |
|
40 |
<dxf-legend-jarIncludes>org/gvsig/fmap/dal/store/dxf/legend/**/**</dxf-legend-jarIncludes> |
|
41 |
<dxf-jarExcludes>${dxf-legend-jarIncludes}</dxf-jarExcludes> |
|
42 |
<dxf-legend-jarExcludes>NONE</dxf-legend-jarExcludes> |
|
43 |
|
|
44 |
<!-- shp --> |
|
45 |
<shp-jarIncludes>org/gvsig/fmap/dal/store/shp/**/**</shp-jarIncludes> |
|
46 |
<shp-jarExcludes>NONE</shp-jarExcludes> |
|
47 |
|
|
48 |
<!-- Common --> |
|
49 |
<common-jarIncludes>**/**</common-jarIncludes> |
|
50 |
<build-dir>${basedir}/../build</build-dir> |
|
51 |
|
|
52 |
</properties> |
|
53 |
|
|
54 |
<dependencies> |
|
55 |
<dependency> |
|
56 |
<groupId>org.gvsig</groupId> |
|
57 |
<artifactId>org.gvsig.tools.lib</artifactId> |
|
58 |
</dependency> |
|
59 |
<dependency> |
|
60 |
<groupId>org.gvsig</groupId> |
|
61 |
<artifactId>org.gvsig.projection</artifactId> |
|
62 |
<version>2.0-SNAPSHOT</version> |
|
63 |
</dependency> |
|
64 |
<dependency> |
|
65 |
<groupId>org.gvsig</groupId> |
|
66 |
<artifactId>org.gvsig.fmap.dal</artifactId> |
|
67 |
<version>2.0-SNAPSHOT</version> |
|
68 |
</dependency> |
|
69 |
<dependency> |
|
70 |
<groupId>org.gvsig</groupId> |
|
71 |
<artifactId>org.gvsig.fmap.dal</artifactId> |
|
72 |
<version>2.0-SNAPSHOT</version> |
|
73 |
<classifier>spi</classifier> |
|
74 |
</dependency> |
|
75 |
<dependency> |
|
76 |
<groupId>org.gvsig</groupId> |
|
77 |
<artifactId>org.gvsig.dxf</artifactId> |
|
78 |
<version>2.0-SNAPSHOT</version> |
|
79 |
</dependency> |
|
80 |
<dependency> |
|
81 |
<groupId>org.gvsig</groupId> |
|
82 |
<artifactId>org.gvsig.fmap.mapcontext</artifactId> |
|
83 |
<version>2.0-SNAPSHOT</version> |
|
84 |
</dependency> |
|
85 |
<dependency> |
|
86 |
<groupId>org.gvsig</groupId> |
|
87 |
<artifactId>org.gvsig.symbology</artifactId> |
|
88 |
<version>2.0-SNAPSHOT</version> |
|
89 |
</dependency> |
|
90 |
<dependency> |
|
91 |
<groupId>org.gvsig</groupId> |
|
92 |
<artifactId>org.gvsig.tools.evaluator.sqljep</artifactId> |
|
93 |
<version>2.0-SNAPSHOT</version> |
|
94 |
</dependency> |
|
95 |
|
|
96 |
<!-- TESTS --> |
|
97 |
<dependency> |
|
98 |
<groupId>org.gvsig</groupId> |
|
99 |
<artifactId>org.gvsig.tools.lib</artifactId> |
|
100 |
<classifier>tests</classifier> |
|
101 |
<scope>test</scope> |
|
102 |
</dependency> |
|
103 |
<dependency> |
|
104 |
<groupId>org.gvsig</groupId> |
|
105 |
<artifactId>org.gvsig.compat</artifactId> |
|
106 |
<version>2.0-SNAPSHOT</version> |
|
107 |
<classifier>se</classifier> |
|
108 |
<scope>test</scope> |
|
109 |
</dependency> |
|
110 |
<dependency> |
|
111 |
<groupId>org.gvsig</groupId> |
|
112 |
<artifactId>org.gvsig.fmap.dal</artifactId> |
|
113 |
<version>2.0-SNAPSHOT</version> |
|
114 |
<classifier>impl</classifier> |
|
115 |
<!--scope>test</scope--> |
|
116 |
</dependency> |
|
117 |
<dependency> |
|
118 |
<groupId>org.gvsig</groupId> |
|
119 |
<artifactId>org.gvsig.fmap.dal</artifactId> |
|
120 |
<version>2.0-SNAPSHOT</version> |
|
121 |
<classifier>tests</classifier> |
|
122 |
<scope>test</scope> |
|
123 |
</dependency> |
|
124 |
<dependency> |
|
125 |
<groupId>org.gvsig</groupId> |
|
126 |
<artifactId>org.gvsig.fmap.dal.index.spatial</artifactId> |
|
127 |
<version>2.0-SNAPSHOT</version> |
|
128 |
<classifier>jts</classifier> |
|
129 |
<scope>test</scope> |
|
130 |
</dependency> |
|
131 |
<dependency> |
|
132 |
<groupId>org.gvsig</groupId> |
|
133 |
<artifactId>org.gvsig.fmap.geometry</artifactId> |
|
134 |
<version>2.0-SNAPSHOT</version> |
|
135 |
<classifier>impl</classifier> |
|
136 |
<scope>test</scope> |
|
137 |
</dependency> |
|
138 |
<dependency> |
|
139 |
<groupId>org.gvsig</groupId> |
|
140 |
<artifactId>org.gvsig.fmap.mapcontext</artifactId> |
|
141 |
<version>2.0-SNAPSHOT</version> |
|
142 |
<classifier>operation</classifier> |
|
143 |
<scope>test</scope> |
|
144 |
</dependency> |
|
145 |
<dependency> |
|
146 |
<groupId>org.gvsig</groupId> |
|
147 |
<artifactId>org.gvsig.projection</artifactId> |
|
148 |
<version>2.0-SNAPSHOT</version> |
|
149 |
<classifier>cresques-impl</classifier> |
|
150 |
<scope>test</scope> |
|
151 |
</dependency> |
|
152 |
<dependency> |
|
153 |
<groupId>org.gvsig</groupId> |
|
154 |
<artifactId>org.gvsig.symbology</artifactId> |
|
155 |
<version>2.0-SNAPSHOT</version> |
|
156 |
<classifier>impl</classifier> |
|
157 |
<scope>test</scope> |
|
158 |
</dependency> |
|
159 |
|
|
160 |
</dependencies> |
|
161 |
<build> |
|
162 |
<sourceDirectory>src</sourceDirectory> |
|
163 |
<testSourceDirectory>src-test</testSourceDirectory> |
|
164 |
<testResources> |
|
165 |
<testResource> |
|
166 |
<directory>src-test</directory> |
|
167 |
</testResource> |
|
168 |
</testResources> |
|
169 |
<plugins> |
|
170 |
<!-- TODO: MAKE TESTS WORK AND REMOVE THIS OPTION --> |
|
171 |
<plugin> |
|
172 |
<groupId>org.apache.maven.plugins</groupId> |
|
173 |
<artifactId>maven-surefire-plugin</artifactId> |
|
174 |
<configuration> |
|
175 |
<skipTests>true</skipTests> |
|
176 |
</configuration> |
|
177 |
</plugin> |
|
178 |
</plugins> |
|
179 |
</build> |
|
180 |
<profiles> |
|
181 |
<profile> |
|
182 |
<id>se</id> |
|
183 |
<activation> |
|
184 |
<activeByDefault>true</activeByDefault> |
|
185 |
</activation> |
|
186 |
<build> |
|
187 |
<plugins> |
|
188 |
<plugin> |
|
189 |
<groupId>org.apache.maven.plugins</groupId> |
|
190 |
<artifactId>maven-jar-plugin</artifactId> |
|
191 |
<configuration> |
|
192 |
<excludes> |
|
193 |
<exclude>${dbf-jarIncludes}</exclude> |
|
194 |
<exclude>${dgn-jarIncludes}</exclude> |
|
195 |
<exclude>${dxf-jarIncludes}</exclude> |
|
196 |
<exclude>${shp-jarIncludes}</exclude> |
|
197 |
</excludes> |
|
198 |
</configuration> |
|
199 |
<executions> |
|
200 |
<!-- |
|
201 |
Generates a jar file only with the DAL file DBF Store classes |
|
202 |
--> |
|
203 |
<execution> |
|
204 |
<id>dbf</id> |
|
205 |
<phase>package</phase> |
|
206 |
<goals> |
|
207 |
<goal>jar</goal> |
|
208 |
</goals> |
|
209 |
<configuration> |
|
210 |
<classifier>store.dbf</classifier> |
|
211 |
<includes> |
|
212 |
<include>${dbf-jarIncludes}</include> |
|
213 |
</includes> |
|
214 |
<excludes> |
|
215 |
<exclude>${dbf-jarExcludes}</exclude> |
|
216 |
</excludes> |
|
217 |
</configuration> |
|
218 |
</execution> |
|
219 |
<!-- |
|
220 |
Generates a jar file only with the DAL file DGN Store classes |
|
221 |
--> |
|
222 |
<execution> |
|
223 |
<id>dgn</id> |
|
224 |
<phase>package</phase> |
|
225 |
<goals> |
|
226 |
<goal>jar</goal> |
|
227 |
</goals> |
|
228 |
<configuration> |
|
229 |
<classifier>store.dgn</classifier> |
|
230 |
<includes> |
|
231 |
<include>${dgn-jarIncludes}</include> |
|
232 |
</includes> |
|
233 |
<excludes> |
|
234 |
<exclude>${dgn-jarExcludes}</exclude> |
|
235 |
</excludes> |
|
236 |
</configuration> |
|
237 |
</execution> |
|
238 |
<!-- |
|
239 |
Generates a jar file only with the DAL file DGN Store legend classes |
|
240 |
--> |
|
241 |
<execution> |
|
242 |
<id>dgn.legend</id> |
|
243 |
<phase>package</phase> |
|
244 |
<goals> |
|
245 |
<goal>jar</goal> |
|
246 |
</goals> |
|
247 |
<configuration> |
|
248 |
<classifier>store.dgn.legend</classifier> |
|
249 |
<includes> |
|
250 |
<include>${dgn-legend-jarIncludes}</include> |
|
251 |
</includes> |
|
252 |
<excludes> |
|
253 |
<exclude>${dgn-legend-jarExcludes}</exclude> |
|
254 |
</excludes> |
|
255 |
</configuration> |
|
256 |
</execution> |
|
257 |
<!-- |
|
258 |
Generates a jar file only with the DAL file DXF Store classes |
|
259 |
--> |
|
260 |
<execution> |
|
261 |
<id>dxf</id> |
|
262 |
<phase>package</phase> |
|
263 |
<goals> |
|
264 |
<goal>jar</goal> |
|
265 |
</goals> |
|
266 |
<configuration> |
|
267 |
<classifier>store.dxf</classifier> |
|
268 |
<includes> |
|
269 |
<include>${dxf-jarIncludes}</include> |
|
270 |
</includes> |
|
271 |
<excludes> |
|
272 |
<exclude>${dxf-jarExcludes}</exclude> |
|
273 |
</excludes> |
|
274 |
</configuration> |
|
275 |
</execution> |
|
276 |
<!-- |
|
277 |
Generates a jar file only with the DAL file DXF Store legend classes |
|
278 |
--> |
|
279 |
<execution> |
|
280 |
<id>dxf.legend</id> |
|
281 |
<phase>package</phase> |
|
282 |
<goals> |
|
283 |
<goal>jar</goal> |
|
284 |
</goals> |
|
285 |
<configuration> |
|
286 |
<classifier>store.dxf.legend</classifier> |
|
287 |
<includes> |
|
288 |
<include>${dxf-legend-jarIncludes}</include> |
|
289 |
</includes> |
|
290 |
<excludes> |
|
291 |
<exclude>${dxf-legend-jarExcludes}</exclude> |
|
292 |
</excludes> |
|
293 |
</configuration> |
|
294 |
</execution> |
|
295 |
<!-- |
|
296 |
Generates a jar file only with the DAL file SHP Store classes |
|
297 |
--> |
|
298 |
<execution> |
|
299 |
<id>shp</id> |
|
300 |
<phase>package</phase> |
|
301 |
<goals> |
|
302 |
<goal>jar</goal> |
|
303 |
</goals> |
|
304 |
<configuration> |
|
305 |
<classifier>store.shp</classifier> |
|
306 |
<includes> |
|
307 |
<include>${shp-jarIncludes}</include> |
|
308 |
</includes> |
|
309 |
<excludes> |
|
310 |
<exclude>${shp-jarExcludes}</exclude> |
|
311 |
</excludes> |
|
312 |
</configuration> |
|
313 |
</execution> |
|
314 |
</executions> |
|
315 |
</plugin> |
|
316 |
<plugin> |
|
317 |
<artifactId>maven-antrun-plugin</artifactId> |
|
318 |
<executions> |
|
319 |
<execution> |
|
320 |
<id>services</id> |
|
321 |
<phase>package</phase> |
|
322 |
<goals> |
|
323 |
<goal>run</goal> |
|
324 |
</goals> |
|
325 |
<configuration> |
|
326 |
<tasks> |
|
327 |
<jar destfile="${project.build.directory}/${project.build.finalName}.jar" |
|
328 |
update="true"> |
|
329 |
<fileset dir="${basedir}/resources/api" /> |
|
330 |
</jar> |
|
331 |
<jar destfile="${project.build.directory}/${project.build.finalName}-store.dbf.jar" |
|
332 |
update="true"> |
|
333 |
<fileset dir="${basedir}/resources/dbf" /> |
|
334 |
</jar> |
|
335 |
<jar destfile="${project.build.directory}/${project.build.finalName}-store.dgn.jar" |
|
336 |
update="true"> |
|
337 |
<fileset dir="${basedir}/resources/dgn" /> |
|
338 |
</jar> |
|
339 |
<jar destfile="${project.build.directory}/${project.build.finalName}-store.dgn.legend.jar" |
|
340 |
update="true"> |
|
341 |
<fileset dir="${basedir}/resources/dgn.legend" /> |
|
342 |
</jar> |
|
343 |
<jar destfile="${project.build.directory}/${project.build.finalName}-store.dxf.jar" |
|
344 |
update="true"> |
|
345 |
<fileset dir="${basedir}/resources/dxf" /> |
|
346 |
</jar> |
|
347 |
<jar destfile="${project.build.directory}/${project.build.finalName}-store.dxf.legend.jar" |
|
348 |
update="true"> |
|
349 |
<fileset dir="${basedir}/resources/dxf.legend" /> |
|
350 |
</jar> |
|
351 |
<jar destfile="${project.build.directory}/${project.build.finalName}-store.shp.jar" |
|
352 |
update="true"> |
|
353 |
<fileset dir="${basedir}/resources/shp" /> |
|
354 |
</jar> |
|
355 |
</tasks> |
|
356 |
</configuration> |
|
357 |
</execution> |
|
358 |
</executions> |
|
359 |
</plugin> |
|
360 |
<plugin> |
|
361 |
<groupId>org.apache.maven.plugins</groupId> |
|
362 |
<artifactId>maven-surefire-plugin</artifactId> |
|
363 |
<configuration> |
|
364 |
<additionalClasspathElements> |
|
365 |
<additionalClasspathElement>${basedir}/resources/api</additionalClasspathElement> |
|
366 |
<additionalClasspathElement>${basedir}/resources/dbf</additionalClasspathElement> |
|
367 |
<additionalClasspathElement>${basedir}/resources/dgn</additionalClasspathElement> |
|
368 |
<additionalClasspathElement>${basedir}/resources/dgn.legend</additionalClasspathElement> |
|
369 |
<additionalClasspathElement>${basedir}/resources/dxf</additionalClasspathElement> |
|
370 |
<additionalClasspathElement>${basedir}/resources/dxf.legend</additionalClasspathElement> |
|
371 |
<additionalClasspathElement>${basedir}/resources/shp</additionalClasspathElement> |
|
372 |
</additionalClasspathElements> |
|
373 |
</configuration> |
|
374 |
</plugin> |
|
375 |
</plugins> |
|
376 |
</build> |
|
377 |
</profile> |
|
378 |
<profile> |
|
379 |
<id>cdc</id> |
|
380 |
<activation> |
|
381 |
<activeByDefault>false</activeByDefault> |
|
382 |
</activation> |
|
383 |
<build> |
|
384 |
<plugins> |
|
385 |
<plugin> |
|
386 |
<groupId>org.apache.maven.plugins</groupId> |
|
387 |
<artifactId>maven-compiler-plugin</artifactId> |
|
388 |
<configuration> |
|
389 |
<excludes> |
|
390 |
<exclude>org/gvsig/fmap/dal/store/**</exclude> |
|
391 |
</excludes> |
|
392 |
<testExcludes> |
|
393 |
<exclude>org/gvsig/fmap/dal/store/**</exclude> |
|
394 |
<exclude>org/gvsig/fmap/dal/explorer/filesystem/FileSystemExplorerTest.java</exclude> |
|
395 |
</testExcludes> |
|
396 |
</configuration> |
|
397 |
</plugin> |
|
398 |
<plugin> |
|
399 |
<groupId>org.apache.maven.plugins</groupId> |
|
400 |
<artifactId>maven-jar-plugin</artifactId> |
|
401 |
<configuration> |
|
402 |
<excludes> |
|
403 |
<exclude>org/gvsig/fmap/dal/store/**</exclude> |
|
404 |
</excludes> |
|
405 |
</configuration> |
|
406 |
</plugin> |
|
407 |
<plugin> |
|
408 |
<artifactId>maven-antrun-plugin</artifactId> |
|
409 |
<executions> |
|
410 |
<execution> |
|
411 |
<id>services</id> |
|
412 |
<phase>package</phase> |
|
413 |
<goals> |
|
414 |
<goal>run</goal> |
|
415 |
</goals> |
|
416 |
<configuration> |
|
417 |
<tasks> |
|
418 |
<jar destfile="${project.build.directory}/${project.build.finalName}.jar" |
|
419 |
update="true"> |
|
420 |
<fileset dir="${basedir}/resources/api" /> |
|
421 |
</jar> |
|
422 |
</tasks> |
|
423 |
</configuration> |
|
424 |
</execution> |
|
425 |
</executions> |
|
426 |
</plugin> |
|
427 |
<plugin> |
|
428 |
<groupId>org.apache.maven.plugins</groupId> |
|
429 |
<artifactId>maven-surefire-plugin</artifactId> |
|
430 |
<configuration> |
|
431 |
<additionalClasspathElements> |
|
432 |
<additionalClasspathElement>${basedir}/resources/api</additionalClasspathElement> |
|
433 |
</additionalClasspathElements> |
|
434 |
</configuration> |
|
435 |
</plugin> |
|
436 |
</plugins> |
|
437 |
</build> |
|
438 |
</profile> |
|
439 |
<profile> |
|
440 |
<id>eclipse-project</id> |
|
441 |
<build> |
|
442 |
<defaultGoal>antrun:run</defaultGoal> |
|
443 |
<plugins> |
|
444 |
<plugin> |
|
445 |
<artifactId>maven-antrun-plugin</artifactId> |
|
446 |
<configuration> |
|
447 |
<tasks> |
|
448 |
<ant antfile="${build-dir}/ant-tasks/eclipse-tasks.xml" |
|
449 |
target="eclipse.all"/> |
|
450 |
</tasks> |
|
451 |
</configuration> |
|
452 |
</plugin> |
|
453 |
</plugins> |
|
454 |
</build> |
|
455 |
</profile> |
|
456 |
</profiles> |
|
457 |
<reporting> |
|
458 |
<plugins> |
|
459 |
<plugin> |
|
460 |
<groupId>org.apache.maven.plugins</groupId> |
|
461 |
<artifactId>maven-javadoc-plugin</artifactId> |
|
462 |
<configuration> |
|
463 |
<doctitle>${project.name} ${project.version}</doctitle> |
|
464 |
<groups> |
|
465 |
<group> |
|
466 |
<title>DAL File common</title> |
|
467 |
<packages>org.gvsig.fmap.dal*</packages> |
|
468 |
</group> |
|
469 |
<group> |
|
470 |
<title>DBF Store</title> |
|
471 |
<packages>org.gvsig.fmap.dal.store.dbf*</packages> |
|
472 |
</group> |
|
473 |
<group> |
|
474 |
<title>DGN Store</title> |
|
475 |
<packages>org.gvsig.fmap.dal.store.dgn*</packages> |
|
476 |
</group> |
|
477 |
<group> |
|
478 |
<title>SHP Store</title> |
|
479 |
<packages>org.gvsig.fmap.dal.store.shp*</packages> |
|
480 |
</group> |
|
481 |
<group> |
|
482 |
<title>DXF Store</title> |
|
483 |
<packages>org.gvsig.fmap.dal.store.dxf*</packages> |
|
484 |
</group> |
|
485 |
</groups> |
|
486 |
</configuration> |
|
487 |
</plugin> |
|
488 |
</plugins> |
|
489 |
</reporting> |
|
490 |
</project> |
tags/v2_0_0_Build_2020/libraries/libFMap_dalfile/resources/dgn/META-INF/services/org.gvsig.tools.library.Library | ||
---|---|---|
1 |
org.gvsig.fmap.dal.store.dgn.DGNLibrary |
tags/v2_0_0_Build_2020/libraries/libFMap_dalfile/resources/dgn/org/gvsig/fmap/dal/store/dgn/DGNMetadata.xml | ||
---|---|---|
1 |
<?xml version="1.0"?> |
|
2 |
<!-- |
|
3 |
Definitions of metadata fields of a shp file. |
|
4 |
--> |
|
5 |
<definitions> |
|
6 |
<version>1.0.0</version> |
|
7 |
<classes> |
|
8 |
|
|
9 |
<class name="DGN" namespace="Metadata"> |
|
10 |
<extends> |
|
11 |
<class namespace="Metadata" name="SpatialProvider"/> |
|
12 |
</extends> |
|
13 |
<description>Metadata of a DGN store</description> |
|
14 |
<fields> |
|
15 |
</fields> |
|
16 |
</class> |
|
17 |
|
|
18 |
</classes> |
|
19 |
</definitions> |
|
0 | 20 |
tags/v2_0_0_Build_2020/libraries/libFMap_dalfile/resources/dgn/org/gvsig/fmap/dal/store/dgn/DGNParameters.xml | ||
---|---|---|
1 |
<?xml version= "1.0 "?> |
|
2 |
<definitions> |
|
3 |
<version>1.0.0</version> |
|
4 |
<classes> |
|
5 |
<class name="DGNStoreParameters"> |
|
6 |
<extends> |
|
7 |
<class namespace="dal" name="ProviderParameters"/> |
|
8 |
</extends> |
|
9 |
<description>Store the parameters need to open a dgn file</description> |
|
10 |
<fields> |
|
11 |
<field name="file" type="file" mandatory="true"> |
|
12 |
<description>dgn file</description> |
|
13 |
</field> |
|
14 |
<field name="CRS" type="crs" mandatory="true"> |
|
15 |
<description>The coordinate reference system used in this dgn file</description> |
|
16 |
</field> |
|
17 |
</fields> |
|
18 |
</class> |
|
19 |
</classes> |
|
20 |
</definitions> |
|
0 | 21 |
tags/v2_0_0_Build_2020/libraries/libFMap_dalfile/resources/api/META-INF/services/org.gvsig.tools.library.Library | ||
---|---|---|
1 |
org.gvsig.fmap.dal.DALFileLibrary |
tags/v2_0_0_Build_2020/libraries/libFMap_dalfile/resources/shp/META-INF/services/org.gvsig.tools.library.Library | ||
---|---|---|
1 |
org.gvsig.fmap.dal.store.shp.SHPLibrary |
tags/v2_0_0_Build_2020/libraries/libFMap_dalfile/resources/shp/org/gvsig/fmap/dal/store/shp/SHPMetadata.xml | ||
---|---|---|
1 |
<?xml version="1.0"?> |
|
2 |
<!-- |
|
3 |
Definitions of metadata fields of a shp file. |
|
4 |
--> |
|
5 |
<definitions> |
|
6 |
<version>1.0.0</version> |
|
7 |
<classes> |
|
8 |
|
|
9 |
<class name="Shape" namespace="Metadata"> |
|
10 |
<extends> |
|
11 |
<class namespace="Metadata" name="dbf"/> |
|
12 |
<class namespace="Metadata" name="SpatialProvider"/> |
|
13 |
</extends> |
|
14 |
<description>Metadata of a Shape store</description> |
|
15 |
<fields> |
|
16 |
</fields> |
|
17 |
</class> |
|
18 |
|
|
19 |
</classes> |
|
20 |
</definitions> |
|
0 | 21 |
tags/v2_0_0_Build_2020/libraries/libFMap_dalfile/resources/shp/org/gvsig/fmap/dal/store/shp/SHPParameters.xml | ||
---|---|---|
1 |
<?xml version= "1.0 "?> |
|
2 |
<definitions> |
|
3 |
<version>1.0.0</version> |
|
4 |
<classes> |
|
5 |
<class name="SHPStoreParameters"> |
|
6 |
<extends> |
|
7 |
<class namespace="dal" name="ProviderParameters"/> |
|
8 |
<class name="DBFStoreParameters"/> |
|
9 |
</extends> |
|
10 |
<description>Store the parameters need to open a shp file</description> |
|
11 |
<fields> |
|
12 |
<field name="dbfFile" type="file" mandatory="false"> |
|
13 |
<description>dbf file</description> |
|
14 |
</field> |
|
15 |
<field name="shxFile" type="file" mandatory="false"> |
|
16 |
<description>The shx file associated to this shape file</description> |
|
17 |
</field> |
|
18 |
<field name="shpFile" type="file" mandatory="true"> |
|
19 |
<description>The shp file associated to this shape file</description> |
|
20 |
</field> |
|
21 |
<field name="CRS" type="crs" mandatory="true"> |
|
22 |
<description>The coordinate reference system used in this shape file</description> |
|
23 |
</field> |
|
24 |
</fields> |
|
25 |
</class> |
|
26 |
|
|
27 |
<class name="SHPNewStoreParameters"> |
|
28 |
<description>Store the parameters need to create a shape file</description> |
|
29 |
<extends> |
|
30 |
<class>SHPStoreParameters</class> |
|
31 |
<class>DBFNewStoreParameters</class> |
|
32 |
</extends> |
|
33 |
<fields> |
|
34 |
</fields> |
|
35 |
</class> |
|
36 |
|
|
37 |
</classes> |
|
38 |
</definitions> |
|
0 | 39 |
tags/v2_0_0_Build_2020/libraries/libFMap_dalfile/resources/dbf/org/gvsig/fmap/dal/store/dbf/DBFMetadata.xml | ||
---|---|---|
1 |
<?xml version="1.0"?> |
|
2 |
<!-- |
|
3 |
Definitions of metadata fields of a dbf file. |
|
4 |
--> |
|
5 |
<definitions> |
|
6 |
<version>1.0.0</version> |
|
7 |
<classes> |
|
8 |
<class name="DBF" namespace="Metadata"> |
|
9 |
<extends> |
|
10 |
<class namespace="Metadata" name="FeatureProvider"/> |
|
11 |
</extends> |
|
12 |
<description>Metadata of a DBF store</description> |
|
13 |
<fields> |
|
14 |
<field name="Encoding" type="string" mandatory="false"> |
|
15 |
<description>Encoding used</description> |
|
16 |
<availableValues> |
|
17 |
<value label="(default)"></value> |
|
18 |
<value label="US-ASCII">US-ASCII</value> |
|
19 |
<value label="ISO-8859-1">ISO-8859-1</value> |
|
20 |
<value label="ISO-8859-15">ISO-8859-15</value> |
|
21 |
<value label="windows-1250">windows-1250</value> |
|
22 |
<value label="windows-1252">windows-1252</value> |
|
23 |
<value label="UTF-8">UTF-8</value> |
|
24 |
<value label="UTF-16">UTF-16</value> |
|
25 |
<value label="UTF-16BE">UTF-16BE</value> |
|
26 |
<value label="UTF-16LE">UTF-16LE</value> |
|
27 |
</availableValues> |
|
28 |
</field> |
|
29 |
<field name="CodePage" type="Integer" mandatory="false"> |
|
30 |
<description>Code page used</description> |
|
31 |
<availableValues> |
|
32 |
<value label="DOS USA">0x01</value> |
|
33 |
<value label="DOS Multilingual">0x02</value> |
|
34 |
<value label="Windows ANSI">0x03</value> |
|
35 |
<value label="Standard Macintosh">0x04</value> |
|
36 |
<value label="EE MS-DOS">0x64</value> |
|
37 |
<value label="Nordic MS-DOS">0x65</value> |
|
38 |
<value label="Russian MS-DOS">0x66</value> |
|
39 |
<value label="Icelandic MS-DOS">0x67</value> |
|
40 |
<value label="Kamenicky (Czech) MS-DOS">0x68</value> |
|
41 |
<value label="Mazovia (Polish) MS-DOS">0x69</value> |
|
42 |
<value label="Greek MS-DOS (437G)">0x6A</value> |
|
43 |
<value label="Turkish MS-DOS">0x6B</value> |
|
44 |
<value label="Russian Macintosh">0x96</value> |
|
45 |
<value label="Macintosh">0x97</value> |
|
46 |
<value label="Greek Macintosh">0x98</value> |
|
47 |
<value label="Windows EE">0xC8</value> |
|
48 |
<value label="Russian Windows">0xC9</value> |
|
49 |
<value label="Turkish Windows">0xCA</value> |
|
50 |
<value label="Greek Windows">0xCB</value> |
|
51 |
</availableValues> |
|
52 |
</field> |
|
53 |
</fields> |
|
54 |
</class> |
|
55 |
|
|
56 |
</classes> |
|
57 |
</definitions> |
|
0 | 58 |
tags/v2_0_0_Build_2020/libraries/libFMap_dalfile/resources/dbf/org/gvsig/fmap/dal/store/dbf/DBFParameters.xml | ||
---|---|---|
1 |
<?xml version="1.0"?> |
|
2 |
<definitions> |
|
3 |
<version>1.0.0</version> |
|
4 |
<classes> |
|
5 |
<class name="DBFStoreParameters"> |
|
6 |
<extends> |
|
7 |
<class namespace="dal" name="ProviderParameters"/> |
|
8 |
</extends> |
|
9 |
<description>Store the parameters need to open a dbf file</description> |
|
10 |
<fields> |
|
11 |
<field name="DbfFile" type="file" mandatory="true"> |
|
12 |
<description>dbf file</description> |
|
13 |
</field> |
|
14 |
<field name="Encoding" type="string" mandatory="false"> |
|
15 |
<description>Encoding used in this file</description> |
|
16 |
<availableValues> |
|
17 |
<value label="(default)"></value> |
|
18 |
<value label="US-ASCII">US-ASCII</value> |
|
19 |
<value label="ISO-8859-1">ISO-8859-1</value> |
|
20 |
<value label="ISO-8859-15">ISO-8859-15</value> |
|
21 |
<value label="windows-1250">windows-1250</value> |
|
22 |
<value label="windows-1252">windows-1252</value> |
|
23 |
<value label="UTF-8">UTF-8</value> |
|
24 |
<value label="UTF-16">UTF-16</value> |
|
25 |
<value label="UTF-16BE">UTF-16BE</value> |
|
26 |
<value label="UTF-16LE">UTF-16LE</value> |
|
27 |
</availableValues> |
|
28 |
</field> |
|
29 |
</fields> |
|
30 |
</class> |
|
31 |
|
|
32 |
<class name="DBFNewStoreParameters"> |
|
33 |
<description>Store the parameters need to create a dbf file</description> |
|
34 |
<extends> |
|
35 |
<class>DBFStoreParameters</class> |
|
36 |
<class namespace="dal" name="NewProviderParameters"/> |
|
37 |
</extends> |
|
38 |
<fields> |
|
39 |
<field name="codePage" type="Integer" mandatory="false"> |
|
40 |
<description>Code page used in this file</description> |
|
41 |
<availableValues> |
|
42 |
<value label="DOS USA">0x01</value> |
|
43 |
<value label="DOS Multilingual">0x02</value> |
|
44 |
<value label="Windows ANSI">0x03</value> |
|
45 |
<value label="Standard Macintosh">0x04</value> |
|
46 |
<value label="EE MS-DOS">0x64</value> |
|
47 |
<value label="Nordic MS-DOS">0x65</value> |
|
48 |
<value label="Russian MS-DOS">0x66</value> |
|
49 |
<value label="Icelandic MS-DOS">0x67</value> |
|
50 |
<value label="Kamenicky (Czech) MS-DOS">0x68</value> |
|
51 |
<value label="Mazovia (Polish) MS-DOS">0x69</value> |
|
52 |
<value label="Greek MS-DOS (437G)">0x6A</value> |
|
53 |
<value label="Turkish MS-DOS">0x6B</value> |
|
54 |
<value label="Russian Macintosh">0x96</value> |
|
55 |
<value label="Macintosh">0x97</value> |
|
56 |
<value label="Greek Macintosh">0x98</value> |
|
57 |
<value label="Windows EE">0xC8</value> |
|
58 |
<value label="Russian Windows">0xC9</value> |
|
59 |
<value label="Turkish Windows">0xCA</value> |
|
60 |
<value label="Greek Windows">0xCB</value> |
|
61 |
</availableValues> |
|
62 |
</field> |
|
63 |
</fields> |
|
64 |
</class> |
|
65 |
|
|
66 |
</classes> |
|
67 |
</definitions> |
|
0 | 68 |
tags/v2_0_0_Build_2020/libraries/libFMap_dalfile/resources/dbf/META-INF/services/org.gvsig.tools.library.Library | ||
---|---|---|
1 |
org.gvsig.fmap.dal.store.dbf.DBFLibrary |
tags/v2_0_0_Build_2020/libraries/libFMap_dalfile/resources/dxf.legend/META-INF/services/org.gvsig.tools.library.Library | ||
---|---|---|
1 |
org.gvsig.fmap.dal.store.dxf.legend.DXFLegendLibrary |
tags/v2_0_0_Build_2020/libraries/libFMap_dalfile/resources/dxf/META-INF/services/org.gvsig.tools.library.Library | ||
---|---|---|
1 |
org.gvsig.fmap.dal.store.dxf.DXFLibrary |
tags/v2_0_0_Build_2020/libraries/libFMap_dalfile/resources/dxf/org/gvsig/fmap/dal/store/dxf/DXFMetadata.xml | ||
---|---|---|
1 |
<?xml version="1.0"?> |
|
2 |
<!-- |
|
3 |
Definitions of metadata fields of a shp file. |
|
4 |
--> |
|
5 |
<definitions> |
|
6 |
<version>1.0.0</version> |
|
7 |
<classes> |
|
8 |
|
|
9 |
<class name="DXF" namespace="Metadata"> |
|
10 |
<extends> |
|
11 |
<class namespace="Metadata" name="SpatialProvider"/> |
|
12 |
</extends> |
|
13 |
<description>Metadata of a DXF store</description> |
|
14 |
<fields> |
|
15 |
</fields> |
|
16 |
</class> |
|
17 |
|
|
18 |
</classes> |
|
19 |
</definitions> |
|
0 | 20 |
tags/v2_0_0_Build_2020/libraries/libFMap_dalfile/resources/dxf/org/gvsig/fmap/dal/store/dxf/DXFParameters.xml | ||
---|---|---|
1 |
<?xml version= "1.0 "?> |
|
2 |
<definitions> |
|
3 |
<version>1.0.0</version> |
|
4 |
<classes> |
|
5 |
<class name="DXFStoreParameters"> |
|
6 |
<extends> |
|
7 |
<class namespace="dal" name="ProviderParameters"/> |
|
8 |
</extends> |
|
9 |
<description>Store the parameters need to open a dxf file</description> |
|
10 |
<fields> |
|
11 |
<field name="File" type="file" mandatory="true"> |
|
12 |
<description>dxf file</description> |
|
13 |
</field> |
|
14 |
<field name="CRS" type="crs" mandatory="true"> |
|
15 |
<description>The coordinate reference system used in this dxf file</description> |
|
16 |
</field> |
|
17 |
</fields> |
|
18 |
</class> |
|
19 |
</classes> |
|
20 |
</definitions> |
|
0 | 21 |
tags/v2_0_0_Build_2020/libraries/libFMap_dalfile/resources/dgn.legend/META-INF/services/org.gvsig.tools.library.Library | ||
---|---|---|
1 |
org.gvsig.fmap.dal.store.dgn.legend.DGNLegendLibrary |
tags/v2_0_0_Build_2020/libraries/libFMap_dalfile/src-test/org/gvsig/fmap/dal/explorer/filesystem/FileSystemExplorerTest.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 |
* 2008 IVER T.I. S.A. {{Task}} |
|
26 |
*/ |
|
27 |
|
|
28 |
package org.gvsig.fmap.dal.explorer.filesystem; |
|
29 |
|
|
30 |
import java.io.File; |
|
31 |
import java.util.Iterator; |
|
32 |
import java.util.List; |
|
33 |
|
|
34 |
import org.gvsig.fmap.dal.DALLocator; |
|
35 |
import org.gvsig.fmap.dal.DataManager; |
|
36 |
import org.gvsig.fmap.dal.DataServerExplorer; |
|
37 |
import org.gvsig.fmap.dal.DataStoreParameters; |
|
38 |
import org.gvsig.fmap.dal.DataTypes; |
|
39 |
import org.gvsig.fmap.dal.NewDataStoreParameters; |
|
40 |
import org.gvsig.fmap.dal.feature.EditableFeatureType; |
|
41 |
import org.gvsig.fmap.dal.feature.NewFeatureStoreParameters; |
|
42 |
import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemServerExplorer; |
|
43 |
import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemServerExplorerParameters; |
|
44 |
import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemStoreParameters; |
|
45 |
import org.gvsig.fmap.dal.store.dbf.DBFStoreParameters; |
|
46 |
import org.gvsig.fmap.dal.store.dbf.DBFStoreProvider; |
|
47 |
import org.gvsig.fmap.dal.store.dbf.TestDBF; |
|
48 |
import org.gvsig.tools.junit.AbstractLibraryAutoInitTestCase; |
|
49 |
|
|
50 |
public class FileSystemExplorerTest extends AbstractLibraryAutoInitTestCase { |
|
51 |
|
|
52 |
private static DataManager dataManager = null; |
|
53 |
public static final File dbf_data = new File(TestDBF.class.getResource( |
|
54 |
"data/prueba.dbf").getFile()).getParentFile(); |
|
55 |
|
|
56 |
@Override |
|
57 |
protected void doSetUp() throws Exception { |
|
58 |
dataManager = DALLocator.getDataManager(); |
|
59 |
} |
|
60 |
|
|
61 |
public void testList() throws Exception { |
|
62 |
FilesystemServerExplorerParameters exParam = (FilesystemServerExplorerParameters) dataManager |
|
63 |
.createServerExplorerParameters(FilesystemServerExplorer.NAME); |
|
64 |
|
|
65 |
exParam.setRoot(dbf_data.getPath()); |
|
66 |
|
|
67 |
DataServerExplorer ex = dataManager.createServerExplorer(exParam); |
|
68 |
|
|
69 |
List list = ex.list(); |
|
70 |
|
|
71 |
assertEquals(2, list.size()); |
|
72 |
|
|
73 |
if (((FilesystemStoreParameters) list.get(0)).getFile().getPath() |
|
74 |
.equals(TestDBF.dbf_prueba.getPath())) { |
|
75 |
assertEquals(((FilesystemStoreParameters) list.get(1)).getFile() |
|
76 |
.getPath(), TestDBF.dbf_pruebaNull.getPath()); |
|
77 |
|
|
78 |
} else { |
|
79 |
assertEquals(((FilesystemStoreParameters) list.get(0)).getFile() |
|
80 |
.getPath(), TestDBF.dbf_pruebaNull.getPath()); |
|
81 |
assertEquals(((FilesystemStoreParameters) list.get(1)).getFile() |
|
82 |
.getPath(), TestDBF.dbf_prueba.getPath()); |
|
83 |
} |
|
84 |
|
|
85 |
Iterator iter = list.iterator(); |
|
86 |
TestDBF testDBF = new TestDBF(); |
|
87 |
while (iter.hasNext()) { |
|
88 |
testDBF.testSimpleIteration((DBFStoreParameters) iter.next()); |
|
89 |
} |
|
90 |
|
|
91 |
|
|
92 |
|
|
93 |
} |
|
94 |
|
|
95 |
private boolean deleteDir(File dir) { |
|
96 |
File[] files = dir.listFiles(); |
|
97 |
for (int i = 0; i < files.length; i++) { |
|
98 |
if (files[i].isDirectory()) { |
|
99 |
if (!deleteDir(files[i])) { |
|
100 |
return false; |
|
101 |
} |
|
102 |
} |
|
103 |
if (!files[i].delete()) { |
|
104 |
return false; |
|
105 |
} |
|
106 |
} |
|
107 |
return dir.delete(); |
|
108 |
} |
|
109 |
|
|
110 |
public void testAddRemove() throws Exception { |
|
111 |
File tmpDir = new File("target/_FilesystemExplorer.tmp"); |
|
112 |
|
|
113 |
if (tmpDir.exists()) { |
|
114 |
if (!deleteDir(tmpDir)) { |
|
115 |
fail("Clean tmp dir:" + tmpDir.getAbsolutePath()); |
|
116 |
} |
|
117 |
} |
|
118 |
|
|
119 |
tmpDir.mkdir(); |
|
120 |
|
|
121 |
FilesystemServerExplorerParameters exParam = (FilesystemServerExplorerParameters) dataManager |
|
122 |
.createServerExplorerParameters(FilesystemServerExplorer.NAME); |
|
123 |
|
|
124 |
exParam.setRoot(tmpDir.getAbsolutePath()); |
|
125 |
|
|
126 |
DataServerExplorer ex = dataManager.createServerExplorer(exParam); |
|
127 |
|
|
128 |
assertTrue(ex.canAdd()); |
|
129 |
|
|
130 |
assertTrue(ex.canAdd(DBFStoreProvider.NAME)); |
|
131 |
|
|
132 |
assertEquals(0, ex.list().size()); |
|
133 |
|
|
134 |
NewDataStoreParameters newParams = ex |
|
135 |
.getAddParameters(DBFStoreProvider.NAME); |
|
136 |
|
|
137 |
((FilesystemStoreParameters) newParams).setFile(new File(tmpDir, |
|
138 |
"tmp1.dbf")); |
|
139 |
EditableFeatureType fType; |
|
140 |
if (((NewFeatureStoreParameters) newParams).getDefaultFeatureType() instanceof EditableFeatureType) { |
|
141 |
fType = (EditableFeatureType) ((NewFeatureStoreParameters) newParams) |
|
142 |
.getDefaultFeatureType(); |
|
143 |
} else { |
|
144 |
fType = ((NewFeatureStoreParameters) newParams) |
|
145 |
.getDefaultFeatureType().getEditable(); |
|
146 |
} |
|
147 |
fType.add("campo1", DataTypes.STRING).setSize(10); |
|
148 |
((NewFeatureStoreParameters) newParams).setDefaultFeatureType(fType); |
|
149 |
ex.add(DBFStoreProvider.NAME, newParams, false); |
|
150 |
|
|
151 |
List list = ex.list(); |
|
152 |
assertEquals(1, list.size()); |
|
153 |
|
|
154 |
Iterator iter = list.iterator(); |
|
155 |
TestDBF testDBF = new TestDBF(); |
|
156 |
while (iter.hasNext()) { |
|
157 |
testDBF.testSimpleIteration((DBFStoreParameters) iter.next()); |
|
158 |
} |
|
159 |
|
|
160 |
ex.remove((DataStoreParameters) list.get(0)); |
|
161 |
|
|
162 |
assertEquals(0, ex.list().size()); |
|
163 |
|
|
164 |
|
|
165 |
} |
|
166 |
} |
|
0 | 167 |
tags/v2_0_0_Build_2020/libraries/libFMap_dalfile/src-test/org/gvsig/fmap/dal/store/shp/TestSHP.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 |
* 2008 IVER T.I. S.A. {{Task}} |
|
26 |
*/ |
|
27 |
|
|
28 |
package org.gvsig.fmap.dal.store.shp; |
|
29 |
|
|
30 |
import java.io.File; |
|
31 |
import java.util.Iterator; |
|
32 |
|
|
33 |
import org.gvsig.fmap.dal.DataStoreParameters; |
|
34 |
import org.gvsig.fmap.dal.exception.DataException; |
|
35 |
import org.gvsig.fmap.dal.feature.BaseTestEditableFeatureStore; |
|
36 |
import org.gvsig.tools.dispose.DisposableIterator; |
|
37 |
import org.gvsig.fmap.dal.feature.EditableFeature; |
|
38 |
import org.gvsig.fmap.dal.feature.Feature; |
|
39 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
|
40 |
import org.gvsig.fmap.dal.feature.FeatureSet; |
|
41 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
42 |
import org.gvsig.fmap.dal.feature.FeatureType; |
|
43 |
import org.gvsig.fmap.dal.feature.NewFeatureStoreParameters; |
|
44 |
import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemServerExplorer; |
|
45 |
import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemServerExplorerParameters; |
|
46 |
import org.gvsig.fmap.dal.store.dbf.DBFStoreParameters; |
|
47 |
import org.gvsig.fmap.dal.store.dbf.DBFStoreProvider; |
|
48 |
|
|
49 |
public class TestSHP extends BaseTestEditableFeatureStore { |
|
50 |
|
|
51 |
private FilesystemServerExplorer myExplorer; |
|
52 |
|
|
53 |
public static final File file_prueba = new File(TestSHP.class.getResource( |
|
54 |
"data/prueba.shp").getFile()); |
|
55 |
public static final File file_prueba_destino = new File(file_prueba |
|
56 |
.getParent() |
|
57 |
+ File.separatorChar + "pruebaTemp.shp"); |
|
58 |
public static final File file_pruebaNull = new File(TestSHP.class |
|
59 |
.getResource("data/pruebaNull.shp").getFile()); |
|
60 |
|
|
61 |
public static final File file_poly_valencia = new File(TestSHP.class |
|
62 |
.getResource("data/poly-valencia.shp").getFile()); |
|
63 |
|
|
64 |
public void testSimpleIteration() throws Exception { |
|
65 |
|
|
66 |
FeatureStore store = null; |
|
67 |
SHPStoreParameters shpParameters = null; |
|
68 |
|
|
69 |
shpParameters = (SHPStoreParameters) dataManager |
|
70 |
.createStoreParameters(SHPStoreProvider.NAME); |
|
71 |
|
|
72 |
// shpParameters.setFile(file_poly_valencia); |
|
73 |
shpParameters.setFile(file_prueba); |
|
74 |
|
|
75 |
shpParameters.setCRS("EPSG:23030"); |
|
76 |
|
|
77 |
store = (FeatureStore) dataManager.createStore(shpParameters); |
|
78 |
FeatureSet set; |
|
79 |
FeatureType type = store.getDefaultFeatureType(); |
|
80 |
set = store.getFeatureSet(); |
|
81 |
|
|
82 |
System.out.println("Num:" + set.getSize()); |
|
83 |
DisposableIterator it = set.iterator(); |
|
84 |
Iterator ftIt; |
|
85 |
FeatureAttributeDescriptor desc; |
|
86 |
|
|
87 |
int i = 0; |
|
88 |
Feature feature; |
|
89 |
while (it.hasNext()) { |
|
90 |
ftIt = type.iterator(); |
|
91 |
|
|
92 |
feature = (Feature) it.next(); |
|
93 |
// while (ftIt.hasNext()) { |
|
94 |
// desc = (FeatureAttributeDescriptor) ftIt.next(); |
|
95 |
// System.out.println(desc.getName() + ":" |
|
96 |
// + feature.get(desc.getIndex())); |
|
97 |
// |
|
98 |
// } |
|
99 |
// System.out.println(feature.get("NOMBRE")); |
|
100 |
System.out.print(feature.getDefaultEnvelope() + "\t"); |
|
101 |
// System.out.print(feature.getDefaultGeometry() + "\t"); |
|
102 |
// System.out.println(feature.get("NOMBRE")); |
|
103 |
System.out.println("row:" + i); |
|
104 |
i++; |
|
105 |
|
|
106 |
|
|
107 |
} |
|
108 |
|
|
109 |
it.dispose(); |
|
110 |
set.dispose(); |
|
111 |
|
|
112 |
store.dispose(); |
|
113 |
|
|
114 |
} |
|
115 |
|
|
116 |
public void testEditing(Object x) throws Exception { |
|
117 |
FeatureStore store = null; |
|
118 |
SHPStoreParameters shpParameters = null; |
|
119 |
|
|
120 |
shpParameters = (SHPStoreParameters) dataManager |
|
121 |
.createStoreParameters(SHPStoreProvider.NAME); |
|
122 |
|
|
123 |
shpParameters.setFile(file_poly_valencia); |
|
124 |
|
|
125 |
store = (FeatureStore) dataManager.createStore(shpParameters); |
|
126 |
FeatureSet set; |
|
127 |
FeatureType type = store.getDefaultFeatureType(); |
|
128 |
System.err.println("Antes de la edici?n"); |
|
129 |
set = store.getFeatureSet(); |
|
130 |
System.out.println("Num:" + set.getSize()); |
|
131 |
DisposableIterator it = set.iterator(); |
|
132 |
Iterator ftIt; |
|
133 |
FeatureAttributeDescriptor desc; |
|
134 |
|
|
135 |
int i = 0; |
|
136 |
Feature feature; |
|
137 |
while (it.hasNext()) { |
|
138 |
ftIt = type.iterator(); |
|
139 |
|
|
140 |
feature = (Feature) it.next(); |
|
141 |
// while (ftIt.hasNext()) { |
|
142 |
// desc = (FeatureAttributeDescriptor) ftIt.next(); |
|
143 |
// System.out.println(desc.getName() + ":" |
|
144 |
// + feature.get(desc.getIndex())); |
|
145 |
// |
|
146 |
// } |
|
147 |
// System.out.println(feature.get("NOMBRE")); |
|
148 |
System.out.print(feature.getDefaultEnvelope() + "\t"); |
|
149 |
// System.out.print(feature.getDefaultGeometry() + "\t"); |
|
150 |
// System.out.println(feature.get("NOMBRE")); |
|
151 |
System.out.println("row:" + i); |
|
152 |
i++; |
|
153 |
|
|
154 |
|
|
155 |
} |
|
156 |
|
|
157 |
it.dispose(); |
|
158 |
set.dispose(); |
|
159 |
store.edit(); |
|
160 |
EditableFeature ef = store.createNewFeature(); |
|
161 |
store.insert(ef); |
|
162 |
store.finishEditing(); |
|
163 |
System.err.println("Despu?s de la edici?n"); |
|
164 |
set = store.getFeatureSet(); |
|
165 |
System.out.println("Num:" + set.getSize()); |
|
166 |
it = set.iterator(); |
|
167 |
|
|
168 |
i = 0; |
|
169 |
while (it.hasNext()) { |
|
170 |
ftIt = type.iterator(); |
|
171 |
|
|
172 |
feature = (Feature) it.next(); |
|
173 |
// while (ftIt.hasNext()) { |
|
174 |
// desc = (FeatureAttributeDescriptor) ftIt.next(); |
|
175 |
// System.out.println(desc.getName() + ":" |
|
176 |
// + feature.get(desc.getIndex())); |
|
177 |
// |
|
178 |
// } |
|
179 |
// System.out.println(feature.get("NOMBRE")); |
|
180 |
System.out.print(feature.getDefaultEnvelope() + "\t"); |
|
181 |
// System.out.print(feature.getDefaultGeometry() + "\t"); |
|
182 |
// System.out.println(feature.get("NOMBRE")); |
|
183 |
System.out.println("row:" + i); |
|
184 |
i++; |
|
185 |
|
|
186 |
|
|
187 |
} |
|
188 |
|
|
189 |
it.dispose(); |
|
190 |
set.dispose(); |
|
191 |
|
|
192 |
store.dispose(); |
|
193 |
|
|
194 |
} |
|
195 |
|
|
196 |
public void testExport(Object x) throws Exception { |
|
197 |
DBFStoreParameters dbfParameters = null; |
|
198 |
|
|
199 |
dbfParameters = (DBFStoreParameters) dataManager |
|
200 |
.createStoreParameters(DBFStoreProvider.NAME); |
|
201 |
|
|
202 |
dbfParameters.setFile(file_prueba); |
|
203 |
|
|
204 |
FeatureStore store = (FeatureStore) dataManager |
|
205 |
.createStore(dbfParameters); |
|
206 |
FilesystemServerExplorerParameters explorerParams = (FilesystemServerExplorerParameters) dataManager |
|
207 |
.createServerExplorerParameters(FilesystemServerExplorerParameters.DYNCLASS_NAME); |
|
208 |
explorerParams.setRoot(file_prueba.getParent()); |
|
209 |
|
|
210 |
FilesystemServerExplorer explorer = (FilesystemServerExplorer) dataManager |
|
211 |
.createServerExplorer(explorerParams); |
|
212 |
|
|
213 |
NewFeatureStoreParameters newParams = (NewFeatureStoreParameters) explorer |
|
214 |
.getAddParameters(file_prueba_destino); |
|
215 |
|
|
216 |
store.export(explorer, DBFStoreProvider.NAME, newParams); |
|
217 |
|
|
218 |
FeatureStore result = (FeatureStore) dataManager.createStore(newParams); |
|
219 |
|
|
220 |
FeatureSet set = result.getFeatureSet(); |
|
221 |
FeatureSet originalSet = store.getFeatureSet(); |
|
222 |
assertEquals(set.getSize(), originalSet.getSize()); |
|
223 |
|
|
224 |
DisposableIterator originalIter = originalSet.iterator(); |
|
225 |
DisposableIterator iter = set.iterator(); |
|
226 |
while (iter.hasNext()) { |
|
227 |
assertEquals(originalIter.next(), iter.next()); |
|
228 |
} |
|
229 |
|
|
230 |
originalIter.dispose(); |
|
231 |
iter.dispose(); |
|
232 |
result.dispose(); |
|
233 |
explorer.remove(newParams); |
|
234 |
|
|
235 |
} |
|
236 |
|
|
237 |
/* |
|
238 |
* (non-Javadoc) |
|
239 |
* |
|
240 |
* @see |
|
241 |
* org.gvsig.fmap.dal.feature.BaseTestFeatureStore#getDefaultDataStoreParameters |
|
242 |
* () |
|
243 |
*/ |
|
244 |
public DataStoreParameters getDefaultDataStoreParameters() |
|
245 |
throws DataException { |
|
246 |
SHPStoreParameters shpParameters = (SHPStoreParameters) dataManager |
|
247 |
.createStoreParameters(SHPStoreProvider.NAME); |
|
248 |
|
|
249 |
// shpParameters.setFile(file_poly_valencia); |
|
250 |
shpParameters.setFile(file_prueba); |
|
251 |
shpParameters.setCRS("EPSG:23030"); |
|
252 |
return shpParameters; |
|
253 |
} |
|
254 |
|
|
255 |
/* |
|
256 |
* (non-Javadoc) |
|
257 |
* |
|
258 |
* @see org.gvsig.fmap.dal.feature.BaseTestFeatureStore#hasExplorer() |
|
259 |
*/ |
|
260 |
public boolean hasExplorer() { |
|
261 |
return true; |
|
262 |
} |
|
263 |
|
|
264 |
/* |
|
265 |
* (non-Javadoc) |
|
266 |
* |
|
267 |
* @seeorg.gvsig.fmap.dal.feature.BaseTestEditableFeatureStore# |
|
268 |
* getDefaultNewDataStoreParameters() |
|
269 |
*/ |
|
270 |
public NewFeatureStoreParameters getDefaultNewDataStoreParameters() |
|
271 |
throws Exception { |
|
272 |
SHPStoreParameters parameters = (SHPStoreParameters) this |
|
273 |
.getDefaultDataStoreParameters(); |
|
274 |
|
|
275 |
if (this.myExplorer == null) { |
|
276 |
FeatureStore store = (FeatureStore) dataManager |
|
277 |
.createStore(parameters); |
|
278 |
myExplorer = (FilesystemServerExplorer) store.getExplorer(); |
|
279 |
store.dispose(); |
|
280 |
} |
|
281 |
|
|
282 |
SHPNewStoreParameters result = (SHPNewStoreParameters) myExplorer |
|
283 |
.getAddParameters(file_prueba_destino); |
|
284 |
|
|
285 |
result.setCRS(parameters.getCRS()); |
|
286 |
return result; |
|
287 |
} |
|
288 |
|
|
289 |
public boolean usesResources() { |
|
290 |
return true; |
|
291 |
} |
|
292 |
|
|
293 |
public boolean resourcesNotifyChanges() { |
|
294 |
return true; |
|
295 |
} |
|
296 |
|
|
297 |
} |
|
0 | 298 |
tags/v2_0_0_Build_2020/libraries/libFMap_dalfile/src-test/org/gvsig/fmap/dal/store/dbf/JoinTransform.java | ||
---|---|---|
1 |
package org.gvsig.fmap.dal.store.dbf; |
|
2 |
|
|
3 |
import java.util.ArrayList; |
|
4 |
import java.util.Arrays; |
|
5 |
import java.util.HashMap; |
|
6 |
import java.util.Iterator; |
|
7 |
import java.util.Map; |
|
8 |
import java.util.Map.Entry; |
|
9 |
|
Also available in: Unified diff