[Yanel-commits] rev 32478 - in public/yanel/contributions/ajax-components/src/access-policy-editor/java/org/wyona/yanel/gwt/accesspolicyeditor: client public

michi at wyona.com michi at wyona.com
Tue Feb 26 09:38:39 CET 2008


Author: michi
Date: 2008-02-26 09:38:38 +0100 (Tue, 26 Feb 2008)
New Revision: 32478

Modified:
   public/yanel/contributions/ajax-components/src/access-policy-editor/java/org/wyona/yanel/gwt/accesspolicyeditor/client/AccessPolicyEditor.java
   public/yanel/contributions/ajax-components/src/access-policy-editor/java/org/wyona/yanel/gwt/accesspolicyeditor/public/TestAccessPolicyEditor.html
Log:
read urls from host page

Modified: public/yanel/contributions/ajax-components/src/access-policy-editor/java/org/wyona/yanel/gwt/accesspolicyeditor/client/AccessPolicyEditor.java
===================================================================
--- public/yanel/contributions/ajax-components/src/access-policy-editor/java/org/wyona/yanel/gwt/accesspolicyeditor/client/AccessPolicyEditor.java	2008-02-26 08:16:39 UTC (rev 32477)
+++ public/yanel/contributions/ajax-components/src/access-policy-editor/java/org/wyona/yanel/gwt/accesspolicyeditor/client/AccessPolicyEditor.java	2008-02-26 08:38:38 UTC (rev 32478)
@@ -45,19 +45,19 @@
      *
      */
     public void onModuleLoad() {
+        String identitiesURL = "sample-identities-and-usecases.xml";
+        String policyURL = "sample-policy.xml";
         try {
             Dictionary dict = Dictionary.getDictionary("getURLs");
-            String identitiesURL = dict.get("identities-url");
-            Window.alert("Identities URL: " + identitiesURL);
-            String policyURL = dict.get("policy-url");
-            Window.alert("Policy URL: " + policyURL);
+            identitiesURL = dict.get("identities-url");
+            policyURL = dict.get("policy-url");
         } catch (java.util.MissingResourceException e) {
             Window.alert("Exception: " + e.getMessage());
         }
 
         // Get data from server
-        getIdentitiesAndRights();
-        String[] policyIdentities = getPolicy();
+        getIdentitiesAndRights(identitiesURL);
+        String[] policyIdentities = getPolicy(policyURL);
 
         // Setup GUI
         VerticalPanel vp = new VerticalPanel();
@@ -95,9 +95,10 @@
     /**
      * Get identities and rights
      */
-    private void getIdentitiesAndRights() {
+    private void getIdentitiesAndRights(String url) {
         // TODO: See src/extra/globus/image-browser/src/java/ch/globus/yanel/gwt/client/ImageBrowser.java how to use Asyn Identities and Rights Getter!
 
+        Window.alert("Load identities: " + url);
         final AsynchronousIdentitiesAndRightsGetter ag = new AsynchronousIdentitiesAndRightsGetter("sample-identities-and-usecases.xml");
         try {
             final com.google.gwt.http.client.Request request = ag.execute();
@@ -133,10 +134,11 @@
     /**
      * Get policy
      */
-    private String[] getPolicy() {
+    private String[] getPolicy(String url) {
         // TODO: See src/extra/globus/image-browser/src/java/ch/globus/yanel/gwt/client/ImageBrowser.java how to use Asyn Policy Getter!
 
-        final AsynchronousPolicyGetter apg = new AsynchronousPolicyGetter("sample-policy.xml");
+        Window.alert("Load policy: " + url);
+        final AsynchronousPolicyGetter apg = new AsynchronousPolicyGetter(url);
         try {
             final com.google.gwt.http.client.Request request = apg.execute();
             //Window.alert("Just a second to process the policy response ...");

Modified: public/yanel/contributions/ajax-components/src/access-policy-editor/java/org/wyona/yanel/gwt/accesspolicyeditor/public/TestAccessPolicyEditor.html
===================================================================
--- public/yanel/contributions/ajax-components/src/access-policy-editor/java/org/wyona/yanel/gwt/accesspolicyeditor/public/TestAccessPolicyEditor.html	2008-02-26 08:16:39 UTC (rev 32477)
+++ public/yanel/contributions/ajax-components/src/access-policy-editor/java/org/wyona/yanel/gwt/accesspolicyeditor/public/TestAccessPolicyEditor.html	2008-02-26 08:38:38 UTC (rev 32478)
@@ -7,8 +7,9 @@
   <body bgcolor="white"> 
     <h1>Test Access Policy Editor</h1>
 <p>
-    <script type="text/javascript">
-      var getURLs = {identities-url: "sample-identities-and-usecases.xml", policy-url: "sample-policy.xml"};
+    <script language="javascript">
+      var getURLs = {"identities-url": "sample-identities-and-usecases.xml", "policy-url": "sample-policy.xml"};
+      //window.alert(getURLs);
     </script>
 
     <script language="javascript" src="org.wyona.yanel.gwt.accesspolicyeditor.AccessPolicyEditor.nocache.js">



More information about the Yanel-commits mailing list