comparison artifact-database/src/main/java/de/intevation/artifactdatabase/Backend.java @ 233:16cd059945e5

Removed trailing whitespace. artifacts/trunk@1638 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Sun, 03 Apr 2011 10:45:48 +0000
parents fbd57d2eeaef
children 3e29395ebac6
comparison
equal deleted inserted replaced
232:202b6ae2fcad 233:16cd059945e5
760 } 760 }
761 }.runWrite(); 761 }.runWrite();
762 } 762 }
763 763
764 public User createUser( 764 public User createUser(
765 final String name, 765 final String name,
766 final Document role, 766 final Document role,
767 final UserFactory factory, 767 final UserFactory factory,
768 final Object context 768 final Object context
769 ) { 769 ) {
770 final User [] user = new User[1]; 770 final User [] user = new User[1];
847 // delete the collection items of the user 847 // delete the collection items of the user
848 848
849 prepareStatement(SQL_DELETE_USER_COLLECTION_ITEMS); 849 prepareStatement(SQL_DELETE_USER_COLLECTION_ITEMS);
850 stmnt.setInt(1, id); 850 stmnt.setInt(1, id);
851 stmnt.execute(); 851 stmnt.execute();
852 852
853 reset(); 853 reset();
854 854
855 // delete the collections of the user 855 // delete the collections of the user
856 856
857 prepareStatement(SQL_USERS_DELETE_COLLECTIONS); 857 prepareStatement(SQL_USERS_DELETE_COLLECTIONS);
873 873
874 return exec.runWrite(); 874 return exec.runWrite();
875 } 875 }
876 876
877 public User getUser( 877 public User getUser(
878 final String identifier, 878 final String identifier,
879 final UserFactory factory, 879 final UserFactory factory,
880 final Object context 880 final Object context
881 ) { 881 ) {
882 if (!isValidIdentifier(identifier)) { 882 if (!isValidIdentifier(identifier)) {
883 logger.debug("Invalid UUID: '" + identifier + "'"); 883 logger.debug("Invalid UUID: '" + identifier + "'");
908 908
909 return exec.runRead() ? user[0] : null; 909 return exec.runRead() ? user[0] : null;
910 } 910 }
911 911
912 public User [] getUsers( 912 public User [] getUsers(
913 final UserFactory factory, 913 final UserFactory factory,
914 final Object context 914 final Object context
915 ) { 915 ) {
916 final ArrayList<User> users = new ArrayList<User>(); 916 final ArrayList<User> users = new ArrayList<User>();
917 917
918 SQLExecutor exec = new SQLExecutor() { 918 SQLExecutor exec = new SQLExecutor() {
939 ? users.toArray(new User[users.size()]) 939 ? users.toArray(new User[users.size()])
940 : null; 940 : null;
941 } 941 }
942 942
943 public ArtifactCollection createCollection( 943 public ArtifactCollection createCollection(
944 final String ownerIdentifier, 944 final String ownerIdentifier,
945 final String name, 945 final String name,
946 final ArtifactCollectionFactory factory, 946 final ArtifactCollectionFactory factory,
947 final Document attribute, 947 final Document attribute,
948 final Object context 948 final Object context
949 ) { 949 ) {
1105 final Document data, 1105 final Document data,
1106 final ArtifactCollectionFactory collectionFactory, 1106 final ArtifactCollectionFactory collectionFactory,
1107 final UserFactory userFactory, 1107 final UserFactory userFactory,
1108 final Object context 1108 final Object context
1109 ) { 1109 ) {
1110 if (ownerIdentifier != null 1110 if (ownerIdentifier != null
1111 && !isValidIdentifier(ownerIdentifier)) { 1111 && !isValidIdentifier(ownerIdentifier)) {
1112 logger.debug("Invalid owner id: '" + ownerIdentifier + "'"); 1112 logger.debug("Invalid owner id: '" + ownerIdentifier + "'");
1113 return null; 1113 return null;
1114 } 1114 }
1115 1115
1236 1236
1237 return exec.runRead() ? document[0] : null; 1237 return exec.runRead() ? document[0] : null;
1238 } 1238 }
1239 1239
1240 public boolean setCollectionAttribute( 1240 public boolean setCollectionAttribute(
1241 final String collectionId, 1241 final String collectionId,
1242 final String artifactId, 1242 final String artifactId,
1243 Document attribute 1243 Document attribute
1244 ) { 1244 ) {
1245 if (!isValidIdentifier(collectionId)) { 1245 if (!isValidIdentifier(collectionId)) {
1246 logger.debug("collection id is not valid: " + collectionId); 1246 logger.debug("collection id is not valid: " + collectionId);

http://dive4elements.wald.intevation.org