From f0105e9f1279487a2a8f84f9d42db1642a2ac7c1 Mon Sep 17 00:00:00 2001 From: Christos Stathis Date: Fri, 2 Mar 2012 17:29:50 +0200 Subject: [PATCH] Cloudbar variables and loginUrl are configurable through runtime.properties and build.xml --- build.xml | 35 ++++++++++++++++++-- runtime.properties | 5 +++ src/gr/grnet/pithos/web/client/Configuration.java | 6 ---- .../pithos/web/client/Configuration.properties | 1 - src/gr/grnet/pithos/web/client/Pithos.java | 4 ++- src/gr/grnet/pithos/web/public/index.html | 5 +++ 6 files changed, 45 insertions(+), 11 deletions(-) create mode 100644 runtime.properties diff --git a/build.xml b/build.xml index 76fd86d..d132a2e 100644 --- a/build.xml +++ b/build.xml @@ -1,8 +1,9 @@ - + The Pithos web client project build file + @@ -73,10 +74,38 @@ - + + + + + + + + + - + diff --git a/runtime.properties b/runtime.properties new file mode 100644 index 0000000..675bbef --- /dev/null +++ b/runtime.properties @@ -0,0 +1,5 @@ +loginUrl=/im/login?next=/ui +CLOUDBAR_ACTIVE_SERVICE = pithos +CLOUDBAR_LOCATION = /static/im/cloudbar/ +CLOUDBAR_SERVICES = /im/get_services +CLOUDBAR_MENU = /im/get_menu diff --git a/src/gr/grnet/pithos/web/client/Configuration.java b/src/gr/grnet/pithos/web/client/Configuration.java index a3ce127..5715b95 100644 --- a/src/gr/grnet/pithos/web/client/Configuration.java +++ b/src/gr/grnet/pithos/web/client/Configuration.java @@ -44,12 +44,6 @@ import com.google.gwt.i18n.client.Constants; */ public interface Configuration extends Constants { /** - * @return the login URL - */ - @DefaultStringValue("/im/login?next=/ui") - String loginUrl(); - - /** * @return the authentication cookie name */ @DefaultStringValue("_pithos2_a") diff --git a/src/gr/grnet/pithos/web/client/Configuration.properties b/src/gr/grnet/pithos/web/client/Configuration.properties index 46d2bc0..a76c6ae 100644 --- a/src/gr/grnet/pithos/web/client/Configuration.properties +++ b/src/gr/grnet/pithos/web/client/Configuration.properties @@ -39,4 +39,3 @@ apiPath=/v1/ version=0.8.1 authTokenCookie=X-Auth-Token shibSessionCookiePrefix=_shibsession_ -loginUrl=/im/login?next=/ui diff --git a/src/gr/grnet/pithos/web/client/Pithos.java b/src/gr/grnet/pithos/web/client/Pithos.java index 28f5d89..9d75105 100644 --- a/src/gr/grnet/pithos/web/client/Pithos.java +++ b/src/gr/grnet/pithos/web/client/Pithos.java @@ -75,6 +75,7 @@ import com.google.gwt.http.client.RequestCallback; import com.google.gwt.http.client.RequestException; import com.google.gwt.http.client.Response; import com.google.gwt.http.client.URL; +import com.google.gwt.i18n.client.Dictionary; import com.google.gwt.i18n.client.NumberFormat; import com.google.gwt.json.client.JSONArray; import com.google.gwt.json.client.JSONObject; @@ -545,7 +546,8 @@ public class Pithos implements EntryPoint, ResizeHandler { * Redirect the user to the login page for authentication. */ protected void authenticateUser() { - Window.Location.assign(config.loginUrl()); + Dictionary otherProperties = Dictionary.getDictionary("otherProperties"); + Window.Location.assign(otherProperties.get("loginUrl")); } protected void fetchAccount(final Command callback) { diff --git a/src/gr/grnet/pithos/web/public/index.html b/src/gr/grnet/pithos/web/public/index.html index 905f9f2..19e4377 100644 --- a/src/gr/grnet/pithos/web/public/index.html +++ b/src/gr/grnet/pithos/web/public/index.html @@ -64,6 +64,11 @@ $.getScript(CLOUDBAR_LOCATION + 'cloudbar.js'); }) + -- 1.7.10.4