Removed or commented out various things not related to v.2
authorChristos Stathis <chstath@ebs.gr>
Fri, 6 May 2011 14:26:06 +0000 (17:26 +0300)
committerChristos Stathis <chstath@ebs.gr>
Fri, 6 May 2011 14:26:06 +0000 (17:26 +0300)
build.xml
src/gr/grnet/pithos/web/client/Configuration.java
src/gr/grnet/pithos/web/client/Configuration.properties
src/gr/grnet/pithos/web/client/CredentialsDialog.java
src/gr/grnet/pithos/web/client/GSS.java

index 14b3129..fcc2b16 100644 (file)
--- a/build.xml
+++ b/build.xml
@@ -1,23 +1,11 @@
 <?xml version="1.0" encoding="utf-8" ?>
-<project name="gss" default="package-war" basedir=".">
+<project name="gss" default="gwt-compile" basedir=".">
        <description>The GSS project build file</description>
 
        <property file="build.properties"/>
     <property name="deps.dir" value="dependencies"/>
 
     <property name="gwt.workers" value="1"/>
-    <property name="jboss.args" value="-b 0.0.0.0" />
-
-    <property name="jboss.version" value="5.1.0"/>
-    <property name="jboss.home" value="${deps.dir}/jboss-${jboss.version}.GA" />
-    <property name="jboss.bin.dir" value="${jboss.home}/bin" />
-    <property name="jboss.conf.dir" value="${jboss.home}/server/default/conf" />
-    <property name="jboss.deploy.dir" value="${jboss.home}/server/default/deploy" />
-    <property name="jboss.lib.dir" value="${jboss.home}/server/default/lib" />
-    <property name="jboss.root.lib.dir" value="${jboss.home}/lib" />
-    <property name="jboss.common.lib.dir" value="${jboss.home}/common/lib" />
-    <property name="jboss.filename" value="jboss-${jboss.version}.GA-jdk6.zip"/>
-       <property name="jboss.download.url" value="http://switch.dl.sourceforge.net/project/jboss/JBoss/JBoss-${jboss.version}.GA/${jboss.filename}"/>
 
     <property name="gwt.version" value="2.1.1"/>
        <property name="gwt.home" value="${deps.dir}/gwt-${gwt.version}"/>
        <!-- set classpath -->
        <path id="project.class.path">
         <pathelement location="${gwt.home}/gwt-user.jar"/>
-        <pathelement location="${war.lib.dir}/commons-fileupload-1.2.jar"/>
        </path>
 
        <target name="check-dependencies" description="Checks if all dependencies are present">
         <condition property="dependencies.present">
             <and>
-                <available file="${jboss.home}" type="dir"/>
                 <available file="${gwt.home}" type="dir"/>
                 <available file="${gwt-gears.home}" type="dir"/>
                 <available file="${deps.dir}/${gwtquery.filename}"/>
                </java>
         <!--move file="${gwt.www.dir}/${gwt.module}/${gwt.module.class}.html" tofile="${gwt.www.dir}/${gwt.module}/index.html"/-->
        </target>
-       
-    <target name="package-war" depends="gwt-compile" description="Package up the web client as a war">
-        <jar destfile="${build.dir}/${dist.war}">
-            <zipfileset dir="${war.dir}"/>
-            <zipfileset dir="${gwt.www.dir}/${gwt.module}"/>
-        </jar>
-    </target>
 
        <target name="clean" description="Delete all build artifacts">
                <delete dir="${build.dir}"/>
index 9cc414e..5da52b4 100644 (file)
@@ -21,7 +21,7 @@ public interface Configuration extends Constants {
        /**
         * @return the login URL
         */
-       @DefaultStringValue("/pithos/login")
+       @DefaultStringValue("pithos/login")
        String loginUrl();
 
        /**
@@ -37,12 +37,6 @@ public interface Configuration extends Constants {
        String authCookie();
 
        /**
-        * @return the webdav cookie name
-        */
-       @DefaultStringValue("_gss_wd")
-       String webdavCookie();
-
-       /**
         * @return the separator string between username and token in the
         * authentication cookie
         */
@@ -56,18 +50,6 @@ public interface Configuration extends Constants {
        String apiPath();
 
        /**
-        * @return the WebDAV URL
-        */
-       @DefaultStringValue("/webdav/")
-       String webdavUrl();
-
-       /**
-        * @return the token TTL note
-        */
-       @DefaultStringValue("")
-       String tokenTTLNote();
-
-       /**
         * @return the version string
         */
        @DefaultStringValue("")
index e6d63c1..a230d37 100644 (file)
@@ -3,12 +3,9 @@
 #
 
 serviceName=Pithos
-loginUrl=login
+loginUrl=pithos/login
 logoutUrl=/Shibboleth.sso/Logout
-authCookie=_gss_a
-webdavCookie=_gss_wd
+authCookie=_pithos_a
 cookieSeparator=|
-apiPath=rest/
-webdavUrl=/webdav/
-tokenTTLNote=The token is valid for 30 days.
-version=1.5
\ No newline at end of file
+apiPath=v1/
+version=2.0
\ No newline at end of file
index a92ae7e..0b157ee 100644 (file)
@@ -34,8 +34,6 @@ public class CredentialsDialog extends DialogBox {
        private final String WIDTH_FIELD = "35em";
        private final String WIDTH_TEXT = "42em";
 
-       private TextBox passwordBox;
-
        /**
         * The 'confirm reset password' dialog box.
         */
@@ -173,25 +171,15 @@ public class CredentialsDialog extends DialogBox {
                VerticalPanel outer = new VerticalPanel();
                Configuration conf = (Configuration) GWT.create(Configuration.class);
                String service = conf.serviceName();
-        String path = Window.Location.getPath();
-        String baseUrl = GWT.getModuleBaseURL();
-        String homeUrl = baseUrl.substring(0, baseUrl.indexOf(path));
-               String webdavUrl = homeUrl + 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 for interacting with " + service + ". You can copy" +
-                               " and paste the username and password in the WebDAV client " +
-                               "in order to use " + service + " through the WebDAV " +
-                               "interface, at:<br/> " + webdavUrl + "<br/>" + tokenNote +
-                               "</p>");
+                               "required for interacting with " + service + ".");
                text.setStyleName("pithos-AboutText");
                text.setWidth(WIDTH_TEXT);
                outer.add(text);
                FlexTable table = new FlexTable();
                table.setText(0, 0, "Username");
-               table.setText(1, 0, "Password");
-               table.setText(2, 0, "Token");
+               table.setText(1, 0, "Token");
                TextBox username = new TextBox();
                final GSS app = GSS.get();
                username.setText(app.getCurrentUserResource().getUsername());
@@ -207,20 +195,6 @@ public class CredentialsDialog extends DialogBox {
 
                });
                table.setWidget(0, 1, username);
-               passwordBox = new TextBox();
-               passwordBox.setText(app.getWebDAVPassword());
-               passwordBox.setReadOnly(true);
-               passwordBox.setWidth(WIDTH_FIELD);
-               passwordBox.addClickHandler(new  ClickHandler() {
-                       @Override
-                       public void onClick(ClickEvent event) {
-                               GSS.enableIESelection();
-                               ((TextBox) event.getSource()).selectAll();
-                               GSS.preventIESelection();
-                       }
-
-               });
-               table.setWidget(1, 1, passwordBox);
 
                TextBox tokenBox = new TextBox();
                tokenBox.setText(app.getToken());
@@ -235,14 +209,12 @@ public class CredentialsDialog extends DialogBox {
                        }
 
                });
-               table.setWidget(2, 1, tokenBox);
+               table.setWidget(1, 1, tokenBox);
 
                table.getFlexCellFormatter().setStyleName(0, 0, "props-labels");
                table.getFlexCellFormatter().setStyleName(0, 1, "props-values");
                table.getFlexCellFormatter().setStyleName(1, 0, "props-labels");
                table.getFlexCellFormatter().setStyleName(1, 1, "props-values");
-               table.getFlexCellFormatter().setStyleName(2, 0, "props-labels");
-               table.getFlexCellFormatter().setStyleName(2, 1, "props-values");
                outer.add(table);
 
                // Create the 'OK' button, along with a listener that hides the dialog
@@ -291,7 +263,6 @@ public class CredentialsDialog extends DialogBox {
        /**
         * Generate an RPC request to reset WebDAV password.
         *
-        * @param userId the Uri of the user whose password will be reset
         */
        private void resetPassword(String userUri) {
 
index 24c3b56..bd1e28a 100644 (file)
@@ -350,15 +350,6 @@ public class GSS implements EntryPoint, ResizeHandler {
                        public void onComplete() {
                                
                                currentUserResource = getResult();
-                               final String announcement = currentUserResource.getAnnouncement();
-                               if (announcement != null)
-                                       DeferredCommand.addCommand(new Command() {
-
-                                               @Override
-                                               public void execute() {
-                                                       displayInformation(announcement);
-                                               }
-                                       });
                        }
 
                        @Override
@@ -378,24 +369,25 @@ public class GSS implements EntryPoint, ResizeHandler {
         * Parse and store the user credentials to the appropriate fields.
         */
        private void parseUserCredentials() {
-               Configuration conf = (Configuration) GWT.create(Configuration.class);
-               String cookie = conf.authCookie();
-               String auth = Cookies.getCookie(cookie);
-               if (auth == null) {
-                       authenticateUser();
-                       // Redundant, but silences warnings about possible auth NPE, below.
-                       return;
-               }
-               int sepIndex = auth.indexOf(conf.cookieSeparator());
-               if (sepIndex == -1)
-                       authenticateUser();
-               token = auth.substring(sepIndex + 1);
-               final String username = auth.substring(0, sepIndex);
-               if (username == null)
-                       authenticateUser();
-
-               refreshWebDAVPassword();
-
+//             Configuration conf = (Configuration) GWT.create(Configuration.class);
+//             String cookie = conf.authCookie();
+//             String auth = Cookies.getCookie(cookie);
+//             if (auth == null) {
+//                     authenticateUser();
+//                     // Redundant, but silences warnings about possible auth NPE, below.
+//                     return;
+//             }
+//             int sepIndex = auth.indexOf(conf.cookieSeparator());
+//             if (sepIndex == -1)
+//                     authenticateUser();
+//             token = auth.substring(sepIndex + 1);
+//             final String username = auth.substring(0, sepIndex);
+//             if (username == null)
+//                     authenticateUser();
+//
+//             refreshWebDAVPassword();
+
+        final String username = "test";
                DeferredCommand.addCommand(new Command() {
 
                        @Override
@@ -409,12 +401,13 @@ public class GSS implements EntryPoint, ResizeHandler {
         * Redirect the user to the login page for authentication.
         */
        protected void authenticateUser() {
-               Configuration conf = (Configuration) GWT.create(Configuration.class);
+//             Configuration conf = (Configuration) GWT.create(Configuration.class);
         //IMPORTANT: Temporary circumvention of the Shiboleth login process for development and testing
         //Some time in the future the comment line will be restored
-               //Window.Location.assign(GWT.getModuleBaseURL() + conf.loginUrl() + "?next=" + GWT.getModuleBaseURL());
-        Cookies.setCookie(conf.authCookie(), "chstath@ebs.gr" + conf.cookieSeparator() + "triapoulakiakathontan");
-        Window.Location.assign(GWT.getModuleBaseURL());
+        
+//        Window.Location.assign(GWT.getModuleBaseURL() + conf.loginUrl() + "?next=" + Window.Location.getHref());
+//        Cookies.setCookie(conf.authCookie(), "chstath@ebs.gr" + conf.cookieSeparator() + "triapoulakiakathontan");
+//        Window.Location.assign(GWT.getModuleBaseURL());
        }
 
        /**
@@ -759,15 +752,6 @@ public class GSS implements EntryPoint, ResizeHandler {
                return GWT.getModuleBaseURL() + conf.apiPath();
        }
 
-       public void refreshWebDAVPassword() {
-               Configuration conf = (Configuration) GWT.create(Configuration.class);
-               String domain = Window.Location.getHostName();
-               String path = Window.Location.getPath();
-               String cookie = conf.webdavCookie();
-               webDAVPassword = Cookies.getCookie(cookie);
-               Cookies.setCookie(cookie, "", null, domain, path, false);
-       }
-
        /**
         * Convert server date to local time according to browser timezone
         * and format it according to localized pattern.