Author: lgiessmann Date: Mon Sep 19 02:28:50 2011 New Revision: 921
Log: gdl-frontend: Widgets: changed the actual request for getting all psis of environment instances; changed the isidorus-url-constants
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/IsidorusConstants.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 02:18:12 2011 (r920) +++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/isidorus/GdlWebPage.java Mon Sep 19 02:28:50 2011 (r921) @@ -89,13 +89,28 @@ private void requestPsis() throws ExecutionException { String url = null; - if(IsidorusConstants.HASH_OBJECT_PSI.equals(GdlWebPage.this.topicTypePsi)) url = URL.encode(IsidorusConstants.GET_HASH_OBJECT_PSIS_URL); - else if(IsidorusConstants.ENVIRONMENT_PSI.equals(GdlWebPage.this.topicTypePsi)) url = URL.encode(IsidorusConstants.GET_ENVIRONMENT_PSIS_URL); - else throw new ExecutionException("the topic type PSI " + GdlWebPage.this.topicTypePsi + " is not supported!"); - RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, url); + String postData = null; + if(IsidorusConstants.HASH_OBJECT_PSI.equals(GdlWebPage.this.topicTypePsi)){ + url = URL.encode(IsidorusConstants.GET_HASH_OBJECT_PSIS_URL); + postData = "PREFIX pref:http://textgrid.org/serviceregistry/model/types\n" + + "SELECT ?topics WHERE {\n" + + "?topics a pref:Hash-Object.\n" + + "}"; + } + else if(IsidorusConstants.ENVIRONMENT_PSI.equals(GdlWebPage.this.topicTypePsi)){ + url = URL.encode(IsidorusConstants.GET_ENVIRONMENT_PSIS_URL); + postData = "PREFIX pref:http://textgrid.org/serviceregistry/model/types\n" + + "SELECT ?topics WHERE {\n" + + "?topics a pref:Environment.\n" + + "}"; + } + else{ + throw new ExecutionException("the topic type PSI " + GdlWebPage.this.topicTypePsi + " is not supported!"); + } + RequestBuilder builder = new RequestBuilder(RequestBuilder.POST, url); try{ - builder.sendRequest(null, new PsiRequest()); + builder.sendRequest(postData, new PsiRequest()); }catch(RequestException e){ e.printStackTrace(); Window.alert("could not request existing instances of " + GdlWebPage.this.topicTypePsi + ", because(" + e.getClass() + "): " + e.getMessage());
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/isidorus/IsidorusConstants.java ============================================================================== --- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/isidorus/IsidorusConstants.java Mon Sep 19 02:18:12 2011 (r920) +++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/isidorus/IsidorusConstants.java Mon Sep 19 02:28:50 2011 (r921) @@ -1,8 +1,6 @@ package us.isidor.gdl.anaToMia.Widgets.isidorus;
- -import com.google.gwt.core.client.GWT; import com.google.gwt.user.client.Window;
@@ -15,9 +13,12 @@ public final static String DELETE_REQUEST_URL = Window.Location.getProtocol() + "//" + Window.Location.getHost() + "/gdl/delete"; public final static String COMMIT_REQUEST_URL = Window.Location.getProtocol() + "//" + Window.Location.getHost() + "/gdl/commit"; public final static String GET_FRAGMENT_REQUEST_URL = Window.Location.getProtocol() + "//" + Window.Location.getHost() + "/gdl/fragment/"; - //public final static String GET_SCHEMA_REQUEST_URL = Window.Location.getProtocol() + "//" + Window.Location.getHost() + "/gdl/schema"; - public final static String GET_SCHEMA_REQUEST_URL = GWT.getModuleBaseURL() + "TextGrid_ServiceRegistry_required_TMCL_and_GDL_Schema_with_test_data.jtm"; - public final static String GET_HASH_OBJECT_PSIS_URL = GWT.getModuleBaseURL() + "HashObjectPsis.json"; - public final static String GET_ENVIRONMENT_PSIS_URL = GWT.getModuleBaseURL() + "EnvironmentPsis.json"; - public final static String TEXTGRID_LOGO_URL = GWT.getModuleBaseURL() + "textgrid_small.png"; + public final static String GET_SCHEMA_REQUEST_URL = Window.Location.getProtocol() + "//" + Window.Location.getHost() + "/gdl/schema"; + //public final static String GET_SCHEMA_REQUEST_URL = GWT.getModuleBaseURL() + "TextGrid_ServiceRegistry_required_TMCL_and_GDL_Schema_with_test_data.jtm"; + public final static String GET_HASH_OBJECT_PSIS_URL = Window.Location.getProtocol() + "//" + Window.Location.getHost() + "/gdl/tm-sparql"; + //public final static String GET_HASH_OBJECT_PSIS_URL = GWT.getModuleBaseURL() + "HashObjectPsis.json"; + public final static String GET_ENVIRONMENT_PSIS_URL = Window.Location.getProtocol() + "//" + Window.Location.getHost() + "/gdl/tm-sparql"; + //public final static String GET_ENVIRONMENT_PSIS_URL = GWT.getModuleBaseURL() + "EnvironmentPsis.json"; + public final static String TEXTGRID_LOGO_URL = Window.Location.getProtocol() + "//" + Window.Location.getHost() + "textgrid_small.png"; + //public final static String TEXTGRID_LOGO_URL = GWT.getModuleBaseURL() + "textgrid_small.png"; }