Revision 38001
tags/v2_0_0_Build_2045/libraries/libFMap_daldb/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 |
<artifactId>org.gvsig.fmap.dal.db</artifactId> |
|
9 |
<packaging>jar</packaging> |
|
10 |
<version>2.0-SNAPSHOT</version> |
|
11 |
<name>libFMap_daldb</name> |
|
12 |
<parent> |
|
13 |
<groupId>org.gvsig</groupId> |
|
14 |
<artifactId>gvsig-base-library-pom</artifactId> |
|
15 |
<version>2.0-SNAPSHOT</version> |
|
16 |
</parent> |
|
17 |
<properties> |
|
18 |
|
|
19 |
<!-- jdbc --> |
|
20 |
<jdbc-jarIncludes>org/gvsig/fmap/dal/store/jdbc/**/**</jdbc-jarIncludes> |
|
21 |
<jdbc-jarExcludes>NONE</jdbc-jarExcludes> |
|
22 |
|
|
23 |
|
|
24 |
<!-- postgresql --> |
|
25 |
<postgresql-jarIncludes>org/gvsig/fmap/dal/store/postgresql/**/**</postgresql-jarIncludes> |
|
26 |
<postgresql-jarExcludes>NONE</postgresql-jarExcludes> |
|
27 |
|
|
28 |
<!-- mysql --> |
|
29 |
<mysql-jarIncludes>org/gvsig/fmap/dal/store/mysql/**/**</mysql-jarIncludes> |
|
30 |
<mysql-jarExcludes>NONE</mysql-jarExcludes> |
|
31 |
|
|
32 |
<!-- Common --> |
|
33 |
<common-jarIncludes>**/**</common-jarIncludes> |
|
34 |
<build-dir>${basedir}/../build</build-dir> |
|
35 |
<eclipse.project.name>libFMap_daldb</eclipse.project.name> |
|
36 |
</properties> |
|
37 |
|
|
38 |
<dependencies> |
|
39 |
<dependency> |
|
40 |
<groupId>org.gvsig</groupId> |
|
41 |
<artifactId>org.gvsig.fmap.dal</artifactId> |
|
42 |
<scope>compile</scope> |
|
43 |
</dependency> |
|
44 |
<dependency> |
|
45 |
<groupId>org.gvsig</groupId> |
|
46 |
<artifactId>org.gvsig.fmap.dal</artifactId> |
|
47 |
<classifier>spi</classifier> |
|
48 |
<scope>compile</scope> |
|
49 |
</dependency> |
|
50 |
<dependency> |
|
51 |
<groupId>org.gvsig</groupId> |
|
52 |
<artifactId>org.gvsig.fmap.geometry</artifactId> |
|
53 |
<classifier>operation</classifier> |
|
54 |
<scope>compile</scope> |
|
55 |
</dependency> |
|
56 |
<dependency> |
|
57 |
<groupId>postgresql</groupId> |
|
58 |
<artifactId>postgresql</artifactId> |
|
59 |
<scope>compile</scope> |
|
60 |
</dependency> |
|
61 |
<dependency> |
|
62 |
<groupId>commons-dbcp</groupId> |
|
63 |
<artifactId>commons-dbcp</artifactId> |
|
64 |
<scope>compile</scope> |
|
65 |
</dependency> |
|
66 |
<dependency> |
|
67 |
<groupId>commons-collections</groupId> |
|
68 |
<artifactId>commons-collections</artifactId> |
|
69 |
<scope>compile</scope> |
|
70 |
</dependency> |
|
71 |
<dependency> |
|
72 |
<groupId>mysql</groupId> |
|
73 |
<artifactId>mysql-connector-java</artifactId> |
|
74 |
<scope>compile</scope> |
|
75 |
</dependency> |
|
76 |
<!--TEST--> |
|
77 |
<dependency> |
|
78 |
<groupId>org.gvsig</groupId> |
|
79 |
<artifactId>org.gvsig.tools.lib</artifactId> |
|
80 |
<type>test-jar</type> |
|
81 |
<scope>test</scope> |
|
82 |
</dependency> |
|
83 |
<dependency> |
|
84 |
<groupId>org.gvsig</groupId> |
|
85 |
<artifactId>org.gvsig.fmap.dal</artifactId> |
|
86 |
<classifier>tests</classifier> |
|
87 |
<scope>test</scope> |
|
88 |
</dependency> |
|
89 |
<dependency> |
|
90 |
<groupId>org.gvsig</groupId> |
|
91 |
<artifactId>org.gvsig.fmap.dal</artifactId> |
|
92 |
<classifier>impl</classifier> |
|
93 |
<scope>test</scope> |
|
94 |
</dependency> |
|
95 |
<dependency> |
|
96 |
<groupId>org.gvsig</groupId> |
|
97 |
<artifactId>org.gvsig.fmap.dal.index.spatial</artifactId> |
|
98 |
<classifier>jts</classifier> |
|
99 |
<scope>test</scope> |
|
100 |
</dependency> |
|
101 |
<dependency> |
|
102 |
<groupId>org.gvsig</groupId> |
|
103 |
<artifactId>org.gvsig.fmap.geometry</artifactId> |
|
104 |
<classifier>impl</classifier> |
|
105 |
<scope>test</scope> |
|
106 |
</dependency> |
|
107 |
<dependency> |
|
108 |
<groupId>org.gvsig</groupId> |
|
109 |
<artifactId>org.gvsig.projection</artifactId> |
|
110 |
<classifier>cresques-impl</classifier> |
|
111 |
<scope>test</scope> |
|
112 |
</dependency> |
|
113 |
<dependency> |
|
114 |
<groupId>org.gvsig</groupId> |
|
115 |
<artifactId>org.gvsig.utils</artifactId> |
|
116 |
<scope>test</scope> |
|
117 |
</dependency> |
|
118 |
<dependency> |
|
119 |
<groupId>org.slf4j</groupId> |
|
120 |
<artifactId>slf4j-api</artifactId> |
|
121 |
<scope>compile</scope> |
|
122 |
</dependency> |
|
123 |
<dependency> |
|
124 |
<groupId>org.gvsig</groupId> |
|
125 |
<artifactId>org.gvsig.tools.lib</artifactId> |
|
126 |
<scope>compile</scope> |
|
127 |
</dependency> |
|
128 |
<dependency> |
|
129 |
<groupId>org.gvsig</groupId> |
|
130 |
<artifactId>org.gvsig.projection</artifactId> |
|
131 |
<scope>compile</scope> |
|
132 |
</dependency> |
|
133 |
<dependency> |
|
134 |
<groupId>org.gvsig</groupId> |
|
135 |
<artifactId>org.gvsig.fmap.geometry</artifactId> |
|
136 |
<scope>compile</scope> |
|
137 |
</dependency> |
|
138 |
<dependency> |
|
139 |
<groupId>org.gvsig</groupId> |
|
140 |
<artifactId>org.gvsig.metadata.lib.basic.api</artifactId> |
|
141 |
<scope>compile</scope> |
|
142 |
</dependency> |
|
143 |
<dependency> |
|
144 |
<groupId>org.gvsig</groupId> |
|
145 |
<artifactId>org.gvsig.timesupport.lib.api</artifactId> |
|
146 |
<scope>compile</scope> |
|
147 |
</dependency> |
|
148 |
</dependencies> |
|
149 |
<build> |
|
150 |
<sourceDirectory>src</sourceDirectory> |
|
151 |
<testSourceDirectory>src-test</testSourceDirectory> |
|
152 |
<plugins> |
|
153 |
<plugin> |
|
154 |
<groupId>org.apache.maven.plugins</groupId> |
|
155 |
<artifactId>maven-compiler-plugin</artifactId> |
|
156 |
<configuration> |
|
157 |
<excludes> |
|
158 |
<exclude>org/gvsig/fmap/data/**</exclude> |
|
159 |
</excludes> |
|
160 |
</configuration> |
|
161 |
</plugin> |
|
162 |
<plugin> |
|
163 |
<groupId>org.apache.maven.plugins</groupId> |
|
164 |
<artifactId>maven-javadoc-plugin</artifactId> |
|
165 |
<configuration> |
|
166 |
<excludePackageNames>org/gvsig/fmap/data</excludePackageNames> |
|
167 |
</configuration> |
|
168 |
</plugin> |
|
169 |
<plugin> |
|
170 |
<groupId>org.apache.maven.plugins</groupId> |
|
171 |
<artifactId>maven-jar-plugin</artifactId> |
|
172 |
<configuration> |
|
173 |
<excludes> |
|
174 |
<exclude>${jdbc-jarIncludes}</exclude> |
|
175 |
<exclude>${postgresql-jarIncludes}</exclude> |
|
176 |
<exclude>${mysql-jarIncludes}</exclude> |
|
177 |
</excludes> |
|
178 |
</configuration> |
|
179 |
<executions> |
|
180 |
<!-- |
|
181 |
Generates a jar file only with the DAL JDBC Store classes |
|
182 |
--> |
|
183 |
<execution> |
|
184 |
<id>jdbc</id> |
|
185 |
<phase>package</phase> |
|
186 |
<goals> |
|
187 |
<goal>jar</goal> |
|
188 |
</goals> |
|
189 |
<configuration> |
|
190 |
<classifier>store.jdbc</classifier> |
|
191 |
<includes> |
|
192 |
<include>${jdbc-jarIncludes}</include> |
|
193 |
</includes> |
|
194 |
<excludes> |
|
195 |
<exclude>${jdbc-jarExcludes}</exclude> |
|
196 |
</excludes> |
|
197 |
</configuration> |
|
198 |
</execution> |
|
199 |
<!-- |
|
200 |
Generates a jar file only with the DAL PostgreSQL Store classes |
|
201 |
--> |
|
202 |
<execution> |
|
203 |
<id>postgresql</id> |
|
204 |
<phase>package</phase> |
|
205 |
<goals> |
|
206 |
<goal>jar</goal> |
|
207 |
</goals> |
|
208 |
<configuration> |
|
209 |
<classifier>store.postgresql</classifier> |
|
210 |
<includes> |
|
211 |
<include>${postgresql-jarIncludes}</include> |
|
212 |
</includes> |
|
213 |
<excludes> |
|
214 |
<exclude>${postgresql-jarExcludes}</exclude> |
|
215 |
</excludes> |
|
216 |
</configuration> |
|
217 |
</execution> |
|
218 |
<!-- |
|
219 |
Generates a jar file only with the DAL MySQL Store classes |
|
220 |
--> |
|
221 |
<execution> |
|
222 |
<id>mysql</id> |
|
223 |
<phase>package</phase> |
|
224 |
<goals> |
|
225 |
<goal>jar</goal> |
|
226 |
</goals> |
|
227 |
<configuration> |
|
228 |
<classifier>store.mysql</classifier> |
|
229 |
<includes> |
|
230 |
<include>${mysql-jarIncludes}</include> |
|
231 |
</includes> |
|
232 |
<excludes> |
|
233 |
<exclude>${mysql-jarExcludes}</exclude> |
|
234 |
</excludes> |
|
235 |
</configuration> |
|
236 |
</execution> |
|
237 |
</executions> |
|
238 |
</plugin> |
|
239 |
<plugin> |
|
240 |
<artifactId>maven-antrun-plugin</artifactId> |
|
241 |
<executions> |
|
242 |
<execution> |
|
243 |
<id>services</id> |
|
244 |
<phase>package</phase> |
|
245 |
<goals> |
|
246 |
<goal>run</goal> |
|
247 |
</goals> |
|
248 |
<configuration> |
|
249 |
<tasks> |
|
250 |
<jar destfile="${project.build.directory}/${project.build.finalName}.jar" |
|
251 |
update="true"> |
|
252 |
<fileset dir="${basedir}/resources/api" /> |
|
253 |
</jar> |
|
254 |
<jar destfile="${project.build.directory}/${project.build.finalName}-store.jdbc.jar" |
|
255 |
update="true"> |
|
256 |
<fileset dir="${basedir}/resources/jdbc" /> |
|
257 |
</jar> |
|
258 |
<jar destfile="${project.build.directory}/${project.build.finalName}-store.mysql.jar" |
|
259 |
update="true"> |
|
260 |
<fileset dir="${basedir}/resources/mysql" /> |
|
261 |
</jar> |
|
262 |
<jar destfile="${project.build.directory}/${project.build.finalName}-store.postgresql.jar" |
|
263 |
update="true"> |
|
264 |
<fileset dir="${basedir}/resources/postgresql" /> |
|
265 |
</jar> |
|
266 |
</tasks> |
|
267 |
</configuration> |
|
268 |
</execution> |
|
269 |
</executions> |
|
270 |
</plugin> |
|
271 |
<!-- PostgreSQL and MySQL is needed to run the tests --> |
|
272 |
<plugin> |
|
273 |
<groupId>org.apache.maven.plugins</groupId> |
|
274 |
<artifactId>maven-surefire-plugin</artifactId> |
|
275 |
<configuration> |
|
276 |
<additionalClasspathElements> |
|
277 |
<additionalClasspathElement>${basedir}/resources/api</additionalClasspathElement> |
|
278 |
<additionalClasspathElement>${basedir}/resources/jdbc</additionalClasspathElement> |
|
279 |
<additionalClasspathElement>${basedir}/resources/mysql</additionalClasspathElement> |
|
280 |
<additionalClasspathElement>${basedir}/resources/postgresql</additionalClasspathElement> |
|
281 |
</additionalClasspathElements> |
|
282 |
<skipTests>true</skipTests> |
|
283 |
</configuration> |
|
284 |
</plugin> |
|
285 |
</plugins> |
|
286 |
</build> |
|
287 |
<profiles> |
|
288 |
<profile> |
|
289 |
<id>eclipse-project</id> |
|
290 |
<build> |
|
291 |
<defaultGoal>antrun:run</defaultGoal> |
|
292 |
<plugins> |
|
293 |
<plugin> |
|
294 |
<artifactId>maven-antrun-plugin</artifactId> |
|
295 |
<configuration> |
|
296 |
<tasks> |
|
297 |
<ant antfile="${build-dir}/ant-tasks/eclipse-tasks.xml" |
|
298 |
target="eclipse.all"/> |
|
299 |
</tasks> |
|
300 |
</configuration> |
|
301 |
</plugin> |
|
302 |
</plugins> |
|
303 |
</build> |
|
304 |
</profile> |
|
305 |
</profiles> |
|
306 |
<reporting> |
|
307 |
<plugins> |
|
308 |
<plugin> |
|
309 |
<groupId>org.apache.maven.plugins</groupId> |
|
310 |
<artifactId>maven-javadoc-plugin</artifactId> |
|
311 |
<configuration> |
|
312 |
<doctitle>${project.name} ${project.version}</doctitle> |
|
313 |
<groups> |
|
314 |
<group> |
|
315 |
<title>DAL DB common</title> |
|
316 |
<packages>org.gvsig.fmap.dal*</packages> |
|
317 |
</group> |
|
318 |
<group> |
|
319 |
<title>DB Store</title> |
|
320 |
<packages>org.gvsig.fmap.dal.store.db*</packages> |
|
321 |
</group> |
|
322 |
<group> |
|
323 |
<title>JDBC Store</title> |
|
324 |
<packages>org.gvsig.fmap.dal.store.jdbc*</packages> |
|
325 |
</group> |
|
326 |
<group> |
|
327 |
<title>PostgreSQL Store</title> |
|
328 |
<packages>org.gvsig.fmap.dal.store.postgresql*</packages> |
|
329 |
</group> |
|
330 |
<group> |
|
331 |
<title>MySQL Store</title> |
|
332 |
<packages>org.gvsig.fmap.dal.store.mysql*</packages> |
|
333 |
</group> |
|
334 |
</groups> |
|
335 |
</configuration> |
|
336 |
<reportSets> |
|
337 |
<reportSet> |
|
338 |
<id>api</id> |
|
339 |
<configuration> |
|
340 |
<excludePackageNames>*.spi:*.impl:*.store</excludePackageNames> |
|
341 |
<name>Javadoc: API</name> |
|
342 |
<destDir>apidoc</destDir> |
|
343 |
<windowtitle>API Documentation</windowtitle> |
|
344 |
<links> |
|
345 |
</links> |
|
346 |
</configuration> |
|
347 |
<reports> |
|
348 |
<report>javadoc</report> |
|
349 |
</reports> |
|
350 |
</reportSet> |
|
351 |
<reportSet> |
|
352 |
<id>spi</id> |
|
353 |
<configuration> |
|
354 |
<doctitle>${project.name} ${project.version} SPI</doctitle> |
|
355 |
<subpackages>org.gvsig.fmap.dal.serverexplorer.db.spi:org.gvsig.fmap.dal.store.db:org.gvsig.fmap.dal.store.jdbc</subpackages> |
|
356 |
<name>Javadoc: SPI</name> |
|
357 |
<destDir>spidoc</destDir> |
|
358 |
<windowtitle>SPI and base stores documentation</windowtitle> |
|
359 |
<links> |
|
360 |
<link>../apidoc/</link> |
|
361 |
</links> |
|
362 |
</configuration> |
|
363 |
<reports> |
|
364 |
<report>javadoc</report> |
|
365 |
</reports> |
|
366 |
</reportSet> |
|
367 |
<reportSet> |
|
368 |
<id>impl</id> |
|
369 |
<configuration> |
|
370 |
<doctitle>${project.name} ${project.version} Default implementation and |
|
371 |
stores</doctitle> |
|
372 |
<subpackages>org.gvsig.fmap.dal.store.mysql:org.gvsig.fmap.dal.store.postgresql</subpackages> |
|
373 |
<name>Javadoc: Impl and Stores</name> |
|
374 |
<destDir>impldoc</destDir> |
|
375 |
<windowtitle>Default implementation and Stores Documentation</windowtitle> |
|
376 |
<links> |
|
377 |
<link>../apidoc/</link> |
|
378 |
<link>../spidoc/</link> |
|
379 |
</links> |
|
380 |
</configuration> |
|
381 |
<reports> |
|
382 |
<report>javadoc</report> |
|
383 |
</reports> |
|
384 |
</reportSet> |
|
385 |
</reportSets> |
|
386 |
</plugin> |
|
387 |
</plugins> |
|
388 |
</reporting> |
|
389 |
</project> |
tags/v2_0_0_Build_2045/libraries/libFMap_daldb/resources/jdbc/META-INF/services/org.gvsig.tools.library.Library | ||
---|---|---|
1 |
org.gvsig.fmap.dal.store.jdbc.JDBCLibrary |
tags/v2_0_0_Build_2045/libraries/libFMap_daldb/resources/jdbc/org/gvsig/fmap/dal/store/jdbc/JDBCMetadata.xml | ||
---|---|---|
1 |
<?xml version="1.0"?> |
|
2 |
<definitions> |
|
3 |
<version>1.0.0</version> |
|
4 |
<classes> |
|
5 |
<class name="JDBC" namespace="Metadata"> |
|
6 |
<extends> |
|
7 |
<class name="SpatialProvider" namespace="Metadata"/> |
|
8 |
</extends> |
|
9 |
<description>Metadata of a JDBC store</description> |
|
10 |
<fields> |
|
11 |
</fields> |
|
12 |
</class> |
|
13 |
|
|
14 |
</classes> |
|
15 |
</definitions> |
|
0 | 16 |
tags/v2_0_0_Build_2045/libraries/libFMap_daldb/resources/jdbc/org/gvsig/fmap/dal/store/jdbc/JDBCParameters.xml | ||
---|---|---|
1 |
<?xml version="1.0"?> |
|
2 |
<definitions> |
|
3 |
<version>1.0.0</version> |
|
4 |
<classes> |
|
5 |
<class name="JDBCResourceParameters"> |
|
6 |
<description></description> |
|
7 |
<extends> |
|
8 |
<class>DBResourceParameters</class> |
|
9 |
</extends> |
|
10 |
<fields> |
|
11 |
<field name="JDBCDriverClass" type="string" mandatory="true" group="Advanced"> |
|
12 |
<description>JDBC Driver class</description> |
|
13 |
</field> |
|
14 |
<field name="URL" type="string" mandatory="true" group="Connection"> |
|
15 |
<description>JDBC url connection</description> |
|
16 |
</field> |
|
17 |
<field name="Catalog" type="string" mandatory="false" group="Basic"> |
|
18 |
<description>Database catalog</description> |
|
19 |
</field> |
|
20 |
<field name="Schema" type="string" mandatory="false" group="Basic"> |
|
21 |
<description>Database schema</description> |
|
22 |
</field> |
|
23 |
</fields> |
|
24 |
</class> |
|
25 |
|
|
26 |
<class name="JDBCStoreParameters"> |
|
27 |
<extends> |
|
28 |
<class>JDBCResourceParameters</class> |
|
29 |
<class>DBStoreParameters</class> |
|
30 |
</extends> |
|
31 |
<fields> |
|
32 |
</fields> |
|
33 |
</class> |
|
34 |
|
|
35 |
<class name="JDBCNewStoreParameters"> |
|
36 |
<description></description> |
|
37 |
<extends> |
|
38 |
<class>JDBCStoreParameters</class> |
|
39 |
<class namespace="dal" name="NewProviderParameters"/> |
|
40 |
</extends> |
|
41 |
<fields> |
|
42 |
</fields> |
|
43 |
</class> |
|
44 |
|
|
45 |
|
|
46 |
<class name="JDBCServerExplorerParameters"> |
|
47 |
<extends> |
|
48 |
<class>JDBCResourceParameters</class> |
|
49 |
<class>DBServerExplorerParameters</class> |
|
50 |
</extends> |
|
51 |
<fields> |
|
52 |
<field name="ShowInformationDBTables" type="boolean" |
|
53 |
mandatory="false" defaultValue="false" group="Basic"> |
|
54 |
<description>Show information tables</description> |
|
55 |
</field> |
|
56 |
</fields> |
|
57 |
</class> |
|
58 |
|
|
59 |
|
|
60 |
</classes> |
|
61 |
</definitions> |
|
0 | 62 |
tags/v2_0_0_Build_2045/libraries/libFMap_daldb/resources/postgresql/org/gvsig/fmap/dal/store/postgresql/PostgreSQLMetadata.xml | ||
---|---|---|
1 |
<?xml version="1.0"?> |
|
2 |
<definitions> |
|
3 |
<version>1.0.0</version> |
|
4 |
<classes> |
|
5 |
<class name="PostgreSQL" namespace="Metadata"> |
|
6 |
<extends> |
|
7 |
<class name="JDBC" namespace="Metadata"/> |
|
8 |
</extends> |
|
9 |
<description>Metadata of a PostgreSQL store</description> |
|
10 |
<fields> |
|
11 |
</fields> |
|
12 |
</class> |
|
13 |
|
|
14 |
</classes> |
|
15 |
</definitions> |
|
0 | 16 |
tags/v2_0_0_Build_2045/libraries/libFMap_daldb/resources/postgresql/org/gvsig/fmap/dal/store/postgresql/PostgreSQLParameters.xml | ||
---|---|---|
1 |
<?xml version="1.0"?> |
|
2 |
<definitions> |
|
3 |
<version>1.0.0</version> |
|
4 |
<classes> |
|
5 |
<class name="PostgreSQLResourceParameters"> |
|
6 |
<extends> |
|
7 |
<class>JDBCResourceParameters</class> |
|
8 |
</extends> |
|
9 |
<fields> |
|
10 |
<field name="JDBCDriverClass" type="string" mandatory="true" |
|
11 |
defaultValue="org.postgresql.Driver" group="Advanced"> |
|
12 |
<description>JDBC Driver class</description> |
|
13 |
</field> |
|
14 |
<field name="port" type="integer" mandatory="false" |
|
15 |
defaultValue="5432" group="Connection"> |
|
16 |
<description></description> |
|
17 |
</field> |
|
18 |
<field name="UseSSL" type="boolean" mandatory="false" |
|
19 |
defaultValue="false" group="Basic"> |
|
20 |
<description>Use SSL connetion</description> |
|
21 |
</field> |
|
22 |
</fields> |
|
23 |
</class> |
|
24 |
|
|
25 |
<class name="PostgreSQLStoreParameters"> |
|
26 |
<extends> |
|
27 |
<class>JDBCStoreParameters</class> |
|
28 |
<class>PostgreSQLResourceParameters</class> |
|
29 |
</extends> |
|
30 |
<fields/> |
|
31 |
</class> |
|
32 |
|
|
33 |
<class name="PostgreSQLNewStoreParameters"> |
|
34 |
<extends> |
|
35 |
<class>PostgreSQLStoreParameters</class> |
|
36 |
<class namespace="dal" name="NewProviderParameters"/> |
|
37 |
</extends> |
|
38 |
<fields/> |
|
39 |
</class> |
|
40 |
|
|
41 |
|
|
42 |
<class name="PostgreSQLServerExplorerParameters"> |
|
43 |
<extends> |
|
44 |
<class>PostgreSQLResourceParameters</class> |
|
45 |
<class>JDBCServerExplorerParameters</class> |
|
46 |
</extends> |
|
47 |
<fields/> |
|
48 |
</class> |
|
49 |
|
|
50 |
|
|
51 |
</classes> |
|
52 |
</definitions> |
|
0 | 53 |
tags/v2_0_0_Build_2045/libraries/libFMap_daldb/resources/postgresql/META-INF/services/org.gvsig.tools.library.Library | ||
---|---|---|
1 |
org.gvsig.fmap.dal.store.postgresql.PostgreSQLLibrary |
tags/v2_0_0_Build_2045/libraries/libFMap_daldb/resources/mysql/org/gvsig/fmap/dal/store/mysql/MySQLMetadata.xml | ||
---|---|---|
1 |
<?xml version="1.0"?> |
|
2 |
<definitions> |
|
3 |
<version>1.0.0</version> |
|
4 |
<classes> |
|
5 |
<class name="MySQL" namespace="Metadata"> |
|
6 |
<extends> |
|
7 |
<class name="JDBC" namespace="Metadata"/> |
|
8 |
</extends> |
|
9 |
<description>Metadata of a MySQL store</description> |
|
10 |
<fields> |
|
11 |
</fields> |
|
12 |
</class> |
|
13 |
|
|
14 |
</classes> |
|
15 |
</definitions> |
|
0 | 16 |
tags/v2_0_0_Build_2045/libraries/libFMap_daldb/resources/mysql/org/gvsig/fmap/dal/store/mysql/MySQLParameters.xml | ||
---|---|---|
1 |
<?xml version="1.0"?> |
|
2 |
<definitions> |
|
3 |
<version>1.0.0</version> |
|
4 |
<classes> |
|
5 |
<class name="MySQLResourceParameters"> |
|
6 |
<extends> |
|
7 |
<class>JDBCResourceParameters</class> |
|
8 |
</extends> |
|
9 |
<fields> |
|
10 |
<field name="JDBCDriverClass" type="string" mandatory="true" |
|
11 |
defaultValue="com.mysql.jdbc.Driver" group="Advanced"> |
|
12 |
<description>JDBC Driver class</description> |
|
13 |
</field> |
|
14 |
<field name="port" type="integer" mandatory="false" |
|
15 |
defaultValue="3306" group="Basic"> |
|
16 |
<description></description> |
|
17 |
</field> |
|
18 |
<field name="UseSSL" type="boolean" mandatory="false" |
|
19 |
defaultValue="false" group="Basic"> |
|
20 |
<description>Use SSL connetion</description> |
|
21 |
</field> |
|
22 |
</fields> |
|
23 |
</class> |
|
24 |
|
|
25 |
<class name="MySQLStoreParameters"> |
|
26 |
<extends> |
|
27 |
<class>JDBCStoreParameters</class> |
|
28 |
<class>MySQLResourceParameters</class> |
|
29 |
</extends> |
|
30 |
<fields/> |
|
31 |
</class> |
|
32 |
|
|
33 |
<class name="MySQLNewStoreParameters"> |
|
34 |
<extends> |
|
35 |
<class>MySQLStoreParameters</class> |
|
36 |
<class namespace="dal" name="NewProviderParameters"/> |
|
37 |
</extends> |
|
38 |
<fields/> |
|
39 |
</class> |
|
40 |
|
|
41 |
|
|
42 |
<class name="MySQLServerExplorerParameters"> |
|
43 |
<extends> |
|
44 |
<class>MySQLResourceParameters</class> |
|
45 |
<class>JDBCServerExplorerParameters</class> |
|
46 |
</extends> |
|
47 |
<fields/> |
|
48 |
</class> |
|
49 |
|
|
50 |
|
|
51 |
</classes> |
|
52 |
</definitions> |
|
0 | 53 |
tags/v2_0_0_Build_2045/libraries/libFMap_daldb/resources/mysql/META-INF/services/org.gvsig.tools.library.Library | ||
---|---|---|
1 |
org.gvsig.fmap.dal.store.mysql.MySQLLibrary |
tags/v2_0_0_Build_2045/libraries/libFMap_daldb/resources/api/META-INF/services/org.gvsig.tools.library.Library | ||
---|---|---|
1 |
org.gvsig.fmap.dal.DALDbLibrary |
|
2 |
org.gvsig.fmap.dal.resource.db.DBResourceLibrary |
|
3 |
org.gvsig.fmap.dal.store.db.DBStoreLibrary |
tags/v2_0_0_Build_2045/libraries/libFMap_daldb/resources/api/org/gvsig/fmap/dal/resource/db/DBParameters.xml | ||
---|---|---|
1 |
<?xml version= "1.0 "?> |
|
2 |
<definitions> |
|
3 |
<version>1.0.0</version> |
|
4 |
<classes> |
|
5 |
<class name="DBResourceParameters"> |
|
6 |
<extends> |
|
7 |
<class namespace="dal" name="ProviderParameters"/> |
|
8 |
</extends> |
|
9 |
<description>Store the parameters need to open a table of a database</description> |
|
10 |
<fields> |
|
11 |
<field name="host" type="string" mandatory="true" group="Connection"> |
|
12 |
<description></description> |
|
13 |
</field> |
|
14 |
<field name="port" type="integer" mandatory="false" group="Connection"> |
|
15 |
<description></description> |
|
16 |
</field> |
|
17 |
|
|
18 |
<field name="dbname" type="string" mandatory="false" group="Basic"> |
|
19 |
<description></description> |
|
20 |
</field> |
|
21 |
<field name="dbuser" type="string" mandatory="false" group="Basic"> |
|
22 |
<description></description> |
|
23 |
</field> |
|
24 |
<field name="password" type="string" mandatory="false" group="Basic"> |
|
25 |
<description></description> |
|
26 |
</field> |
|
27 |
</fields> |
|
28 |
</class> |
|
29 |
|
|
30 |
</classes> |
|
31 |
</definitions> |
|
0 | 32 |
tags/v2_0_0_Build_2045/libraries/libFMap_daldb/resources/api/org/gvsig/fmap/dal/serverexplorer/db/DBParameters.xml | ||
---|---|---|
1 |
<?xml version= "1.0 "?> |
|
2 |
<definitions> |
|
3 |
<version>1.0.0</version> |
|
4 |
<classes> |
|
5 |
|
|
6 |
<class name="DBServerExplorerParameters"> |
|
7 |
<description></description> |
|
8 |
<extends> |
|
9 |
<class name="DBResourceParameters"/> |
|
10 |
</extends> |
|
11 |
<fields> |
|
12 |
</fields> |
|
13 |
</class> |
|
14 |
|
|
15 |
</classes> |
|
16 |
</definitions> |
|
0 | 17 |
tags/v2_0_0_Build_2045/libraries/libFMap_daldb/resources/api/org/gvsig/fmap/dal/store/db/DBParameters.xml | ||
---|---|---|
1 |
<?xml version="1.0"?> |
|
2 |
<definitions> |
|
3 |
<version>1.0.0</version> |
|
4 |
<classes> |
|
5 |
|
|
6 |
<class name="DBStoreParameters"> |
|
7 |
<description>Store the parameters need to open a table of a database</description> |
|
8 |
<extends> |
|
9 |
<class name="DBResourceParameters"/> |
|
10 |
</extends> |
|
11 |
<fields> |
|
12 |
<!-- Basic data --> |
|
13 |
<field name="Table" type="string" mandatory="true" group="Basic"> |
|
14 |
<description>Name of the table or view to access</description> |
|
15 |
</field> |
|
16 |
<field name="DefaultGeometryField" type="string" mandatory="false" |
|
17 |
group="Basic"> |
|
18 |
<description>Default geometry field</description> |
|
19 |
</field> |
|
20 |
|
|
21 |
<!-- Advanced --> |
|
22 |
<field name="CRS" type="crs" mandatory="false"> |
|
23 |
<description>CRS used to override the autodetection</description> |
|
24 |
</field> |
|
25 |
<field name="SQL" type="string" mandatory="false"> |
|
26 |
<description>SQL to use instead the table name</description> |
|
27 |
</field> |
|
28 |
<field name="Fields" type="string" mandatory="false"> |
|
29 |
<description>comma separated list of the field names that we want to use</description> |
|
30 |
</field> |
|
31 |
<field name="BaseFilter" type="string" mandatory="false"> |
|
32 |
<description>This filter is passed to BD provider on each request as a base filter.</description> |
|
33 |
</field> |
|
34 |
<field name="BaseOrder" type="string" mandatory="false"> |
|
35 |
<description>This order is used if no custom order is request in query.</description> |
|
36 |
</field> |
|
37 |
<field name="PKFields" type="string" mandatory="false"> |
|
38 |
<description>Comma separated list of the field names that compound the primary key</description> |
|
39 |
</field> |
|
40 |
<field name="Workingarea" type="envelope" mandatory="false"> |
|
41 |
<description>Envelop that define the filter by area used</description> |
|
42 |
</field> |
|
43 |
</fields> |
|
44 |
</class> |
|
45 |
|
|
46 |
</classes> |
|
47 |
</definitions> |
|
0 | 48 |
tags/v2_0_0_Build_2045/libraries/libFMap_daldb/src-test/org/gvsig/fmap/dal/store/mysql/MySQLTestWrite.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 2 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
*/ |
|
22 |
|
|
23 |
/* |
|
24 |
* AUTHORS (In addition to CIT): |
|
25 |
* 2009 IVER T.I {{Task}} |
|
26 |
*/ |
|
27 |
|
|
28 |
package org.gvsig.fmap.dal.store.mysql; |
|
29 |
|
|
30 |
import org.gvsig.fmap.dal.DataStoreParameters; |
|
31 |
import org.gvsig.fmap.dal.exception.DataException; |
|
32 |
import org.gvsig.fmap.dal.feature.BaseTestEditableFeatureStore; |
|
33 |
import org.gvsig.fmap.dal.feature.EditableFeatureType; |
|
34 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
35 |
import org.gvsig.fmap.dal.feature.FeatureType; |
|
36 |
import org.gvsig.fmap.dal.feature.NewFeatureStoreParameters; |
|
37 |
import org.gvsig.fmap.dal.store.jdbc.JDBCStoreParameters; |
|
38 |
|
|
39 |
|
|
40 |
public class MySQLTestWrite extends BaseTestEditableFeatureStore { |
|
41 |
private MySQLNewStoreParameters newParams; |
|
42 |
private MySQLServerExplorer myExplorer; |
|
43 |
|
|
44 |
@Override |
|
45 |
protected void doSetUp() throws Exception { |
|
46 |
super.doSetUp(); |
|
47 |
} |
|
48 |
|
|
49 |
public DataStoreParameters getDefaultDataStoreParameters() |
|
50 |
throws DataException { |
|
51 |
MySQLStoreParameters parameters = null; |
|
52 |
parameters = (MySQLStoreParameters) dataManager |
|
53 |
.createStoreParameters(MySQLStoreProvider.NAME); |
|
54 |
|
|
55 |
parameters.setHost("localhost"); |
|
56 |
parameters.setPort(3306); |
|
57 |
parameters.setUser("test"); |
|
58 |
parameters.setPassword("test"); |
|
59 |
parameters.setDBName("gis"); |
|
60 |
// parameters.setTable("alfanum_autoid"); |
|
61 |
parameters.setTable("comunic_lin_300k"); |
|
62 |
|
|
63 |
return parameters; |
|
64 |
} |
|
65 |
|
|
66 |
/* |
|
67 |
* (non-Javadoc) |
|
68 |
* |
|
69 |
* @see org.gvsig.fmap.dal.feature.BaseTestFeatureStore#hasExplorer() |
|
70 |
*/ |
|
71 |
@Override |
|
72 |
public boolean hasExplorer() { |
|
73 |
// TODO Auto-generated method stub |
|
74 |
return true; |
|
75 |
} |
|
76 |
|
|
77 |
/* |
|
78 |
* (non-Javadoc) |
|
79 |
* |
|
80 |
* @see org.gvsig.fmap.dal.feature.BaseTestFeatureStore#usesResources() |
|
81 |
*/ |
|
82 |
@Override |
|
83 |
public boolean usesResources() { |
|
84 |
// TODO Auto-generated method stub |
|
85 |
return true; |
|
86 |
} |
|
87 |
|
|
88 |
/* |
|
89 |
public void testImportDB() throws Exception { |
|
90 |
JDBCNewStoreParameters newParasm = (JDBCNewStoreParameters) getDefaultNewDataStoreParameters(); |
|
91 |
JDBCServerExplorerParameters seParams = (JDBCServerExplorerParameters) dataManager |
|
92 |
.createServerExplorerParameters(JDBCServerExplorer.NAME); |
|
93 |
|
|
94 |
assertTrue(myExplorer.add(newParasm, true)); |
|
95 |
|
|
96 |
FeatureStore store = (FeatureStore) dataManager |
|
97 |
.createStore(getDefaultDataStoreParameters()); |
|
98 |
|
|
99 |
FeatureStore newstore = (FeatureStore) dataManager |
|
100 |
.createStore(newParasm); |
|
101 |
|
|
102 |
|
|
103 |
|
|
104 |
newstore.edit(FeatureStore.MODE_APPEND); |
|
105 |
FeatureSet set = store.getFeatureSet(); |
|
106 |
DisposableIterator iter = set.iterator(); |
|
107 |
Feature org; |
|
108 |
EditableFeature trg; |
|
109 |
Iterator attrIter; |
|
110 |
FeatureAttributeDescriptor attr; |
|
111 |
while (iter.hasNext()) { |
|
112 |
org = (Feature) iter.next(); |
|
113 |
trg = newstore.createNewFeature(false); |
|
114 |
attrIter = trg.getType().iterator(); |
|
115 |
while (attrIter.hasNext()) { |
|
116 |
attr = (FeatureAttributeDescriptor) attrIter.next(); |
|
117 |
trg.set(attr.getName(), org.get(attr.getName())); |
|
118 |
} |
|
119 |
newstore.insert(trg); |
|
120 |
} |
|
121 |
newstore.finishEditing(); |
|
122 |
|
|
123 |
iter.dispose(); |
|
124 |
set.dispose(); |
|
125 |
store.dispose(); |
|
126 |
newstore.dispose(); |
|
127 |
|
|
128 |
|
|
129 |
} |
|
130 |
*/ |
|
131 |
|
|
132 |
@Override |
|
133 |
public NewFeatureStoreParameters getDefaultNewDataStoreParameters() |
|
134 |
throws Exception { |
|
135 |
|
|
136 |
|
|
137 |
JDBCStoreParameters params = (JDBCStoreParameters) getDefaultDataStoreParameters(); |
|
138 |
|
|
139 |
if (this.myExplorer == null) { |
|
140 |
|
|
141 |
MySQLServerExplorerParameters seParameters = null; |
|
142 |
seParameters = (MySQLServerExplorerParameters) dataManager |
|
143 |
.createServerExplorerParameters(MySQLServerExplorer.NAME); |
|
144 |
|
|
145 |
seParameters.setHost("localhost"); |
|
146 |
seParameters.setPort(3306); |
|
147 |
seParameters.setUser("test"); |
|
148 |
seParameters.setPassword("test"); |
|
149 |
seParameters.setDBName("gis"); |
|
150 |
|
|
151 |
|
|
152 |
myExplorer = (MySQLServerExplorer) dataManager |
|
153 |
.createServerExplorer(seParameters); |
|
154 |
} |
|
155 |
if (this.newParams == null) { |
|
156 |
FeatureStore store = (FeatureStore) dataManager.createStore(params); |
|
157 |
|
|
158 |
newParams = (MySQLNewStoreParameters) myExplorer |
|
159 |
.getAddParameters(); |
|
160 |
|
|
161 |
|
|
162 |
newParams.setTable(params.getTable() + "_test"); |
|
163 |
FeatureType ftOrg = store.getDefaultFeatureType(); |
|
164 |
EditableFeatureType ftTrg = ftOrg.getEditable(); |
|
165 |
|
|
166 |
// EditableFeatureType ftTrg = (EditableFeatureType) newParams |
|
167 |
// .getDefaultFeatureType(); |
|
168 |
newParams.setDefaultFeatureType(ftTrg); |
|
169 |
|
|
170 |
// FeatureAttributeDescriptor org; |
|
171 |
// EditableFeatureAttributeDescriptor trg; |
|
172 |
// Iterator iter = ftOrg.iterator(); |
|
173 |
// while (iter.hasNext()) { |
|
174 |
// org = (FeatureAttributeDescriptor) iter.next(); |
|
175 |
// trg = ftTrg.add(org.getName(), org.getDataType()); |
|
176 |
// trg.setAllowNull(org.allowNull()); |
|
177 |
// trg.setDefaultValue(org.getDefaultValue()); |
|
178 |
// trg.setGeometrySubType(org.getGeometrySubType()); |
|
179 |
// trg.setGeometryType(org.getGeometryType()); |
|
180 |
// trg.setIsAutomatic(org.isAutomatic()); |
|
181 |
// trg.setIsPrimaryKey(org.isPrimaryKey()); |
|
182 |
// trg.setIsReadOnly(org.isReadOnly()); |
|
183 |
// trg.setMaximumOccurrences(org.getMaximumOccurrences()); |
|
184 |
// trg.setMinimumOccurrences(org.getMinimumOccurrences()); |
|
185 |
// trg.setPrecision(org.getPrecision()); |
|
186 |
// trg.setSize(org.getSize()); |
|
187 |
// trg.setSRS(org.getSRS()); |
|
188 |
// trg.setAdditionalInfo("SQLType", org |
|
189 |
// .getAdditionalInfo("SQLType")); |
|
190 |
// trg.setAdditionalInfo("SQLTypeName", org |
|
191 |
// .getAdditionalInfo("SQLTypeName")); |
|
192 |
// |
|
193 |
// } |
|
194 |
// ftTrg.setDefaultGeometryAttributeName(ftOrg |
|
195 |
// .getDefaultGeometryAttributeName()); |
|
196 |
// ftTrg.setHasOID(ftOrg.hasOID()); |
|
197 |
|
|
198 |
store.dispose(); |
|
199 |
} |
|
200 |
|
|
201 |
return this.newParams; |
|
202 |
} |
|
203 |
|
|
204 |
@Override |
|
205 |
public boolean resourcesNotifyChanges() { |
|
206 |
// TODO Auto-generated method stub |
|
207 |
return false; |
|
208 |
} |
|
209 |
|
|
210 |
} |
|
0 | 211 |
tags/v2_0_0_Build_2045/libraries/libFMap_daldb/src-test/org/gvsig/fmap/dal/store/jdbc/JDBCTestWrite.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 2 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
*/ |
|
22 |
|
|
23 |
/* |
|
24 |
* AUTHORS (In addition to CIT): |
|
25 |
* 2009 IVER T.I {{Task}} |
|
26 |
*/ |
|
27 |
|
|
28 |
package org.gvsig.fmap.dal.store.jdbc; |
|
29 |
|
|
30 |
import org.gvsig.fmap.dal.DataStoreParameters; |
|
31 |
import org.gvsig.fmap.dal.exception.DataException; |
|
32 |
import org.gvsig.fmap.dal.feature.BaseTestEditableFeatureStore; |
|
33 |
import org.gvsig.fmap.dal.feature.EditableFeature; |
|
34 |
import org.gvsig.fmap.dal.feature.EditableFeatureType; |
|
35 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
36 |
import org.gvsig.fmap.dal.feature.FeatureType; |
|
37 |
import org.gvsig.fmap.dal.feature.NewFeatureStoreParameters; |
|
38 |
|
|
39 |
import com.mysql.jdbc.Driver; |
|
40 |
|
|
41 |
|
|
42 |
public class JDBCTestWrite extends BaseTestEditableFeatureStore { |
|
43 |
private JDBCNewStoreParameters newParams; |
|
44 |
private JDBCServerExplorer myExplorer; |
|
45 |
private int newId = 50000; |
|
46 |
|
|
47 |
public void fillPrimaryKeyInserFeature(EditableFeature feature) { |
|
48 |
feature.set("id", newId); |
|
49 |
newId++; |
|
50 |
} |
|
51 |
|
|
52 |
@Override |
|
53 |
protected void doSetUp() throws Exception { |
|
54 |
// Nothing to do |
|
55 |
} |
|
56 |
|
|
57 |
public DataStoreParameters getDefaultDataStoreParameters() |
|
58 |
throws DataException { |
|
59 |
JDBCStoreParameters parameters = null; |
|
60 |
parameters = (JDBCStoreParameters) dataManager |
|
61 |
.createStoreParameters(JDBCStoreProvider.NAME); |
|
62 |
|
|
63 |
parameters.setHost("localhost"); |
|
64 |
parameters.setPort(3306); |
|
65 |
parameters.setUser("test"); |
|
66 |
parameters.setPassword("test"); |
|
67 |
parameters.setDBName("gis"); |
|
68 |
parameters.setTable("alfanum"); |
|
69 |
parameters.setUrl("jdbc:mysql://" + parameters.getHost() + ":" |
|
70 |
+ parameters.getPort() + "/" + parameters.getDBName()); |
|
71 |
parameters.setJDBCDriverClassName(Driver.class.getName()); |
|
72 |
|
|
73 |
return parameters; |
|
74 |
} |
|
75 |
|
|
76 |
/* |
|
77 |
* (non-Javadoc) |
|
78 |
* |
|
79 |
* @see org.gvsig.fmap.dal.feature.BaseTestFeatureStore#hasExplorer() |
|
80 |
*/ |
|
81 |
@Override |
|
82 |
public boolean hasExplorer() { |
|
83 |
// TODO Auto-generated method stub |
|
84 |
return true; |
|
85 |
} |
|
86 |
|
|
87 |
/* |
|
88 |
* (non-Javadoc) |
|
89 |
* |
|
90 |
* @see org.gvsig.fmap.dal.feature.BaseTestFeatureStore#usesResources() |
|
91 |
*/ |
|
92 |
@Override |
|
93 |
public boolean usesResources() { |
|
94 |
// TODO Auto-generated method stub |
|
95 |
return true; |
|
96 |
} |
|
97 |
|
|
98 |
/* |
|
99 |
public void testImportDB() throws Exception { |
|
100 |
JDBCNewStoreParameters newParasm = (JDBCNewStoreParameters) getDefaultNewDataStoreParameters(); |
|
101 |
JDBCServerExplorerParameters seParams = (JDBCServerExplorerParameters) dataManager |
|
102 |
.createServerExplorerParameters(JDBCServerExplorer.NAME); |
|
103 |
|
|
104 |
assertTrue(myExplorer.add(newParasm, true)); |
|
105 |
|
|
106 |
FeatureStore store = (FeatureStore) dataManager |
|
107 |
.createStore(getDefaultDataStoreParameters()); |
|
108 |
|
|
109 |
FeatureStore newstore = (FeatureStore) dataManager |
|
110 |
.createStore(newParasm); |
|
111 |
|
|
112 |
|
|
113 |
|
|
114 |
newstore.edit(FeatureStore.MODE_APPEND); |
|
115 |
FeatureSet set = store.getFeatureSet(); |
|
116 |
DisposableIterator iter = set.iterator(); |
|
117 |
Feature org; |
|
118 |
EditableFeature trg; |
|
119 |
Iterator attrIter; |
|
120 |
FeatureAttributeDescriptor attr; |
|
121 |
while (iter.hasNext()) { |
|
122 |
org = (Feature) iter.next(); |
|
123 |
trg = newstore.createNewFeature(false); |
|
124 |
attrIter = trg.getType().iterator(); |
|
125 |
while (attrIter.hasNext()) { |
|
126 |
attr = (FeatureAttributeDescriptor) attrIter.next(); |
|
127 |
trg.set(attr.getName(), org.get(attr.getName())); |
|
128 |
} |
|
129 |
newstore.insert(trg); |
|
130 |
} |
|
131 |
newstore.finishEditing(); |
|
132 |
|
|
133 |
iter.dispose(); |
|
134 |
set.dispose(); |
|
135 |
store.dispose(); |
|
136 |
newstore.dispose(); |
|
137 |
|
|
138 |
|
|
139 |
} |
|
140 |
*/ |
|
141 |
|
|
142 |
@Override |
|
143 |
public NewFeatureStoreParameters getDefaultNewDataStoreParameters() |
|
144 |
throws Exception { |
|
145 |
|
|
146 |
|
|
147 |
JDBCStoreParameters params = (JDBCStoreParameters) getDefaultDataStoreParameters(); |
|
148 |
|
|
149 |
if (this.myExplorer == null) { |
|
150 |
|
|
151 |
JDBCServerExplorerParameters seParameters = null; |
|
152 |
seParameters = (JDBCServerExplorerParameters) dataManager |
|
153 |
.createServerExplorerParameters(JDBCServerExplorer.NAME); |
|
154 |
|
|
155 |
seParameters.setHost("localhost"); |
|
156 |
seParameters.setPort(3306); |
|
157 |
seParameters.setUser("test"); |
|
158 |
seParameters.setPassword("test"); |
|
159 |
seParameters.setDBName("gis"); |
|
160 |
|
|
161 |
seParameters.setUrl("jdbc:mysql://" + seParameters.getHost() + ":" |
|
162 |
+ seParameters.getPort() + "/" + seParameters.getDBName()); |
|
163 |
seParameters.setJDBCDriverClassName(Driver.class.getName()); |
|
164 |
|
|
165 |
|
|
166 |
myExplorer = (JDBCServerExplorer) dataManager |
|
167 |
.createServerExplorer(seParameters); |
|
168 |
} |
|
169 |
if (this.newParams == null) { |
|
170 |
FeatureStore store = (FeatureStore) dataManager.createStore(params); |
|
171 |
|
|
172 |
newParams = (JDBCNewStoreParameters) myExplorer |
|
173 |
.getAddParameters(); |
|
174 |
|
|
175 |
|
|
176 |
newParams.setTable(params.getTable() + "_test"); |
|
177 |
FeatureType ftOrg = store.getDefaultFeatureType(); |
|
178 |
EditableFeatureType ftTrg = ftOrg.getEditable(); |
|
179 |
|
|
180 |
// EditableFeatureType ftTrg = (EditableFeatureType) newParams |
|
181 |
// .getDefaultFeatureType(); |
|
182 |
newParams.setDefaultFeatureType(ftTrg); |
|
183 |
|
|
184 |
// FeatureAttributeDescriptor org; |
|
185 |
// EditableFeatureAttributeDescriptor trg; |
|
186 |
// Iterator iter = ftOrg.iterator(); |
|
187 |
// while (iter.hasNext()) { |
|
188 |
// org = (FeatureAttributeDescriptor) iter.next(); |
|
189 |
// trg = ftTrg.add(org.getName(), org.getDataType()); |
|
190 |
// trg.setAllowNull(org.allowNull()); |
|
191 |
// trg.setDefaultValue(org.getDefaultValue()); |
|
192 |
// trg.setGeometrySubType(org.getGeometrySubType()); |
|
193 |
// trg.setGeometryType(org.getGeometryType()); |
|
194 |
// trg.setIsAutomatic(org.isAutomatic()); |
|
195 |
// trg.setIsPrimaryKey(org.isPrimaryKey()); |
|
196 |
// trg.setIsReadOnly(org.isReadOnly()); |
|
197 |
// trg.setMaximumOccurrences(org.getMaximumOccurrences()); |
|
198 |
// trg.setMinimumOccurrences(org.getMinimumOccurrences()); |
|
199 |
// trg.setPrecision(org.getPrecision()); |
|
200 |
// trg.setSize(org.getSize()); |
|
201 |
// trg.setSRS(org.getSRS()); |
|
202 |
// trg.setAdditionalInfo("SQLType", org |
|
203 |
// .getAdditionalInfo("SQLType")); |
|
204 |
// trg.setAdditionalInfo("SQLTypeName", org |
|
205 |
// .getAdditionalInfo("SQLTypeName")); |
|
206 |
// |
|
207 |
// } |
|
208 |
// ftTrg.setDefaultGeometryAttributeName(ftOrg |
|
209 |
// .getDefaultGeometryAttributeName()); |
|
210 |
// ftTrg.setHasOID(ftOrg.hasOID()); |
|
211 |
|
|
212 |
store.dispose(); |
|
213 |
} |
|
214 |
|
|
215 |
return this.newParams; |
|
216 |
} |
|
217 |
|
|
218 |
@Override |
|
219 |
public boolean resourcesNotifyChanges() { |
|
220 |
// TODO Auto-generated method stub |
|
221 |
return false; |
|
222 |
} |
|
223 |
|
|
224 |
} |
|
0 | 225 |
tags/v2_0_0_Build_2045/libraries/libFMap_daldb/src-test/org/gvsig/fmap/dal/store/jdbc/JDBCTest.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 2 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
*/ |
|
22 |
|
|
23 |
/* |
|
24 |
* AUTHORS (In addition to CIT): |
|
25 |
* 2009 IVER T.I {{Task}} |
|
26 |
*/ |
|
27 |
|
|
28 |
/** |
|
29 |
* |
|
30 |
*/ |
|
31 |
package org.gvsig.fmap.dal.store.jdbc; |
|
32 |
|
|
33 |
import org.gvsig.fmap.dal.DataStoreParameters; |
|
34 |
import org.gvsig.fmap.dal.exception.DataException; |
|
35 |
import org.gvsig.fmap.dal.feature.BaseTestFeatureStore; |
|
36 |
|
|
37 |
import com.mysql.jdbc.Driver; |
|
38 |
|
|
39 |
/** |
|
40 |
* @author jmvivo |
|
41 |
* |
|
42 |
*/ |
|
43 |
public class JDBCTest extends BaseTestFeatureStore { |
|
44 |
|
|
45 |
@Override |
|
46 |
protected void doSetUp() throws Exception { |
|
47 |
// Nothing to do |
|
48 |
} |
|
49 |
|
|
50 |
public DataStoreParameters getDefaultDataStoreParameters() |
|
51 |
throws DataException { |
|
52 |
JDBCStoreParameters parameters = null; |
|
53 |
parameters = (JDBCStoreParameters) dataManager |
|
54 |
.createStoreParameters(JDBCStoreProvider.NAME); |
|
55 |
|
|
56 |
|
|
57 |
parameters.setHost("localhost"); |
|
58 |
parameters.setPort(3306); |
|
59 |
parameters.setUser("test"); |
|
60 |
parameters.setPassword("test"); |
|
61 |
parameters.setDBName("gis"); |
|
62 |
parameters.setTable("alfanum"); |
|
63 |
parameters.setUrl("jdbc:mysql://" + parameters.getHost() + ":" |
|
64 |
+ parameters.getPort() + "/" + parameters.getDBName()); |
|
65 |
parameters.setJDBCDriverClassName(Driver.class.getName()); |
|
66 |
|
|
67 |
return parameters; |
|
68 |
} |
|
69 |
|
|
70 |
/* (non-Javadoc) |
|
71 |
* @see org.gvsig.fmap.dal.feature.BaseTestFeatureStore#hasExplorer() |
|
72 |
*/ |
|
73 |
@Override |
|
74 |
public boolean hasExplorer() { |
|
75 |
// TODO Auto-generated method stub |
|
76 |
return true; |
|
77 |
} |
|
78 |
|
|
79 |
/* (non-Javadoc) |
|
80 |
* @see org.gvsig.fmap.dal.feature.BaseTestFeatureStore#usesResources() |
|
81 |
*/ |
|
82 |
@Override |
|
83 |
public boolean usesResources() { |
|
84 |
// TODO Auto-generated method stub |
|
85 |
return true; |
|
86 |
} |
|
87 |
|
|
88 |
} |
|
0 | 89 |
tags/v2_0_0_Build_2045/libraries/libFMap_daldb/src-test/org/gvsig/fmap/dal/store/postgresql/TestReadAndWriteGeom.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 2 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
*/ |
|
22 |
|
|
23 |
/* |
|
24 |
* AUTHORS (In addition to CIT): |
|
25 |
* 2009 IVER T.I {{Task}} |
|
26 |
*/ |
|
27 |
|
|
28 |
package org.gvsig.fmap.dal.store.postgresql; |
|
29 |
|
|
30 |
import java.sql.Connection; |
|
31 |
import java.sql.DriverManager; |
|
32 |
import java.sql.PreparedStatement; |
|
33 |
import java.sql.ResultSet; |
|
34 |
import java.sql.SQLException; |
|
35 |
import java.sql.Statement; |
|
36 |
import java.text.MessageFormat; |
|
37 |
|
|
38 |
import org.gvsig.fmap.geom.Geometry; |
|
39 |
import org.gvsig.fmap.geom.GeometryLocator; |
|
40 |
import org.gvsig.fmap.geom.GeometryManager; |
|
41 |
import org.gvsig.fmap.geom.operation.fromwkb.FromWKB; |
|
42 |
import org.gvsig.fmap.geom.operation.fromwkb.FromWKBGeometryOperationContext; |
|
43 |
import org.gvsig.fmap.geom.operation.towkb.ToWKB; |
|
44 |
import org.gvsig.fmap.geom.operation.towkt.ToWKT; |
|
45 |
import org.gvsig.fmap.geom.primitive.impl.Point2D; |
|
46 |
import org.gvsig.tools.junit.AbstractLibraryAutoInitTestCase; |
|
47 |
|
|
48 |
public class TestReadAndWriteGeom extends AbstractLibraryAutoInitTestCase { |
|
49 |
private static final int FEATURES_TO_INSERT = 12000; |
|
50 |
private static final String TABLE_NAME_INSERT = "testReadadnwritegeom_testcase"; |
|
51 |
private static final String FIELD_NAME_INSERT = "geom"; |
|
52 |
private Connection conn; |
|
53 |
private GeometryManager geoManager; |
|
54 |
private static String SQL_FOR_READ_TEST = "Select {0} from medio_ejes"; |
|
55 |
|
|
56 |
@Override |
|
57 |
protected void doSetUp() throws Exception { |
|
58 |
geoManager = GeometryLocator.getGeometryManager(); |
|
59 |
|
|
60 |
Class klass = Class.forName(PostgreSQLLibrary.DEFAULT_JDCB_DRIVER_NAME); |
|
61 |
if (klass == null) { |
|
62 |
throw new Exception("Driver not found: " |
|
63 |
+ PostgreSQLLibrary.DEFAULT_JDCB_DRIVER_NAME); |
|
64 |
} |
|
65 |
|
|
66 |
// inicializamos operaciones de geometrias de las que dependemos |
|
67 |
int code = FromWKB.CODE; |
|
68 |
code = ToWKB.CODE; |
|
69 |
code = ToWKT.CODE; |
|
70 |
conn = DriverManager.getConnection(PostgreSQLLibrary.getJdbcUrl( |
|
71 |
"localhost", 5432, "gis"), "postgres", "postgres"); |
|
72 |
} |
|
73 |
|
|
74 |
public void testInsertWKB() throws Exception { |
|
75 |
PreparedStatement pst = null; |
|
76 |
try { |
|
77 |
crearTablaTest(); |
|
78 |
Point2D geom = (Point2D) geoManager.createPoint(0, 0, |
|
79 |
Geometry.SUBTYPES.GEOM2D); |
|
80 |
pst = conn.prepareStatement( |
|
81 |
"Insert into " |
|
82 |
+ TABLE_NAME_INSERT.toLowerCase() + |
|
83 |
" (" |
|
84 |
+ FIELD_NAME_INSERT + ") Values (GeomFromWKB(?))"); |
|
85 |
|
|
86 |
|
|
87 |
int i; |
|
88 |
for (i = 1; i <= FEATURES_TO_INSERT; i++) { |
|
89 |
pst.clearParameters(); |
|
90 |
geom.setX(i); |
|
91 |
geom.setY(i); |
|
92 |
pst.setBytes(1, |
|
93 |
(byte[]) geom.invokeOperation( |
|
94 |
ToWKB.CODE, |
|
95 |
null) |
|
96 |
); |
|
97 |
|
|
98 |
pst.executeUpdate(); |
|
99 |
} |
|
100 |
|
|
101 |
System.out |
|
102 |
.println("TestReadAndWriteGeom.testInsertPostgis() Inserteds= i"); |
|
103 |
|
|
104 |
|
|
105 |
|
|
106 |
|
|
107 |
} finally { |
|
108 |
if (pst != null) { |
|
109 |
try {pst.close();} catch (SQLException e) {e.printStackTrace();} |
|
110 |
} |
|
111 |
|
|
112 |
} |
|
113 |
|
Also available in: Unified diff