<?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}"/>
/**
* @return the login URL
*/
- @DefaultStringValue("/pithos/login")
+ @DefaultStringValue("pithos/login")
String loginUrl();
/**
String authCookie();
/**
- * @return the webdav cookie name
- */
- @DefaultStringValue("_gss_wd")
- String webdavCookie();
-
- /**
* @return the separator string between username and token in the
* authentication cookie
*/
String apiPath();
/**
- * @return the WebDAV URL
- */
- @DefaultStringValue("/webdav/")
- String webdavUrl();
-
- /**
- * @return the token TTL note
- */
- @DefaultStringValue("")
- String tokenTTLNote();
-
- /**
* @return the version string
*/
@DefaultStringValue("")
#
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
private final String WIDTH_FIELD = "35em";
private final String WIDTH_TEXT = "42em";
- private TextBox passwordBox;
-
/**
* The 'confirm reset password' dialog box.
*/
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());
});
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());
}
});
- 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
/**
* 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) {
public void onComplete() {
currentUserResource = getResult();
- final String announcement = currentUserResource.getAnnouncement();
- if (announcement != null)
- DeferredCommand.addCommand(new Command() {
-
- @Override
- public void execute() {
- displayInformation(announcement);
- }
- });
}
@Override
* 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
* 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());
}
/**
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.