comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/datacage/Datacage.java @ 1009:fc5fca0c33b3

Datacage: Set the name of the collections at initial scan, too. flys-artifacts/trunk@2454 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Tue, 02 Aug 2011 14:09:01 +0000
parents 6268009e177d
children d419c9904825
comparison
equal deleted inserted replaced
1008:6268009e177d 1009:fc5fca0c33b3
104 104
105 @Override 105 @Override
106 public void artifactLoaded( 106 public void artifactLoaded(
107 String userId, 107 String userId,
108 String collectionId, 108 String collectionId,
109 String collectionName,
109 String artifactId, 110 String artifactId,
110 Artifact artifact 111 Artifact artifact
111 ) { 112 ) {
112 if (!(artifact instanceof FLYSArtifact)) { 113 if (!(artifact instanceof FLYSArtifact)) {
113 log.warn("ignoring none FLYS artifacts"); 114 log.warn("ignoring none FLYS artifacts");
115 } 116 }
116 117
117 FLYSArtifact flysArtifact = (FLYSArtifact)artifact; 118 FLYSArtifact flysArtifact = (FLYSArtifact)artifact;
118 119
119 Integer uId = getUserId(userId); 120 Integer uId = getUserId(userId);
120 // TODO: We need the name of the collection 121 Integer cId = getCollectionId(collectionId, uId, collectionName);
121 Integer cId = getCollectionId(collectionId, uId, "XXX");
122 122
123 storeArtifact(artifactId, cId, flysArtifact); 123 storeArtifact(artifactId, cId, flysArtifact);
124 } 124 }
125 125
126 protected Integer getId( 126 protected Integer getId(
262 reset(); 262 reset();
263 prepareStatement(SQL_INSERT_COLLECTION); 263 prepareStatement(SQL_INSERT_COLLECTION);
264 stmnt.setInt (1, res[0]); 264 stmnt.setInt (1, res[0]);
265 stmnt.setString(2, collectionId); 265 stmnt.setString(2, collectionId);
266 stmnt.setInt (3, ownerId); 266 stmnt.setInt (3, ownerId);
267 stmnt.setString(4, collectionName); 267 setString(stmnt, 4, collectionName);
268 stmnt.execute(); 268 stmnt.execute();
269 conn.commit(); 269 conn.commit();
270 return true; 270 return true;
271 } 271 }
272 }; 272 };

http://dive4elements.wald.intevation.org