[isidorus-cvs] r958 - branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/isidorus

lgiessmann at common-lisp.net lgiessmann at common-lisp.net
Wed Sep 21 14:22:50 UTC 2011


Author: lgiessmann
Date: Wed Sep 21 07:22:50 2011
New Revision: 958

Log:
gdl-frontend: Widgets: fixed a bug in the delete operation handler of environment topics

Modified:
   branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/isidorus/DeleteCallback.java
   branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/isidorus/HashObjectPsiContainer.java

Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/isidorus/DeleteCallback.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/isidorus/DeleteCallback.java	Wed Sep 21 06:56:39 2011	(r957)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/isidorus/DeleteCallback.java	Wed Sep 21 07:22:50 2011	(r958)
@@ -176,7 +176,7 @@
 				RequestBuilder builder = new RequestBuilder(RequestBuilder.DELETE, url);
 				builder.setHeader("Content-type", "application/json");
 				
-				builder.sendRequest(delObj.toString(), new DeleteRequest(delObj, top));
+				builder.sendRequest(delObj.toString(), new DeleteRequest(delObj));
 			}catch(RequestException e){
 				Window.alert("could not delete the topic: " + psi + ", because(" + e.getClass() + "): " + e.getMessage());
 			}catch(ExporterException e){
@@ -188,16 +188,14 @@
 	
 	private class DeleteRequest implements RequestCallback {
 		private JSONObject objectToBeSend = null;
-		private Topic topicToBeDeleted = null;
 		
 		
 		@SuppressWarnings("unused")
 		private DeleteRequest(){}
 		
 		
-		public DeleteRequest(JSONObject objectToBeDeleted, Topic topicToBeDeleted){
+		public DeleteRequest(JSONObject objectToBeDeleted){
 			this.objectToBeSend = objectToBeDeleted;
-			this.topicToBeDeleted = topicToBeDeleted;
 		}
 		
 		
@@ -205,7 +203,6 @@
 		public void onResponseReceived(Request request, Response response) {
 			if (200 == response.getStatusCode()) {
 				Window.Location.reload();
-				this.topicToBeDeleted.remove();
 			} else {
 				Window.alert("delete operation of the object " + this.objectToBeSend + " failed: " + response.getStatusCode() + "(" + response.getStatusText() + ")\n" + response.getText());
 			}

Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/isidorus/HashObjectPsiContainer.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/isidorus/HashObjectPsiContainer.java	Wed Sep 21 06:56:39 2011	(r957)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/isidorus/HashObjectPsiContainer.java	Wed Sep 21 07:22:50 2011	(r958)
@@ -3,7 +3,6 @@
 
 import java.util.ArrayList;
 import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
-import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMap;
 import us.isidor.gdl.anaToMia.Widgets.base.TmHelper;
 import us.isidor.gdl.anaToMia.Widgets.base.Utils;
 import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
@@ -171,13 +170,7 @@
 		public void onResponseReceived(Request request, Response response) {
 			if (200 == response.getStatusCode()) {
 				++this.objectsDeleted;
-				if(this.objectsDeleted == this.hashObjectsToDelete.size()){
-					TopicMap tm = environmentTopic.getTopicMap();
-					for (String psi : this.hashObjectsToDelete) {
-						Topic top = tm.getTopicBySubjectIdentifier(tm.createLocator(psi));
-						top.remove();
-					}
-					
+				if(this.objectsDeleted == this.hashObjectsToDelete.size()){						
 					JSONObject delObj = HashObjectPsiContainer.this.createObjectToBeDeleted(this.environmentPsi);
 					String url = URL.encode(HashObjectPsiContainer.this.DELETE_URL);
 					RequestBuilder builder = new RequestBuilder(RequestBuilder.DELETE, url);




More information about the Isidorus-cvs mailing list