2013-04-10 18:32:02 +02:00
|
|
|
package org.gcube.portlets.user.gcubeloggedin.client;
|
|
|
|
|
2013-04-11 12:42:56 +02:00
|
|
|
import org.gcube.portlets.user.gcubeloggedin.client.ui.AboutView;
|
2013-04-10 18:32:02 +02:00
|
|
|
import org.gcube.portlets.user.gcubeloggedin.shared.VObject;
|
|
|
|
|
|
|
|
import com.google.gwt.core.client.EntryPoint;
|
|
|
|
import com.google.gwt.core.client.GWT;
|
2014-12-11 18:38:17 +01:00
|
|
|
import com.google.gwt.user.client.Window.Location;
|
2013-04-10 18:32:02 +02:00
|
|
|
import com.google.gwt.user.client.rpc.AsyncCallback;
|
|
|
|
import com.google.gwt.user.client.rpc.ServiceDefTarget;
|
|
|
|
import com.google.gwt.user.client.ui.HTML;
|
|
|
|
import com.google.gwt.user.client.ui.RootPanel;
|
|
|
|
import com.google.gwt.user.client.ui.VerticalPanel;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Entry point classes define <code>onModuleLoad()</code>.
|
|
|
|
*/
|
|
|
|
public class GCubeLoggedin implements EntryPoint {
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a remote service proxy to talk to the server-side Greeting service.
|
|
|
|
*/
|
|
|
|
private final LoggedinServiceAsync loggedinService = GWT.create(LoggedinService.class);
|
|
|
|
private ServiceDefTarget endpoint = (ServiceDefTarget) loggedinService;
|
|
|
|
private VerticalPanel main_panel = new VerticalPanel();
|
|
|
|
/**
|
|
|
|
* This is the entry point method.
|
|
|
|
*/
|
|
|
|
public void onModuleLoad() {
|
|
|
|
main_panel.setWidth("100%");
|
|
|
|
|
|
|
|
endpoint.setServiceEntryPoint(GWT.getModuleBaseURL()+"LoggedinServiceImpl");
|
2015-05-12 14:02:17 +02:00
|
|
|
main_panel.add(AboutView.getLoadingHTML());
|
2013-04-10 18:32:02 +02:00
|
|
|
// Associate the new panel with the HTML host page.
|
|
|
|
RootPanel.get("LoggedinDiv").add(main_panel);
|
|
|
|
|
2014-12-11 18:38:17 +01:00
|
|
|
loggedinService.getSelectedRE(Location.getHref(), new AsyncCallback<VObject>() {
|
2015-05-12 14:02:17 +02:00
|
|
|
public void onFailure(Throwable caught) {
|
|
|
|
main_panel.add(new HTML("<div style=\"height: 450px; text-align:center; vertical-align:text-top;\">"
|
|
|
|
+ "<p>Sorry there was a problem on the server, please reload this page</p></div>" ));
|
|
|
|
|
|
|
|
}
|
2013-04-10 18:32:02 +02:00
|
|
|
|
|
|
|
public void onSuccess(VObject result) {
|
2014-09-15 19:02:39 +02:00
|
|
|
|
2013-04-10 18:32:02 +02:00
|
|
|
main_panel.clear();
|
2013-04-11 12:42:56 +02:00
|
|
|
main_panel.add(new AboutView(result, loggedinService));
|
2013-04-10 18:32:02 +02:00
|
|
|
}
|
2013-04-11 12:42:56 +02:00
|
|
|
});
|
2015-05-12 14:02:17 +02:00
|
|
|
}
|
2014-09-15 19:02:39 +02:00
|
|
|
|
2013-04-10 18:32:02 +02:00
|
|
|
}
|