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

michi at wyona.com michi at wyona.com
Thu Oct 15 14:28:09 CEST 2009


Author: michi
Date: 2009-10-15 14:28:08 +0200 (Thu, 15 Oct 2009)
New Revision: 45048

Modified:
   public/yanel/contributions/ajax-components/src/access-policy-editor/java/org/wyona/security/gwt/accesspolicyeditor/client/AccessPolicyEditor.java
Log:
make use of the cancel base URL flag

Modified: public/yanel/contributions/ajax-components/src/access-policy-editor/java/org/wyona/security/gwt/accesspolicyeditor/client/AccessPolicyEditor.java
===================================================================
--- public/yanel/contributions/ajax-components/src/access-policy-editor/java/org/wyona/security/gwt/accesspolicyeditor/client/AccessPolicyEditor.java	2009-10-15 12:27:43 UTC (rev 45047)
+++ public/yanel/contributions/ajax-components/src/access-policy-editor/java/org/wyona/security/gwt/accesspolicyeditor/client/AccessPolicyEditor.java	2009-10-15 12:28:08 UTC (rev 45048)
@@ -69,6 +69,7 @@
 
         String identitiesURL = "DEFAULT-identities-and-usecases.xml";
         String readPolicyURL = "DEFAULT-policy.xml";
+        boolean cancelURLBaseEqualsHostPageURL = false;
         String cancelURL = "DEFAULT-cancel.html";
         String savePolicyURL = "DEFAULT-save-policy.xml";
         // Get URLs from host/html page
@@ -77,6 +78,7 @@
             identitiesURL = dict.get("identities-url");
             readPolicyURL = dict.get("policy-url");
             cancelURL = dict.get("cancel-url");
+            cancelURLBaseEqualsHostPageURL = new Boolean(dict.get("cancel-url-base-equals-host-page-url")).booleanValue();
             savePolicyURL = dict.get("save-url");
         } catch (java.util.MissingResourceException e) {
             Window.alert("Exception: " + e.getMessage());
@@ -183,10 +185,15 @@
 
         // Cancel Button
         final String cancelUrl = cancelURL;
+        final boolean cancelURLBaseEqualsHostPageURLFinal = cancelURLBaseEqualsHostPageURL;
         Button cancelButton = new Button("Cancel/Close", new ClickListener() {
             public void onClick(Widget sender) {
                 //Window.alert("Redirect to " + cancelUrl);
-                redirectTo(GWT.getHostPageBaseURL() + cancelUrl);
+                if (cancelURLBaseEqualsHostPageURLFinal) {
+                    redirectTo(GWT.getHostPageBaseURL() + cancelUrl);
+                } else {
+                    redirectTo(cancelUrl);
+                }
             }
             public native void redirectTo(String url) /*-{
                 $wnd.location.href=url;



More information about the Yanel-commits mailing list