2251: Accounting Manager - Stacked column chart for tops
Task-Url: https://support.d4science.org/issues/2251 Updated Support to Top Chart git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/admin/accounting-manager@124235 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
9a881615a0
commit
ee3a27c342
|
@ -17,6 +17,7 @@ import org.gcube.portlets.admin.accountingmanager.client.type.StateChangeType;
|
|||
import org.gcube.portlets.admin.accountingmanager.client.type.UIStateType;
|
||||
import org.gcube.portlets.admin.accountingmanager.client.utils.UtilsGXT3;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.Constants;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.AccountingFilterBasic;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.AccountingPeriod;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.AccountingPeriodMode;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.AccountingType;
|
||||
|
@ -244,7 +245,7 @@ public class AccountingManagerController {
|
|||
Date lastMonth=new Date(date.getTime());
|
||||
CalendarUtil.addMonthsToDate(lastMonth, -1);
|
||||
SeriesRequest seriesRequest = new SeriesRequest(new AccountingPeriod(dtf.format(lastMonth),
|
||||
dtf.format(date), AccountingPeriodMode.DAILY), null);
|
||||
dtf.format(date), AccountingPeriodMode.DAILY), new AccountingFilterBasic());
|
||||
Log.debug("DefaultSeriesRequest: "+seriesRequest);
|
||||
Log.debug("LastMoth= "+dtf.format(lastMonth)+" , date="+dtf.format(date));
|
||||
this.accountingType = accountingType;
|
||||
|
|
|
@ -12,6 +12,10 @@ import org.gcube.portlets.admin.accountingmanager.client.state.AccountingStateDa
|
|||
import org.gcube.portlets.admin.accountingmanager.client.type.SessionExpiredType;
|
||||
import org.gcube.portlets.admin.accountingmanager.client.utils.UtilsGXT3;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.AccountingFilter;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.AccountingFilterBasic;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.AccountingFilterDefinition;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.AccountingFilterTop;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.ChartTypeDisplayable;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.FilterKey;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.FilterValue;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.FilterValuesRequest;
|
||||
|
@ -57,7 +61,9 @@ import com.sencha.gxt.widget.core.client.event.CompleteEditEvent.CompleteEditHan
|
|||
import com.sencha.gxt.widget.core.client.event.SelectEvent;
|
||||
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
|
||||
import com.sencha.gxt.widget.core.client.form.ComboBox;
|
||||
import com.sencha.gxt.widget.core.client.form.FieldLabel;
|
||||
import com.sencha.gxt.widget.core.client.form.FieldSet;
|
||||
import com.sencha.gxt.widget.core.client.form.IntegerSpinnerField;
|
||||
import com.sencha.gxt.widget.core.client.form.StringComboBox;
|
||||
import com.sencha.gxt.widget.core.client.grid.ColumnConfig;
|
||||
import com.sencha.gxt.widget.core.client.grid.ColumnModel;
|
||||
|
@ -75,6 +81,9 @@ import com.sencha.gxt.widget.core.client.toolbar.ToolBar;
|
|||
*/
|
||||
public class ActiveFiltersPanel extends SimpleContainer {
|
||||
|
||||
private static final int TOP_NUMBER_DEFAULT = 5;
|
||||
private static final int TOP_NUMBER_MAX = 10;
|
||||
private static final int TOP_NUMBER_MIN = 1;
|
||||
private EventBus eventBus;
|
||||
private Grid<AccountingFilter> grid;
|
||||
private ListStore<AccountingFilter> store;
|
||||
|
@ -87,6 +96,14 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
private GridRowEditing<AccountingFilter> editing;
|
||||
private TextButton addButton;
|
||||
private int seq;
|
||||
private ListStore<ChartTypeDisplayable> storeComboChartType;
|
||||
private ComboBox<ChartTypeDisplayable> comboChartType;
|
||||
private ListStore<FilterKey> storeComboTopFilterKey;
|
||||
private ComboBox<FilterKey> comboTopFilterKey;
|
||||
private FieldLabel comboTopFilterKeyLabel;
|
||||
private ToolBar toolBar;
|
||||
private IntegerSpinnerField topNumber;
|
||||
private FieldLabel topNumberLabel;
|
||||
|
||||
public interface FilterKeyPropertiesCombo extends PropertyAccess<FilterKey> {
|
||||
|
||||
|
@ -348,10 +365,81 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
});
|
||||
|
||||
//
|
||||
ToolBar toolBar = new ToolBar();
|
||||
toolBar = new ToolBar();
|
||||
toolBar.add(addButton, new BoxLayoutData(new Margins(0)));
|
||||
|
||||
// ChartTypeSelection
|
||||
|
||||
storeComboChartType = new ListStore<ChartTypeDisplayable>(
|
||||
new ModelKeyProvider<ChartTypeDisplayable>() {
|
||||
|
||||
@Override
|
||||
public String getKey(ChartTypeDisplayable item) {
|
||||
// TODO Auto-generated method stub
|
||||
return item.name();
|
||||
}
|
||||
|
||||
});
|
||||
storeComboChartType.addAll(ChartTypeDisplayable.asList());
|
||||
|
||||
LabelProvider<ChartTypeDisplayable> comboChartTypeLabelProvider = new LabelProvider<ChartTypeDisplayable>() {
|
||||
|
||||
@Override
|
||||
public String getLabel(ChartTypeDisplayable item) {
|
||||
|
||||
return item.getLabel();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
comboChartType = new ComboBox<>(storeComboChartType,
|
||||
comboChartTypeLabelProvider);
|
||||
comboChartType.setClearValueOnParseError(false);
|
||||
comboChartType.setEditable(false);
|
||||
comboChartType.setForceSelection(true);
|
||||
// comboFilterValue.setAllowBlank(false);
|
||||
comboChartType.setValue(ChartTypeDisplayable.Basic);
|
||||
// comboFilterValue.setFinishEditOnEnter(false);
|
||||
// comboFilterValue.setAutoValidate(true);
|
||||
// comboFilterValue.addValidator(new EmptyValidator<String>());
|
||||
comboChartType.setTriggerAction(TriggerAction.ALL);
|
||||
addHandlersForComboChartType(comboChartTypeLabelProvider);
|
||||
|
||||
FieldLabel comboChartTypeLabel = new FieldLabel(comboChartType, "Chart");
|
||||
|
||||
// FileterKeyCombo for Top Chart
|
||||
storeComboTopFilterKey = new ListStore<FilterKey>(
|
||||
filterKeyPropertiesCombo.id());
|
||||
|
||||
comboTopFilterKey = new ComboBox<FilterKey>(storeComboTopFilterKey,
|
||||
filterKeyPropertiesCombo.key());
|
||||
comboTopFilterKey.setClearValueOnParseError(false);
|
||||
comboTopFilterKey.setEditable(false);
|
||||
|
||||
comboTopFilterKey.setTriggerAction(TriggerAction.ALL);
|
||||
addHandlersForComboTopFilterKey(filterKeyPropertiesCombo.key());
|
||||
|
||||
comboTopFilterKeyLabel = new FieldLabel(comboTopFilterKey, "Key");
|
||||
|
||||
//
|
||||
topNumber = new IntegerSpinnerField();
|
||||
topNumber.setMaxValue(TOP_NUMBER_MAX);
|
||||
topNumber.setMinValue(TOP_NUMBER_MIN);
|
||||
topNumber.setAllowNegative(false);
|
||||
topNumber.setAllowBlank(false);
|
||||
topNumber.setValue(TOP_NUMBER_DEFAULT);
|
||||
topNumber.setEditable(false);
|
||||
|
||||
topNumberLabel = new FieldLabel(topNumber, "Number");
|
||||
|
||||
// //
|
||||
VerticalLayoutContainer vlc = new VerticalLayoutContainer();
|
||||
|
||||
vlc.add(comboChartTypeLabel, new VerticalLayoutData(1, -1, new Margins(
|
||||
0)));
|
||||
vlc.add(comboTopFilterKeyLabel, new VerticalLayoutData(1, -1,
|
||||
new Margins(0)));
|
||||
vlc.add(topNumberLabel, new VerticalLayoutData(1, -1, new Margins(0)));
|
||||
vlc.add(toolBar, new VerticalLayoutData(1, -1, new Margins(0)));
|
||||
vlc.add(grid, new VerticalLayoutData(1, 1, new Margins(0)));
|
||||
|
||||
|
@ -361,7 +449,8 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
fieldSet.add(vlc);
|
||||
|
||||
add(fieldSet, new MarginData(0));
|
||||
|
||||
comboTopFilterKeyLabel.setVisible(false);
|
||||
topNumberLabel.setVisible(false);
|
||||
}
|
||||
|
||||
// Bind to Events
|
||||
|
@ -413,34 +502,157 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
storeComboFilterKey
|
||||
.addAll(accountingStateData.getAvailableFilterKeys());
|
||||
storeComboFilterKey.commitChanges();
|
||||
storeComboTopFilterKey.clear();
|
||||
storeComboTopFilterKey.addAll(accountingStateData
|
||||
.getAvailableFilterKeys());
|
||||
storeComboTopFilterKey.commitChanges();
|
||||
|
||||
ChartTypeDisplayable chartTypeDisplayable = accountingStateData
|
||||
.getSeriesRequest().getAccountingFilterDefinition()
|
||||
.getChartTypeDisplayable();
|
||||
|
||||
switch (chartTypeDisplayable) {
|
||||
case Basic:
|
||||
changeActiveFiltersForBasic();
|
||||
break;
|
||||
case Top:
|
||||
changeActiveFiltersForTop();
|
||||
break;
|
||||
|
||||
default:
|
||||
changeActiveFiltersForBasic();
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void changeActiveFiltersForBasic() {
|
||||
if (accountingStateData.getSeriesRequest() != null
|
||||
&& accountingStateData.getSeriesRequest().getFilters() != null) {
|
||||
List<AccountingFilter> filters = accountingStateData
|
||||
.getSeriesRequest().getFilters();
|
||||
store.clear();
|
||||
store.addAll(filters);
|
||||
seq = 0;
|
||||
for (AccountingFilter filter : filters) {
|
||||
if (filter.getId() > seq) {
|
||||
seq = filter.getId();
|
||||
&& accountingStateData.getSeriesRequest()
|
||||
.getAccountingFilterDefinition() != null
|
||||
&& accountingStateData.getSeriesRequest()
|
||||
.getAccountingFilterDefinition() instanceof AccountingFilterBasic) {
|
||||
AccountingFilterBasic accountingFilterBasic = (AccountingFilterBasic) accountingStateData
|
||||
.getSeriesRequest().getAccountingFilterDefinition();
|
||||
|
||||
if (accountingFilterBasic.getFilters() != null) {
|
||||
List<AccountingFilter> filters = accountingFilterBasic
|
||||
.getFilters();
|
||||
store.clear();
|
||||
store.addAll(filters);
|
||||
seq = 0;
|
||||
for (AccountingFilter filter : filters) {
|
||||
if (filter.getId() > seq) {
|
||||
seq = filter.getId();
|
||||
}
|
||||
}
|
||||
;
|
||||
store.commitChanges();
|
||||
} else {
|
||||
store.clear();
|
||||
store.commitChanges();
|
||||
seq = 0;
|
||||
}
|
||||
store.commitChanges();
|
||||
} else {
|
||||
store.clear();
|
||||
store.commitChanges();
|
||||
seq = 0;
|
||||
}
|
||||
comboChartType.setValue(ChartTypeDisplayable.Basic);
|
||||
comboTopFilterKey.reset();
|
||||
comboTopFilterKeyLabel.setVisible(false);
|
||||
topNumber.reset();
|
||||
topNumberLabel.setVisible(false);
|
||||
forceLayout();
|
||||
|
||||
}
|
||||
|
||||
public ArrayList<AccountingFilter> getActiveFilters() {
|
||||
private void changeActiveFiltersForTop() {
|
||||
if (accountingStateData.getSeriesRequest() != null
|
||||
&& accountingStateData.getSeriesRequest()
|
||||
.getAccountingFilterDefinition() != null
|
||||
&& accountingStateData.getSeriesRequest()
|
||||
.getAccountingFilterDefinition() instanceof AccountingFilterTop) {
|
||||
AccountingFilterTop accountingFilterTop = (AccountingFilterTop) accountingStateData
|
||||
.getSeriesRequest().getAccountingFilterDefinition();
|
||||
if (accountingFilterTop.getFilterKey() != null) {
|
||||
comboTopFilterKey.setValue(accountingFilterTop.getFilterKey());
|
||||
topNumber.setValue(accountingFilterTop.getTopNumber());
|
||||
|
||||
} else {
|
||||
comboTopFilterKey.reset();
|
||||
topNumber.reset();
|
||||
topNumber.setValue(TOP_NUMBER_DEFAULT);
|
||||
|
||||
}
|
||||
} else {
|
||||
comboTopFilterKey.reset();
|
||||
topNumber.reset();
|
||||
topNumber.setValue(TOP_NUMBER_DEFAULT);
|
||||
|
||||
}
|
||||
store.clear();
|
||||
store.commitChanges();
|
||||
seq = 0;
|
||||
comboChartType.setValue(ChartTypeDisplayable.Top);
|
||||
comboTopFilterKeyLabel.setVisible(true);
|
||||
topNumberLabel.setVisible(true);
|
||||
forceLayout();
|
||||
}
|
||||
|
||||
public AccountingFilterDefinition getActiveFilters() {
|
||||
try {
|
||||
ChartTypeDisplayable chartTypeDisplayable = comboChartType
|
||||
.getCurrentValue();
|
||||
|
||||
switch (chartTypeDisplayable) {
|
||||
case Basic:
|
||||
return getActiveFiltersForBasic();
|
||||
case Top:
|
||||
return getActiveFiltersForTop();
|
||||
|
||||
default:
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
} catch (Throwable e) {
|
||||
Log.error(e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
UtilsGXT3.alert("Attention", e.getLocalizedMessage());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private AccountingFilterDefinition getActiveFiltersForBasic() {
|
||||
if (store == null || store.size() <= 0) {
|
||||
return new AccountingFilterBasic();
|
||||
} else {
|
||||
List<AccountingFilter> filtersActives = store.getAll();
|
||||
ArrayList<AccountingFilter> filtersReady = new ArrayList<AccountingFilter>();
|
||||
for (AccountingFilter filter : filtersActives) {
|
||||
if (filter.getFilterValue() != null
|
||||
&& !filter.getFilterValue().isEmpty()) {
|
||||
filtersReady.add(filter);
|
||||
}
|
||||
}
|
||||
if (filtersReady.size() > 0) {
|
||||
return new AccountingFilterBasic(filtersReady);
|
||||
} else {
|
||||
return new AccountingFilterBasic();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private AccountingFilterDefinition getActiveFiltersForTop() {
|
||||
FilterKey filterKey = comboTopFilterKey.getCurrentValue();
|
||||
if (filterKey == null) {
|
||||
return new AccountingFilterTop();
|
||||
} else {
|
||||
Integer topN = topNumber.getCurrentValue();
|
||||
|
||||
if (store == null || store.size() <= 0) {
|
||||
return null;
|
||||
return new AccountingFilterTop(filterKey, null, topN);
|
||||
} else {
|
||||
List<AccountingFilter> filtersActives = store.getAll();
|
||||
ArrayList<AccountingFilter> filtersReady = new ArrayList<AccountingFilter>();
|
||||
|
@ -451,19 +663,15 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
}
|
||||
}
|
||||
if (filtersReady.size() > 0) {
|
||||
return filtersReady;
|
||||
return new AccountingFilterTop(filterKey, filtersReady,
|
||||
topN);
|
||||
} else {
|
||||
return null;
|
||||
return new AccountingFilterTop(filterKey, null, topN);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} catch (Throwable e) {
|
||||
Log.error(e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
UtilsGXT3.alert("Attention", e.getLocalizedMessage());
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void addNewFilter(SelectEvent event) {
|
||||
|
@ -484,6 +692,15 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
removableFilterKeys.add(filterSet.getFilterKey());
|
||||
}
|
||||
|
||||
if (comboChartType.getCurrentValue() != null
|
||||
&& comboChartType.getCurrentValue().compareTo(
|
||||
ChartTypeDisplayable.Top) == 0) {
|
||||
if (comboTopFilterKey.getCurrentValue() != null) {
|
||||
removableFilterKeys
|
||||
.add(comboTopFilterKey.getCurrentValue());
|
||||
}
|
||||
}
|
||||
|
||||
remainingFilterKeys.removeAll(removableFilterKeys);
|
||||
|
||||
if (remainingFilterKeys.size() > 0) {
|
||||
|
@ -569,6 +786,14 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
|
||||
List<FilterKey> setFilterKeys = new ArrayList<FilterKey>();
|
||||
|
||||
if (comboChartType.getCurrentValue() != null
|
||||
&& comboChartType.getCurrentValue().compareTo(
|
||||
ChartTypeDisplayable.Top) == 0) {
|
||||
if (comboTopFilterKey.getCurrentValue() != null) {
|
||||
setFilterKeys.add(comboTopFilterKey.getCurrentValue());
|
||||
}
|
||||
}
|
||||
|
||||
for (AccountingFilter filterSet : filtersSet) {
|
||||
if (filterSet.getFilterKey().getKey()
|
||||
.compareTo(editingFilter.getFilterKey().getKey()) != 0) {
|
||||
|
@ -605,4 +830,73 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
retrieveFilterValuesByKey(selectedFilterKey, true);
|
||||
}
|
||||
|
||||
private void addHandlersForComboChartType(
|
||||
final LabelProvider<ChartTypeDisplayable> labelProvider) {
|
||||
comboChartType
|
||||
.addSelectionHandler(new SelectionHandler<ChartTypeDisplayable>() {
|
||||
public void onSelection(
|
||||
SelectionEvent<ChartTypeDisplayable> event) {
|
||||
Log.debug("FilterKey selected: "
|
||||
+ event.getSelectedItem());
|
||||
updateComboChartType(event.getSelectedItem());
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
private void updateComboChartType(ChartTypeDisplayable chartTypeDisplayable) {
|
||||
switch (chartTypeDisplayable) {
|
||||
case Basic:
|
||||
comboTopFilterKey.reset();
|
||||
comboTopFilterKeyLabel.setVisible(false);
|
||||
topNumber.reset();
|
||||
topNumberLabel.setVisible(false);
|
||||
store.clear();
|
||||
store.commitChanges();
|
||||
seq = 0;
|
||||
forceLayout();
|
||||
break;
|
||||
case Top:
|
||||
comboTopFilterKey.reset();
|
||||
if (accountingStateData != null
|
||||
&& accountingStateData.getAvailableFilterKeys() != null
|
||||
&& accountingStateData.getAvailableFilterKeys().size() > 0) {
|
||||
comboTopFilterKey.setValue(accountingStateData
|
||||
.getAvailableFilterKeys().get(0));
|
||||
}
|
||||
comboTopFilterKeyLabel.setVisible(true);
|
||||
topNumber.reset();
|
||||
topNumber.setValue(TOP_NUMBER_DEFAULT);
|
||||
topNumberLabel.setVisible(true);
|
||||
store.clear();
|
||||
store.commitChanges();
|
||||
seq = 0;
|
||||
forceLayout();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void addHandlersForComboTopFilterKey(
|
||||
final LabelProvider<FilterKey> labelProvider) {
|
||||
comboTopFilterKey
|
||||
.addSelectionHandler(new SelectionHandler<FilterKey>() {
|
||||
public void onSelection(SelectionEvent<FilterKey> event) {
|
||||
Log.debug("FilterKey selected: "
|
||||
+ event.getSelectedItem());
|
||||
updateTopFilterKey(event.getSelectedItem());
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
private void updateTopFilterKey(FilterKey selectedFilterKey) {
|
||||
store.clear();
|
||||
store.commitChanges();
|
||||
seq = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.client.filters;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.client.event.FiltersChangeEvent;
|
||||
import org.gcube.portlets.admin.accountingmanager.client.resource.AccountingManagerResources;
|
||||
import org.gcube.portlets.admin.accountingmanager.client.type.FiltersChangeType;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.AccountingFilter;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.AccountingFilterDefinition;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.AccountingPeriod;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.query.SeriesRequest;
|
||||
|
||||
|
@ -91,12 +89,12 @@ public class FiltersPanel extends FramedPanel {
|
|||
protected void updateChart() {
|
||||
AccountingPeriod accountingPeriod = accountPeriodPanel
|
||||
.getAccountingPeriod();
|
||||
ArrayList<AccountingFilter> activeFilters = activeFiltersPanel
|
||||
AccountingFilterDefinition accountingFilterDefinition = activeFiltersPanel
|
||||
.getActiveFilters();
|
||||
|
||||
if (accountingPeriod != null) {
|
||||
SeriesRequest seriesRequest = new SeriesRequest(accountingPeriod,
|
||||
activeFilters);
|
||||
accountingFilterDefinition);
|
||||
Log.debug("UpdateChart: " + seriesRequest);
|
||||
|
||||
FiltersChangeEvent filtersChangeEvent = new FiltersChangeEvent(
|
||||
|
|
|
@ -1,15 +1,13 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.client.maindata.charts;
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.storage.StorageChart4Top;
|
||||
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.storage.StorageChartBuilder;
|
||||
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.storage.StorageChartDirector;
|
||||
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.storage.StorageChartPanel;
|
||||
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.storage.StorageChartBasicPanel;
|
||||
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.storage.StorageChartTopPanel;
|
||||
import org.gcube.portlets.admin.accountingmanager.client.state.AccountingStateData;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesStorage;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.exception.AccountingManagerChartDrawException;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.exception.AccountingManagerStorageChartDrawException;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
import com.sencha.gxt.widget.core.client.container.SimpleContainer;
|
||||
|
||||
/**
|
||||
* Accounting Chart 4 Storage
|
||||
|
@ -43,51 +41,43 @@ public class AccountingChart4Storage extends AccountingChartBuilder {
|
|||
return;
|
||||
}
|
||||
|
||||
StorageChartPanel container = createStorageChartPanel();
|
||||
SimpleContainer container = createStorageChartPanel();
|
||||
|
||||
accountingChartPanel = new AccountingChartPanel(container.getChart());
|
||||
accountingChartPanel = new AccountingChartPanel(container);
|
||||
|
||||
accountingChartSpec.setChart(accountingChartPanel);
|
||||
|
||||
}
|
||||
|
||||
private StorageChartPanel createStorageChartPanel() throws AccountingManagerStorageChartDrawException {
|
||||
private SimpleContainer createStorageChartPanel()
|
||||
throws AccountingManagerStorageChartDrawException {
|
||||
|
||||
if (accountingStateData == null
|
||||
|| accountingStateData.getAccountingType() == null) {
|
||||
|| accountingStateData.getSeriesRequest() == null
|
||||
|| accountingStateData.getSeriesRequest()
|
||||
.getAccountingFilterDefinition() == null
|
||||
|| accountingStateData.getSeriesRequest()
|
||||
.getAccountingFilterDefinition()
|
||||
.getChartTypeDisplayable() == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
switch (accountingStateData.getAccountingType()) {
|
||||
|
||||
case STORAGE:
|
||||
return createStorageChart(new StorageChart4Top(
|
||||
accountingStateData));
|
||||
|
||||
switch (accountingStateData.getSeriesRequest()
|
||||
.getAccountingFilterDefinition().getChartTypeDisplayable()) {
|
||||
|
||||
case Top:
|
||||
return new StorageChartTopPanel(accountingStateData);
|
||||
//createStorageChart(new StorageChart4Top(accountingStateData));
|
||||
case Basic:
|
||||
return new StorageChartBasicPanel(accountingStateData);
|
||||
//createStorageChart(new StorageChart4Basic(
|
||||
//accountingStateData));
|
||||
default:
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private StorageChartPanel createStorageChart(
|
||||
StorageChartBuilder chartBuilder) throws AccountingManagerStorageChartDrawException {
|
||||
|
||||
try {
|
||||
StorageChartDirector director = new StorageChartDirector();
|
||||
director.setStorageChartBuilder(chartBuilder);
|
||||
director.constructStorageChart();
|
||||
|
||||
StorageChartPanel chart = director.getStorageChart();
|
||||
|
||||
return chart;
|
||||
} catch (AccountingManagerStorageChartDrawException e) {
|
||||
Log.error(e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,50 +0,0 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.client.maindata.charts.storage;
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.storage.panels.StorageChartMultiPanel;
|
||||
import org.gcube.portlets.admin.accountingmanager.client.state.AccountingStateData;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesStorage;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.exception.AccountingManagerStorageChartDrawException;
|
||||
|
||||
/**
|
||||
* Accounting Chart 4 Storage Multi
|
||||
*
|
||||
* @author "Giancarlo Panichi" email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class StorageChart4Multi extends StorageChartBuilder {
|
||||
|
||||
private AccountingStateData accountingStateData;
|
||||
|
||||
public StorageChart4Multi(AccountingStateData accountingStateData) {
|
||||
this.accountingStateData = accountingStateData;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildChart() throws AccountingManagerStorageChartDrawException {
|
||||
StorageChartPanel storageChartPanel = null;
|
||||
|
||||
if (accountingStateData == null
|
||||
|| accountingStateData.getAccountingType() == null
|
||||
|| accountingStateData.getSeriesRequest() == null
|
||||
|| accountingStateData.getSeriesResponse() == null) {
|
||||
storageChartSpec.setChart(storageChartPanel);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(accountingStateData.getSeriesResponse() instanceof SeriesStorage)) {
|
||||
storageChartSpec.setChart(storageChartPanel);
|
||||
return;
|
||||
}
|
||||
|
||||
StorageChartMultiPanel container = new StorageChartMultiPanel(accountingStateData);
|
||||
|
||||
storageChartPanel = new StorageChartPanel(container);
|
||||
|
||||
storageChartSpec.setChart(storageChartPanel);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -1,50 +0,0 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.client.maindata.charts.storage;
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.storage.panels.StorageChartTopPanel;
|
||||
import org.gcube.portlets.admin.accountingmanager.client.state.AccountingStateData;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesStorage;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.exception.AccountingManagerStorageChartDrawException;
|
||||
|
||||
/**
|
||||
* Accounting Chart 4 Storage Top
|
||||
*
|
||||
* @author "Giancarlo Panichi" email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class StorageChart4Top extends StorageChartBuilder {
|
||||
|
||||
private AccountingStateData accountingStateData;
|
||||
|
||||
public StorageChart4Top(AccountingStateData accountingStateData) {
|
||||
this.accountingStateData = accountingStateData;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildChart() throws AccountingManagerStorageChartDrawException {
|
||||
StorageChartPanel storageChartPanel = null;
|
||||
|
||||
if (accountingStateData == null
|
||||
|| accountingStateData.getAccountingType() == null
|
||||
|| accountingStateData.getSeriesRequest() == null
|
||||
|| accountingStateData.getSeriesResponse() == null) {
|
||||
storageChartSpec.setChart(storageChartPanel);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(accountingStateData.getSeriesResponse() instanceof SeriesStorage)) {
|
||||
storageChartSpec.setChart(storageChartPanel);
|
||||
return;
|
||||
}
|
||||
|
||||
StorageChartTopPanel container = new StorageChartTopPanel(accountingStateData);
|
||||
|
||||
storageChartPanel = new StorageChartPanel(container);
|
||||
|
||||
storageChartSpec.setChart(storageChartPanel);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.client.maindata.charts.storage.panels;
|
||||
package org.gcube.portlets.admin.accountingmanager.client.maindata.charts.storage;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
@ -43,7 +43,7 @@ import com.sencha.gxt.widget.core.client.toolbar.ToolBar;
|
|||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class StorageChartMultiPanel extends SimpleContainer {
|
||||
public class StorageChartBasicPanel extends SimpleContainer {
|
||||
|
||||
private static final String DATA_VOLUME_UNIT = "Data Volume Unit";
|
||||
|
||||
|
@ -71,7 +71,7 @@ public class StorageChartMultiPanel extends SimpleContainer {
|
|||
private long unitMeasure = ByteUnitMeasure.getMegaByteDimForStorage();
|
||||
private String unitMeasureLabel = ByteUnitMeasure.MB;
|
||||
|
||||
public StorageChartMultiPanel(AccountingStateData accountingStateData) {
|
||||
public StorageChartBasicPanel(AccountingStateData accountingStateData) {
|
||||
this.accountingStateData = accountingStateData;
|
||||
forceLayoutOnResize = true;
|
||||
create();
|
||||
|
@ -257,7 +257,7 @@ public class StorageChartMultiPanel extends SimpleContainer {
|
|||
var chart = $wnd
|
||||
.jQuery('#' + id)
|
||||
.highcharts(
|
||||
this.@org.gcube.portlets.admin.accountingmanager.client.maindata.charts.storage.panels.StorageChartMultiPanel::options);
|
||||
this.@org.gcube.portlets.admin.accountingmanager.client.maindata.charts.storage.StorageChartBasicPanel::options);
|
||||
console.log(chart);
|
||||
chart.exportChart();
|
||||
|
||||
|
@ -268,7 +268,7 @@ public class StorageChartMultiPanel extends SimpleContainer {
|
|||
var chart = $wnd
|
||||
.jQuery('#' + id)
|
||||
.highcharts(
|
||||
this.@org.gcube.portlets.admin.accountingmanager.client.maindata.charts.storage.panels.StorageChartMultiPanel::options);
|
||||
this.@org.gcube.portlets.admin.accountingmanager.client.maindata.charts.storage.StorageChartBasicPanel::options);
|
||||
console.log(chart);
|
||||
chart.exportChart({
|
||||
type : 'image/jpeg'
|
||||
|
@ -281,7 +281,7 @@ public class StorageChartMultiPanel extends SimpleContainer {
|
|||
var chart = $wnd
|
||||
.jQuery('#' + id)
|
||||
.highcharts(
|
||||
this.@org.gcube.portlets.admin.accountingmanager.client.maindata.charts.storage.panels.StorageChartMultiPanel::options);
|
||||
this.@org.gcube.portlets.admin.accountingmanager.client.maindata.charts.storage.StorageChartBasicPanel::options);
|
||||
console.log(chart);
|
||||
chart.exportChart({
|
||||
type : 'application/pdf'
|
||||
|
@ -294,7 +294,7 @@ public class StorageChartMultiPanel extends SimpleContainer {
|
|||
var chart = $wnd
|
||||
.jQuery('#' + id)
|
||||
.highcharts(
|
||||
this.@org.gcube.portlets.admin.accountingmanager.client.maindata.charts.storage.panels.StorageChartMultiPanel::options);
|
||||
this.@org.gcube.portlets.admin.accountingmanager.client.maindata.charts.storage.StorageChartBasicPanel::options);
|
||||
console.log(chart);
|
||||
chart.exportChart({
|
||||
type : 'image/svg+xml'
|
|
@ -1,26 +0,0 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.client.maindata.charts.storage;
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.exception.AccountingManagerStorageChartDrawException;
|
||||
|
||||
/**
|
||||
* Abstract class for build Accounting Chart
|
||||
*
|
||||
* @author "Giancarlo Panichi"
|
||||
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public abstract class StorageChartBuilder {
|
||||
protected StorageChartSpec storageChartSpec;
|
||||
|
||||
public StorageChartSpec getStorageChartSpec(){
|
||||
return storageChartSpec;
|
||||
}
|
||||
public void createSpec(){
|
||||
storageChartSpec=new StorageChartSpec();
|
||||
|
||||
}
|
||||
|
||||
public abstract void buildChart() throws AccountingManagerStorageChartDrawException;
|
||||
|
||||
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.client.maindata.charts.storage;
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.exception.AccountingManagerStorageChartDrawException;
|
||||
|
||||
|
||||
/**
|
||||
* Storage Chart Director
|
||||
*
|
||||
* @author "Giancarlo Panichi"
|
||||
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class StorageChartDirector {
|
||||
StorageChartBuilder storageChartBuilder;
|
||||
|
||||
public void setStorageChartBuilder(
|
||||
StorageChartBuilder storageChartBuilder) {
|
||||
this.storageChartBuilder = storageChartBuilder;
|
||||
}
|
||||
|
||||
public StorageChartPanel getStorageChart() {
|
||||
return storageChartBuilder.getStorageChartSpec().getChart();
|
||||
|
||||
}
|
||||
|
||||
public void constructStorageChart() throws AccountingManagerStorageChartDrawException {
|
||||
storageChartBuilder.createSpec();
|
||||
storageChartBuilder.buildChart();
|
||||
|
||||
}
|
||||
}
|
|
@ -1,34 +0,0 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.client.maindata.charts.storage;
|
||||
|
||||
import com.sencha.gxt.widget.core.client.container.Container;
|
||||
|
||||
/**
|
||||
* Storage Chart Panel
|
||||
*
|
||||
* @author giancarlo email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class StorageChartPanel {
|
||||
|
||||
private Container chart;
|
||||
|
||||
public StorageChartPanel(Container chart) {
|
||||
super();
|
||||
this.chart = chart;
|
||||
}
|
||||
|
||||
public Container getChart() {
|
||||
return chart;
|
||||
}
|
||||
|
||||
public void setChart(Container chart) {
|
||||
this.chart = chart;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StorageChartPanel [chart=" + chart + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.client.maindata.charts.storage;
|
||||
|
||||
|
||||
/**
|
||||
* Storage Chart Specification
|
||||
*
|
||||
* @author "Giancarlo Panichi" email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class StorageChartSpec {
|
||||
private StorageChartPanel chart;
|
||||
|
||||
public StorageChartPanel getChart() {
|
||||
return chart;
|
||||
}
|
||||
|
||||
public void setChart(StorageChartPanel chart) {
|
||||
this.chart = chart;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.client.maindata.charts.storage.panels;
|
||||
package org.gcube.portlets.admin.accountingmanager.client.maindata.charts.storage;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
|
@ -302,7 +302,7 @@ public class StorageChartTopPanel extends SimpleContainer {
|
|||
var chart = $wnd
|
||||
.jQuery('#' + id)
|
||||
.highcharts(
|
||||
this.@org.gcube.portlets.admin.accountingmanager.client.maindata.charts.storage.panels.StorageChartTopPanel::options);
|
||||
this.@org.gcube.portlets.admin.accountingmanager.client.maindata.charts.storage.StorageChartTopPanel::options);
|
||||
console.log(chart);
|
||||
chart.exportChart();
|
||||
|
||||
|
@ -313,7 +313,7 @@ public class StorageChartTopPanel extends SimpleContainer {
|
|||
var chart = $wnd
|
||||
.jQuery('#' + id)
|
||||
.highcharts(
|
||||
this.@org.gcube.portlets.admin.accountingmanager.client.maindata.charts.storage.panels.StorageChartTopPanel::options);
|
||||
this.@org.gcube.portlets.admin.accountingmanager.client.maindata.charts.storage.StorageChartTopPanel::options);
|
||||
console.log(chart);
|
||||
chart.exportChart({
|
||||
type : 'image/jpeg'
|
||||
|
@ -326,7 +326,7 @@ public class StorageChartTopPanel extends SimpleContainer {
|
|||
var chart = $wnd
|
||||
.jQuery('#' + id)
|
||||
.highcharts(
|
||||
this.@org.gcube.portlets.admin.accountingmanager.client.maindata.charts.storage.panels.StorageChartTopPanel::options);
|
||||
this.@org.gcube.portlets.admin.accountingmanager.client.maindata.charts.storage.StorageChartTopPanel::options);
|
||||
console.log(chart);
|
||||
chart.exportChart({
|
||||
type : 'application/pdf'
|
||||
|
@ -339,7 +339,7 @@ public class StorageChartTopPanel extends SimpleContainer {
|
|||
var chart = $wnd
|
||||
.jQuery('#' + id)
|
||||
.highcharts(
|
||||
this.@org.gcube.portlets.admin.accountingmanager.client.maindata.charts.storage.panels.StorageChartTopPanel::options);
|
||||
this.@org.gcube.portlets.admin.accountingmanager.client.maindata.charts.storage.StorageChartTopPanel::options);
|
||||
console.log(chart);
|
||||
chart.exportChart({
|
||||
type : 'image/svg+xml'
|
|
@ -17,7 +17,8 @@ public enum StorageChartMeasure {
|
|||
DataVolume("Data Volume"), OperationCount("Operation Count");
|
||||
|
||||
/**
|
||||
* @param text
|
||||
*
|
||||
* @param id
|
||||
*/
|
||||
private StorageChartMeasure(final String id) {
|
||||
this.id = id;
|
||||
|
|
|
@ -10,6 +10,8 @@ import org.gcube.accounting.analytics.TemporalConstraint;
|
|||
import org.gcube.accounting.datamodel.aggregation.AggregatedJobUsageRecord;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.PeriodModeMap;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.AccountingFilter;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.AccountingFilterBasic;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.AccountingFilterTop;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.query.SeriesRequest;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.exception.AccountingManagerServiceException;
|
||||
import org.slf4j.Logger;
|
||||
|
@ -33,38 +35,55 @@ public class AccountingQuery4Job extends AccountingQueryBuilder {
|
|||
|
||||
@Override
|
||||
public void buildOpEx() throws AccountingManagerServiceException {
|
||||
|
||||
Calendar startCalendar = GregorianCalendar.getInstance(TemporalConstraint.DEFAULT_TIME_ZONE);
|
||||
|
||||
Calendar startCalendar = GregorianCalendar
|
||||
.getInstance(TemporalConstraint.DEFAULT_TIME_ZONE);
|
||||
try {
|
||||
startCalendar.setTime(sdf.parse(seriesRequest.getAccountingPeriod().getStartDate()));
|
||||
startCalendar.setTime(sdf.parse(seriesRequest.getAccountingPeriod()
|
||||
.getStartDate()));
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
throw new AccountingManagerServiceException("Start Date not valid!");
|
||||
}
|
||||
|
||||
Calendar endCalendar = GregorianCalendar.getInstance(TemporalConstraint.DEFAULT_TIME_ZONE);
|
||||
|
||||
Calendar endCalendar = GregorianCalendar
|
||||
.getInstance(TemporalConstraint.DEFAULT_TIME_ZONE);
|
||||
try {
|
||||
endCalendar.setTime(sdf.parse(seriesRequest.getAccountingPeriod().getEndDate()));
|
||||
endCalendar.setTime(sdf.parse(seriesRequest.getAccountingPeriod()
|
||||
.getEndDate()));
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
throw new AccountingManagerServiceException("End Date not valid!");
|
||||
}
|
||||
|
||||
|
||||
endCalendar.set(GregorianCalendar.HOUR_OF_DAY, 23);
|
||||
endCalendar.set(GregorianCalendar.MINUTE, 59);
|
||||
endCalendar.set(GregorianCalendar.SECOND, 59);
|
||||
endCalendar.set(GregorianCalendar.MILLISECOND, 999);
|
||||
|
||||
|
||||
TemporalConstraint temporalConstraint = new TemporalConstraint(
|
||||
startCalendar.getTimeInMillis(),
|
||||
endCalendar.getTimeInMillis(),
|
||||
startCalendar.getTimeInMillis(), endCalendar.getTimeInMillis(),
|
||||
PeriodModeMap.getMode(seriesRequest.getAccountingPeriod()
|
||||
.getPeriod()));
|
||||
|
||||
ArrayList<AccountingFilter> accountingFilters = seriesRequest
|
||||
.getFilters();
|
||||
|
||||
ArrayList<Filter> filters = null;
|
||||
ArrayList<AccountingFilter> accountingFilters = null;
|
||||
|
||||
if (seriesRequest != null
|
||||
&& seriesRequest.getAccountingFilterDefinition() != null) {
|
||||
if (seriesRequest.getAccountingFilterDefinition() instanceof AccountingFilterBasic) {
|
||||
AccountingFilterBasic accountingFilterBasic = (AccountingFilterBasic) seriesRequest
|
||||
.getAccountingFilterDefinition();
|
||||
accountingFilters = accountingFilterBasic.getFilters();
|
||||
} else {
|
||||
if (seriesRequest.getAccountingFilterDefinition() instanceof AccountingFilterTop) {
|
||||
AccountingFilterTop accountingFilterTop = (AccountingFilterTop) seriesRequest
|
||||
.getAccountingFilterDefinition();
|
||||
accountingFilters = accountingFilterTop.getFilters();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (accountingFilters != null) {
|
||||
filters = new ArrayList<Filter>();
|
||||
for (AccountingFilter accountigFilters : accountingFilters) {
|
||||
|
|
|
@ -10,6 +10,8 @@ import org.gcube.accounting.analytics.TemporalConstraint;
|
|||
import org.gcube.accounting.datamodel.aggregation.AggregatedPortletUsageRecord;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.PeriodModeMap;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.AccountingFilter;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.AccountingFilterBasic;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.AccountingFilterTop;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.query.SeriesRequest;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.exception.AccountingManagerServiceException;
|
||||
import org.slf4j.Logger;
|
||||
|
@ -33,37 +35,54 @@ public class AccountingQuery4Portlet extends AccountingQueryBuilder {
|
|||
|
||||
@Override
|
||||
public void buildOpEx() throws AccountingManagerServiceException {
|
||||
Calendar startCalendar = GregorianCalendar.getInstance(TemporalConstraint.DEFAULT_TIME_ZONE);
|
||||
Calendar startCalendar = GregorianCalendar
|
||||
.getInstance(TemporalConstraint.DEFAULT_TIME_ZONE);
|
||||
try {
|
||||
startCalendar.setTime(sdf.parse(seriesRequest.getAccountingPeriod().getStartDate()));
|
||||
startCalendar.setTime(sdf.parse(seriesRequest.getAccountingPeriod()
|
||||
.getStartDate()));
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
throw new AccountingManagerServiceException("Start Date not valid!");
|
||||
}
|
||||
|
||||
Calendar endCalendar = GregorianCalendar.getInstance(TemporalConstraint.DEFAULT_TIME_ZONE);
|
||||
|
||||
Calendar endCalendar = GregorianCalendar
|
||||
.getInstance(TemporalConstraint.DEFAULT_TIME_ZONE);
|
||||
try {
|
||||
endCalendar.setTime(sdf.parse(seriesRequest.getAccountingPeriod().getEndDate()));
|
||||
endCalendar.setTime(sdf.parse(seriesRequest.getAccountingPeriod()
|
||||
.getEndDate()));
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
throw new AccountingManagerServiceException("End Date not valid!");
|
||||
}
|
||||
|
||||
|
||||
endCalendar.set(GregorianCalendar.HOUR_OF_DAY, 23);
|
||||
endCalendar.set(GregorianCalendar.MINUTE, 59);
|
||||
endCalendar.set(GregorianCalendar.SECOND, 59);
|
||||
endCalendar.set(GregorianCalendar.MILLISECOND, 999);
|
||||
|
||||
|
||||
TemporalConstraint temporalConstraint = new TemporalConstraint(
|
||||
startCalendar.getTimeInMillis(),
|
||||
endCalendar.getTimeInMillis(),
|
||||
startCalendar.getTimeInMillis(), endCalendar.getTimeInMillis(),
|
||||
PeriodModeMap.getMode(seriesRequest.getAccountingPeriod()
|
||||
.getPeriod()));
|
||||
|
||||
ArrayList<AccountingFilter> accountingFilters = seriesRequest
|
||||
.getFilters();
|
||||
|
||||
ArrayList<Filter> filters = null;
|
||||
ArrayList<AccountingFilter> accountingFilters = null;
|
||||
|
||||
if (seriesRequest != null
|
||||
&& seriesRequest.getAccountingFilterDefinition() != null) {
|
||||
if (seriesRequest.getAccountingFilterDefinition() instanceof AccountingFilterBasic) {
|
||||
AccountingFilterBasic accountingFilterBasic = (AccountingFilterBasic) seriesRequest
|
||||
.getAccountingFilterDefinition();
|
||||
accountingFilters = accountingFilterBasic.getFilters();
|
||||
} else {
|
||||
if (seriesRequest.getAccountingFilterDefinition() instanceof AccountingFilterTop) {
|
||||
AccountingFilterTop accountingFilterTop = (AccountingFilterTop) seriesRequest
|
||||
.getAccountingFilterDefinition();
|
||||
accountingFilters = accountingFilterTop.getFilters();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (accountingFilters != null) {
|
||||
filters = new ArrayList<Filter>();
|
||||
for (AccountingFilter accountigFilters : accountingFilters) {
|
||||
|
@ -72,9 +91,8 @@ public class AccountingQuery4Portlet extends AccountingQueryBuilder {
|
|||
filters.add(filter);
|
||||
}
|
||||
}
|
||||
|
||||
AccountingQuery invocation = new AccountingQuery(
|
||||
AggregatedPortletUsageRecord.class, temporalConstraint,filters);
|
||||
AggregatedPortletUsageRecord.class, temporalConstraint, filters);
|
||||
|
||||
accountingQuerySpec.setOp(invocation);
|
||||
|
||||
|
|
|
@ -10,6 +10,8 @@ import org.gcube.accounting.analytics.TemporalConstraint;
|
|||
import org.gcube.accounting.datamodel.aggregation.AggregatedServiceUsageRecord;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.PeriodModeMap;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.AccountingFilter;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.AccountingFilterBasic;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.AccountingFilterTop;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.query.SeriesRequest;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.exception.AccountingManagerServiceException;
|
||||
import org.slf4j.Logger;
|
||||
|
@ -33,38 +35,55 @@ public class AccountingQuery4Service extends AccountingQueryBuilder {
|
|||
|
||||
@Override
|
||||
public void buildOpEx() throws AccountingManagerServiceException {
|
||||
|
||||
Calendar startCalendar = GregorianCalendar.getInstance(TemporalConstraint.DEFAULT_TIME_ZONE);
|
||||
|
||||
Calendar startCalendar = GregorianCalendar
|
||||
.getInstance(TemporalConstraint.DEFAULT_TIME_ZONE);
|
||||
try {
|
||||
startCalendar.setTime(sdf.parse(seriesRequest.getAccountingPeriod().getStartDate()));
|
||||
startCalendar.setTime(sdf.parse(seriesRequest.getAccountingPeriod()
|
||||
.getStartDate()));
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
throw new AccountingManagerServiceException("Start Date not valid!");
|
||||
}
|
||||
|
||||
Calendar endCalendar = GregorianCalendar.getInstance(TemporalConstraint.DEFAULT_TIME_ZONE);
|
||||
|
||||
Calendar endCalendar = GregorianCalendar
|
||||
.getInstance(TemporalConstraint.DEFAULT_TIME_ZONE);
|
||||
try {
|
||||
endCalendar.setTime(sdf.parse(seriesRequest.getAccountingPeriod().getEndDate()));
|
||||
endCalendar.setTime(sdf.parse(seriesRequest.getAccountingPeriod()
|
||||
.getEndDate()));
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
throw new AccountingManagerServiceException("End Date not valid!");
|
||||
}
|
||||
|
||||
|
||||
endCalendar.set(GregorianCalendar.HOUR_OF_DAY, 23);
|
||||
endCalendar.set(GregorianCalendar.MINUTE, 59);
|
||||
endCalendar.set(GregorianCalendar.SECOND, 59);
|
||||
endCalendar.set(GregorianCalendar.MILLISECOND, 999);
|
||||
|
||||
|
||||
TemporalConstraint temporalConstraint = new TemporalConstraint(
|
||||
startCalendar.getTimeInMillis(),
|
||||
endCalendar.getTimeInMillis(),
|
||||
startCalendar.getTimeInMillis(), endCalendar.getTimeInMillis(),
|
||||
PeriodModeMap.getMode(seriesRequest.getAccountingPeriod()
|
||||
.getPeriod()));
|
||||
|
||||
ArrayList<AccountingFilter> accountingFilters = seriesRequest
|
||||
.getFilters();
|
||||
|
||||
ArrayList<Filter> filters=null;
|
||||
|
||||
ArrayList<Filter> filters = null;
|
||||
ArrayList<AccountingFilter> accountingFilters = null;
|
||||
|
||||
if (seriesRequest != null
|
||||
&& seriesRequest.getAccountingFilterDefinition() != null) {
|
||||
if (seriesRequest.getAccountingFilterDefinition() instanceof AccountingFilterBasic) {
|
||||
AccountingFilterBasic accountingFilterBasic = (AccountingFilterBasic) seriesRequest
|
||||
.getAccountingFilterDefinition();
|
||||
accountingFilters = accountingFilterBasic.getFilters();
|
||||
} else {
|
||||
if (seriesRequest.getAccountingFilterDefinition() instanceof AccountingFilterTop) {
|
||||
AccountingFilterTop accountingFilterTop = (AccountingFilterTop) seriesRequest
|
||||
.getAccountingFilterDefinition();
|
||||
accountingFilters = accountingFilterTop.getFilters();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (accountingFilters != null) {
|
||||
filters = new ArrayList<Filter>();
|
||||
for (AccountingFilter accountigFilters : accountingFilters) {
|
||||
|
@ -76,7 +95,7 @@ public class AccountingQuery4Service extends AccountingQueryBuilder {
|
|||
|
||||
AccountingQuery invocation = new AccountingQuery(
|
||||
AggregatedServiceUsageRecord.class, temporalConstraint, filters);
|
||||
|
||||
|
||||
accountingQuerySpec.setOp(invocation);
|
||||
|
||||
}
|
||||
|
|
|
@ -10,6 +10,8 @@ import org.gcube.accounting.analytics.TemporalConstraint;
|
|||
import org.gcube.accounting.datamodel.aggregation.AggregatedStorageUsageRecord;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.PeriodModeMap;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.AccountingFilter;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.AccountingFilterBasic;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.AccountingFilterTop;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.query.SeriesRequest;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.exception.AccountingManagerServiceException;
|
||||
import org.slf4j.Logger;
|
||||
|
@ -61,10 +63,24 @@ public class AccountingQuery4Storage extends AccountingQueryBuilder {
|
|||
PeriodModeMap.getMode(seriesRequest.getAccountingPeriod()
|
||||
.getPeriod()));
|
||||
|
||||
ArrayList<AccountingFilter> accountingFilters = seriesRequest
|
||||
.getFilters();
|
||||
|
||||
ArrayList<Filter> filters = null;
|
||||
ArrayList<AccountingFilter> accountingFilters = null;
|
||||
|
||||
if (seriesRequest != null
|
||||
&& seriesRequest.getAccountingFilterDefinition() != null) {
|
||||
if (seriesRequest.getAccountingFilterDefinition() instanceof AccountingFilterBasic) {
|
||||
AccountingFilterBasic accountingFilterBasic = (AccountingFilterBasic) seriesRequest
|
||||
.getAccountingFilterDefinition();
|
||||
accountingFilters = accountingFilterBasic.getFilters();
|
||||
} else {
|
||||
if (seriesRequest.getAccountingFilterDefinition() instanceof AccountingFilterTop) {
|
||||
AccountingFilterTop accountingFilterTop = (AccountingFilterTop) seriesRequest
|
||||
.getAccountingFilterDefinition();
|
||||
accountingFilters = accountingFilterTop.getFilters();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (accountingFilters != null) {
|
||||
filters = new ArrayList<Filter>();
|
||||
for (AccountingFilter accountigFilters : accountingFilters) {
|
||||
|
@ -74,6 +90,7 @@ public class AccountingQuery4Storage extends AccountingQueryBuilder {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
AccountingQuery invocation = new AccountingQuery(
|
||||
AggregatedStorageUsageRecord.class, temporalConstraint, filters);
|
||||
|
||||
|
|
|
@ -10,6 +10,8 @@ import org.gcube.accounting.analytics.TemporalConstraint;
|
|||
import org.gcube.accounting.datamodel.aggregation.AggregatedTaskUsageRecord;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.PeriodModeMap;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.AccountingFilter;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.AccountingFilterBasic;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.AccountingFilterTop;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.query.SeriesRequest;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.exception.AccountingManagerServiceException;
|
||||
import org.slf4j.Logger;
|
||||
|
@ -33,38 +35,55 @@ public class AccountingQuery4Task extends AccountingQueryBuilder {
|
|||
|
||||
@Override
|
||||
public void buildOpEx() throws AccountingManagerServiceException {
|
||||
|
||||
Calendar startCalendar = GregorianCalendar.getInstance(TemporalConstraint.DEFAULT_TIME_ZONE);
|
||||
|
||||
Calendar startCalendar = GregorianCalendar
|
||||
.getInstance(TemporalConstraint.DEFAULT_TIME_ZONE);
|
||||
try {
|
||||
startCalendar.setTime(sdf.parse(seriesRequest.getAccountingPeriod().getStartDate()));
|
||||
startCalendar.setTime(sdf.parse(seriesRequest.getAccountingPeriod()
|
||||
.getStartDate()));
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
throw new AccountingManagerServiceException("Start Date not valid!");
|
||||
}
|
||||
|
||||
Calendar endCalendar = GregorianCalendar.getInstance(TemporalConstraint.DEFAULT_TIME_ZONE);
|
||||
|
||||
Calendar endCalendar = GregorianCalendar
|
||||
.getInstance(TemporalConstraint.DEFAULT_TIME_ZONE);
|
||||
try {
|
||||
endCalendar.setTime(sdf.parse(seriesRequest.getAccountingPeriod().getEndDate()));
|
||||
endCalendar.setTime(sdf.parse(seriesRequest.getAccountingPeriod()
|
||||
.getEndDate()));
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
throw new AccountingManagerServiceException("End Date not valid!");
|
||||
}
|
||||
|
||||
|
||||
endCalendar.set(GregorianCalendar.HOUR_OF_DAY, 23);
|
||||
endCalendar.set(GregorianCalendar.MINUTE, 59);
|
||||
endCalendar.set(GregorianCalendar.SECOND, 59);
|
||||
endCalendar.set(GregorianCalendar.MILLISECOND, 999);
|
||||
|
||||
|
||||
TemporalConstraint temporalConstraint = new TemporalConstraint(
|
||||
startCalendar.getTimeInMillis(),
|
||||
endCalendar.getTimeInMillis(),
|
||||
startCalendar.getTimeInMillis(), endCalendar.getTimeInMillis(),
|
||||
PeriodModeMap.getMode(seriesRequest.getAccountingPeriod()
|
||||
.getPeriod()));
|
||||
|
||||
ArrayList<AccountingFilter> accountingFilters = seriesRequest
|
||||
.getFilters();
|
||||
|
||||
ArrayList<Filter> filters = null;
|
||||
ArrayList<AccountingFilter> accountingFilters = null;
|
||||
|
||||
if (seriesRequest != null
|
||||
&& seriesRequest.getAccountingFilterDefinition() != null) {
|
||||
if (seriesRequest.getAccountingFilterDefinition() instanceof AccountingFilterBasic) {
|
||||
AccountingFilterBasic accountingFilterBasic = (AccountingFilterBasic) seriesRequest
|
||||
.getAccountingFilterDefinition();
|
||||
accountingFilters = accountingFilterBasic.getFilters();
|
||||
} else {
|
||||
if (seriesRequest.getAccountingFilterDefinition() instanceof AccountingFilterTop) {
|
||||
AccountingFilterTop accountingFilterTop = (AccountingFilterTop) seriesRequest
|
||||
.getAccountingFilterDefinition();
|
||||
accountingFilters = accountingFilterTop.getFilters();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (accountingFilters != null) {
|
||||
filters = new ArrayList<Filter>();
|
||||
for (AccountingFilter accountigFilters : accountingFilters) {
|
||||
|
@ -73,8 +92,10 @@ public class AccountingQuery4Task extends AccountingQueryBuilder {
|
|||
filters.add(filter);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
AccountingQuery invocation = new AccountingQuery(
|
||||
AggregatedTaskUsageRecord.class, temporalConstraint,filters);
|
||||
AggregatedTaskUsageRecord.class, temporalConstraint, filters);
|
||||
|
||||
accountingQuerySpec.setOp(invocation);
|
||||
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class AccountingFilterBasic extends AccountingFilterDefinition implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -6805006183397381154L;
|
||||
ArrayList<AccountingFilter> filters;
|
||||
|
||||
|
||||
public AccountingFilterBasic() {
|
||||
super();
|
||||
this.chartTypeDisplayable=ChartTypeDisplayable.Basic;
|
||||
filters=null;
|
||||
}
|
||||
|
||||
public AccountingFilterBasic(ArrayList<AccountingFilter> filters) {
|
||||
super();
|
||||
chartTypeDisplayable = ChartTypeDisplayable.Basic;
|
||||
this.filters = filters;
|
||||
}
|
||||
|
||||
public ArrayList<AccountingFilter> getFilters() {
|
||||
return filters;
|
||||
}
|
||||
|
||||
public void setFilters(ArrayList<AccountingFilter> filters) {
|
||||
this.filters = filters;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "AccountingFilterBasic [filters=" + filters + "]";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class AccountingFilterDefinition {
|
||||
|
||||
protected ChartTypeDisplayable chartTypeDisplayable;
|
||||
|
||||
public AccountingFilterDefinition() {
|
||||
super();
|
||||
}
|
||||
|
||||
public ChartTypeDisplayable getChartTypeDisplayable() {
|
||||
return chartTypeDisplayable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "AccountingFilterDefinition [chartTypeDisplayable="
|
||||
+ chartTypeDisplayable + "]";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,69 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class AccountingFilterTop extends AccountingFilterDefinition implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -6805006183397381154L;
|
||||
private FilterKey filterKey;
|
||||
private Integer topNumber;
|
||||
private ArrayList<AccountingFilter> filters;
|
||||
|
||||
public AccountingFilterTop() {
|
||||
super();
|
||||
this.chartTypeDisplayable=ChartTypeDisplayable.Top;
|
||||
topNumber=5;
|
||||
filterKey=null;
|
||||
filters=null;
|
||||
|
||||
}
|
||||
|
||||
public AccountingFilterTop(FilterKey filterKey, ArrayList<AccountingFilter> filters, Integer topNumber) {
|
||||
super();
|
||||
chartTypeDisplayable = ChartTypeDisplayable.Top;
|
||||
this.filterKey = filterKey;
|
||||
this.filters = filters;
|
||||
this.topNumber=topNumber;
|
||||
}
|
||||
|
||||
public FilterKey getFilterKey() {
|
||||
return filterKey;
|
||||
}
|
||||
|
||||
public void setFilterKey(FilterKey filterKey) {
|
||||
this.filterKey = filterKey;
|
||||
}
|
||||
|
||||
public Integer getTopNumber() {
|
||||
return topNumber;
|
||||
}
|
||||
|
||||
public void setTopNumber(Integer topNumber) {
|
||||
this.topNumber = topNumber;
|
||||
}
|
||||
|
||||
public ArrayList<AccountingFilter> getFilters() {
|
||||
return filters;
|
||||
}
|
||||
|
||||
public void setFilters(ArrayList<AccountingFilter> filters) {
|
||||
this.filters = filters;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "AccountingFilterTop [filterKey=" + filterKey + ", topNumber="
|
||||
+ topNumber + ", filters=" + filters + "]";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,64 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Chart Type
|
||||
*
|
||||
*
|
||||
* @author Giancarlo Panichi email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
|
||||
public enum ChartTypeDisplayable {
|
||||
|
||||
Basic("Basic"),Top("Top");
|
||||
|
||||
/**
|
||||
*
|
||||
* @param id
|
||||
*/
|
||||
private ChartTypeDisplayable(final String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
private final String id;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getLabel() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public static ChartTypeDisplayable getFromId(String id) {
|
||||
if (id == null || id.isEmpty())
|
||||
return null;
|
||||
|
||||
for (ChartTypeDisplayable columnDataType : values()) {
|
||||
if (columnDataType.id.compareToIgnoreCase(id) == 0) {
|
||||
return columnDataType;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static List<ChartTypeDisplayable> asList() {
|
||||
List<ChartTypeDisplayable> list = Arrays.asList(values());
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,32 +1,31 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data.query;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.AccountingFilter;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.AccountingFilterDefinition;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.AccountingPeriod;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author giancarlo
|
||||
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
* @author giancarlo email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class SeriesRequest implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -109538024097615414L;
|
||||
private AccountingPeriod accountingPeriod;
|
||||
private ArrayList<AccountingFilter> filters;
|
||||
private AccountingFilterDefinition accountingFilterDefinition;
|
||||
|
||||
public SeriesRequest() {
|
||||
super();
|
||||
}
|
||||
|
||||
public SeriesRequest(AccountingPeriod accountingPeriod,
|
||||
ArrayList<AccountingFilter> filters) {
|
||||
AccountingFilterDefinition accountingFilterDefinition) {
|
||||
super();
|
||||
this.accountingPeriod = accountingPeriod;
|
||||
this.filters = filters;
|
||||
this.accountingFilterDefinition = accountingFilterDefinition;
|
||||
}
|
||||
|
||||
public AccountingPeriod getAccountingPeriod() {
|
||||
|
@ -37,22 +36,22 @@ public class SeriesRequest implements Serializable {
|
|||
this.accountingPeriod = accountingPeriod;
|
||||
}
|
||||
|
||||
public ArrayList<AccountingFilter> getFilters() {
|
||||
return filters;
|
||||
public AccountingFilterDefinition getAccountingFilterDefinition() {
|
||||
return accountingFilterDefinition;
|
||||
}
|
||||
|
||||
public void setFilters(ArrayList<AccountingFilter> filters) {
|
||||
this.filters = filters;
|
||||
public void setAccountingFilterDefinition(
|
||||
AccountingFilterDefinition accountingFilterDefinition) {
|
||||
this.accountingFilterDefinition = accountingFilterDefinition;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SeriesRequest [accountingPeriod=" + accountingPeriod
|
||||
+ ", filters=" + filters + "]";
|
||||
+ ", accountingFilterDefinition=" + accountingFilterDefinition
|
||||
+ "]";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue