comparison artifact-database/src/main/java/de/intevation/artifactdatabase/rest/CollectionResource.java @ 253:a2df2b48d2aa

Enabled the artifact database to handle requests specific to collection attributes and collection item attributes. artifacts/trunk@1746 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 26 Apr 2011 07:43:40 +0000
parents 6de74b0b878e
children 4edaf3073109
comparison
equal deleted inserted replaced
252:6de74b0b878e 253:a2df2b48d2aa
64 public static final String ACTION_DELETE = "delete"; 64 public static final String ACTION_DELETE = "delete";
65 65
66 /** Action name for describing the collection.*/ 66 /** Action name for describing the collection.*/
67 public static final String ACTION_DESCRIBE = "describe"; 67 public static final String ACTION_DESCRIBE = "describe";
68 68
69 /** Action name for retrieving the attribute of a collection.*/
70 public static final String ACTION_GET_ATTRIBUTE = "getattribute";
71
69 /** Action name for retrieving the attributes of an artifact stored in the 72 /** Action name for retrieving the attributes of an artifact stored in the
70 * collection.*/ 73 * collection.*/
71 public static final String ACTION_GET_ATTRIBUTE = "getattribute"; 74 public static final String ACTION_GET_ITEM_ATTRIBUTE = "getitemattribute";
75
76 /** Action name for setting the attribute of a collection.*/
77 public static final String ACTION_SET_ATTRIBUTE = "setattribute";
72 78
73 /** Action name for setting the attribute for an artifact stored in the 79 /** Action name for setting the attribute for an artifact stored in the
74 * collection.*/ 80 * collection.*/
75 public static final String ACTION_SET_ATTRIBUTE = "setattribute"; 81 public static final String ACTION_SET_ITEM_ATTRIBUTE = "setitemattribute";
76 82
77 /** Action name for adding a new artifact to the collection.*/ 83 /** Action name for adding a new artifact to the collection.*/
78 public static final String ACTION_ADD_ARTIFACT = "addartifact"; 84 public static final String ACTION_ADD_ARTIFACT = "addartifact";
79 85
80 /** Action name for removing an artifact from the collection.*/ 86 /** Action name for removing an artifact from the collection.*/
133 out = db.listCollectionArtifacts(identifier, meta); 139 out = db.listCollectionArtifacts(identifier, meta);
134 } 140 }
135 else if (action.equals(ACTION_SET_ATTRIBUTE)) { 141 else if (action.equals(ACTION_SET_ATTRIBUTE)) {
136 String art = getArtifactIdentifier(source); 142 String art = getArtifactIdentifier(source);
137 143
144 logger.info("Set attribute for collection '" + identifier + "'");
145 out = db.setCollectionAttribute(identifier, meta, source);
146 }
147 else if (action.equals(ACTION_SET_ITEM_ATTRIBUTE)) {
148 String art = getArtifactIdentifier(source);
149
138 logger.info("Set attribute for artifact '" + art + "'"); 150 logger.info("Set attribute for artifact '" + art + "'");
139 out = db.setCollectionItemAttribute(identifier, art, source, meta); 151 out = db.setCollectionItemAttribute(identifier, art, source, meta);
140 } 152 }
141 else if (action.equals(ACTION_GET_ATTRIBUTE)) { 153 else if (action.equals(ACTION_GET_ATTRIBUTE)) {
154 String art = getArtifactIdentifier(source);
155
156 logger.info("Retrieve attribute of collection '" + identifier + "'");
157 out = db.getCollectionAttribute(identifier, meta);
158 }
159 else if (action.equals(ACTION_GET_ITEM_ATTRIBUTE)) {
142 String art = getArtifactIdentifier(source); 160 String art = getArtifactIdentifier(source);
143 161
144 logger.info("Retrieve attribute of artifact '" + art + "'"); 162 logger.info("Retrieve attribute of artifact '" + art + "'");
145 out = db.getCollectionItemAttribute(identifier, art, meta); 163 out = db.getCollectionItemAttribute(identifier, art, meta);
146 } 164 }

http://dive4elements.wald.intevation.org