oodt-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l...@apache.org
Subject svn commit: r1410380 - /oodt/trunk/curator/src/main/java/org/apache/oodt/cas/curation/service/MetadataResource.java
Date Fri, 16 Nov 2012 14:53:52 GMT
Author: luca
Date: Fri Nov 16 14:53:52 2012
New Revision: 1410380

URL: http://svn.apache.org/viewvc?rev=1410380&view=rev
Log:
Implementing removal of metadata tags (OODT-535)

Modified:
    oodt/trunk/curator/src/main/java/org/apache/oodt/cas/curation/service/MetadataResource.java

Modified: oodt/trunk/curator/src/main/java/org/apache/oodt/cas/curation/service/MetadataResource.java
URL: http://svn.apache.org/viewvc/oodt/trunk/curator/src/main/java/org/apache/oodt/cas/curation/service/MetadataResource.java?rev=1410380&r1=1410379&r2=1410380&view=diff
==============================================================================
--- oodt/trunk/curator/src/main/java/org/apache/oodt/cas/curation/service/MetadataResource.java
(original)
+++ oodt/trunk/curator/src/main/java/org/apache/oodt/cas/curation/service/MetadataResource.java
Fri Nov 16 14:53:52 2012
@@ -494,7 +494,8 @@ public class MetadataResource extends Cu
   public String updateMetadata(MultivaluedMap<String, String> formParams, 
 		  @FormParam("id") String id, 
 		  @FormParam("name") String name, 
-		  @DefaultValue("true") @FormParam("replace") boolean replace) {
+		  @DefaultValue("true") @FormParam("replace") boolean replace,
+		  @DefaultValue("false") @FormParam("remove") boolean remove) {
 	      
   	// new metadata from HTTP POST request
     Metadata newMetadata = this.getMetadataFromMap(formParams);
@@ -532,6 +533,13 @@ public class MetadataResource extends Cu
     	  }
       }
       
+      // remove metadata tags
+      if (remove) {
+	      for (String key : newMetadata.getAllKeys()) {
+	      	metadata.removeMetadata(key);
+	      }
+      }
+      
       this.updateCatalogMetadata(product, metadata);
       
       // return product id to downstream processors



Mime
View raw message