Mercurial > dive4elements > framework
changeset 196:171b6200d26d
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
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Tue, 08 Mar 2011 10:38:14 +0000 |
parents | 63f555bbdbc0 |
children | 94654cbf8db2 |
files | ChangeLog artifact-database/src/main/java/de/intevation/artifactdatabase/ArtifactDatabaseImpl.java artifact-database/src/main/java/de/intevation/artifactdatabase/rest/CollectionResource.java artifacts/src/main/java/de/intevation/artifacts/ArtifactDatabase.java |
diffstat | 4 files changed, 30 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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 <ingo@intevation.de> + + * 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 <sascha.teichmann@intevation.de> * artifact-database/src/main/resources/sql/org-h2-driver.properties
--- 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 {
--- 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);
--- 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;