|
|
|
@ -68,6 +68,7 @@ public class AccountingManagerController {
|
|
|
|
|
private BorderLayoutContainer mainPanel;
|
|
|
|
|
private AccountingMonitor accountingMonitor;
|
|
|
|
|
private EnableTabs enableTabs;
|
|
|
|
|
private Context availableContext;
|
|
|
|
|
|
|
|
|
|
public AccountingManagerController() {
|
|
|
|
|
eventBus = new SimpleEventBus();
|
|
|
|
@ -106,7 +107,7 @@ public class AccountingManagerController {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onFailure(Throwable caught) {
|
|
|
|
|
Log.info("No valid user found: " + caught.getMessage());
|
|
|
|
|
Log.error("No valid user found: " + caught.getMessage());
|
|
|
|
|
if (caught instanceof SessionExpiredException) {
|
|
|
|
|
UtilsGXT3.alert("Error", "Expired Session");
|
|
|
|
|
sessionExpiredShowDelayed();
|
|
|
|
@ -131,7 +132,7 @@ public class AccountingManagerController {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onFailure(Throwable caught) {
|
|
|
|
|
Log.info("No valid user found: " + caught.getMessage());
|
|
|
|
|
Log.error("Error in check root scope: " + caught.getMessage());
|
|
|
|
|
if (caught instanceof SessionExpiredException) {
|
|
|
|
|
UtilsGXT3.alert("Error", "Expired Session");
|
|
|
|
|
sessionExpiredShowDelayed();
|
|
|
|
@ -144,12 +145,39 @@ public class AccountingManagerController {
|
|
|
|
|
public void onSuccess(Boolean result) {
|
|
|
|
|
rootScope = result;
|
|
|
|
|
Log.info("RootScope: " + result);
|
|
|
|
|
retrieveEnableTabs();
|
|
|
|
|
retrieveContext();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void retrieveContext() {
|
|
|
|
|
|
|
|
|
|
AccountingManagerServiceAsync.INSTANCE.getContext(new AsyncCallback<Context>() {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onFailure(Throwable caught) {
|
|
|
|
|
Log.error("Error in retrieve context: " + caught.getMessage());
|
|
|
|
|
if (caught instanceof SessionExpiredException) {
|
|
|
|
|
eventBus.fireEvent(new SessionExpiredEvent(SessionExpiredType.EXPIREDONSERVER));
|
|
|
|
|
} else {
|
|
|
|
|
Log.error("Error retrieving contexts for " + accountingType + ":" + caught.getLocalizedMessage());
|
|
|
|
|
UtilsGXT3.alert("Error retrieving contexts ", caught.getLocalizedMessage());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onSuccess(Context result) {
|
|
|
|
|
Log.debug("Available Context: " + result);
|
|
|
|
|
availableContext=result;
|
|
|
|
|
retrieveEnableTabs();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void retrieveEnableTabs() {
|
|
|
|
|
AccountingManagerServiceAsync.INSTANCE.getEnableTabs(new AsyncCallback<EnableTabs>() {
|
|
|
|
@ -319,6 +347,7 @@ public class AccountingManagerController {
|
|
|
|
|
this.accountingType = accountingType;
|
|
|
|
|
|
|
|
|
|
AccountingClientStateData accountingStateData = new AccountingClientStateData(accountingType, rootScope);
|
|
|
|
|
accountingStateData.setAvailableContext(availableContext);
|
|
|
|
|
accountingState.setState(accountingType, accountingStateData);
|
|
|
|
|
|
|
|
|
|
retrieveFilterKey();
|
|
|
|
@ -348,40 +377,14 @@ public class AccountingManagerController {
|
|
|
|
|
AccountingClientStateData accountingStateData = accountingState.getState(accountingType);
|
|
|
|
|
accountingStateData.setAvailableFilterKeys(result);
|
|
|
|
|
accountingState.setState(accountingType, accountingStateData);
|
|
|
|
|
retrieveContext();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void retrieveContext() {
|
|
|
|
|
|
|
|
|
|
AccountingManagerServiceAsync.INSTANCE.getContext(new AsyncCallback<Context>() {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onFailure(Throwable caught) {
|
|
|
|
|
accountingMonitor.hide();
|
|
|
|
|
if (caught instanceof SessionExpiredException) {
|
|
|
|
|
eventBus.fireEvent(new SessionExpiredEvent(SessionExpiredType.EXPIREDONSERVER));
|
|
|
|
|
} else {
|
|
|
|
|
Log.error("Error retrieving contexts for " + accountingType + ":" + caught.getLocalizedMessage());
|
|
|
|
|
UtilsGXT3.alert("Error retrieving contexts ", caught.getLocalizedMessage());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onSuccess(Context result) {
|
|
|
|
|
Log.debug("Available Context: " + result);
|
|
|
|
|
AccountingClientStateData accountingStateData = accountingState.getState(accountingType);
|
|
|
|
|
accountingStateData.setAvailableContext(result);
|
|
|
|
|
accountingState.setState(accountingType, accountingStateData);
|
|
|
|
|
retrieveSpace();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void retrieveSpace() {
|
|
|
|
|
if (rootScope) {
|
|
|
|
|
|
|
|
|
|