Mercurial > dive4elements > framework
comparison artifact-database/src/main/java/de/intevation/artifactdatabase/ArtifactDatabaseImpl.java @ 190:7acf4a325bfe
Implemented removeCollectionArtifact() method of the artifact database.
artifacts/trunk@1420 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Tue, 08 Mar 2011 08:25:24 +0000 |
parents | fbaeb5931d10 |
children | dad6071c9072 |
comparison
equal
deleted
inserted
replaced
189:fbaeb5931d10 | 190:7acf4a325bfe |
---|---|
1291 | 1291 |
1292 return result; | 1292 return result; |
1293 } | 1293 } |
1294 | 1294 |
1295 public Document removeCollectionArtifact(String collectionId, String artifactId, | 1295 public Document removeCollectionArtifact(String collectionId, String artifactId, |
1296 CallMeta callMeta) throws ArtifactDatabaseException { | 1296 CallMeta callMeta) throws ArtifactDatabaseException |
1297 throw new ArtifactDatabaseException("Not implemented, yet!"); | 1297 { |
1298 logger.debug( | |
1299 "Remove artifact '" + artifactId + "' from collection '" + | |
1300 collectionId + "'"); | |
1301 | |
1302 Document attr = XMLUtils.newDocument(); | |
1303 | |
1304 boolean success = backend.removeCollectionArtifact( | |
1305 collectionId, | |
1306 artifactId); | |
1307 | |
1308 Document result = XMLUtils.newDocument(); | |
1309 | |
1310 XMLUtils.ElementCreator ec = new XMLUtils.ElementCreator( | |
1311 result, | |
1312 ArtifactNamespaceContext.NAMESPACE_URI, | |
1313 ArtifactNamespaceContext.NAMESPACE_PREFIX); | |
1314 | |
1315 Element root = ec.create("result"); | |
1316 result.appendChild(root); | |
1317 | |
1318 root.setTextContent(success ? OPERATION_SUCCESSFUL: OPERATION_FAILURE); | |
1319 | |
1320 return result; | |
1298 } | 1321 } |
1299 | 1322 |
1300 public Document listCollectionArtifacts(String collectionId, | 1323 public Document listCollectionArtifacts(String collectionId, |
1301 CallMeta callMeta) throws ArtifactDatabaseException | 1324 CallMeta callMeta) throws ArtifactDatabaseException |
1302 { | 1325 { |