Repository: atlas
Updated Branches:
  refs/heads/branch-1.0 d3feb0409 -> 2f7ad90e3


ATLAS-2995 : Added new API method to disassociate the term assignment from 
entity.

Change-Id: I6655626c937bf629ba5bffcbfce8f5c1fbbd0ed9


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/2f7ad90e
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/2f7ad90e
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/2f7ad90e

Branch: refs/heads/branch-1.0
Commit: 2f7ad90e35b6920df96a22ba93637e97b1371b56
Parents: d3feb04
Author: nixonrodrigues <ni...@apache.org>
Authored: Thu Dec 13 17:50:04 2018 +0530
Committer: nixonrodrigues <ni...@apache.org>
Committed: Thu Dec 20 19:26:12 2018 +0530

----------------------------------------------------------------------
 dashboardv2/public/js/models/VGlossary.js       |  2 +-
 .../org/apache/atlas/web/rest/GlossaryREST.java | 30 +++++++++++++++++---
 2 files changed, 27 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/atlas/blob/2f7ad90e/dashboardv2/public/js/models/VGlossary.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/models/VGlossary.js 
b/dashboardv2/public/js/models/VGlossary.js
index f33ef0f..48c5a99 100644
--- a/dashboardv2/public/js/models/VGlossary.js
+++ b/dashboardv2/public/js/models/VGlossary.js
@@ -106,7 +106,7 @@ define(['require',
                 contentType: 'application/json',
                 dataType: 'json'
             }, options);
-            return this.constructor.nonCrudOperation.call(this, url, 'DELETE', 
options);
+            return this.constructor.nonCrudOperation.call(this, url, 'PUT', 
options);
         },
         removeTermFromCategory: function() {
 

http://git-wip-us.apache.org/repos/asf/atlas/blob/2f7ad90e/webapp/src/main/java/org/apache/atlas/web/rest/GlossaryREST.java
----------------------------------------------------------------------
diff --git a/webapp/src/main/java/org/apache/atlas/web/rest/GlossaryREST.java 
b/webapp/src/main/java/org/apache/atlas/web/rest/GlossaryREST.java
index d13fbd9..151aa6b 100644
--- a/webapp/src/main/java/org/apache/atlas/web/rest/GlossaryREST.java
+++ b/webapp/src/main/java/org/apache/atlas/web/rest/GlossaryREST.java
@@ -857,21 +857,43 @@ public class GlossaryREST {
     @DELETE
     @Path("/terms/{termGuid}/assignedEntities")
     public void removeTermAssignmentFromEntities(@PathParam("termGuid") String 
termGuid, List<AtlasRelatedObjectId> relatedObjectIds) throws 
AtlasBaseException {
-        Servlets.validateQueryParamLength("termGuid", termGuid);
+        removeTermFromGlossary(termGuid, relatedObjectIds);
+    }
+
+
+    /**
+     * Remove the term assignment for the given list of entity headers
+     * @param termGuid Glossary term GUID
+     * @param relatedObjectIds List of related entity IDs from which the term 
has to be dissociated
+     * @throws AtlasBaseException
+     * @HTTP 204 If glossary term dissociation was successful
+     * @HTTP 400 If ANY of the entity header is invalid
+     * @HTTP 404 If glossary term guid in invalid
+     */
+    @PUT
+    @Path("/terms/{termGuid}/assignedEntities")
+    public void disassociateTermAssignmentFromEntities(@PathParam("termGuid") 
String termGuid, List<AtlasRelatedObjectId> relatedObjectIds) throws 
AtlasBaseException {
+        removeTermFromGlossary(termGuid, relatedObjectIds);
+    }
+
+
+
+    private void removeTermFromGlossary(String termGuid, 
List<AtlasRelatedObjectId> relatedObjectIds) throws AtlasBaseException{
+
+        Servlets.validateQueryParamLength("termGuid", termGuid) ;
 
         AtlasPerfTracer perf = null;
         try {
             if (AtlasPerfTracer.isPerfTraceEnabled(PERF_LOG)) {
-                perf = AtlasPerfTracer.getPerfTracer(PERF_LOG, 
"GlossaryREST.removeTermAssignmentFromEntities(" + termGuid + ")");
+                perf = AtlasPerfTracer.getPerfTracer(PERF_LOG, 
"GlossaryREST.removeTermFromGlossary(" + termGuid + ")");
             }
 
             glossaryService.removeTermFromEntities(termGuid, relatedObjectIds);
         } finally {
             AtlasPerfTracer.log(perf);
         }
-    }
-
 
+    }
 
     /**
      * Get all related categories (parent and children)

Reply via email to