|
|
|
@ -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.getLocalizedMessage(), caught);
|
|
|
|
|
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.getLocalizedMessage(), caught);
|
|
|
|
|
if (caught instanceof SessionExpiredException) {
|
|
|
|
|
UtilsGXT3.alert("Error", "Expired Session");
|
|
|
|
|
sessionExpiredShowDelayed();
|
|
|
|
@ -156,7 +157,7 @@ public class AccountingManagerController {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onFailure(Throwable caught) {
|
|
|
|
|
Log.error("Error retrieving enable tabs: " + caught.getLocalizedMessage());
|
|
|
|
|
Log.error("Error retrieving enable tabs: " + caught.getLocalizedMessage(), caught);
|
|
|
|
|
if (caught instanceof SessionExpiredException) {
|
|
|
|
|
UtilsGXT3.alert("Error", "Expired Session");
|
|
|
|
|
sessionExpiredShowDelayed();
|
|
|
|
@ -293,7 +294,7 @@ public class AccountingManagerController {
|
|
|
|
|
Log.debug("AccountingType: " + event.getAccountingType());
|
|
|
|
|
accountingStateData = accountingState.getState(event.getAccountingType());
|
|
|
|
|
if (accountingStateData == null) {
|
|
|
|
|
createDefaultChart(event.getAccountingType());
|
|
|
|
|
configureDefaultChart(event.getAccountingType());
|
|
|
|
|
} else {
|
|
|
|
|
accountingType = event.getAccountingType();
|
|
|
|
|
StateChangeEvent stateChangeEvent = new StateChangeEvent(StateChangeType.Restore, accountingStateData);
|
|
|
|
@ -310,71 +311,77 @@ public class AccountingManagerController {
|
|
|
|
|
if (enableTabs != null && enableTabs.getTabs() != null && enableTabs.getTabs().size() > 0
|
|
|
|
|
&& enableTabs.getTabs().get(0) != null) {
|
|
|
|
|
Log.debug("Create DefaultChart");
|
|
|
|
|
createDefaultChart(enableTabs.getTabs().get(0).getAccountingType());
|
|
|
|
|
configureDefaultChart(enableTabs.getTabs().get(0).getAccountingType());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void createDefaultChart(AccountingType accountingType) {
|
|
|
|
|
private void configureDefaultChart(AccountingType accountingType) {
|
|
|
|
|
accountingMonitor = new AccountingMonitor();
|
|
|
|
|
this.accountingType = accountingType;
|
|
|
|
|
if (availableContext == null) {
|
|
|
|
|
retrieveContext();
|
|
|
|
|
} else {
|
|
|
|
|
createDefaultChart();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void createDefaultChart() {
|
|
|
|
|
AccountingClientStateData accountingStateData = new AccountingClientStateData(accountingType, rootScope);
|
|
|
|
|
accountingStateData.setAvailableContext(availableContext);
|
|
|
|
|
accountingState.setState(accountingType, accountingStateData);
|
|
|
|
|
|
|
|
|
|
retrieveFilterKey();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void retrieveFilterKey() {
|
|
|
|
|
private void retrieveContext() {
|
|
|
|
|
|
|
|
|
|
AccountingManagerServiceAsync.INSTANCE.getFilterKeys(accountingType, new AsyncCallback<ArrayList<FilterKey>>() {
|
|
|
|
|
AccountingManagerServiceAsync.INSTANCE.getContext(new AsyncCallback<Context>() {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onFailure(Throwable caught) {
|
|
|
|
|
accountingMonitor.hide();
|
|
|
|
|
Log.error("Error retrieving contexts: " + caught.getLocalizedMessage(), caught);
|
|
|
|
|
if (caught instanceof SessionExpiredException) {
|
|
|
|
|
eventBus.fireEvent(new SessionExpiredEvent(SessionExpiredType.EXPIREDONSERVER));
|
|
|
|
|
} else {
|
|
|
|
|
Log.error(
|
|
|
|
|
"Error retrieving filter keys for " + accountingType + ":" + caught.getLocalizedMessage());
|
|
|
|
|
UtilsGXT3.alert("Error retrieving filter keys", caught.getLocalizedMessage());
|
|
|
|
|
UtilsGXT3.alert("Error retrieving contexts ", caught.getLocalizedMessage());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onSuccess(ArrayList<FilterKey> result) {
|
|
|
|
|
Log.debug("FilterKeys: " + result);
|
|
|
|
|
AccountingClientStateData accountingStateData = accountingState.getState(accountingType);
|
|
|
|
|
accountingStateData.setAvailableFilterKeys(result);
|
|
|
|
|
accountingState.setState(accountingType, accountingStateData);
|
|
|
|
|
retrieveContext();
|
|
|
|
|
public void onSuccess(Context result) {
|
|
|
|
|
Log.debug("Available Context: " + result);
|
|
|
|
|
availableContext = result;
|
|
|
|
|
createDefaultChart();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void retrieveContext() {
|
|
|
|
|
private void retrieveFilterKey() {
|
|
|
|
|
|
|
|
|
|
AccountingManagerServiceAsync.INSTANCE.getContext(new AsyncCallback<Context>() {
|
|
|
|
|
AccountingManagerServiceAsync.INSTANCE.getFilterKeys(accountingType, new AsyncCallback<ArrayList<FilterKey>>() {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onFailure(Throwable caught) {
|
|
|
|
|
accountingMonitor.hide();
|
|
|
|
|
Log.error("Error retrieving filter keys: " + caught.getLocalizedMessage(), caught);
|
|
|
|
|
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());
|
|
|
|
|
Log.error(
|
|
|
|
|
"Error retrieving filter keys for " + accountingType + ":" + caught.getLocalizedMessage());
|
|
|
|
|
UtilsGXT3.alert("Error retrieving filter keys", caught.getLocalizedMessage());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onSuccess(Context result) {
|
|
|
|
|
Log.debug("Available Context: " + result);
|
|
|
|
|
public void onSuccess(ArrayList<FilterKey> result) {
|
|
|
|
|
Log.debug("FilterKeys: " + result);
|
|
|
|
|
AccountingClientStateData accountingStateData = accountingState.getState(accountingType);
|
|
|
|
|
accountingStateData.setAvailableContext(result);
|
|
|
|
|
accountingStateData.setAvailableFilterKeys(result);
|
|
|
|
|
accountingState.setState(accountingType, accountingStateData);
|
|
|
|
|
retrieveSpace();
|
|
|
|
|
}
|
|
|
|
@ -383,7 +390,7 @@ public class AccountingManagerController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void retrieveSpace() {
|
|
|
|
|
if (rootScope) {
|
|
|
|
|
/* if (rootScope) {
|
|
|
|
|
|
|
|
|
|
AccountingManagerServiceAsync.INSTANCE.getSpaces(new AsyncCallback<Spaces>() {
|
|
|
|
|
|
|
|
|
@ -393,7 +400,7 @@ public class AccountingManagerController {
|
|
|
|
|
if (caught instanceof SessionExpiredException) {
|
|
|
|
|
eventBus.fireEvent(new SessionExpiredEvent(SessionExpiredType.EXPIREDONSERVER));
|
|
|
|
|
} else {
|
|
|
|
|
Log.error("Error retrieving sapces for " + accountingType + ":" + caught.getLocalizedMessage());
|
|
|
|
|
Log.error("Error retrieving spaces for " + accountingType + ":" + caught.getLocalizedMessage());
|
|
|
|
|
UtilsGXT3.alert("Error retrieving spaces ", caught.getLocalizedMessage());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -407,7 +414,9 @@ public class AccountingManagerController {
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
createDefaultSeriesRequest(null);
|
|
|
|
|
}
|
|
|
|
|
} */
|
|
|
|
|
createDefaultSeriesRequest(null);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void createDefaultSeriesRequest(Spaces spaces) {
|
|
|
|
@ -838,8 +847,6 @@ public class AccountingManagerController {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void doExportRequest(ExportRequestEvent event) {
|
|
|
|
|
StringBuilder actionUrl = new StringBuilder();
|
|
|
|
|
actionUrl.append(GWT.getModuleBaseURL());
|
|
|
|
|