[isidorus-cvs] r930 - branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/isidorus
lgiessmann at common-lisp.net
lgiessmann at common-lisp.net
Mon Sep 19 15:46:53 UTC 2011
Author: lgiessmann
Date: Mon Sep 19 08:46:52 2011
New Revision: 930
Log:
gdl-frontend: Widgets: changed the error behavior of the psi-request handler
Modified:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/isidorus/GdlWebPage.java
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/isidorus/GdlWebPage.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/isidorus/GdlWebPage.java Mon Sep 19 08:34:07 2011 (r929)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/isidorus/GdlWebPage.java Mon Sep 19 08:46:52 2011 (r930)
@@ -190,40 +190,31 @@
if (200 == response.getStatusCode()) {
JSONValue psiVals = JSONParser.parseStrict(response.getText());
JSONObject resultObject = psiVals.isObject();
- if(resultObject == null) {
- Window.alert("got bad json, a query result object was expected, but got: " + response.getText());
- GdlWebPage.this.resetPage();
- }
+ if(resultObject == null) Window.alert("got bad json, a query result object was expected, but got: " + response.getText());
JSONValue content = resultObject.get("topics");
- if(content == null){
- Window.alert("got bad json, a query result object was expected, but got: " + response.getText());
- GdlWebPage.this.resetPage();
- }
+ if(content == null) Window.alert("got bad json, a query result object was expected, but got: " + response.getText());
JSONArray psis = null;
if(psiVals != null) psis = content.isArray();
- if(psis == null){
- Window.alert("got bad json, a query result object was expected, but got: " + response.getText());
- GdlWebPage.this.resetPage();
- }
- for(int psisIdx = 0; psisIdx != psis.size(); ++psisIdx){
- JSONValue psiVal = psis.get(psisIdx);
- JSONString psiString = null;
- if(psiVal != null) psiString = psiVal.isString();
- String psiValue = null;
- if(psiString != null){
- psiValue = psiString.stringValue();
- if(psiValue.startsWith("<")) psiValue = psiValue.substring(1);
- if(psiValue.endsWith(">")) psiValue = psiValue.substring(0, psiValue.length() - 1);
+ if(psis != null){
+ for(int psisIdx = 0; psisIdx != psis.size(); ++psisIdx){
+ JSONValue psiVal = psis.get(psisIdx);
+ JSONString psiString = null;
+ if(psiVal != null) psiString = psiVal.isString();
+ String psiValue = null;
+ if(psiString != null){
+ psiValue = psiString.stringValue();
+ if(psiValue.startsWith("<")) psiValue = psiValue.substring(1);
+ if(psiValue.endsWith(">")) psiValue = psiValue.substring(0, psiValue.length() - 1);
+ }
+ GdlWebPage.this.psiContainer.addPsi(psiValue);
}
- GdlWebPage.this.psiContainer.addPsi(psiValue);
}
GdlWebPage.this.psiContainer.insertIn(GdlWebPage.this.navigationPanel);
} else {
Window.alert("could not request existing instances of " + GdlWebPage.this.topicTypePsi + ", because(" + response.getStatusCode() + "): " + response.getStatusText());
- GdlWebPage.this.resetPage();
}
}
More information about the Isidorus-cvs
mailing list