Author: lgiessmann Date: Wed Sep 14 03:40:50 2011 New Revision: 898
Log: gdl-frontend: Widgets: fixed a bug when creating delete requests to update http://textgrid.org/serivceregistry/model/types/Hash-Object
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/isidorus/CommitCallback.java
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/isidorus/CommitCallback.java ============================================================================== --- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/isidorus/CommitCallback.java Wed Sep 14 03:35:08 2011 (r897) +++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/isidorus/CommitCallback.java Wed Sep 14 03:40:50 2011 (r898) @@ -6,7 +6,6 @@ import us.isidor.gdl.anaToMia.Widgets.base.Utils; import us.isidor.gdl.anaToMia.Widgets.environment.Pair; import us.isidor.gdl.anaToMia.Widgets.environment.TopicIdentifierTypes; - import com.google.gwt.core.client.JsArray; import com.google.gwt.http.client.Request; import com.google.gwt.http.client.RequestBuilder; @@ -239,7 +238,8 @@ if (200 == response.getStatusCode()) { if(edited){ String[] topPsi = Utils.splitUriByLastFragment(psi); - String[] hashValuePsi = Utils.splitUriByLastFragment(CommitCallback.this.HASH_VALUE_OCCURRENCE_TYPE); + String[] hashValuePsi = Utils.splitUriByLastFragment(CommitCallback.this.HASH_VALUE_OCCURRENCE_TYPE); + String[] xsdString = Utils.splitUriByLastFragment(IsidorusConstants.XSD_STRING); JSONObject delObj = new JSONObject(); delObj.put("type", new JSONString("Occurrence")); @@ -250,12 +250,14 @@ JSONObject prefixes = new JSONObject(); prefixes.put("pref_1", new JSONString(topPsi[0])); prefixes.put("pref_2", new JSONString(hashValuePsi[0])); + prefixes.put("pref_3", new JSONString(xsdString[0])); delOcc.put("prefixes", prefixes); JSONArray jParents = new JSONArray(); jParents.set(0, new JSONString("si:[pref_1:" + topPsi[1] + "]")); delOcc.put("parent", jParents); delOcc.put("value", this.getOldHashValue(response.getText(), this.psi)); + delOcc.put("datatype", new JSONString("[pref_3:" + xsdString[1] + "]")); delOcc.put("type", new JSONString("si:[pref_2:" + hashValuePsi[1] + "]")); Window.alert(">>\n" + delObj.toString()); @@ -315,7 +317,7 @@ JSONObject hashTopic = hashTopicVal.isObject(); if(hashTopic == null) continue; - JSONValue psisVal = topics.get(topicIdx); + JSONValue psisVal = hashTopic.get("subject_identifiers"); if(psisVal == null) continue; JSONArray psis = psisVal.isArray(); @@ -325,7 +327,8 @@ if(psiVal == null) continue; JSONString psi = psiVal.isString(); - if(psi != null && this.computeUri(psi.stringValue(), prefixes).equals(psi)){ + + if(psi != null && this.computeUri(psi.stringValue(), prefixes).equals(topicPsiToBeUpdated)){ JSONObject occ = this.gethashValueOccurrence(hashTopic, prefixes); if(occ == null) continue; @@ -338,7 +341,6 @@ } } - return result; } @@ -400,7 +402,7 @@ JSONString prefString = prefVal.isString(); if(prefString == null) return ""; - return prefString + parts[1]; + return prefString.stringValue() + parts[1]; } else { return curie; }