# HG changeset patch # User Ingo Weinzierl # Date 1299580694 0 # Node ID 171b6200d26dc5d8d0e7314331d691a50f0e21d8 # Parent 63f555bbdbc0d3f19b8506444f79cbda21427e19 Added a describe() action for collections - the implementation in the artifact server is currently just a stub that throws an not implemented exception. artifacts/trunk@1426 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 63f555bbdbc0 -r 171b6200d26d ChangeLog --- a/ChangeLog Tue Mar 08 10:35:40 2011 +0000 +++ b/ChangeLog Tue Mar 08 10:38:14 2011 +0000 @@ -1,3 +1,14 @@ +2011-03-08 Ingo Weinzierl + + * artifact-database/src/main/java/de/intevation/artifactdatabase/ArtifactDatabaseImpl.java, + artifacts/src/main/java/de/intevation/artifacts/ArtifactDatabase.java: + New method describeCollection() that might be used to retrieve a list of + items in the collection and the facets supported by those items. + + * artifact-database/src/main/java/de/intevation/artifactdatabase/rest/CollectionResource.java: + Enabled the describeCollection() method with an action 'describe' equal + to the implementation of describe of an artifact. + 2011-03-08 Sascha L. Teichmann * artifact-database/src/main/resources/sql/org-h2-driver.properties diff -r 63f555bbdbc0 -r 171b6200d26d artifact-database/src/main/java/de/intevation/artifactdatabase/ArtifactDatabaseImpl.java --- a/artifact-database/src/main/java/de/intevation/artifactdatabase/ArtifactDatabaseImpl.java Tue Mar 08 10:35:40 2011 +0000 +++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/ArtifactDatabaseImpl.java Tue Mar 08 10:38:14 2011 +0000 @@ -1239,6 +1239,14 @@ return result; } + public Document describeCollection(String collectionId, CallMeta callMeta) + throws ArtifactDatabaseException + { + logger.debug("Describe collection: " + collectionId); + + throw new ArtifactDatabaseException("Not implemented yet."); + } + public Document getCollectionAttribute(String collectionId, String artifactId, CallMeta callMeta) throws ArtifactDatabaseException { diff -r 63f555bbdbc0 -r 171b6200d26d artifact-database/src/main/java/de/intevation/artifactdatabase/rest/CollectionResource.java --- a/artifact-database/src/main/java/de/intevation/artifactdatabase/rest/CollectionResource.java Tue Mar 08 10:35:40 2011 +0000 +++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/rest/CollectionResource.java Tue Mar 08 10:38:14 2011 +0000 @@ -63,6 +63,9 @@ /** Action name for deleting a collection.*/ public static final String ACTION_DELETE = "delete"; + /** Action name for describing the collection.*/ + public static final String ACTION_DESCRIBE = "describe"; + /** Action name for retrieving the attributes of an artifact stored in the * collection.*/ public static final String ACTION_GET_ATTRIBUTE = "getattribute"; @@ -108,6 +111,11 @@ logger.info("Delete collection '" + identifier + "'"); out = db.deleteCollection(identifier, getCallMeta()); } + else if (action.equals(ACTION_DESCRIBE)) { + logger.info("Describe collection '" + identifier + "'"); + + out = db.describeCollection(identifier, meta); + } else if (action.equals(ACTION_ADD_ARTIFACT)) { String art = getArtifactIdentifier(source); diff -r 63f555bbdbc0 -r 171b6200d26d artifacts/src/main/java/de/intevation/artifacts/ArtifactDatabase.java --- a/artifacts/src/main/java/de/intevation/artifacts/ArtifactDatabase.java Tue Mar 08 10:35:40 2011 +0000 +++ b/artifacts/src/main/java/de/intevation/artifacts/ArtifactDatabase.java Tue Mar 08 10:38:14 2011 +0000 @@ -203,6 +203,9 @@ Document deleteCollection(String collectionId, CallMeta callMeta) throws ArtifactDatabaseException; + Document describeCollection(String collectionId, CallMeta callMeta) + throws ArtifactDatabaseException; + Document getCollectionAttribute(String collectionId, String artifactId, CallMeta callMeta) throws ArtifactDatabaseException;