Revision 37475

View differences:

tags/v2_0_0_Build_2042/libraries/org.gvsig.exportto/prepare-workspace.xml
1
<project name="org.gvsig.initial.build" default="prepare-workspace">
2

  
3
	<dirname property="org.gvsig.initial.build.basedir" file="${ant.file.org.gvsig.initial.build}" />
4

  
5
	<property name="workspace.basedir" value="${org.gvsig.initial.build.basedir}/.." />
6
	<property name="build.basedir" value="${workspace.basedir}/org.gvsig.maven.base.build" description="Eclipse workspace location" />
7
	<property name="build.jar.version" value="1.0.6-SNAPSHOT" />
8
	<property name="build.jar.file" value="org.gvsig.maven.base.build-${build.jar.version}.jar" />
9

  
10
	<property name="ant.libs.dir" location="${build.basedir}" description="Additional ant tasks libs folder" />
11

  
12
	<target name="check-maven-base-build-available">
13
		<available file="${user.home}/.m2/repository/org/gvsig/org.gvsig.maven.base.build/${build.jar.version}/${build.jar.file}" property="maven-base-build-available" />
14
	</target>
15

  
16
	<target name="get-maven-base-build-local" depends="check-maven-base-build-available" if="maven-base-build-available">
17
		<!-- Unzip de build jar file from the maven repository into the workspace root folder -->
18
		<copy todir="${workspace.basedir}" preservelastmodified="false" filtering="false">
19
			<zipfileset src="${user.home}/.m2/repository/org/gvsig/org.gvsig.maven.base.build/${build.jar.version}/${build.jar.file}">
20
				<patternset>
21
					<exclude name="META-INF/**" />
22
				</patternset>
23
			</zipfileset>
24
		</copy>
25
	</target>
26

  
27
	<target name="get-maven-base-build-remote" depends="check-maven-base-build-available" unless="maven-base-build-available">
28
		<mkdir dir="target" />
29

  
30
		<!-- Download the build jar file -->
31
		<get src="http://gvsig-desktop.forge.osor.eu/downloads/pub/projects/gvSIG-desktop/maven-repository/org/gvsig/org.gvsig.maven.base.build/${build.jar.version}/${build.jar.file}" dest="target/${build.jar.file}" verbose="true" />
32

  
33
		<!-- Unzip de build jar file into the workspace root folder -->
34
		<copy todir="${workspace.basedir}" preservelastmodified="false" filtering="false">
35
			<zipfileset src="target/${build.jar.file}">
36
				<patternset>
37
					<exclude name="META-INF/**" />
38
				</patternset>
39
			</zipfileset>
40
		</copy>
41

  
42
	</target>
43

  
44
	<target name="prepare-workspace" depends="get-maven-base-build-local,get-maven-base-build-remote">
45

  
46
		<mkdir dir="target" />
47

  
48
		<chmod dir="${build.basedir}/maven/bin" perm="u+x" includes="m2,mvn,mvnDebug" />
49

  
50
		<!-- Copy the maven launchers to the workspace metadata folder -->
51
		<copy todir="${workspace.basedir}/.metadata">
52
			<fileset dir="${build.basedir}/eclipse-launchers">
53
				<exclude name="**/org.eclipse.jdt.core.prefs" />
54
				<exclude name="**/org.eclipse.core.variables.prefs" />
55
			</fileset>
56
		</copy>
57

  
58
		<concat destfile="${workspace.basedir}/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs" append="true">
59
			<filelist dir="${build.basedir}/eclipse-launchers/.plugins/org.eclipse.core.runtime/.settings" files="org.eclipse.jdt.core.prefs" />
60
		</concat>
61
		<concat destfile="${workspace.basedir}/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.variables.prefs" append="true">
62
			<filelist dir="${build.basedir}/eclipse-launchers/.plugins/org.eclipse.core.runtime/.settings" files="org.eclipse.core.variables.prefs" />
63
		</concat>
64

  
65
		<!-- Configure the eclipse workspace -->
66
		<ant antfile="${build.basedir}/maven-goals.xml" target="mvn-configure-eclipse-workspace" />
67

  
68
		<!-- Configure the gvSIG profile -->
69
		<ant antfile="${build.basedir}/check-gvsig-profile.xml" target="initialize" />
70

  
71
		<property name="user-settings-file-location" value="${user.home}/.m2/settings.xml" />
72

  
73
		<taskdef name="xmltask" classname="com.oopsconsultancy.xmltask.ant.XmlTask">
74
			<classpath>
75
				<pathelement location="${ant.libs.dir}/com.oopsconsultancy.xmltask-1.16.1.jar" />
76
			</classpath>
77
		</taskdef>
78

  
79
		<xmltask source="${user-settings-file-location}" dest="${user-settings-file-location}">
80
			<copy path="//:settings/:profiles/:profile[:id/text() = 'gvsig-install']/:properties/:gvsig.install.dir/text()" property="current-gvsig-location" />
81
		</xmltask>
82

  
83
		<replace file="${workspace.basedir}/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs" token="@GVSIG_HOME@" value="${current-gvsig-location}" />
84
		<replace file="${workspace.basedir}/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.variables.prefs" token="@GVSIG_HOME@" value="${current-gvsig-location}" />
85

  
86
		<!-- Compile, install and generate eclipse projects -->
87
		<ant antfile="${build.basedir}/maven-goals.xml" target="mvn-install-and-eclipse-eclipse" />
88

  
89
		<echo>INFORMATION!!!</echo>
90
		<echo>Restart eclipse and then proceed to import the subprojects contained into the main project</echo>
91

  
92
		<!-- TODO: copiar al proyecto de configuraciĆ³n general -->
93
	</target>
94

  
95
	<target name="clean">
96
		<delete dir="target" />
97
	</target>
98

  
99
</project>
0 100

  
tags/v2_0_0_Build_2042/libraries/org.gvsig.exportto/pom.xml
1
<?xml version="1.0" encoding="ISO-8859-1"?>
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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5
	<modelVersion>4.0.0</modelVersion>
6
	<artifactId>org.gvsig.exportto</artifactId>
7
	<packaging>pom</packaging>
8
	<version>1.0.0-SNAPSHOT</version>
9
	<name>org.gvsig.exportto</name>
10
	<description>Exportto example project</description>
11
	<url>http://gvsig-desktop.forge.osor.eu/downloads/pub/projects/gvSIG-desktop/docs/reference/org.gvsig.exportto/${project.version}/basic/org.gvsig.exportto</url>
12
	<parent>
13
		<groupId>org.gvsig</groupId>
14
		<artifactId>org.gvsig.maven.base.pom</artifactId>
15
		<version>1.0.8-SNAPSHOT</version>
16
	</parent>
17

  
18
	<scm>
19
		<connection>scm:svn:https://svn.forge.osor.eu/svn/gvsig-exportto/org.gvsig.exportto/library/trunk</connection>
20
		<developerConnection>scm:svn:https://svn.forge.osor.eu/svn/gvsig-exportto/org.gvsig.exportto/library/trunk</developerConnection>
21
		<url>https://forge.osor.eu/plugins/scmsvn/viewcvs.php/org.gvsig.exportto/library/trunk/?root=gvsig-exportto</url>
22
	</scm>
23

  
24
	<developers>
25
        <developer>
26
            <id>jpiera</id>
27
            <name>Jorge Piera</name>
28
            <email>jpiera@gvsig.org</email>
29
            <roles>
30
                <role>Architect</role>
31
                <role>Developer</role>
32
            </roles>
33
        </developer>
34
        <developer>
35
            <id>jjdelcerro</id>
36
            <name>Joaqu?n Jos? del Cerro</name>
37
            <email>jjdelcerro@gvsig.org</email>
38
            <roles>
39
                <role>Architect</role>          
40
            </roles>
41
        </developer>        
42
    </developers>
43

  
44
	<distributionManagement>
45
		<site>
46
			<id>gvsig-repository</id>
47
			<url>scp://shell.forge.osor.eu/home/groups/gvsig-desktop/www/downloads/pub/projects/gvSIG-desktop/docs/reference/org.gvsig.exportto/${project.version}/basic/org.gvsig.exportto</url>
48
		</site>
49
	</distributionManagement>
50
	<repositories>
51
		<repository>
52
			<id>gvsig-public-http-repository</id>
53
			<name>gvSIG maven public HTTP repository</name>
54
			<url>http://gvsig-desktop.forge.osor.eu/downloads/pub/projects/gvSIG-desktop/maven-repository</url>
55
			<releases>
56
				<enabled>true</enabled>
57
				<updatePolicy>daily</updatePolicy>
58
				<checksumPolicy>warn</checksumPolicy>
59
			</releases>
60
			<snapshots>
61
				<enabled>true</enabled>
62
				<updatePolicy>daily</updatePolicy>
63
				<checksumPolicy>warn</checksumPolicy>
64
			</snapshots>
65
		</repository>
66
	</repositories>
67
	<build>
68
		<plugins>
69
			<plugin>
70
				<groupId>org.apache.maven.plugins</groupId>
71
				<artifactId>maven-release-plugin</artifactId>
72
				<configuration>
73
					<tagBase>https://svn.forge.osor.eu/svn/gvsig-exportto/org.gvsig.exportto/library/tags</tagBase>
74
				</configuration>
75
			</plugin>
76
		</plugins>
77
	</build>
78
	<dependencyManagement>
79
		<dependencies>			
80
            <dependency>
81
                <groupId>org.gvsig</groupId>
82
                <artifactId>org.gvsig.core.maven.dependencies</artifactId>
83
                <version>2.0.1-SNAPSHOT</version>
84
                <type>pom</type>
85
                <scope>import</scope>
86
            </dependency>
87
            <dependency>
88
                <groupId>org.gvsig</groupId>
89
                <artifactId>org.gvsig.geodb</artifactId>
90
                <version>2.0-SNAPSHOT</version>
91
            </dependency>
92
		</dependencies>
93
	</dependencyManagement>
94

  
95
	<dependencies>
96
		<dependency>
97
			<groupId>org.gvsig</groupId>
98
			<artifactId>org.gvsig.tools.lib</artifactId>
99
		</dependency>
100
		<dependency>
101
			<groupId>org.gvsig</groupId>
102
			<artifactId>org.gvsig.tools.lib</artifactId>
103
			<type>test-jar</type>
104
		</dependency>	
105
	</dependencies>
106

  
107
	<modules>
108
		<module>org.gvsig.exportto.lib</module>
109
		<module>org.gvsig.exportto.swing</module>
110
		<module>org.gvsig.exportto.main</module>
111
	</modules>
112

  
113
</project>
0 114

  
tags/v2_0_0_Build_2042/libraries/org.gvsig.exportto/README.txt
1
The first time you checkout the current project to a new workspace, 
2
you have to prepare it to be able to work easily with maven from
3
eclipse itself.
4

  
5
Perform the following steps:
6

  
7
1.- Launch the *prepare-workspace.xml* ant build file. 
8
    You can do it by loading the file into the ant view, 
9
    and running the default task, or right-clicking the 
10
    file from the package explorer or the navigator and
11
    select the option: *Run as > Ant build*. 
12
    
13
2.- Restart eclipse.
14

  
15
3.- Import the subprojects of the project you have just checked out.
16

  
17
Those steps are only needed once per workspace.     
18

  
0 19

  
tags/v2_0_0_Build_2042/libraries/org.gvsig.exportto/org.gvsig.exportto.main/src/main/resources/log4j.xml
1
<?xml version="1.0" encoding="ISO-8859-1" ?>
2
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
3

  
4
<!-- 
5
Log4J configuration file for unit tests execution.
6
 -->
7
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
8

  
9
	<!-- Appender configuration to show logging messages through the console -->
10
	<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
11
		<layout class="org.apache.log4j.PatternLayout">
12
			<param name="ConversionPattern" value="%d{HH:mm:ss,SSS} %-5p [%c{2}.%M()]\n  %m%n" />
13
		</layout>
14
	</appender>
15

  
16
	<!-- 
17
	Activate logging messages of DEBUG level of higher only for the
18
	org.gvsig.tools packages.
19
	You can put full classes names or packages instead, to configure
20
	logging for all the classes and subpackages of the package.
21
	-->
22
	<category name="org.gvsig.tools">
23
		<priority value="DEBUG" />
24
	</category>
25
	<category name="org.gvsig.exportto">
26
		<priority value="DEBUG" />
27
	</category>
28

  
29
	<!-- 
30
	By default, show only logging messages of INFO level or higher, 
31
	through the previously configured CONSOLE appender. 
32
	-->
33
	<root>
34
		<priority value="INFO" />
35
		<appender-ref ref="CONSOLE" />
36
	</root>
37
</log4j:configuration>
0 38

  
tags/v2_0_0_Build_2042/libraries/org.gvsig.exportto/org.gvsig.exportto.main/src/main/resources/README.txt
1
Put into this folder the resources needed by your classes.
2

  
3
This folder is added to the classpath, so you can load any resources 
4
through the ClassLoader.
5

  
6
By default, in this folder you can find an example of log4j configuration,
7
prepared to log messages through the console, so logging works when you
8
run your classes.
0 9

  
tags/v2_0_0_Build_2042/libraries/org.gvsig.exportto/org.gvsig.exportto.main/src/main/java/org/gvsig/exportto/main/package.html
1
<?xml version="1.0" encoding="UTF-8" ?>
2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
<html xmlns="http://www.w3.org/1999/xhtml">
4
<head>
5
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6
<title>org.gvsig.exportto package documentation</title>
7
</head>
8
<body>
9

  
10
	<p>Exportto library testing and demo application.</p>
11

  
12
</body>
13
</html>
0 14

  
tags/v2_0_0_Build_2042/libraries/org.gvsig.exportto/org.gvsig.exportto.main/src/main/java/org/gvsig/exportto/main/Main.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
package org.gvsig.exportto.main;
23

  
24
import java.awt.BorderLayout;
25
import java.awt.Dimension;
26
import java.awt.event.ActionEvent;
27

  
28
import javax.swing.AbstractAction;
29
import javax.swing.Action;
30
import javax.swing.JButton;
31
import javax.swing.JFrame;
32
import javax.swing.JMenu;
33
import javax.swing.JMenuBar;
34
import javax.swing.JMenuItem;
35
import javax.swing.JToolBar;
36
import javax.swing.WindowConstants;
37

  
38
import org.slf4j.Logger;
39
import org.slf4j.LoggerFactory;
40

  
41
import org.gvsig.exportto.ExporttoLocator;
42
import org.gvsig.exportto.ExporttoManager;
43
import org.gvsig.exportto.swing.ExporttoSwingLocator;
44
import org.gvsig.exportto.swing.ExporttoSwingManager;
45
import org.gvsig.exportto.swing.ExporttoWindowManager;
46
import org.gvsig.exportto.swing.JExporttoServicePanel;
47
import org.gvsig.fmap.crs.CRSFactory;
48
import org.gvsig.fmap.dal.DALLocator;
49
import org.gvsig.fmap.dal.DataManager;
50
import org.gvsig.fmap.dal.DataStoreParameters;
51
import org.gvsig.fmap.dal.exception.InitializeException;
52
import org.gvsig.fmap.dal.exception.ProviderNotRegisteredException;
53
import org.gvsig.fmap.dal.exception.ValidateDataParametersException;
54
import org.gvsig.fmap.dal.feature.FeatureStore;
55
import org.gvsig.tools.library.impl.DefaultLibrariesInitializer;
56

  
57
/**
58
 * Main executable class for testing the Exportto library.
59
 * 
60
 * @author gvSIG Team
61
 * @version $Id$
62
 */
63
public class Main {
64

  
65
    private static final Logger LOG = LoggerFactory.getLogger(Main.class);
66

  
67
    private ExporttoManager manager;
68
    private ExporttoSwingManager swingManager;
69
    private DataManager dataManager;
70
    
71
    public static void main(String args[]) {
72
        new DefaultLibrariesInitializer().fullInitialize();
73
        Main main = new Main();
74
        main.show();
75
    }
76

  
77
    @SuppressWarnings("serial")
78
    public void show() {
79
        manager = ExporttoLocator.getManager();
80
        swingManager = ExporttoSwingLocator.getSwingManager();
81
        dataManager = DALLocator.getDataManager();
82
        
83
        Action showCookie = new AbstractAction("Get a Exportto") {
84

  
85
            public void actionPerformed(ActionEvent e) {
86
                showExportto(manager);
87
            }
88
        };
89

  
90
        Action exit = new AbstractAction("Exit") {
91

  
92
            public void actionPerformed(ActionEvent e) {
93
                System.exit(0);
94
            }
95
        };
96

  
97
        JFrame frame = new JFrame("Exportto example app");
98
        frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
99

  
100
        // Create the menu bar.
101
        JMenuBar menuBar = new JMenuBar();
102

  
103
        // Build the menu.
104
        JMenu menuFile = new JMenu("File");
105
        menuFile.add(new JMenuItem(showCookie));
106
        menuFile.add(new JMenuItem(exit));
107

  
108
        menuBar.add(menuFile);
109

  
110
        JToolBar toolBar = new JToolBar();
111
        toolBar.add(new JButton(showCookie));
112
        toolBar.add(new JButton(exit));
113

  
114
        frame.setPreferredSize(new Dimension(200, 100));
115
        frame.setJMenuBar(menuBar);
116
        frame.add(toolBar, BorderLayout.PAGE_START);
117

  
118
        // Display the window.
119
        frame.pack();
120
        frame.setVisible(true);
121
    }
122

  
123
    public void showExportto(ExporttoManager manager) {
124
        try {            
125
            JExporttoServicePanel panel =
126
                swingManager.createExportto(createFeatureStore(), CRSFactory.getCRS("EPSG:23030"));
127
            panel.setPreferredSize(new Dimension(800, 400));
128
            swingManager.getWindowManager().showWindow(panel, "Exportto",
129
                ExporttoWindowManager.MODE_WINDOW);
130
        } catch (ValidateDataParametersException e) {
131
            LOG.error("Error showing a Exportto", e);
132
        } catch (InitializeException e) {
133
            LOG.error("Error showing a Exportto", e);
134
        } catch (ProviderNotRegisteredException e) {
135
            LOG.error("Error showing a Exportto", e);
136
        }
137
    }
138

  
139
    private FeatureStore createFeatureStore() throws InitializeException, ProviderNotRegisteredException, ValidateDataParametersException{
140
        String sourceFileName = getClass().getClassLoader().getResource("org/gvsig/exportto/data/andalucia.shp").getFile();
141
        DataStoreParameters sourceParameters = dataManager.createStoreParameters("Shape");
142
        sourceParameters.setDynValue("shpfile", sourceFileName);
143
        sourceParameters.setDynValue("crs", CRSFactory.getCRS("EPSG:23030"));
144
        return (FeatureStore) dataManager.openStore("Shape", sourceParameters);
145
    }
146
}
0 147

  
tags/v2_0_0_Build_2042/libraries/org.gvsig.exportto/org.gvsig.exportto.main/pom.xml
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
4
	<modelVersion>4.0.0</modelVersion>
5
	<artifactId>org.gvsig.exportto.main</artifactId>
6
	<packaging>jar</packaging>
7
	<name>org.gvsig.exportto.main</name>
8
	<parent>
9
		<groupId>org.gvsig</groupId>
10
		<artifactId>org.gvsig.exportto</artifactId>
11
		<version>1.0.0-SNAPSHOT</version>
12
	</parent>
13
	<dependencies>
14
		<dependency>
15
			<groupId>org.gvsig</groupId>
16
			<artifactId>org.gvsig.exportto.lib.api</artifactId>
17
			<version>1.0.0-SNAPSHOT</version>
18
		</dependency>
19
		<dependency>
20
			<groupId>org.gvsig</groupId>
21
			<artifactId>org.gvsig.exportto.lib.impl</artifactId>
22
			<version>1.0.0-SNAPSHOT</version>
23
			<scope>runtime</scope>
24
		</dependency>
25
		<dependency>
26
			<groupId>org.gvsig</groupId>
27
			<artifactId>org.gvsig.exportto.swing.api</artifactId>
28
			<version>1.0.0-SNAPSHOT</version>
29
		</dependency>
30
		<dependency>
31
			<groupId>org.gvsig</groupId>
32
			<artifactId>org.gvsig.exportto.swing.impl</artifactId>
33
			<version>1.0.0-SNAPSHOT</version>
34
			<scope>runtime</scope>
35
		</dependency>
36
		<dependency>
37
            <groupId>org.gvsig</groupId>
38
            <artifactId>org.gvsig.exportto.swing.prov.generic</artifactId>
39
            <version>1.0.0-SNAPSHOT</version>
40
            <scope>runtime</scope>
41
        </dependency>
42
        <dependency>
43
            <groupId>org.gvsig</groupId>
44
            <artifactId>org.gvsig.exportto.swing.prov.shape</artifactId>
45
            <version>1.0.0-SNAPSHOT</version>
46
            <scope>runtime</scope>
47
        </dependency>
48
        <dependency>
49
            <groupId>org.gvsig</groupId>
50
            <artifactId>org.gvsig.exportto.swing.prov.dxf</artifactId>
51
            <version>1.0.0-SNAPSHOT</version>
52
            <scope>runtime</scope>
53
        </dependency>
54
         <dependency>
55
            <groupId>org.gvsig</groupId>
56
            <artifactId>org.gvsig.exportto.swing.prov.dbf</artifactId>
57
            <version>1.0.0-SNAPSHOT</version>
58
            <scope>runtime</scope>
59
        </dependency>
60
        <dependency>
61
            <groupId>org.gvsig</groupId>
62
            <artifactId>org.gvsig.exportto.swing.prov.postgresql</artifactId>
63
            <version>1.0.0-SNAPSHOT</version>
64
            <scope>runtime</scope>
65
        </dependency>
66
        <dependency>
67
            <groupId>org.gvsig</groupId>
68
            <artifactId>org.gvsig.exportto.swing.prov.mysql</artifactId>
69
            <version>1.0.0-SNAPSHOT</version>
70
            <scope>runtime</scope>
71
        </dependency>
72
		<dependency>
73
            <groupId>org.gvsig</groupId>
74
            <artifactId>org.gvsig.tools.lib</artifactId>
75
            <scope>compile</scope>
76
        </dependency>
77
        <dependency>
78
            <groupId>org.gvsig</groupId>
79
            <artifactId>org.gvsig.projection</artifactId>
80
            <scope>compile</scope>
81
       </dependency>
82
       <dependency>
83
            <groupId>org.gvsig</groupId>
84
            <artifactId>org.gvsig.fmap.dal</artifactId>    
85
            <scope>compile</scope>        
86
        </dependency>
87
        <dependency>
88
            <groupId>org.gvsig</groupId>
89
            <artifactId>org.gvsig.fmap.dal.file</artifactId>
90
            <classifier>store.shp</classifier>
91
            <scope>runtime</scope>
92
        </dependency>
93
        <dependency>
94
            <groupId>org.gvsig</groupId>
95
            <artifactId>org.gvsig.fmap.dal.file</artifactId>
96
            <classifier>store.dxf</classifier>
97
            <scope>runtime</scope>
98
        </dependency>
99
        <dependency>
100
            <groupId>org.gvsig</groupId>
101
            <artifactId>org.gvsig.fmap.dal.db</artifactId>
102
            <classifier>store.postgresql</classifier>
103
            <scope>runtime</scope>
104
        </dependency>   
105
         <dependency>
106
            <groupId>org.gvsig</groupId>
107
            <artifactId>org.gvsig.fmap.mapcontext</artifactId>          
108
            <scope>runtime</scope>
109
        </dependency>   
110
        <dependency>
111
            <groupId>org.gvsig</groupId>
112
            <artifactId>org.gvsig.fmap.dal.db</artifactId>
113
            <classifier>store.mysql</classifier>
114
            <scope>runtime</scope>
115
        </dependency>   
116
        <dependency>
117
            <groupId>org.gvsig</groupId>
118
            <artifactId>org.gvsig.tools.swing.serv.field</artifactId>
119
            <scope>compile</scope>
120
        </dependency> 
121
        <dependency>
122
            <groupId>org.gvsig</groupId>
123
            <artifactId>org.gvsig.metadata.lib.basic.api</artifactId>
124
            <scope>compile</scope>
125
        </dependency>           
126
	</dependencies>
127
</project>
0 128

  
tags/v2_0_0_Build_2042/libraries/org.gvsig.exportto/org.gvsig.exportto.lib/org.gvsig.exportto.lib.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
1
org.gvsig.exportto.impl.ExporttoDefaultImplLibrary
tags/v2_0_0_Build_2042/libraries/org.gvsig.exportto/org.gvsig.exportto.lib/org.gvsig.exportto.lib.impl/src/main/resources/org/gvsig/exportto/lib/impl/exporttofilters.properties
1
#point_geometries_only=
2
#curve_geometries_only=
3
#surface_geometries_only=
4
prov_demo=PROV < '10'
0 5

  
tags/v2_0_0_Build_2042/libraries/org.gvsig.exportto/org.gvsig.exportto.lib/org.gvsig.exportto.lib.impl/src/main/java/org/gvsig/exportto/impl/package.html
1
<?xml version="1.0" encoding="UTF-8" ?>
2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
<html xmlns="http://www.w3.org/1999/xhtml">
4
<head>
5
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6
<title>org.gvsig.exportto package documentation</title>
7
</head>
8
<body>
9

  
10
	<p>Exportto library API default implementation.</p>
11

  
12
</body>
13
</html>
0 14

  
tags/v2_0_0_Build_2042/libraries/org.gvsig.exportto/org.gvsig.exportto.lib/org.gvsig.exportto.lib.impl/src/main/java/org/gvsig/exportto/impl/ExporttoDefaultImplLibrary.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
package org.gvsig.exportto.impl;
23

  
24
import org.gvsig.exportto.ExporttoLibrary;
25
import org.gvsig.exportto.ExporttoLocator;
26
import org.gvsig.tools.library.AbstractLibrary;
27
import org.gvsig.tools.library.LibraryException;
28

  
29
/**
30
 * Library for default implementation initialization and configuration.
31
 * 
32
 * @author gvSIG team
33
 * @version $Id$
34
 */
35
public class ExporttoDefaultImplLibrary extends AbstractLibrary {
36
    
37
    @Override
38
    public void doRegistration() {
39
        registerAsImplementationOf(ExporttoLibrary.class);
40
    }
41

  
42
    @Override
43
    protected void doInitialize() throws LibraryException {
44
        ExporttoLocator.registerManager(DefaultExporttoManager.class);
45
    }
46

  
47
    @Override
48
    protected void doPostInitialize() throws LibraryException {
49
        // Do nothing
50
    }
51

  
52
}
0 53

  
tags/v2_0_0_Build_2042/libraries/org.gvsig.exportto/org.gvsig.exportto.lib/org.gvsig.exportto.lib.impl/src/main/java/org/gvsig/exportto/impl/DefaultExporttoManager.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
package org.gvsig.exportto.impl;
23

  
24
import java.io.File;
25
import java.io.FileInputStream;
26
import java.io.FileOutputStream;
27
import java.io.IOException;
28
import java.io.InputStream;
29
import java.io.OutputStream;
30
import java.util.HashMap;
31
import java.util.Iterator;
32
import java.util.Map;
33
import java.util.Properties;
34

  
35
import org.slf4j.Logger;
36
import org.slf4j.LoggerFactory;
37

  
38
import org.gvsig.exportto.ExporttoManager;
39
import org.gvsig.exportto.ExporttoService;
40
import org.gvsig.fmap.dal.DataServerExplorer;
41
import org.gvsig.fmap.dal.NewDataStoreParameters;
42

  
43
/**
44
 * Default {@link ExporttoManager} implementation.
45
 * 
46
 * @author gvSIG Team
47
 * @version $Id$
48
 */
49
public class DefaultExporttoManager implements ExporttoManager {
50
    private static final Logger LOG =
51
        LoggerFactory.getLogger(DefaultExporttoManager.class);
52

  
53
    @SuppressWarnings("rawtypes")
54
    private Map filters = null;
55
    private static final String EXPORTTOFILTERS_FILENAME = "exporttofilters.properties";  
56
    private static final String GVSIGPREFERENCES_FOLDERNAME = "gvSIG";  
57

  
58
    @SuppressWarnings("rawtypes")
59
    public DefaultExporttoManager() {
60
        super(); 
61
        filters = new HashMap();
62
        try {
63
            initializeFilters();
64
        } catch (IOException e) {
65
            LOG.error("Error reading the exporttofilters.properties file");
66
        }       
67
    }
68

  
69
    @SuppressWarnings({ "rawtypes", "unchecked" })
70
    private void initializeFilters() throws IOException {        
71
        String path = System.getProperty("user.home");
72
        path = path + File.separatorChar + GVSIGPREFERENCES_FOLDERNAME;
73
        File directory = new File(path);
74
        if (!directory.exists()){
75
            directory.mkdirs();
76
        }
77
        path = path + File.separatorChar + EXPORTTOFILTERS_FILENAME;
78
        File exporttoFiltersFile = new File(path);
79
        if (!exporttoFiltersFile.exists()){
80
            File templateFile = new File(getClass().getClassLoader().getResource("org/gvsig/exportto/lib/impl/exporttofilters.properties").getFile());
81
            if (!templateFile.exists()){
82
                return;
83
            }            
84
            copy(templateFile, exporttoFiltersFile);           
85
        }
86
        Properties properties = new Properties();
87
        properties.load(new FileInputStream(exporttoFiltersFile));
88
        Iterator it = properties.keySet().iterator();
89
        while (it.hasNext()){
90
            String key = (String)it.next();
91
            filters.put(key, properties.get(key));
92
        }
93
    }
94

  
95
    private void copy(File sourceLocation, File targetLocation)
96
    throws IOException {
97
        if (sourceLocation.isDirectory()) {
98
            if (!targetLocation.exists()) {
99
                targetLocation.mkdir();
100
            }
101

  
102
            String[] children = sourceLocation.list();
103
            for (int i = 0; i < children.length; i++) {
104
                copy(new File(sourceLocation, children[i]), new File(
105
                    targetLocation, children[i]));
106
            }
107
        } else {
108
            targetLocation.getParentFile().mkdirs();
109

  
110
            InputStream in = new FileInputStream(sourceLocation);
111
            OutputStream out = new FileOutputStream(targetLocation);
112

  
113
            // Copy the bits from instream to outstream
114
            byte[] buf = new byte[1024];
115
            int len;
116
            while ((len = in.read(buf)) > 0) {
117
                out.write(buf, 0, len);
118
            }
119
            in.close();
120
            out.close();
121
        }
122
    }
123

  
124
    public ExporttoService getExporttoService(DataServerExplorer dataServerExplorer, NewDataStoreParameters newDataStoreParameters) {
125
        return new DefaultExporttoService(dataServerExplorer, newDataStoreParameters);
126
    }
127

  
128
    @SuppressWarnings("rawtypes")
129
    public Iterator getPredefinedFilters() {        
130
        return filters.keySet().iterator();
131
    }
132

  
133
    public String getFilter(String filterName) {
134
        if (filters.containsKey(filterName)){
135
            return (String)filters.get(filterName);
136
        }
137
        return null;
138
    }
139

  
140
}
0 141

  
tags/v2_0_0_Build_2042/libraries/org.gvsig.exportto/org.gvsig.exportto.lib/org.gvsig.exportto.lib.impl/src/main/java/org/gvsig/exportto/impl/DefaultExporttoService.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
package org.gvsig.exportto.impl;
23

  
24
import org.cresques.cts.IProjection;
25

  
26
import org.gvsig.exportto.ExporttoService;
27
import org.gvsig.exportto.ExporttoServiceException;
28
import org.gvsig.exportto.ExporttoServiceFinishAction;
29
import org.gvsig.fmap.dal.DALLocator;
30
import org.gvsig.fmap.dal.DataManager;
31
import org.gvsig.fmap.dal.DataServerExplorer;
32
import org.gvsig.fmap.dal.NewDataStoreParameters;
33
import org.gvsig.fmap.dal.feature.Feature;
34
import org.gvsig.fmap.dal.feature.FeatureSet;
35
import org.gvsig.fmap.dal.feature.FeatureStore;
36
import org.gvsig.fmap.dal.feature.FeatureType;
37
import org.gvsig.tools.dispose.DisposableIterator;
38
import org.gvsig.tools.dispose.DisposeUtils;
39
import org.gvsig.tools.task.AbstractMonitorableTask;
40

  
41
/**
42
 * Default {@link ExporttoService} implementation.
43
 * 
44
 * @author gvSIG Team
45
 * @version $Id$
46
 */
47
public class DefaultExporttoService extends AbstractMonitorableTask implements ExporttoService {
48

  
49
    private DataServerExplorer dataServerExplorer;   
50
    private NewDataStoreParameters newDataStoreParameters;
51

  
52
    private ExporttoServiceFinishAction exporttoServiceFinishAction;
53

  
54
    /**
55
     * {@link DefaultExporttoService} constructor 
56

  
57
     */
58
    public DefaultExporttoService(DataServerExplorer dataServerExplorer,       
59
        NewDataStoreParameters newDataStoreParameters) { 
60
        super("Exportto"); 
61
        this.dataServerExplorer = dataServerExplorer;
62
        this.newDataStoreParameters = newDataStoreParameters;
63
    }
64

  
65
    public void export(FeatureStore featureStore, IProjection projection,
66
        FeatureSet featureSet) throws ExporttoServiceException {
67
        // TODO Auto-generated method stub
68

  
69
    }
70
    public void export(FeatureSet featureSet) throws ExporttoServiceException {
71

  
72
        String providerName = newDataStoreParameters.getDataStoreName();
73
        String explorerName = dataServerExplorer.getProviderName();
74

  
75
        DisposableIterator it = null;
76
        FeatureStore target = null;
77
        try {
78
            taskStatus.setRangeOfValues(0, featureSet.getSize());
79

  
80
            DataManager dataManager = DALLocator.getDataManager();           
81

  
82
            dataManager.newStore(explorerName, providerName, newDataStoreParameters, true);
83
            target = (FeatureStore) dataManager.openStore(providerName, newDataStoreParameters);
84

  
85
            FeatureType targetType = target.getDefaultFeatureType();
86

  
87
            target.edit(FeatureStore.MODE_APPEND);
88
            it = featureSet.fastIterator();
89

  
90
            long featureCount = 0;
91
            while (it.hasNext()) {
92
                Feature feature = (Feature) it.next();
93
                target.insert(target.createNewFeature(targetType, feature));
94

  
95
                featureCount++;  
96
                this.taskStatus.setCurValue(featureCount);
97

  
98
                if (this.taskStatus.isCancellationRequested()) {
99
                    return;
100
                }
101
            }
102
            target.finishEditing();       
103

  
104
            this.taskStatus.terminate();
105
            this.taskStatus.remove();
106
        } catch (Exception e) {
107
            throw  new ExporttoServiceException(e);
108
        } finally{
109
            if (target != null){
110
                target.dispose();
111
            }
112
            if (it != null){
113
                it.dispose();
114
            }
115
            if (featureSet != null){
116
                featureSet.dispose();
117
            }
118
            DisposeUtils.dispose(it);
119
        }
120

  
121
        if (exporttoServiceFinishAction != null){         
122
            exporttoServiceFinishAction.finished(newDataStoreParameters.getDataStoreName(), newDataStoreParameters);
123
        }
124
    }
125

  
126
    public void setFinishAction(
127
        ExporttoServiceFinishAction exporttoServiceFinishAction) {
128
        this.exporttoServiceFinishAction = exporttoServiceFinishAction;        
129
    }
130

  
131
}
0 132

  
tags/v2_0_0_Build_2042/libraries/org.gvsig.exportto/org.gvsig.exportto.lib/org.gvsig.exportto.lib.impl/src/test/java/org/gvsig/exportto/impl/DefaultExporttoManagerTest.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
package org.gvsig.exportto.impl;
23

  
24
import org.gvsig.exportto.ExporttoManager;
25
import org.gvsig.exportto.ExporttoManagerTest;
26

  
27
/**
28
 * {@link ExporttoManager} API compatibility tests for the
29
 * {@link DefaultExporttoManager} implementation.
30
 * 
31
 * @author gvSIG Team
32
 * @version $Id$
33
 */
34
public class DefaultExporttoManagerTest extends ExporttoManagerTest {
35

  
36
    // Nothing to add
37
}
0 38

  
tags/v2_0_0_Build_2042/libraries/org.gvsig.exportto/org.gvsig.exportto.lib/org.gvsig.exportto.lib.impl/src/test/resources/README.txt
1
Put into this folder the resources needed by your test classes.
2

  
3
This folder is added to the Tests classpath, so you can load any resources 
4
through the ClassLoader.
5

  
6
By default, in this folder you can find an example of log4j configuration,
7
prepared to log messages through the console, so logging works when you
8
run your tests classes.
0 9

  
tags/v2_0_0_Build_2042/libraries/org.gvsig.exportto/org.gvsig.exportto.lib/org.gvsig.exportto.lib.impl/src/test/resources/log4j.xml
1
<?xml version="1.0" encoding="ISO-8859-1" ?>
2
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
3

  
4
<!-- 
5
Log4J configuration file for unit tests execution.
6
 -->
7
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
8

  
9
	<!-- Appender configuration to show logging messages through the console -->
10
	<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
11
		<layout class="org.apache.log4j.PatternLayout">
12
			<param name="ConversionPattern" value="%d{HH:mm:ss,SSS} %-5p [%c{2}.%M()]\n  %m%n" />
13
		</layout>
14
	</appender>
15

  
16
	<!-- 
17
	Activate logging messages of DEBUG level of higher only for the
18
	org.gvsig.tools packages.
19
	You can put full classes names or packages instead, to configure
20
	logging for all the classes and subpackages of the package.
21
	-->
22
	<category name="org.gvsig.tools">
23
		<priority value="DEBUG" />
24
	</category>
25
	<category name="org.gvsig.exportto">
26
		<priority value="DEBUG" />
27
	</category>
28

  
29
	<!-- 
30
	By default, show only logging messages of INFO level or higher, 
31
	through the previously configured CONSOLE appender. 
32
	-->
33
	<root>
34
		<priority value="INFO" />
35
		<appender-ref ref="CONSOLE" />
36
	</root>
37
</log4j:configuration>
0 38

  
tags/v2_0_0_Build_2042/libraries/org.gvsig.exportto/org.gvsig.exportto.lib/org.gvsig.exportto.lib.impl/pom.xml
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
4
	<modelVersion>4.0.0</modelVersion>
5
	<artifactId>org.gvsig.exportto.lib.impl</artifactId>
6
	<packaging>jar</packaging>
7
	<name>org.gvsig.exportto.lib.impl</name>
8
	<parent>
9
		<groupId>org.gvsig</groupId>
10
		<artifactId>org.gvsig.exportto.lib</artifactId>
11
		<version>1.0.0-SNAPSHOT</version>
12
	</parent>
13
	<dependencies>
14
		<dependency>
15
			<groupId>org.gvsig</groupId>
16
			<artifactId>org.gvsig.exportto.lib.api</artifactId>
17
			<version>1.0.0-SNAPSHOT</version>
18
		</dependency>
19
		<dependency>
20
			<groupId>org.gvsig</groupId>
21
			<artifactId>org.gvsig.exportto.lib.api</artifactId>
22
			<version>1.0.0-SNAPSHOT</version>
23
			<type>test-jar</type>
24
			<scope>test</scope>
25
		</dependency>
26
		<dependency>
27
            <groupId>org.gvsig</groupId>
28
            <artifactId>org.gvsig.tools.lib</artifactId>
29
            <scope>compile</scope>
30
        </dependency>
31
        <dependency>
32
            <groupId>org.gvsig</groupId>
33
            <artifactId>org.gvsig.metadata.lib.basic.api</artifactId>
34
            <scope>compile</scope>
35
        </dependency>
36
        <dependency>
37
            <groupId>org.gvsig</groupId>
38
            <artifactId>org.gvsig.fmap.dal</artifactId>    
39
            <scope>compile</scope>        
40
        </dependency>
41
        <dependency>
42
            <groupId>org.gvsig</groupId>
43
            <artifactId>org.gvsig.projection</artifactId>
44
            <scope>compile</scope>
45
        </dependency>
46
        <dependency>
47
            <groupId>org.gvsig</groupId>
48
            <artifactId>org.gvsig.projection</artifactId>  
49
            <classifier>cresques-impl</classifier>
50
            <scope>runtime</scope>      
51
        </dependency>   
52
        <dependency>
53
            <groupId>org.gvsig</groupId>
54
            <artifactId>org.gvsig.fmap.geometry</artifactId>            
55
            <classifier>impl</classifier>
56
            <scope>runtime</scope>      
57
        </dependency>
58
        <dependency>
59
            <groupId>org.gvsig</groupId>
60
            <artifactId>org.gvsig.fmap.geometry</artifactId>
61
            <classifier>operation</classifier>      
62
            <scope>runtime</scope>
63
        </dependency>  
64
        <dependency>
65
            <groupId>org.gvsig</groupId>
66
            <artifactId>org.gvsig.fmap.dal</artifactId>         
67
            <classifier>impl</classifier>
68
            <scope>runtime</scope>
69
        </dependency> 
70
         <dependency>
71
            <groupId>org.gvsig</groupId>
72
            <artifactId>org.gvsig.fmap.dal.file</artifactId>           
73
            <scope>test</scope>
74
        </dependency>  
75
         <dependency>
76
            <groupId>org.gvsig</groupId>
77
            <artifactId>org.gvsig.fmap.dal.file</artifactId>
78
            <classifier>store.dbf</classifier>
79
            <scope>test</scope>
80
        </dependency>  
81
        <dependency>
82
            <groupId>org.gvsig</groupId>
83
            <artifactId>org.gvsig.fmap.dal.file</artifactId>
84
            <classifier>store.dbf</classifier>
85
            <scope>test</scope>
86
        </dependency>  
87
         <dependency>
88
            <groupId>org.gvsig</groupId>
89
            <artifactId>org.gvsig.fmap.dal.file</artifactId>
90
            <classifier>store.shp</classifier>
91
            <scope>test</scope>
92
        </dependency>  
93
         <dependency>
94
            <groupId>org.gvsig</groupId>
95
            <artifactId>org.gvsig.symbology.lib.impl</artifactId>           
96
            <scope>test</scope>
97
        </dependency>           
98
        <dependency>
99
            <groupId>org.gvsig</groupId>
100
            <artifactId>org.gvsig.fmap.dal</artifactId>
101
            <classifier>spi</classifier>
102
            <scope>runtime</scope>      
103
        </dependency> 
104
        <dependency>
105
            <groupId>org.gvsig</groupId>
106
            <artifactId>org.gvsig.compat</artifactId>           
107
            <classifier>se</classifier>     
108
            <scope>runtime</scope>      
109
        </dependency>   
110
	</dependencies>
111
	<build>
112
		<plugins>
113
			<!-- TODO: MAKE TESTS WORK AND REMOVE THIS OPTION -->
114
			<plugin>
115
				<groupId>org.apache.maven.plugins</groupId>
116
				<artifactId>maven-surefire-plugin</artifactId>
117
				<configuration>
118
                    <excludes>
119
                        <exclude>**/**</exclude>
120
                    </excludes>
121
				</configuration>
122
			</plugin>		
123
		</plugins>
124
	</build>
125
</project>
0 126

  
tags/v2_0_0_Build_2042/libraries/org.gvsig.exportto/org.gvsig.exportto.lib/org.gvsig.exportto.lib.api/src/test/java/org/gvsig/exportto/ExporttoManagerTest.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
package org.gvsig.exportto;
23

  
24
import org.gvsig.fmap.dal.DALLocator;
25
import org.gvsig.fmap.dal.DataManager;
26
import org.gvsig.fmap.dal.DataServerExplorer;
27
import org.gvsig.fmap.dal.DataServerExplorerParameters;
28
import org.gvsig.fmap.dal.NewDataStoreParameters;
29
import org.gvsig.fmap.dal.exception.DataException;
30
import org.gvsig.fmap.dal.exception.ValidateDataParametersException;
31
import org.gvsig.tools.junit.AbstractLibraryAutoInitTestCase;
32

  
33
/**
34
 * API compatibility tests for {@link ExporttoManager} implementations.
35
 * 
36
 * @author gvSIG Team
37
 * @version $Id$
38
 */
39
public abstract class ExporttoManagerTest extends
40
    AbstractLibraryAutoInitTestCase {
41

  
42
    protected ExporttoManager manager;
43
    protected DataManager dataManager = null;
44
    
45
    @Override
46
    protected void doSetUp() throws Exception {
47
        manager = ExporttoLocator.getManager();
48
        dataManager = DALLocator.getDataManager();
49
    }
50

  
51
    /**
52
     * Test for the {@link ExporttoManager#getExporttoService()}
53
     * method.
54
     * 
55
     * @throws Exception
56
     *             if there is any error in the tests
57
     */
58
    public void testGetExporttoService() throws Exception {
59
        ExporttoService exportService;
60
        try {
61
            exportService = createService();
62
            assertNotNull(exportService);
63
        } catch (ValidateDataParametersException e) {
64
           assertNull(e);
65
        } catch (DataException e) {
66
            assertNull(e);
67
        }       
68
    }
69
    
70
    protected ExporttoService createService() throws ValidateDataParametersException, DataException{
71
        DataServerExplorerParameters dataServerExplorerParameters = 
72
            dataManager.createServerExplorerParameters("FilesystemExplorer");
73
        DataServerExplorer dataServerExplorer =
74
            dataManager.openServerExplorer("FilesystemExplorer", dataServerExplorerParameters);
75
        NewDataStoreParameters newDataStoreParameters = dataServerExplorer.getAddParameters("Shape");      
76
        return manager.getExporttoService(dataServerExplorer, newDataStoreParameters);       
77
    }
78

  
79
}
0 80

  
tags/v2_0_0_Build_2042/libraries/org.gvsig.exportto/org.gvsig.exportto.lib/org.gvsig.exportto.lib.api/src/test/java/org/gvsig/exportto/ExporttoServiceTest.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
package org.gvsig.exportto;
23

  
24
import org.gvsig.fmap.dal.DALLocator;
25
import org.gvsig.fmap.dal.DataManager;
26
import org.gvsig.fmap.dal.DataServerExplorer;
27
import org.gvsig.fmap.dal.DataServerExplorerParameters;
28
import org.gvsig.fmap.dal.DataStoreParameters;
29
import org.gvsig.fmap.dal.NewDataStoreParameters;
30
import org.gvsig.fmap.dal.exception.DataException;
31
import org.gvsig.fmap.dal.exception.ValidateDataParametersException;
32
import org.gvsig.fmap.dal.feature.FeatureStore;
33
import org.gvsig.tools.junit.AbstractLibraryAutoInitTestCase;
34

  
35
/**
36
 * API compatibility tests for {@link ExporttoService} implementations.
37
 * 
38
 * @author gvSIG Team
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff