Index: tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/pom.xml
===================================================================
--- tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/pom.xml	(revision 0)
+++ tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/pom.xml	(revision 38363)
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>org.gvsig.personaldb</artifactId>
+    <packaging>pom</packaging>
+    <version>1.0.0-SNAPSHOT</version>
+    <name>org.gvsig.personaldb</name>
+    <description>PersonalDB example project</description>
+    <parent>
+        <groupId>org.gvsig</groupId>
+        <artifactId>org.gvsig.maven.base.pom</artifactId>
+        <version>1.0.8-SNAPSHOT</version>
+    </parent>
+    <scm>
+        <connection>scm:svn:https://devel.gvsig.org/svn/gvsig-desktop/branches/v2_0_0_prep/libraries/org.gvsig.personaldb</connection>
+        <developerConnection>scm:svn:https://devel.gvsig.org/svn/gvsig-desktop/branches/v2_0_0_prep/libraries/org.gvsig.personaldb</developerConnection>
+        <url>https://devel.gvsig.org/redmine/projects/gvsig-desktop/repository/show/branches/v2_0_0_prep/libraries/org.gvsig.personaldb</url>
+    </scm>
+    <developers>
+        <developer>
+            <id>jjdelcerro</id>
+            <name>Joaqu�n Jos� del Cerro</name>
+            <email>jjdelcerro@gvsig.com</email>
+            <roles>
+                <role>Architect</role>
+            </roles>
+        </developer>
+        <developer>
+            <id>cordinyana</id>
+            <name>C�sar Ordi�ana Navarro</name>
+            <email>cordinyana@gvsig.com</email>
+            <roles>
+                <role>Architect</role>
+                <role>Developer</role>
+            </roles>
+        </developer>
+    </developers>
+    <repositories>
+        <repository>
+            <id>gvsig-public-http-repository</id>
+            <name>gvSIG maven public HTTP repository</name>
+            <url>http://devel.gvsig.org/m2repo/j2se</url>
+            <releases>
+                <enabled>true</enabled>
+                <updatePolicy>daily</updatePolicy>
+                <checksumPolicy>warn</checksumPolicy>
+            </releases>
+            <snapshots>
+                <enabled>true</enabled>
+                <updatePolicy>daily</updatePolicy>
+                <checksumPolicy>warn</checksumPolicy>
+            </snapshots>
+        </repository>
+    </repositories>
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.gvsig</groupId>
+                <artifactId>org.gvsig.core.maven.dependencies</artifactId>
+                <version>2.0.1-SNAPSHOT</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.tools.lib</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.tools.lib</artifactId>
+            <type>test-jar</type>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+    <modules>
+        <module>org.gvsig.personaldb.lib</module>
+        <module>org.gvsig.personaldb.main</module>
+    </modules>
+
+</project>
\ No newline at end of file
Index: tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/README.txt
===================================================================
--- tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/README.txt	(revision 0)
+++ tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/README.txt	(revision 38363)
@@ -0,0 +1,18 @@
+The first time you checkout the current project to a new workspace, 
+you have to prepare it to be able to work easily with maven from
+eclipse itself.
+
+Perform the following steps:
+
+1.- Launch the *prepare-workspace.xml* ant build file. 
+    You can do it by loading the file into the ant view, 
+    and running the default task, or right-clicking the 
+    file from the package explorer or the navigator and
+    select the option: *Run as > Ant build*. 
+    
+2.- Restart eclipse.
+
+3.- Import the subprojects of the project you have just checked out.
+
+Those steps are only needed once per workspace.     
+
Index: tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.main/pom.xml
===================================================================
--- tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.main/pom.xml	(revision 0)
+++ tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.main/pom.xml	(revision 38363)
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>org.gvsig.personaldb.main</artifactId>
+    <packaging>jar</packaging>
+    <name>org.gvsig.personaldb.main</name>
+    <parent>
+        <groupId>org.gvsig</groupId>
+        <artifactId>org.gvsig.personaldb</artifactId>
+        <version>1.0.0-SNAPSHOT</version>
+    </parent>
+    <dependencies>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.personaldb.lib.api</artifactId>
+            <version>1.0.0-SNAPSHOT</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.personaldb.lib.impl</artifactId>
+            <version>1.0.0-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.tools.lib</artifactId>
+            <scope>compile</scope>
+        </dependency>        
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.core.maven.dependencies</artifactId>
+            <version>2.0.1-SNAPSHOT</version>
+            <type>pom</type>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <scope>compile</scope>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>exec-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>exec</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <executable>java</executable>
+                    <arguments>
+                        <argument>-classpath</argument>
+                        <!-- automatically creates the classpath using all project 
+                            dependencies, also adding the project build directory -->
+                        <classpath />
+                        <argument>org.gvsig.personaldb.main.Main</argument>
+                    </arguments>
+                    <environmentVariables>
+                    </environmentVariables>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>
\ No newline at end of file
Index: tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.main/src/main/resources/log4j.xml
===================================================================
--- tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.main/src/main/resources/log4j.xml	(revision 0)
+++ tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.main/src/main/resources/log4j.xml	(revision 38363)
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- 
+Log4J configuration file for unit tests execution.
+ -->
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+
+	<!-- Appender configuration to show logging messages through the console -->
+	<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+		<layout class="org.apache.log4j.PatternLayout">
+			<param name="ConversionPattern" value="%d{HH:mm:ss,SSS} %-5p [%c{2}.%M()]\n  %m%n" />
+		</layout>
+	</appender>
+
+	<!-- 
+	Activate logging messages of DEBUG level of higher only for the
+	org.gvsig.tools packages.
+	You can put full classes names or packages instead, to configure
+	logging for all the classes and subpackages of the package.
+	-->
+	<category name="org.gvsig.tools">
+		<priority value="DEBUG" />
+	</category>
+	<category name="org.gvsig.personaldb">
+		<priority value="DEBUG" />
+	</category>
+
+	<!-- 
+	By default, show only logging messages of INFO level or higher, 
+	through the previously configured CONSOLE appender. 
+	-->
+	<root>
+		<priority value="INFO" />
+		<appender-ref ref="CONSOLE" />
+	</root>
+</log4j:configuration>
\ No newline at end of file
Index: tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.main/src/main/resources/README.txt
===================================================================
--- tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.main/src/main/resources/README.txt	(revision 0)
+++ tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.main/src/main/resources/README.txt	(revision 38363)
@@ -0,0 +1,8 @@
+Put into this folder the resources needed by your classes.
+
+This folder is added to the classpath, so you can load any resources 
+through the ClassLoader.
+
+By default, in this folder you can find an example of log4j configuration,
+prepared to log messages through the console, so logging works when you
+run your classes.
\ No newline at end of file
Index: tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.main/src/main/java/org/gvsig/personaldb/main/package.html
===================================================================
--- tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.main/src/main/java/org/gvsig/personaldb/main/package.html	(revision 0)
+++ tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.main/src/main/java/org/gvsig/personaldb/main/package.html	(revision 38363)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<title>org.gvsig.personaldb package documentation</title>
+</head>
+<body>
+
+	<p>PersonalDB library testing and demo application.</p>
+
+</body>
+</html>
\ No newline at end of file
Index: tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.main/src/main/java/org/gvsig/personaldb/main/Main.java
===================================================================
--- tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.main/src/main/java/org/gvsig/personaldb/main/Main.java	(revision 0)
+++ tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.main/src/main/java/org/gvsig/personaldb/main/Main.java	(revision 38363)
@@ -0,0 +1,68 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ * 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ */
+
+package org.gvsig.personaldb.main;
+
+import java.sql.Connection;
+import java.sql.DatabaseMetaData;
+import java.sql.SQLException;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.gvsig.personaldb.PersonalDBException;
+import org.gvsig.personaldb.PersonalDBLocator;
+import org.gvsig.personaldb.PersonalDBManager;
+import org.gvsig.tools.library.impl.DefaultLibrariesInitializer;
+
+/**
+ * Main executable class for testing the PersonalDB library.
+ * 
+ * @author gvSIG Team
+ * @version $Id$
+ */
+public class Main {
+
+    private static final Logger LOG = LoggerFactory.getLogger(Main.class);
+
+    public static void main(String args[]) {
+        Main main = new Main();
+        try {
+            main.show();
+        } catch (Throwable e) {
+            e.printStackTrace();
+            System.exit(-1);
+        }
+        System.exit(0);
+    }
+
+    public void show() throws PersonalDBException, SQLException {
+
+        new DefaultLibrariesInitializer().fullInitialize();
+        PersonalDBManager manager = PersonalDBLocator.getManager();
+
+        Connection connection = manager.getConnection();
+        DatabaseMetaData metadata = connection.getMetaData();
+        LOG.info("DatabaseMetadata: {}", metadata);
+    }
+
+}

Property changes on: tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.main
___________________________________________________________________
Added: svn:ignore
   + .settings
target
.classpath
.project


Index: tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/org.gvsig.personaldb.lib.impl/src/test/resources/README.txt
===================================================================
--- tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/org.gvsig.personaldb.lib.impl/src/test/resources/README.txt	(revision 0)
+++ tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/org.gvsig.personaldb.lib.impl/src/test/resources/README.txt	(revision 38363)
@@ -0,0 +1,8 @@
+Put into this folder the resources needed by your test classes.
+
+This folder is added to the Tests classpath, so you can load any resources 
+through the ClassLoader.
+
+By default, in this folder you can find an example of log4j configuration,
+prepared to log messages through the console, so logging works when you
+run your tests classes.
\ No newline at end of file
Index: tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/org.gvsig.personaldb.lib.impl/src/test/resources/log4j.xml
===================================================================
--- tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/org.gvsig.personaldb.lib.impl/src/test/resources/log4j.xml	(revision 0)
+++ tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/org.gvsig.personaldb.lib.impl/src/test/resources/log4j.xml	(revision 38363)
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- 
+Log4J configuration file for unit tests execution.
+ -->
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+
+	<!-- Appender configuration to show logging messages through the console -->
+	<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+		<layout class="org.apache.log4j.PatternLayout">
+			<param name="ConversionPattern" value="%d{HH:mm:ss,SSS} %-5p [%c{2}.%M()]\n  %m%n" />
+		</layout>
+	</appender>
+
+	<!-- 
+	Activate logging messages of DEBUG level of higher only for the
+	org.gvsig.tools packages.
+	You can put full classes names or packages instead, to configure
+	logging for all the classes and subpackages of the package.
+	-->
+	<category name="org.gvsig.tools">
+		<priority value="DEBUG" />
+	</category>
+	<category name="org.gvsig.personaldb">
+		<priority value="DEBUG" />
+	</category>
+
+	<!-- 
+	By default, show only logging messages of INFO level or higher, 
+	through the previously configured CONSOLE appender. 
+	-->
+	<root>
+		<priority value="INFO" />
+		<appender-ref ref="CONSOLE" />
+	</root>
+</log4j:configuration>
\ No newline at end of file
Index: tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/org.gvsig.personaldb.lib.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/org.gvsig.personaldb.lib.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/org.gvsig.personaldb.lib.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 38363)
@@ -0,0 +1 @@
+org.gvsig.personaldb.impl.PersonalDBDefaultImplLibrary
Index: tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/org.gvsig.personaldb.lib.impl/src/main/java/org/gvsig/personaldb/impl/package.html
===================================================================
--- tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/org.gvsig.personaldb.lib.impl/src/main/java/org/gvsig/personaldb/impl/package.html	(revision 0)
+++ tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/org.gvsig.personaldb.lib.impl/src/main/java/org/gvsig/personaldb/impl/package.html	(revision 38363)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<title>org.gvsig.personaldb package documentation</title>
+</head>
+<body>
+
+	<p>PersonalDB library API default implementation.</p>
+
+</body>
+</html>
\ No newline at end of file
Index: tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/org.gvsig.personaldb.lib.impl/src/main/java/org/gvsig/personaldb/impl/PersonalDBDefaultImplLibrary.java
===================================================================
--- tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/org.gvsig.personaldb.lib.impl/src/main/java/org/gvsig/personaldb/impl/PersonalDBDefaultImplLibrary.java	(revision 0)
+++ tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/org.gvsig.personaldb.lib.impl/src/main/java/org/gvsig/personaldb/impl/PersonalDBDefaultImplLibrary.java	(revision 38363)
@@ -0,0 +1,72 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.personaldb.impl;
+
+import org.gvsig.fmap.dal.store.jdbc.JDBCLibrary;
+import org.gvsig.fmap.dal.store.jdbc.JDBCResourceParameters;
+import org.gvsig.personaldb.PersonalDBLibrary;
+import org.gvsig.personaldb.PersonalDBLocator;
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.LibraryException;
+
+/**
+ * Library for default implementation initialization and configuration.
+ * 
+ * @author gvSIG team
+ * @version $Id$
+ */
+public class PersonalDBDefaultImplLibrary extends AbstractLibrary {
+
+    @Override
+    public void doRegistration() {
+        registerAsImplementationOf(PersonalDBLibrary.class);
+        require(JDBCLibrary.class);
+    }
+
+    @Override
+    protected void doInitialize() throws LibraryException {
+        PersonalDBLocator.registerManager(DefaultPersonalDBManager.class);
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+        if (PersonalDBLocator.getManager() instanceof DefaultPersonalDBManager) {
+
+            String databasePath =
+                System.getProperty("personalDBPath", "~/.gvsig-personaldb");
+            String databasePort = System.getProperty("personalDBPort");
+
+            String personalDBURL =
+                databasePort == null ? "jdbc:h2:" + databasePath
+                    : "jdbc:h2:tcp://localhost:" + databasePort + "/"
+                        + databasePath;
+
+            JDBCResourceParameters parameters = new JDBCResourceParameters();
+            parameters.setJDBCDriverClassName("org.h2.Driver");
+            parameters.setUrl(personalDBURL);
+
+            ((DefaultPersonalDBManager) PersonalDBLocator.getManager())
+                .open(parameters);
+        }
+    }
+
+}
Index: tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/org.gvsig.personaldb.lib.impl/src/main/java/org/gvsig/personaldb/impl/DefaultPersonalDBManager.java
===================================================================
--- tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/org.gvsig.personaldb.lib.impl/src/main/java/org/gvsig/personaldb/impl/DefaultPersonalDBManager.java	(revision 0)
+++ tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/org.gvsig.personaldb.lib.impl/src/main/java/org/gvsig/personaldb/impl/DefaultPersonalDBManager.java	(revision 38363)
@@ -0,0 +1,201 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.personaldb.impl;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+
+import javax.sql.DataSource;
+
+import org.apache.commons.dbcp.BasicDataSource;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.gvsig.fmap.dal.DALLocator;
+import org.gvsig.fmap.dal.DataServerExplorerParameters;
+import org.gvsig.fmap.dal.DataStoreParameters;
+import org.gvsig.fmap.dal.exception.InitializeException;
+import org.gvsig.fmap.dal.exception.ProviderNotRegisteredException;
+import org.gvsig.fmap.dal.store.jdbc.JDBCResourceParameters;
+import org.gvsig.fmap.dal.store.jdbc.JDBCServerExplorer;
+import org.gvsig.fmap.dal.store.jdbc.JDBCServerExplorerParameters;
+import org.gvsig.fmap.dal.store.jdbc.JDBCStoreParameters;
+import org.gvsig.fmap.dal.store.jdbc.JDBCStoreProvider;
+import org.gvsig.personaldb.DBAccessException;
+import org.gvsig.personaldb.DataServerExplorerParametersException;
+import org.gvsig.personaldb.PersonalDBException;
+import org.gvsig.personaldb.PersonalDBManager;
+import org.gvsig.tools.dispose.impl.AbstractDisposable;
+import org.gvsig.tools.exception.BaseException;
+
+/**
+ * Default {@link PersonalDBManager} implementation.
+ * 
+ * @author gvSIG Team
+ * @version $Id$
+ */
+public class DefaultPersonalDBManager extends AbstractDisposable implements
+    PersonalDBManager {
+
+    private static final Logger LOG = LoggerFactory
+        .getLogger(DefaultPersonalDBManager.class);
+
+    private BasicDataSource dataSource;
+    private JDBCResourceParameters resourceParameters;
+
+    public Connection getConnection() throws PersonalDBException {
+
+        try {
+            return getDataSource().getConnection();
+        } catch (SQLException e) {
+            throw new DBAccessException(resourceParameters, e);
+        }
+    }
+
+    private synchronized DataSource getDataSource() {
+
+        if (dataSource == null) {
+            dataSource = new BasicDataSource();
+            dataSource.setDriverClassName(resourceParameters
+                .getJDBCDriverClassName());
+            dataSource.setUsername(resourceParameters.getUser());
+            dataSource.setPassword(resourceParameters.getPassword());
+            dataSource.setUrl(resourceParameters.getUrl());
+
+            dataSource.setMaxWait(60L * 1000); // FIXME
+
+            dataSource.setMaxActive(20);
+            dataSource.setMaxIdle(4);
+            dataSource.setMinIdle(1);
+            dataSource.setInitialSize(1);
+
+            // FIXME Set Pool parameters:
+            /*
+             * dataSource.setMaxOpenPreparedStatements(maxActive);
+             * dataSource.setMaxWait(maxActive);
+             * dataSource.setDefaultReadOnly(defaultReadOnly);
+             * dataSource.setDefaultTransactionIsolation(defaultTransactionIsolation
+             * )
+             * ;
+             * dataSource.setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis
+             * );
+             * dataSource.setTestOnBorrow(testOnBorrow);
+             * dataSource.setTestOnReturn(testOnReturn);
+             * dataSource.setTestWhileIdle(testOnReturn);
+             * dataSource
+             * .setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis);
+             * 
+             * dataSource.setAccessToUnderlyingConnectionAllowed(allow);
+             * dataSource.setLoginTimeout(seconds);
+             * dataSource.setLogWriter(out);
+             */
+        }
+
+        return dataSource;
+    }
+
+    public DataStoreParameters getDataStoreParameters()
+        throws PersonalDBException {
+
+        return getJDBCStoreParameters();
+    }
+
+    public DataStoreParameters getDataStoreParameters(String schema,
+        String table) throws PersonalDBException {
+
+        JDBCStoreParameters params = getJDBCStoreParameters();
+        params.setSchema(schema);
+        params.setTable(table);
+        return params;
+    }
+
+    private JDBCStoreParameters getJDBCStoreParameters()
+        throws PersonalDBException {
+        try {
+            JDBCStoreParameters params =
+                (JDBCStoreParameters) DALLocator.getDataManager()
+                    .createStoreParameters(JDBCStoreProvider.NAME);
+
+            params.setUrl(resourceParameters.getUrl());
+            params.setJDBCDriverClassName(resourceParameters
+                .getJDBCDriverClassName());
+
+            return params;
+        } catch (InitializeException e) {
+            throw new DataServerExplorerParametersException(
+                JDBCServerExplorer.NAME, e);
+        } catch (ProviderNotRegisteredException e) {
+            throw new DataServerExplorerParametersException(
+                JDBCServerExplorer.NAME, e);
+        }
+    }
+
+    public DataServerExplorerParameters getDataServerExplorerParameters()
+        throws PersonalDBException {
+        return getJDBCServerExplorerParameters();
+    }
+
+    public DataServerExplorerParameters getDataServerExplorerParameters(
+        String schema) throws PersonalDBException {
+        JDBCServerExplorerParameters params = getJDBCServerExplorerParameters();
+        params.setSchema(schema);
+        return params;
+    }
+
+    private JDBCServerExplorerParameters getJDBCServerExplorerParameters()
+        throws PersonalDBException {
+        try {
+            JDBCServerExplorerParameters params =
+                (JDBCServerExplorerParameters) DALLocator.getDataManager()
+                    .createServerExplorerParameters(JDBCServerExplorer.NAME);
+
+            params.setUrl(resourceParameters.getUrl());
+            params.setJDBCDriverClassName(resourceParameters
+                .getJDBCDriverClassName());
+
+            return params;
+        } catch (InitializeException e) {
+            throw new DataServerExplorerParametersException(
+                JDBCServerExplorer.NAME, e);
+        } catch (ProviderNotRegisteredException e) {
+            throw new DataServerExplorerParametersException(
+                JDBCServerExplorer.NAME, e);
+        }
+    }
+
+    public void open(JDBCResourceParameters resourceParameters) {
+        LOG.debug(
+            "Creating connection to personal database with parameters: {}",
+            resourceParameters);
+
+        this.resourceParameters = resourceParameters;
+    }
+
+    @Override
+    protected void doDispose() throws BaseException {
+        try {
+            dataSource.close();
+        } catch (SQLException e) {
+            throw new DBAccessException(resourceParameters, e);
+        }
+    }
+}
Index: tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/org.gvsig.personaldb.lib.impl/pom.xml
===================================================================
--- tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/org.gvsig.personaldb.lib.impl/pom.xml	(revision 0)
+++ tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/org.gvsig.personaldb.lib.impl/pom.xml	(revision 38363)
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>org.gvsig.personaldb.lib.impl</artifactId>
+    <packaging>jar</packaging>
+    <name>org.gvsig.personaldb.lib.impl</name>
+    <parent>
+        <groupId>org.gvsig</groupId>
+        <artifactId>org.gvsig.personaldb.lib</artifactId>
+        <version>1.0.0-SNAPSHOT</version>
+    </parent>
+    <dependencies>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.tools.lib</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.personaldb.lib.api</artifactId>
+            <version>1.0.0-SNAPSHOT</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.personaldb.lib.api</artifactId>
+            <version>1.0.0-SNAPSHOT</version>
+            <type>test-jar</type>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.dal</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.dal</artifactId>
+            <classifier>spi</classifier>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.dal.db</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.dal.db</artifactId>
+            <classifier>store.jdbc</classifier>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>commons-dbcp</groupId>
+            <artifactId>commons-dbcp</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.h2database</groupId>
+            <artifactId>h2</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.core.maven.dependencies</artifactId>
+            <version>2.0.1-SNAPSHOT</version>
+            <type>pom</type>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <scope>compile</scope>
+        </dependency>
+    </dependencies>
+</project>

Property changes on: tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/org.gvsig.personaldb.lib.impl
___________________________________________________________________
Added: svn:ignore
   + .settings
target
.classpath
.project


Index: tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/org.gvsig.personaldb.lib.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/org.gvsig.personaldb.lib.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/org.gvsig.personaldb.lib.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 38363)
@@ -0,0 +1 @@
+org.gvsig.personaldb.PersonalDBLibrary
\ No newline at end of file
Index: tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/org.gvsig.personaldb.lib.api/src/main/java/org/gvsig/personaldb/DataServerExplorerParametersException.java
===================================================================
--- tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/org.gvsig.personaldb.lib.api/src/main/java/org/gvsig/personaldb/DataServerExplorerParametersException.java	(revision 0)
+++ tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/org.gvsig.personaldb.lib.api/src/main/java/org/gvsig/personaldb/DataServerExplorerParametersException.java	(revision 38363)
@@ -0,0 +1,50 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.personaldb;
+
+
+/**
+ * Exception thrown when there is an error creating a connection to the
+ * personal database.
+ * 
+ * @author gvSIG Team
+ * @version $Id$
+ */
+public class DataServerExplorerParametersException extends PersonalDBException {
+
+    private static final long serialVersionUID = 8918999379397938916L;
+
+    private final static String MESSAGE_FORMAT =
+        "Error creating a DataServerExplorerParameters for the personal "
+            + "database of the type: %(name)";
+    private final static String MESSAGE_KEY =
+        "_DataServerExplorerParametersException";
+
+    /**
+     * Constructor with a message and a cause
+     */
+    public DataServerExplorerParametersException(String name,
+        Throwable cause) {
+        super(MESSAGE_FORMAT, cause, MESSAGE_KEY, serialVersionUID);
+        setValue("name", name);
+    }
+}
Index: tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/org.gvsig.personaldb.lib.api/src/main/java/org/gvsig/personaldb/PersonalDBManager.java
===================================================================
--- tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/org.gvsig.personaldb.lib.api/src/main/java/org/gvsig/personaldb/PersonalDBManager.java	(revision 0)
+++ tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/org.gvsig.personaldb.lib.api/src/main/java/org/gvsig/personaldb/PersonalDBManager.java	(revision 38363)
@@ -0,0 +1,109 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.personaldb;
+
+import java.sql.Connection;
+
+import org.gvsig.fmap.dal.DataParameters;
+import org.gvsig.fmap.dal.DataServerExplorerParameters;
+import org.gvsig.fmap.dal.DataStoreParameters;
+
+/**
+ * This class is responsible of the management of the library's business logic.
+ * It is the library's main entry point, and provides all the services to manage
+ * {@link Connection}s and {@link DataParameters} to connect to the personal
+ * database.
+ * 
+ * @see PersonalDBService
+ * @author gvSIG team
+ * @version $Id$
+ */
+public interface PersonalDBManager {
+
+    /**
+     * Returns a {@link Connection} the personal database.
+     * 
+     * @return a connection to the personal database
+     * @throws PersonalDBException
+     *             if there is an error getting the connection
+     */
+    public Connection getConnection() throws PersonalDBException;
+
+    /**
+     * Returns a {@link DataStoreParameters} to connect to the personal database
+     * through the DAL library.
+     * 
+     * @return the DAL data store parameters to connect to connect to the
+     *         database
+     * @throws PersonalDBException
+     *             if there is an error creating the parameters
+     */
+    public DataStoreParameters getDataStoreParameters()
+        throws PersonalDBException;
+
+    /**
+     * Returns a {@link DataStoreParameters} to connect to the personal database
+     * through the DAL library.
+     * 
+     * @param schema
+     *            the schema of the table to load data from
+     * @param table
+     *            the name of the table to load data from
+     * @return the DAL data store parameters to connect to connect to the
+     *         database
+     * @throws PersonalDBException
+     *             if there is an error creating the parameters
+     */
+    public DataStoreParameters getDataStoreParameters(String schema,
+        String table) throws PersonalDBException;
+
+    /**
+     * Returns a {@link DataServerExplorerParameters} to connect to the personal
+     * database
+     * through the DAL library.
+     * 
+     * @return the DAL data server explorer parameters to connect to connect to
+     *         the
+     *         database
+     * @throws PersonalDBException
+     *             if there is an error creating the parameters
+     */
+    public DataServerExplorerParameters getDataServerExplorerParameters()
+        throws PersonalDBException;
+
+    /**
+     * Returns a {@link DataServerExplorerParameters} to connect to the personal
+     * database
+     * through the DAL library.
+     * 
+     * @param schema
+     *            the schema of the database to connect to
+     * @return the DAL data server explorer parameters to connect to connect to
+     *         the
+     *         database
+     * @throws PersonalDBException
+     *             if there is an error creating the parameters
+     */
+    public DataServerExplorerParameters getDataServerExplorerParameters(
+        String schema) throws PersonalDBException;
+
+}
Index: tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/org.gvsig.personaldb.lib.api/src/main/java/org/gvsig/personaldb/DBAccessException.java
===================================================================
--- tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/org.gvsig.personaldb.lib.api/src/main/java/org/gvsig/personaldb/DBAccessException.java	(revision 0)
+++ tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/org.gvsig.personaldb.lib.api/src/main/java/org/gvsig/personaldb/DBAccessException.java	(revision 38363)
@@ -0,0 +1,48 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.personaldb;
+
+import org.gvsig.fmap.dal.DataParameters;
+
+/**
+ * Exception thrown when there is an error creating a connection to the
+ * personal database.
+ * 
+ * @author gvSIG Team
+ * @version $Id$
+ */
+public class DBAccessException extends PersonalDBException {
+
+    private static final long serialVersionUID = 8918999379397938916L;
+
+    private final static String MESSAGE_FORMAT =
+        "Access error to a database whose parameters are: %(parameters)";
+    private final static String MESSAGE_KEY = "_DBAccessException";
+
+    /**
+     * Constructor with a message and a cause
+     */
+    public DBAccessException(DataParameters parameters, Throwable cause) {
+        super(MESSAGE_FORMAT, cause, MESSAGE_KEY, serialVersionUID);
+        setValue("parameters", parameters.toString());
+    }
+}
Index: tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/org.gvsig.personaldb.lib.api/src/main/java/org/gvsig/personaldb/PersonalDBException.java
===================================================================
--- tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/org.gvsig.personaldb.lib.api/src/main/java/org/gvsig/personaldb/PersonalDBException.java	(revision 0)
+++ tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/org.gvsig.personaldb.lib.api/src/main/java/org/gvsig/personaldb/PersonalDBException.java	(revision 38363)
@@ -0,0 +1,95 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.personaldb;
+
+import org.gvsig.tools.exception.BaseException;
+
+/**
+ * Generic exception thrown in the PersonalDB API when the exception or error
+ * may be dealt by the program or the user of the program which is a client of
+ * the PersonalDB API.
+ * 
+ * @see {@link PersonalDBManager}
+ * @author gvSIG team.
+ * @version $Id$
+ */
+public class PersonalDBException extends BaseException {
+
+    private static final long serialVersionUID = 6756475060924237176L;
+
+    private static final String MESSAGE =
+        "An error has been produced in the PersonalDB library";
+
+    private static final String KEY = "_PersonalDBException";
+
+    /**
+     * Constructor to be used in rare cases, usually you must create a new child
+     * exception class for each case.
+     * <strong>Don't use this constructor in child classes.</strong>
+     */
+    public PersonalDBException() {
+        super(MESSAGE, KEY, serialVersionUID);
+    }
+
+    /**
+     * Constructor to be used in rare cases, usually you must create a new child
+     * exception class for each case.
+     * <p>
+     * <strong>Don't use this constructor in child classes.</strong>
+     * </p>
+     * 
+     * @param cause
+     *            the original cause of the exception
+     */
+    public PersonalDBException(Exception cause) {
+        super(MESSAGE, cause, KEY, serialVersionUID);
+    }
+
+    /**
+     * @see BaseException#BaseException(String, String, long).
+     * @param message
+     *            the default messageFormat to describe the exception
+     * @param key
+     *            the key to use to search a localized messageFormnata
+     * @param code
+     *            the unique code to identify the exception
+     */
+    protected PersonalDBException(String message, String key, long code) {
+        super(message, key, code);
+    }
+
+    /**
+     * @see BaseException#BaseException(String, Throwable, String, long).
+     * @param message
+     *            the default messageFormat to describe the exception
+     * @param cause
+     *            the original cause of the exception
+     * @param key
+     *            the key to use to search a localized messageFormnata
+     * @param code
+     *            the unique code to identify the exception
+     */
+    protected PersonalDBException(String message, Throwable cause,
+        String key, long code) {
+        super(message, cause, key, code);
+    }
+}
Index: tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/org.gvsig.personaldb.lib.api/src/main/java/org/gvsig/personaldb/PersonalDBLocator.java
===================================================================
--- tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/org.gvsig.personaldb.lib.api/src/main/java/org/gvsig/personaldb/PersonalDBLocator.java	(revision 0)
+++ tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/org.gvsig.personaldb.lib.api/src/main/java/org/gvsig/personaldb/PersonalDBLocator.java	(revision 38363)
@@ -0,0 +1,98 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.personaldb;
+
+import org.gvsig.tools.locator.BaseLocator;
+import org.gvsig.tools.locator.Locator;
+import org.gvsig.tools.locator.LocatorException;
+
+/**
+ * This locator is the entry point for the PersonalDB library, providing
+ * access to all PersonalDB services through the {@link PersonalDBManager}
+ * .
+ * 
+ * @author gvSIG team
+ * @version $Id$
+ */
+public class PersonalDBLocator extends BaseLocator {
+
+    /**
+     * PersonalDB manager name.
+     */
+    public static final String MANAGER_NAME = "PersonalDB.manager";
+
+    /**
+     * PersonalDB manager description.
+     */
+    public static final String MANAGER_DESCRIPTION = "PersonalDB Manager";
+
+    private static final String LOCATOR_NAME = "PersonalDB.locator";
+
+    /**
+     * Unique instance.
+     */
+    private static final PersonalDBLocator INSTANCE =
+        new PersonalDBLocator();
+
+    /**
+     * Return the singleton instance.
+     * 
+     * @return the singleton instance
+     */
+    public static PersonalDBLocator getInstance() {
+        return INSTANCE;
+    }
+
+    /**
+     * Return the Locator's name.
+     * 
+     * @return a String with the Locator's name
+     */
+    public final String getLocatorName() {
+        return LOCATOR_NAME;
+    }
+
+    /**
+     * Return a reference to the PersonalDBManager.
+     * 
+     * @return a reference to the PersonalDBManager
+     * @throws LocatorException
+     *             if there is no access to the class or the class cannot be
+     *             instantiated
+     * @see Locator#get(String)
+     */
+    public static PersonalDBManager getManager() throws LocatorException {
+        return (PersonalDBManager) getInstance().get(MANAGER_NAME);
+    }
+
+    /**
+     * Registers the Class implementing the PersonalDBManager interface.
+     * 
+     * @param clazz
+     *            implementing the PersonalDBManager interface
+     */
+    public static void registerManager(
+        Class<? extends PersonalDBManager> clazz) {
+        getInstance().register(MANAGER_NAME, MANAGER_DESCRIPTION, clazz);
+    }
+
+}
Index: tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/org.gvsig.personaldb.lib.api/src/main/java/org/gvsig/personaldb/PersonalDBLibrary.java
===================================================================
--- tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/org.gvsig.personaldb.lib.api/src/main/java/org/gvsig/personaldb/PersonalDBLibrary.java	(revision 0)
+++ tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/org.gvsig.personaldb.lib.api/src/main/java/org/gvsig/personaldb/PersonalDBLibrary.java	(revision 38363)
@@ -0,0 +1,57 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.personaldb;
+
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.LibraryException;
+import org.gvsig.tools.locator.ReferenceNotRegisteredException;
+
+/**
+ * Library for PersonalDB API initialization and configuration.
+ * 
+ * @author gvSIG team
+ * @version $Id$
+ */
+public class PersonalDBLibrary extends AbstractLibrary {
+
+    @Override
+    public void doRegistration() {
+        registerAsAPI(PersonalDBLibrary.class);
+    }
+
+    @Override
+    protected void doInitialize() throws LibraryException {
+        // Do nothing
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+        // Validate there is any implementation registered.
+        PersonalDBManager manager = PersonalDBLocator.getManager();
+        if (manager == null) {
+            throw new ReferenceNotRegisteredException(
+                PersonalDBLocator.MANAGER_NAME, PersonalDBLocator
+                    .getInstance());
+        }
+    }
+
+}
Index: tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/org.gvsig.personaldb.lib.api/src/main/java/org/gvsig/personaldb/package.html
===================================================================
--- tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/org.gvsig.personaldb.lib.api/src/main/java/org/gvsig/personaldb/package.html	(revision 0)
+++ tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/org.gvsig.personaldb.lib.api/src/main/java/org/gvsig/personaldb/package.html	(revision 38363)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<title>org.gvsig.personaldb package documentation</title>
+</head>
+<body>
+
+	<p>PersonalDB library API.</p>
+	
+	<p>
+	It allows to get new PersonalDB and get their text.
+	</p>
+
+</body>
+</html>
\ No newline at end of file
Index: tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/org.gvsig.personaldb.lib.api/pom.xml
===================================================================
--- tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/org.gvsig.personaldb.lib.api/pom.xml	(revision 0)
+++ tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/org.gvsig.personaldb.lib.api/pom.xml	(revision 38363)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>org.gvsig.personaldb.lib.api</artifactId>
+    <packaging>jar</packaging>
+    <name>org.gvsig.personaldb.lib.api</name>
+    <parent>
+        <groupId>org.gvsig</groupId>
+        <artifactId>org.gvsig.personaldb.lib</artifactId>
+        <version>1.0.0-SNAPSHOT</version>
+    </parent>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <configuration>
+                </configuration>
+                <executions>
+                    <!-- Generates a jar file only with the test classes -->
+                    <execution>
+                        <goals>
+                            <goal>test-jar</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+    <dependencies>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.tools.lib</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.dal</artifactId>
+            <scope>compile</scope>
+        </dependency>
+    </dependencies>
+</project>
\ No newline at end of file

Property changes on: tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/org.gvsig.personaldb.lib.api
___________________________________________________________________
Added: svn:ignore
   + .settings
target
.classpath
.project


Index: tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/pom.xml
===================================================================
--- tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/pom.xml	(revision 0)
+++ tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib/pom.xml	(revision 38363)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+		 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+	<modelVersion>4.0.0</modelVersion>
+	<artifactId>org.gvsig.personaldb.lib</artifactId>
+	<packaging>pom</packaging>
+	<name>org.gvsig.personaldb.lib</name>
+	<parent>
+		<groupId>org.gvsig</groupId>
+		<artifactId>org.gvsig.personaldb</artifactId>
+		<version>1.0.0-SNAPSHOT</version>
+	</parent>
+
+	<modules>
+		<module>org.gvsig.personaldb.lib.api</module>
+		<module>org.gvsig.personaldb.lib.impl</module>
+	</modules>
+</project>

Property changes on: tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/org.gvsig.personaldb.lib
___________________________________________________________________
Added: svn:ignore
   + target
.settings
.project


Index: tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/prepare-workspace.xml
===================================================================
--- tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/prepare-workspace.xml	(revision 0)
+++ tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb/prepare-workspace.xml	(revision 38363)
@@ -0,0 +1,151 @@
+<project name="org.gvsig.initial.build" default="prepare-workspace">
+
+	<dirname property="org.gvsig.initial.build.basedir" file="${ant.file.org.gvsig.initial.build}" />
+
+	<property name="workspace.basedir" value="${org.gvsig.initial.build.basedir}/.." />
+	<property name="build.basedir" value="${workspace.basedir}/org.gvsig.maven.base.build" description="Eclipse workspace location" />
+	<property name="build.jar.version" value="1.0.8-SNAPSHOT" />
+	<property name="build.jar.file" value="org.gvsig.maven.base.build-${build.jar.version}.jar" />
+
+	<property name="ant.libs.dir" location="${build.basedir}" description="Additional ant tasks libs folder" />
+
+	<target name="check-maven-base-build-available">
+		<available file="${user.home}/.m2/repository/org/gvsig/org.gvsig.maven.base.build/${build.jar.version}/${build.jar.file}" property="maven-base-build-available" />
+	</target>
+
+	<target name="get-maven-base-build-local" depends="check-maven-base-build-available" if="maven-base-build-available">
+		<!-- Unzip de build jar file from the maven repository into the workspace root folder -->
+		<copy todir="${workspace.basedir}" preservelastmodified="false" filtering="false">
+			<zipfileset src="${user.home}/.m2/repository/org/gvsig/org.gvsig.maven.base.build/${build.jar.version}/${build.jar.file}">
+				<patternset>
+					<exclude name="META-INF/**" />
+				</patternset>
+			</zipfileset>
+		</copy>
+	</target>
+
+	<target name="get-maven-base-build-remote" depends="check-maven-base-build-available" unless="maven-base-build-available">
+		<mkdir dir="target" />
+
+		<!-- Download the build jar file -->
+		<get src="http://devel.gvsig.org/m2repo/j2se/org/gvsig/org.gvsig.maven.base.build/${build.jar.version}/${build.jar.file}" dest="target/${build.jar.file}" verbose="true" />
+
+		<!-- Unzip de build jar file into the workspace root folder -->
+		<copy todir="${workspace.basedir}" preservelastmodified="false" filtering="false">
+			<zipfileset src="target/${build.jar.file}">
+				<patternset>
+					<exclude name="META-INF/**" />
+				</patternset>
+			</zipfileset>
+		</copy>
+
+	</target>
+	
+	<target name="find.depends.natives.file">
+	    <condition property="depends.natives.file.exists">
+            <available file="${org.gvsig.initial.build.basedir}/DEPENDS_ON_NATIVE_LIBRARIES"/>
+	    </condition>	
+	</target>
+	
+	<target name="find.gvsig.platform.properties.file" 
+			depends="find.depends.natives.file"
+			if="depends.natives.file.exists">
+	    <condition property="gvsig.platform.exists">
+            <available file="${user.home}/.gvsig.platform.properties"/>
+	    </condition>	
+	</target>
+	
+	<target name="check.gvsig.platform.properties" 
+			depends="find.gvsig.platform.properties.file">
+		<fail if="depends.natives.file.exists" unless="gvsig.platform.exists">
+ERROR!!
+	
+You have to define your gvSIG platform properties, 
+by creating the file: ${user.home}/.gvsig.platform.properties
+with the following content:
+
+native_platform=linux
+native_distribution=all
+native_compiler=gcc4
+native_arch=i386
+native_libraryType=dynamic
+export native_classifier=${native_platform}-${native_distribution}-${native_compiler}-${native_arch}-${native_libraryType}
+
+Replace the fifth initial variables values with the ones appropiate 
+to your platform.
+	
+If you use maven in the command line, you can use the previous file also
+to define the MAVEN_OPTS environment variable, by adding to your 
+.bash_rc file something like this:
+
+if [ -f "${HOME}/.gvsig.platform.properties" ]
+then
+    . ${HOME}/.gvsig.platform.properties
+    export MAVEN_OPTS="-Xmx256M -XX:MaxPermSize=64m -Dnative-classifier=${native_classifier}"
+else
+    export MAVEN_OPTS="-Xmx256M -XX:MaxPermSize=64m"
+fi
+
+It will work if you use the bash shell. In any other case or platform, you'll
+have to define your MAVEN_OPTS environment variable and set the 
+"native-classifier" parameter directly.
+		</fail>			
+	
+	</target>
+
+	<target name="prepare-workspace" depends="get-maven-base-build-local,get-maven-base-build-remote,check.gvsig.platform.properties">
+
+		<mkdir dir="target" />
+
+		<chmod dir="${build.basedir}/maven/bin" perm="u+x" includes="m2,mvn,mvnDebug" />
+
+		<!-- Copy the maven launchers to the workspace metadata folder -->
+		<copy todir="${workspace.basedir}/.metadata">
+			<fileset dir="${build.basedir}/eclipse-launchers">
+				<exclude name="**/org.eclipse.jdt.core.prefs" />
+				<exclude name="**/org.eclipse.core.variables.prefs" />
+			</fileset>
+		</copy>
+
+		<concat destfile="${workspace.basedir}/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs" append="true">
+			<filelist dir="${build.basedir}/eclipse-launchers/.plugins/org.eclipse.core.runtime/.settings" files="org.eclipse.jdt.core.prefs" />
+		</concat>
+		<concat destfile="${workspace.basedir}/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.variables.prefs" append="true">
+			<filelist dir="${build.basedir}/eclipse-launchers/.plugins/org.eclipse.core.runtime/.settings" files="org.eclipse.core.variables.prefs" />
+		</concat>
+
+		<!-- Configure the eclipse workspace -->
+		<ant antfile="${build.basedir}/maven-goals.xml" target="mvn-configure-eclipse-workspace" />
+
+		<!-- Configure the gvSIG profile -->
+		<ant antfile="${build.basedir}/check-gvsig-profile.xml" />
+
+		<property name="user-settings-file-location" value="${user.home}/.m2/settings.xml" />
+
+		<taskdef name="xmltask" classname="com.oopsconsultancy.xmltask.ant.XmlTask">
+			<classpath>
+				<pathelement location="${ant.libs.dir}/com.oopsconsultancy.xmltask-1.16.1.jar" />
+			</classpath>
+		</taskdef>
+
+		<xmltask source="${user-settings-file-location}" dest="${user-settings-file-location}">
+			<copy path="//:settings/:profiles/:profile[:id/text() = 'gvsig-install']/:properties/:gvsig.install.dir/text()" property="current-gvsig-location" />
+		</xmltask>
+
+		<replace file="${workspace.basedir}/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs" token="@GVSIG_HOME@" value="${current-gvsig-location}" />
+		<replace file="${workspace.basedir}/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.variables.prefs" token="@GVSIG_HOME@" value="${current-gvsig-location}" />
+
+		<!-- Compile, install and generate eclipse projects -->
+		<ant antfile="${build.basedir}/maven-goals.xml" target="mvn-install-and-eclipse-eclipse" />
+
+		<echo>INFORMATION!!!</echo>
+		<echo>Restart eclipse and then proceed to import the subprojects contained into the main project</echo>
+
+		<!-- TODO: copiar al proyecto de configuración general -->
+	</target>
+
+	<target name="clean">
+		<delete dir="target" />
+	</target>
+	
+</project>

Property changes on: tags/v2_0_0_Build_2047/libraries/org.gvsig.personaldb/org.gvsig.personaldb
___________________________________________________________________
Added: svn:ignore
   + target

.project

.settings


