Use a single configuration entry for the service home URL and avoid hardcoding it...
authorPanagiotis Astithas <pastith@gmail.com>
Tue, 30 Jun 2009 14:14:13 +0000 (17:14 +0300)
committerPanagiotis Astithas <pastith@gmail.com>
Tue, 30 Jun 2009 14:14:13 +0000 (17:14 +0300)
src/gr/ebs/gss/client/Configuration.java
src/gr/ebs/gss/client/Configuration.properties
src/gr/ebs/gss/client/CredentialsDialog.java
src/gr/ebs/gss/client/TopPanel.java

index 67f1e96..3435fdc 100644 (file)
@@ -78,6 +78,12 @@ public interface Configuration extends Constants {
        String webdavUrl();
 
        /**
+        * @return the URL of the service home page
+        */
+       @DefaultStringValue("http://localhost:8080/")
+       String serviceHome();
+
+       /**
         * @return the token TTL note
         */
        @DefaultStringValue("")
index f4c8e6f..d10e2e8 100644 (file)
@@ -5,5 +5,6 @@ authCookie=_gss_a
 webdavCookie=_gss_wd
 cookieSeparator=|
 apiPath=rest/
-webdavUrl=http://pithos.grnet.gr/webdav/
+serviceHome=http://pithos.grnet.gr/
+webdavUrl=webdav/
 tokenTTLNote=The token is valid for 30 days.
\ No newline at end of file
index 1566a34..207b3ed 100644 (file)
@@ -129,7 +129,7 @@ public class CredentialsDialog extends DialogBox {
                VerticalPanel outer = new VerticalPanel();
                Configuration conf = (Configuration) GWT.create(Configuration.class);
                String service = conf.serviceName();
-               String webdavUrl = conf.webdavUrl();
+               String webdavUrl = conf.serviceHome() + conf.webdavUrl();
                String tokenNote = conf.tokenTTLNote();
                // Create the text and set a style name so we can style it with CSS.
                HTML text = new HTML("<p>These are the user credentials that are required " +
index 9d346a6..56bde79 100644 (file)
@@ -18,6 +18,7 @@
  */\r
 package gr.ebs.gss.client;\r
 \r
+import com.google.gwt.core.client.GWT;\r
 import com.google.gwt.user.client.Command;\r
 import com.google.gwt.user.client.ui.AbstractImagePrototype;\r
 import com.google.gwt.user.client.ui.Composite;\r
@@ -170,9 +171,11 @@ public class TopPanel extends Composite {
                outer.add(menu);\r
                outer.setStyleName("toolbar");\r
 \r
-               HTML logos = new HTML("<table><tr><td><a href='http://pithos.grnet.gr/' target='gss'>" +\r
-                                       images.gssLogo().getHTML() + "</a><a href='http://www.grnet.gr/' " +\r
-                                       "target='grnet'>" + images.grnetLogo().getHTML()+"</a></td></tr></table>");\r
+               Configuration conf = (Configuration) GWT.create(Configuration.class);\r
+               HTML logos = new HTML("<table><tr><td><a href='" + conf.serviceHome() +\r
+                                       "' target='gss'>" +     images.gssLogo().getHTML() +\r
+                                       "</a><a href='http://www.grnet.gr/' " + "target='grnet'>" +\r
+                                       images.grnetLogo().getHTML()+"</a></td></tr></table>");\r
                outer.add(logos);\r
 \r
                outer.setCellHorizontalAlignment(logos, HasHorizontalAlignment.ALIGN_RIGHT);\r