refs 3251: Accounting Manager - Fix back button behavior

Task-Url: https://support.d4science.org/issues/3251

Fix back button behavior 

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/admin/accounting-manager@128086 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2016-04-14 13:16:32 +00:00
parent 85a8a1dfe5
commit 6d164eb7f1
3 changed files with 80 additions and 30 deletions

View File

@ -1,10 +1,21 @@
<ReleaseNotes>
<Changeset component="org.gcube.portlets.admin.accounting-manager.1-1-0" date="2016-01-31">
<Change>Added to Storage Accounting more formats for DataVolume axis [Ticket #1831]</Change>
<Change>Fixed on Storage Accounting the popup validation on filters [Ticket #1832]</Change>
<Changeset component="org.gcube.portlets.admin.accounting-manager.1-2-0"
date="2016-05-01">
<Change>Added Top N Chart[Ticket #2251]</Change>
<Change>Fixed back button behavior[Ticket #3251]</Change>
</Changeset>
<Changeset component="org.gcube.portlets.admin.accounting-manager.1-1-0"
date="2016-01-31">
<Change>Added to Storage Accounting more formats for DataVolume axis
[Ticket #1831]
</Change>
<Change>Fixed on Storage Accounting the popup validation on filters
[Ticket #1832]
</Change>
<Change>Fixed library dependencies</Change>
</Changeset>
<Changeset component="org.gcube.portlets.admin.accounting-manager.1-0-0" date="2015-10-15">
<Changeset component="org.gcube.portlets.admin.accounting-manager.1-0-0"
date="2015-10-15">
<Change>First Release</Change>
</Changeset>
</ReleaseNotes>

View File

@ -6,6 +6,8 @@ import org.gcube.portlets.admin.accountingmanager.client.menu.AccountingManagerM
import org.gcube.portlets.admin.accountingmanager.client.resource.AccountingManagerResources;
import org.gcube.portlets.admin.accountingmanager.client.rpc.AccountingManagerService;
import org.gcube.portlets.admin.accountingmanager.client.rpc.AccountingManagerServiceAsync;
import org.gcube.portlets.admin.accountingmanager.client.utils.UtilsGXT3;
import org.gcube.portlets.user.gcubewidgets.client.ClientScopeHelper;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.client.EntryPoint;
@ -13,6 +15,8 @@ import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.Scheduler;
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.user.client.Window.Location;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.RootPanel;
import com.sencha.gxt.core.client.util.Margins;
import com.sencha.gxt.widget.core.client.container.BorderLayoutContainer;
@ -28,12 +32,8 @@ import com.sencha.gxt.widget.core.client.container.Viewport;
*/
public class AccountingManager implements EntryPoint {
private static final String JSP_TAG_ID = "AccountingManagerPortlet";
@SuppressWarnings("unused")
private final AccountingManagerServiceAsync accountingManagerService = GWT
.create(AccountingManagerService.class);
@ -41,7 +41,6 @@ public class AccountingManager implements EntryPoint {
// Main Panel
private static BorderLayoutContainer mainPanelLayout;
/**
* {@inheritDoc}
*/
@ -57,14 +56,39 @@ public class AccountingManager implements EntryPoint {
// onModuleLoad2
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
public void execute() {
loadMainPanel();
loadScope();
}
});
}
protected void loadMainPanel() {
AccountingManagerResources.INSTANCE.accountingManagerCSS().ensureInjected();
private void loadScope() {
ClientScopeHelper.getService().setScope(Location.getHref(),
new AsyncCallback<Boolean>() {
@Override
public void onSuccess(Boolean result) {
if (result) {
loadMainPanel();
} else {
UtilsGXT3
.info("Attention",
"ClientScopeHelper has returned a false value!");
}
}
@Override
public void onFailure(Throwable caught) {
UtilsGXT3.alert("Error", "Error setting scope: "
+ caught.getLocalizedMessage());
caught.printStackTrace();
}
});
}
private void loadMainPanel() {
AccountingManagerResources.INSTANCE.accountingManagerCSS()
.ensureInjected();
// ScriptInjector.fromString(AccountingManagerResources.INSTANCE.jqueryJs().getText()).setWindow(ScriptInjector.TOP_WINDOW).inject();
AccountingManagerController controller = new AccountingManagerController();
@ -77,14 +101,14 @@ public class AccountingManager implements EntryPoint {
mainPanelLayout.setResize(true);
// mainPanelLayout.getElement().getStyle().setBackgroundColor("rgb(3, 126, 207)");
// Main
final MainDataPanel mainDataPanel = new MainDataPanel(eventBus);
MarginData mainData = new MarginData(new Margins(2));
mainPanelLayout.setCenterWidget(mainDataPanel, mainData);
// Menu
AccountingManagerMenu accountingManagerMenu=new AccountingManagerMenu(eventBus);
AccountingManagerMenu accountingManagerMenu = new AccountingManagerMenu(
eventBus);
BorderLayoutData menuData = new BorderLayoutData(58);
menuData.setMargins(new Margins(5));

View File

@ -19,6 +19,12 @@
<servlet-class>org.gcube.portlets.widgets.sessionchecker.server.SessionCheckerServiceImpl</servlet-class>
</servlet>
<!-- Scope Helper -->
<servlet>
<servlet-name>scopeService</servlet-name>
<servlet-class>org.gcube.portlets.user.gcubewidgets.server.ScopeServiceImpl</servlet-class>
</servlet>
<!-- AccountingManagerService -->
<servlet>
<servlet-name>AccountingManagerService</servlet-name>
@ -39,6 +45,12 @@
<url-pattern>/accountingman/checksession</url-pattern>
</servlet-mapping>
<!-- Scope Helper -->
<servlet-mapping>
<servlet-name>scopeService</servlet-name>
<url-pattern>/accountingman/scopeService</url-pattern>
</servlet-mapping>
<!-- AccountingManagerService -->
<servlet-mapping>
<servlet-name>AccountingManagerService</servlet-name>
@ -46,6 +58,9 @@
</servlet-mapping>
<!-- Default page to serve -->
<welcome-file-list>
<welcome-file>AccountingManager.html</welcome-file>