# HG changeset patch # User Sascha L. Teichmann # Date 1301827548 0 # Node ID 16cd059945e5f0afc0e6b91b0e1dc0911bb07f76 # Parent 202b6ae2fcad162214bf20b69325ca6a9d23f2e8 Removed trailing whitespace. artifacts/trunk@1638 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 202b6ae2fcad -r 16cd059945e5 ChangeLog --- a/ChangeLog Thu Mar 31 17:14:22 2011 +0000 +++ b/ChangeLog Sun Apr 03 10:45:48 2011 +0000 @@ -1,3 +1,16 @@ +2011-04-03 Sascha L. Teichmann + + * src/**/*.java: Removed trailing whitespace. + +2011-03-31 Sascha L. Teichmann + + * src/main/java/de/intevation/artifactdatabase/DatabaseCleaner.java: + Removes outdated collections, too. + + * src/main/resources/sql/org-h2-driver.properties, + src/main/resources/sql/org-postgresql-driver.properties: + Added SQL statements to figure out outdated collections. + 2011-03-31 Sascha L. Teichmann * artifact-database/src/main/java/de/intevation/artifactdatabase/StringUtils.java: @@ -39,7 +52,7 @@ Needs testing! - In PostgreSQL it is done by a trigger written in plpgsql. So don't - forget to the language to the database! + forget to add the language to the database! - In H2 it is done by a trigger written in Java, because H2 does not offer a script level trigger support. diff -r 202b6ae2fcad -r 16cd059945e5 artifact-database/src/main/java/de/intevation/artifactdatabase/ArtifactDatabaseImpl.java --- a/artifact-database/src/main/java/de/intevation/artifactdatabase/ArtifactDatabaseImpl.java Thu Mar 31 17:14:22 2011 +0000 +++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/ArtifactDatabaseImpl.java Sun Apr 03 10:45:48 2011 +0000 @@ -59,7 +59,7 @@ * @author Sascha L. Teichmann */ public class ArtifactDatabaseImpl -implements ArtifactDatabase, +implements ArtifactDatabase, DatabaseCleaner.LockedIdsProvider, Backend.FactoryLookup { diff -r 202b6ae2fcad -r 16cd059945e5 artifact-database/src/main/java/de/intevation/artifactdatabase/Backend.java --- a/artifact-database/src/main/java/de/intevation/artifactdatabase/Backend.java Thu Mar 31 17:14:22 2011 +0000 +++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/Backend.java Sun Apr 03 10:45:48 2011 +0000 @@ -762,7 +762,7 @@ } public User createUser( - final String name, + final String name, final Document role, final UserFactory factory, final Object context @@ -849,7 +849,7 @@ prepareStatement(SQL_DELETE_USER_COLLECTION_ITEMS); stmnt.setInt(1, id); stmnt.execute(); - + reset(); // delete the collections of the user @@ -875,7 +875,7 @@ } public User getUser( - final String identifier, + final String identifier, final UserFactory factory, final Object context ) { @@ -910,7 +910,7 @@ } public User [] getUsers( - final UserFactory factory, + final UserFactory factory, final Object context ) { final ArrayList users = new ArrayList(); @@ -941,7 +941,7 @@ } public ArtifactCollection createCollection( - final String ownerIdentifier, + final String ownerIdentifier, final String name, final ArtifactCollectionFactory factory, final Document attribute, @@ -1107,7 +1107,7 @@ final UserFactory userFactory, final Object context ) { - if (ownerIdentifier != null + if (ownerIdentifier != null && !isValidIdentifier(ownerIdentifier)) { logger.debug("Invalid owner id: '" + ownerIdentifier + "'"); return null; @@ -1238,7 +1238,7 @@ } public boolean setCollectionAttribute( - final String collectionId, + final String collectionId, final String artifactId, Document attribute ) { diff -r 202b6ae2fcad -r 16cd059945e5 artifact-database/src/main/java/de/intevation/artifactdatabase/LazyBackendUser.java --- a/artifact-database/src/main/java/de/intevation/artifactdatabase/LazyBackendUser.java Thu Mar 31 17:14:22 2011 +0000 +++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/LazyBackendUser.java Sun Apr 03 10:45:48 2011 +0000 @@ -23,7 +23,7 @@ public LazyBackendUser( String identifier, - UserFactory factory, + UserFactory factory, Backend backend, Object context ) { diff -r 202b6ae2fcad -r 16cd059945e5 artifact-database/src/main/java/de/intevation/artifactdatabase/h2/CollectionAccessUpdateTrigger.java --- a/artifact-database/src/main/java/de/intevation/artifactdatabase/h2/CollectionAccessUpdateTrigger.java Thu Mar 31 17:14:22 2011 +0000 +++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/h2/CollectionAccessUpdateTrigger.java Sun Apr 03 10:45:48 2011 +0000 @@ -26,13 +26,13 @@ String tableName, boolean before, int type - ) + ) throws SQLException { logger.debug("CollectionAccessUpdateTrigger.init"); } public void fire( - Connection conn, + Connection conn, Object [] oldRow, Object [] newRow ) diff -r 202b6ae2fcad -r 16cd059945e5 artifacts/src/main/java/de/intevation/artifacts/ArtifactCollectionFactory.java --- a/artifacts/src/main/java/de/intevation/artifacts/ArtifactCollectionFactory.java Thu Mar 31 17:14:22 2011 +0000 +++ b/artifacts/src/main/java/de/intevation/artifacts/ArtifactCollectionFactory.java Sun Apr 03 10:45:48 2011 +0000 @@ -36,10 +36,10 @@ * @return a new {@linkplain de.intevation.artifacts.ArtifactCollection ArtifactCollection} */ ArtifactCollection createCollection( - String identifier, + String identifier, String name, Date creationTime, - Document data, + Document data, Object context); /**