Revision 36822

View differences:

tags/v2_0_0_Build_2038/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
	<groupId>org.gvsig</groupId>
9
	<artifactId>org.gvsig.fmap.dal.db</artifactId>
10
	<packaging>jar</packaging>
11
	<version>2.0-SNAPSHOT</version>
12
	<name>libFMap_daldb</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
	<properties>
27

  
28
		<!-- jdbc -->
29
		<jdbc-jarIncludes>org/gvsig/fmap/dal/store/jdbc/**/**</jdbc-jarIncludes>
30
		<jdbc-jarExcludes>NONE</jdbc-jarExcludes>
31

  
32

  
33
		<!-- postgresql -->
34
		<postgresql-jarIncludes>org/gvsig/fmap/dal/store/postgresql/**/**</postgresql-jarIncludes>
35
		<postgresql-jarExcludes>NONE</postgresql-jarExcludes>
36

  
37
		<!-- mysql -->
38
		<mysql-jarIncludes>org/gvsig/fmap/dal/store/mysql/**/**</mysql-jarIncludes>
39
		<mysql-jarExcludes>NONE</mysql-jarExcludes>
40

  
41
		<!-- Common -->
42
		<common-jarIncludes>**/**</common-jarIncludes>
43
		<build-dir>${basedir}/../build</build-dir>
44
        <eclipse.project.name>libFMap_daldb</eclipse.project.name>
45
	</properties>
46

  
47
	<dependencies>
48
		<dependency>
49
			<groupId>org.gvsig</groupId>
50
			<artifactId>org.gvsig.fmap.dal</artifactId>
51
            <scope>compile</scope>
52
		</dependency>
53
		<dependency>
54
			<groupId>org.gvsig</groupId>
55
			<artifactId>org.gvsig.fmap.dal</artifactId>
56
			<classifier>spi</classifier>
57
            <scope>compile</scope>
58
		</dependency>		
59
		<dependency>
60
			<groupId>org.gvsig</groupId>
61
			<artifactId>org.gvsig.fmap.geometry</artifactId>
62
			<classifier>operation</classifier>
63
            <scope>compile</scope>
64
		</dependency>
65
		<dependency>
66
			<groupId>postgresql</groupId>
67
			<artifactId>postgresql</artifactId>
68
            <scope>compile</scope>
69
		</dependency>
70
		<dependency>
71
			<groupId>commons-dbcp</groupId>
72
			<artifactId>commons-dbcp</artifactId>
73
            <scope>compile</scope>
74
		</dependency>
75
		<dependency>
76
			<groupId>commons-collections</groupId>
77
			<artifactId>commons-collections</artifactId>
78
            <scope>compile</scope>
79
		</dependency>
80
		<dependency>
81
			<groupId>mysql</groupId>
82
			<artifactId>mysql-connector-java</artifactId>
83
            <scope>compile</scope>
84
		</dependency>
85
		<!--TEST-->
86
		<dependency>
87
			<groupId>org.gvsig</groupId>
88
			<artifactId>org.gvsig.tools.lib</artifactId>
89
			<type>test-jar</type>
90
			<scope>test</scope>
91
		</dependency>
92
		<dependency>
93
			<groupId>org.gvsig</groupId>
94
			<artifactId>org.gvsig.fmap.dal</artifactId>
95
			<classifier>tests</classifier>
96
			<scope>test</scope>
97
		</dependency>
98
		<dependency>
99
			<groupId>org.gvsig</groupId>
100
			<artifactId>org.gvsig.fmap.dal</artifactId>
101
			<classifier>impl</classifier>
102
			<scope>test</scope>
103
		</dependency>
104
		<dependency>
105
			<groupId>org.gvsig</groupId>
106
			<artifactId>org.gvsig.fmap.dal.index.spatial</artifactId>
107
			<classifier>jts</classifier>
108
			<scope>test</scope>
109
		</dependency>
110
		<dependency>
111
			<groupId>org.gvsig</groupId>
112
			<artifactId>org.gvsig.fmap.geometry</artifactId>
113
			<classifier>impl</classifier>
114
			<scope>test</scope>
115
		</dependency>
116
		<dependency>
117
			<groupId>org.gvsig</groupId>
118
			<artifactId>org.gvsig.projection</artifactId>
119
			<classifier>cresques-impl</classifier>
120
			<scope>test</scope>
121
		</dependency>
122
		<dependency>
123
			<groupId>org.gvsig</groupId>
124
			<artifactId>org.gvsig.utils</artifactId>
125
			<scope>test</scope>
126
		</dependency>		
127
        <dependency>
128
            <groupId>org.slf4j</groupId>
129
            <artifactId>slf4j-api</artifactId>
130
            <scope>compile</scope>
131
        </dependency>
132
        <dependency>
133
            <groupId>org.gvsig</groupId>
134
            <artifactId>org.gvsig.tools.lib</artifactId>
135
            <scope>compile</scope>
136
        </dependency>
137
        <dependency>
138
            <groupId>org.gvsig</groupId>
139
            <artifactId>org.gvsig.projection</artifactId>
140
            <scope>compile</scope>
141
        </dependency>
142
        <dependency>
143
            <groupId>org.gvsig</groupId>
144
            <artifactId>org.gvsig.fmap.geometry</artifactId>
145
            <scope>compile</scope>
146
        </dependency>        
147
        <dependency>
148
            <groupId>org.gvsig</groupId>
149
            <artifactId>org.gvsig.metadata.lib.basic.api</artifactId>
150
            <scope>compile</scope>
151
        </dependency>        
152
	</dependencies>
153
	<build>
154
		<sourceDirectory>src</sourceDirectory>
155
		<testSourceDirectory>src-test</testSourceDirectory>
156
		<plugins>
157
			<plugin>
158
				<groupId>org.apache.maven.plugins</groupId>
159
				<artifactId>maven-compiler-plugin</artifactId>
160
				<configuration>
161
					<excludes>
162
						<exclude>org/gvsig/fmap/data/**</exclude>
163
					</excludes>
164
				</configuration>
165
			</plugin>
166
			<plugin>
167
				<groupId>org.apache.maven.plugins</groupId>
168
				<artifactId>maven-javadoc-plugin</artifactId>
169
				<configuration>
170
					<excludePackageNames>org/gvsig/fmap/data</excludePackageNames>
171
				</configuration>
172
			</plugin>
173
			<plugin>
174
				<groupId>org.apache.maven.plugins</groupId>
175
				<artifactId>maven-jar-plugin</artifactId>
176
				<configuration>
177
					<excludes>
178
						<exclude>${jdbc-jarIncludes}</exclude>
179
						<exclude>${postgresql-jarIncludes}</exclude>
180
						<exclude>${mysql-jarIncludes}</exclude>
181
					</excludes>
182
				</configuration>
183
				<executions>
184
					<!--
185
						Generates a jar file only with the DAL JDBC Store classes
186
					-->
187
					<execution>
188
						<id>jdbc</id>
189
						<phase>package</phase>
190
						<goals>
191
							<goal>jar</goal>
192
						</goals>
193
						<configuration>
194
							<classifier>store.jdbc</classifier>
195
							<includes>
196
								<include>${jdbc-jarIncludes}</include>
197
							</includes>
198
							<excludes>
199
								<exclude>${jdbc-jarExcludes}</exclude>
200
							</excludes>
201
						</configuration>
202
					</execution>
203
					<!--
204
						Generates a jar file only with the DAL PostgreSQL Store classes
205
					-->
206
					<execution>
207
						<id>postgresql</id>
208
						<phase>package</phase>
209
						<goals>
210
							<goal>jar</goal>
211
						</goals>
212
						<configuration>
213
							<classifier>store.postgresql</classifier>
214
							<includes>
215
								<include>${postgresql-jarIncludes}</include>
216
							</includes>
217
							<excludes>
218
								<exclude>${postgresql-jarExcludes}</exclude>
219
							</excludes>
220
						</configuration>
221
					</execution>
222
					<!--
223
						Generates a jar file only with the DAL MySQL Store classes
224
					-->
225
					<execution>
226
						<id>mysql</id>
227
						<phase>package</phase>
228
						<goals>
229
							<goal>jar</goal>
230
						</goals>
231
						<configuration>
232
							<classifier>store.mysql</classifier>
233
							<includes>
234
								<include>${mysql-jarIncludes}</include>
235
							</includes>
236
							<excludes>
237
								<exclude>${mysql-jarExcludes}</exclude>
238
							</excludes>
239
						</configuration>
240
					</execution>
241
				</executions>
242
			</plugin>
243
			<plugin>
244
				<artifactId>maven-antrun-plugin</artifactId>
245
				<executions>
246
					<execution>
247
						<id>services</id>
248
						<phase>package</phase>
249
						<goals>
250
							<goal>run</goal>
251
						</goals>
252
						<configuration>
253
							<tasks>
254
								<jar destfile="${project.build.directory}/${project.build.finalName}.jar"
255
									update="true">
256
									<fileset dir="${basedir}/resources/api" />
257
								</jar>
258
								<jar destfile="${project.build.directory}/${project.build.finalName}-store.jdbc.jar"
259
									update="true">
260
									<fileset dir="${basedir}/resources/jdbc" />
261
								</jar>
262
								<jar destfile="${project.build.directory}/${project.build.finalName}-store.mysql.jar"
263
									update="true">
264
									<fileset dir="${basedir}/resources/mysql" />
265
								</jar>
266
								<jar destfile="${project.build.directory}/${project.build.finalName}-store.postgresql.jar"
267
									update="true">
268
									<fileset dir="${basedir}/resources/postgresql" />
269
								</jar>
270
							</tasks>
271
						</configuration>
272
					</execution>
273
				</executions>
274
			</plugin>
275
			<!-- PostgreSQL and MySQL is needed to run the tests -->
276
			<plugin>
277
				<groupId>org.apache.maven.plugins</groupId>
278
				<artifactId>maven-surefire-plugin</artifactId>
279
				<configuration>
280
					<additionalClasspathElements>
281
						<additionalClasspathElement>${basedir}/resources/api</additionalClasspathElement>
282
						<additionalClasspathElement>${basedir}/resources/jdbc</additionalClasspathElement>
283
						<additionalClasspathElement>${basedir}/resources/mysql</additionalClasspathElement>
284
						<additionalClasspathElement>${basedir}/resources/postgresql</additionalClasspathElement>
285
					</additionalClasspathElements>
286
					<skipTests>true</skipTests>
287
				</configuration>
288
			</plugin>
289
		</plugins>
290
	</build>
291
	<profiles>
292
		<profile>
293
			<id>eclipse-project</id>
294
			<build>
295
				<defaultGoal>antrun:run</defaultGoal>
296
				<plugins>
297
					<plugin>
298
						<artifactId>maven-antrun-plugin</artifactId>
299
						<configuration>
300
							<tasks>
301
								<ant antfile="${build-dir}/ant-tasks/eclipse-tasks.xml"
302
									target="eclipse.all"/>
303
							</tasks>
304
						</configuration>
305
					</plugin>
306
				</plugins>
307
			</build>				
308
		</profile>			
309
	</profiles>
310
	<reporting>
311
		<plugins>
312
			<plugin>
313
				<groupId>org.apache.maven.plugins</groupId>
314
				<artifactId>maven-javadoc-plugin</artifactId>
315
				<configuration>
316
					<doctitle>${project.name} ${project.version}</doctitle>
317
					<groups>
318
						<group>
319
							<title>DAL DB common</title>
320
							<packages>org.gvsig.fmap.dal*</packages>
321
						</group>
322
						<group>
323
							<title>DB Store</title>
324
							<packages>org.gvsig.fmap.dal.store.db*</packages>
325
						</group>
326
						<group>
327
							<title>JDBC Store</title>
328
							<packages>org.gvsig.fmap.dal.store.jdbc*</packages>
329
						</group>
330
						<group>
331
							<title>PostgreSQL Store</title>
332
							<packages>org.gvsig.fmap.dal.store.postgresql*</packages>
333
						</group>
334
						<group>
335
							<title>MySQL Store</title>
336
							<packages>org.gvsig.fmap.dal.store.mysql*</packages>
337
						</group>
338
					</groups>
339
				</configuration>
340
				<reportSets>
341
					<reportSet>
342
						<id>api</id>
343
						<configuration>
344
							<excludePackageNames>*.spi:*.impl:*.store</excludePackageNames>
345
							<name>Javadoc: API</name>
346
							<destDir>apidoc</destDir>
347
							<windowtitle>API Documentation</windowtitle>
348
							<links>
349
							</links>
350
						</configuration>
351
						<reports>
352
							<report>javadoc</report>
353
						</reports>
354
					</reportSet>
355
					<reportSet>
356
						<id>spi</id>
357
						<configuration>
358
							<doctitle>${project.name} ${project.version} SPI</doctitle>
359
							<subpackages>org.gvsig.fmap.dal.serverexplorer.db.spi:org.gvsig.fmap.dal.store.db:org.gvsig.fmap.dal.store.jdbc</subpackages>
360
							<name>Javadoc: SPI</name>
361
							<destDir>spidoc</destDir>
362
							<windowtitle>SPI and base stores documentation</windowtitle>
363
							<links>
364
								<link>../apidoc/</link>
365
							</links>
366
						</configuration>
367
						<reports>
368
							<report>javadoc</report>
369
						</reports>
370
					</reportSet>
371
					<reportSet>
372
						<id>impl</id>
373
						<configuration>
374
							<doctitle>${project.name} ${project.version} Default implementation and
375
								stores</doctitle>
376
							<subpackages>org.gvsig.fmap.dal.store.mysql:org.gvsig.fmap.dal.store.postgresql</subpackages>
377
							<name>Javadoc: Impl and Stores</name>
378
							<destDir>impldoc</destDir>
379
							<windowtitle>Default implementation and Stores Documentation</windowtitle>
380
							<links>
381
								<link>../apidoc/</link>
382
								<link>../spidoc/</link>
383
							</links>
384
						</configuration>
385
						<reports>
386
							<report>javadoc</report>
387
						</reports>
388
					</reportSet>
389
				</reportSets>
390
			</plugin>
391
		</plugins>
392
	</reporting>
393
</project>
tags/v2_0_0_Build_2038/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">
19
          <description></description>
20
        </field>
21
        <field name="dbuser" type="string" mandatory="false">
22
          <description></description>
23
        </field>
24
        <field name="password" type="string" mandatory="false">
25
          <description></description>
26
        </field>
27
      </fields>
28
    </class>
29

  
30
  </classes>
31
</definitions>  
0 32

  
tags/v2_0_0_Build_2038/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_2038/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">
14
          <description>Name of the table or view to access</description>
15
        </field>
16
        <field name="DefaultGeometryField" type="string" mandatory="false">
17
          <description>Default geometry field</description>
18
        </field>
19

  
20
		<!-- Advanced  -->
21
        <field name="CRS" type="crs" mandatory="false">
22
          <description>CRS used to override the autodetection</description>
23
        </field>
24
        <field name="SQL" type="string" mandatory="false">
25
          <description>SQL to use instead the table name</description>
26
        </field>
27
        <field name="Fields" type="string" mandatory="false">
28
          <description>comma separated list of the field names that we want to use</description>
29
        </field>
30
        <field name="BaseFilter" type="string" mandatory="false">
31
          <description>This filter is passed to BD provider on each request as a base filter.</description>
32
        </field>
33
        <field name="BaseOrder" type="string" mandatory="false">
34
          <description>This order is used if no custom order is request in query.</description>
35
        </field>
36
        <field name="PKFields" type="string" mandatory="false">
37
          <description>Comma separated list of the field names that compound the primary key</description>
38
        </field>
39
        <field name="Workingarea" type="envelope" mandatory="false">
40
          <description>Envelop that define the filter by area used</description>
41
        </field>
42
      </fields>
43
    </class>
44

  
45
  </classes>
46
</definitions>  
0 47

  
tags/v2_0_0_Build_2038/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_2038/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_2038/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="Other">
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">
18
          <description>Database catalog</description>
19
        </field>
20
        <field name="Schema" type="string" mandatory="false">
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" mandatory="false" defaultValue="false">
53
          <description>Show information tables</description>
54
        </field>
55
      </fields>
56
    </class>
57

  
58

  
59
  </classes>
60
</definitions>  
0 61

  
tags/v2_0_0_Build_2038/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_2038/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_2038/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="Other">
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">
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_2038/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_2038/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_2038/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_2038/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">
12
          <description>JDBC Driver class</description>
13
        </field>
14
		<field name="port" type="integer" mandatory="false"
15
          defaultValue="3306">
16
          <description></description>
17
        </field>
18
        <field name="UseSSL" type="boolean" mandatory="false"
19
          defaultValue="false">
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_2038/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_2038/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_2038/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_2038/libraries/libFMap_daldb/src-test/org/gvsig/fmap/dal/store/postgresql/TestPostgreSQL.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.postgresql;
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
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor;
37
import org.gvsig.fmap.dal.feature.FeatureQuery;
38
import org.gvsig.fmap.dal.feature.FeatureStore;
39
import org.gvsig.fmap.dal.feature.FeatureStoreTransform;
40
import org.gvsig.fmap.dal.feature.FeatureType;
41
import org.gvsig.fmap.dal.feature.NewFeatureStoreParameters;
42
import org.gvsig.fmap.geom.Geometry;
43
import org.gvsig.tools.evaluator.Evaluator;
44
import org.gvsig.tools.evaluator.EvaluatorData;
45
import org.gvsig.tools.evaluator.EvaluatorException;
46
import org.gvsig.tools.evaluator.EvaluatorFieldsInfo;
47

  
48
/**
49
 * @author jmvivo
50
 *
51
 */
52
// public class TestPostgreSQL extends BaseTestEditableFeatureStore {
53
public class TestPostgreSQL extends BaseTestFeatureStore {
54

  
55
	@Override
56
	protected void doSetUp() throws Exception {
57
		super.doSetUp();
58
	}
59

  
60
	public DataStoreParameters getDefaultDataStoreParameters()
61
			throws DataException {
62
		PostgreSQLStoreParameters pgParameters = null;
63
		pgParameters = (PostgreSQLStoreParameters) dataManager
64
				.createStoreParameters(PostgreSQLStoreProvider.NAME);
65

  
66
		pgParameters.setHost("localhost");
67
		pgParameters.setUser("postgres");
68
		pgParameters.setPassword("postgres");
69
		pgParameters.setDBName("gis");
70
		pgParameters.setTable("muni10000_peq");
71

  
72
		return pgParameters;
73
	}
74

  
75
	public boolean hasExplorer() {
76
		return true;
77
	}
78

  
79
	public void testLoadMetadata() throws Exception {
80
		DataStoreParameters params = this.getDefaultDataStoreParameters();
81

  
82
		FeatureStore store = null;
83
		store = (FeatureStore) dataManager.createStore(params);
84
		FeatureType fType = store.getDefaultFeatureType();
85
		FeatureAttributeDescriptor geomAttr;
86

  
87

  
88

  
89
		if (fType.getDefaultGeometryAttributeIndex() >= 0) {
90
			assertNotNull(store.getEnvelope());
91
			geomAttr = fType.getAttributeDescriptor(fType
92
					.getDefaultGeometryAttributeIndex());
93
			assertTrue(geomAttr.getGeometryType() == Geometry.TYPES.MULTISURFACE);
94
			assertTrue(geomAttr.getGeometrySubType() == Geometry.SUBTYPES.GEOM2D);
95
			assertNotNull(store.getDynValue("CRS"));
96

  
97
		}
98

  
99
	}
100

  
101
	public void testCloserConnection() throws Exception {
102

  
103
		DataStoreParameters params = this.getDefaultDataStoreParameters();
104

  
105
		FeatureStore store = null;
106
		store = (FeatureStore) dataManager.createStore(params);
107

  
108
		FeatureQuery query = store.createFeatureQuery();
109

  
110
		query.getOrder().add("gid", true);
111

  
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff