changeset 133:2950c6011afa

Fixed typo in keys. Removed superfluous identifier in UserFactory.createUser(). Added backend stubs for handling of users. artifacts/trunk@1358 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 02 Mar 2011 10:07:37 +0000
parents 6f1e8c08f747
children 19267b9960c3
files ChangeLog artifact-database/src/main/java/de/intevation/artifactdatabase/Backend.java artifact-database/src/main/java/de/intevation/artifactdatabase/DefaultUserFactory.java artifact-database/src/main/resources/sql/org-h2-driver.properties artifact-database/src/main/resources/sql/org-postgresql-driver.properties artifacts/src/main/java/de/intevation/artifacts/UserFactory.java
diffstat 6 files changed, 64 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Mar 02 09:52:21 2011 +0000
+++ b/ChangeLog	Wed Mar 02 10:07:37 2011 +0000
@@ -1,3 +1,16 @@
+2011-03-02	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
+
+	* artifact-database/src/main/resources/sql/org-h2-driver.properties,
+	  artifact-database/src/main/resources/sql/org-postgresql-driver.properties:
+	  Fixed typo in keys.
+
+	* artifacts/src/main/java/de/intevation/artifacts/UserFactory.java,
+	  artifact-database/src/main/java/de/intevation/artifactdatabase/DefaultUserFactory.java:
+	  Removed superfluous identifier in createUser().
+
+	* artifact-database/src/main/java/de/intevation/artifactdatabase/Backend.java:
+	  Added stubs for handling of users.
+
 2011-03-02  Ingo Weinzierl <ingo@intevation.de>
 
 	* artifact-database/src/main/java/de/intevation/artifactdatabase/ArtifactDatabaseImpl.java,
--- a/artifact-database/src/main/java/de/intevation/artifactdatabase/Backend.java	Wed Mar 02 09:52:21 2011 +0000
+++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/Backend.java	Wed Mar 02 10:07:37 2011 +0000
@@ -11,6 +11,7 @@
 import de.intevation.artifacts.Artifact;
 import de.intevation.artifacts.ArtifactFactory;
 import de.intevation.artifacts.ArtifactSerializer;
+import de.intevation.artifacts.User;
 
 import java.sql.Connection;
 import java.sql.PreparedStatement;
@@ -22,6 +23,9 @@
 
 import org.apache.log4j.Logger;
 
+import org.w3c.dom.Document;
+
+
 /**
  * The backend implements the low level layer used to store artifacts
  * in a SQL database.
@@ -80,6 +84,26 @@
     public static final String SQL_REPLACE =
         SQL.get("artifacts.replace");
 
+    // USER SQL
+
+    public static final String SQL_USERS_NEXT_ID =
+        SQL.get("users.id.nextval");
+
+    public static final String SQL_USERS_INSERT =
+        SQL.get("users.insert");
+
+    public static final String SQL_USERS_SELECT_GID =
+        SQL.get("users.select.gid");
+
+    public static final String SQL_USERS_DELETE_ID =
+        SQL.get("users.delete.id");
+
+    public static final String SQL_USERS_DELETE_COLLECTIONS =
+        SQL.get("users.delete.collections");
+
+    public static final String SQL_USER_SELECT_ALL =
+        SQL.get("users.select.all");
+
     /** The singleton.*/
     protected static Backend instance;
 
@@ -764,5 +788,27 @@
             logger.error(e.getLocalizedMessage(), e);
         }
     }
+
+    public User createUser(
+        String   name, 
+        Document role
+    ) {
+        // TODO: implement me!
+        return null;
+    }
+
+    public void deleteUser(User user) {
+        // TODO: implement me!
+    }
+
+    public User getUser(String identifier) {
+        // TODO: implement me!
+        return null;
+    }
+
+    public User [] getUsers() {
+        // TODO: implement me!
+        return null;
+    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/artifact-database/src/main/java/de/intevation/artifactdatabase/DefaultUserFactory.java	Wed Mar 02 09:52:21 2011 +0000
+++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/DefaultUserFactory.java	Wed Mar 02 10:07:37 2011 +0000
@@ -51,13 +51,14 @@
      * @param context The CallContext.
      */
     public User createUser(
-        String   identifier,
         String   name,
         Document role,
         Object   context)
     {
         logger.debug("DefaultUserFactory.createUser: " + name);
 
+        String identifier = "FIXME";
+
         return new DefaultUser(identifier, name, role);
     }
 
--- a/artifact-database/src/main/resources/sql/org-h2-driver.properties	Wed Mar 02 09:52:21 2011 +0000
+++ b/artifact-database/src/main/resources/sql/org-h2-driver.properties	Wed Mar 02 10:07:37 2011 +0000
@@ -31,7 +31,7 @@
 
 users.select.gid=SELECT id, name, role FROM users WHERE gid = ?
 
-users.delete.gid=DELETE FROM users WHERE id = ?
+users.delete.id=DELETE FROM users WHERE id = ?
 
 users.delete.collections=DELETE FROM collections where owner_id = ?
 
--- a/artifact-database/src/main/resources/sql/org-postgresql-driver.properties	Wed Mar 02 09:52:21 2011 +0000
+++ b/artifact-database/src/main/resources/sql/org-postgresql-driver.properties	Wed Mar 02 10:07:37 2011 +0000
@@ -31,7 +31,7 @@
 
 users.select.gid=SELECT id, name, role FROM users WHERE gid = ?::uuid
 
-users.delete.gid=DELETE FROM users WHERE id = ?
+users.delete.id=DELETE FROM users WHERE id = ?
 
 users.delete.collections=DELETE FROM collections where owner_id = ?
 
--- a/artifacts/src/main/java/de/intevation/artifacts/UserFactory.java	Wed Mar 02 09:52:21 2011 +0000
+++ b/artifacts/src/main/java/de/intevation/artifacts/UserFactory.java	Wed Mar 02 10:07:37 2011 +0000
@@ -16,7 +16,7 @@
 {
     void setup(Document config, Node factoryNode);
 
-    User createUser(String identifier, String name, Document role, Object context);
+    User createUser(String name, Document role, Object context);
 
     void deleteUser(User user, Object context);
 

http://dive4elements.wald.intevation.org