Refs #21354: Improve accounting manager portlet by new persistence
Updated Top
This commit is contained in:
parent
ac4c236019
commit
ec06f615d7
|
@ -15,6 +15,7 @@ import org.gcube.portlets.admin.accountingmanager.client.rpc.AccountingManagerSe
|
|||
import org.gcube.portlets.admin.accountingmanager.client.state.AccountingClientStateData;
|
||||
import org.gcube.portlets.admin.accountingmanager.client.type.SessionExpiredType;
|
||||
import org.gcube.portlets.admin.accountingmanager.client.util.UtilsGXT3;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.Constants;
|
||||
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;
|
||||
|
@ -26,6 +27,7 @@ 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;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.FilterValuesResponse;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.exception.NoScopeSelectedException;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.exception.SessionExpiredException;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
|
@ -36,21 +38,17 @@ import com.google.gwt.editor.client.Editor.Path;
|
|||
import com.google.gwt.editor.client.EditorError;
|
||||
import com.google.gwt.event.logical.shared.SelectionEvent;
|
||||
import com.google.gwt.event.logical.shared.SelectionHandler;
|
||||
import com.google.gwt.event.logical.shared.ValueChangeEvent;
|
||||
import com.google.gwt.event.logical.shared.ValueChangeHandler;
|
||||
import com.google.gwt.event.shared.EventBus;
|
||||
import com.google.gwt.safehtml.shared.SafeHtml;
|
||||
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
|
||||
import com.google.gwt.safehtml.shared.SafeHtmlUtils;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
import com.google.gwt.user.client.ui.HasValue;
|
||||
import com.sencha.gxt.cell.core.client.ButtonCell.IconAlign;
|
||||
import com.sencha.gxt.cell.core.client.form.ComboBoxCell.TriggerAction;
|
||||
import com.sencha.gxt.core.client.IdentityValueProvider;
|
||||
import com.sencha.gxt.core.client.Style.SelectionMode;
|
||||
import com.sencha.gxt.core.client.XTemplates;
|
||||
import com.sencha.gxt.core.client.util.Margins;
|
||||
import com.sencha.gxt.core.client.util.ToggleGroup;
|
||||
import com.sencha.gxt.data.shared.LabelProvider;
|
||||
import com.sencha.gxt.data.shared.ListStore;
|
||||
import com.sencha.gxt.data.shared.ModelKeyProvider;
|
||||
|
@ -63,9 +61,6 @@ import com.sencha.gxt.dnd.core.client.GridDropTarget;
|
|||
import com.sencha.gxt.widget.core.client.button.ButtonBar;
|
||||
import com.sencha.gxt.widget.core.client.button.TextButton;
|
||||
import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutData;
|
||||
import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutPack;
|
||||
import com.sencha.gxt.widget.core.client.container.HBoxLayoutContainer;
|
||||
import com.sencha.gxt.widget.core.client.container.HBoxLayoutContainer.HBoxLayoutAlign;
|
||||
import com.sencha.gxt.widget.core.client.container.MarginData;
|
||||
import com.sencha.gxt.widget.core.client.container.SimpleContainer;
|
||||
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer;
|
||||
|
@ -82,10 +77,11 @@ 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.Radio;
|
||||
import com.sencha.gxt.widget.core.client.form.StringComboBox;
|
||||
import com.sencha.gxt.widget.core.client.form.error.DefaultEditorError;
|
||||
import com.sencha.gxt.widget.core.client.form.validator.EmptyValidator;
|
||||
import com.sencha.gxt.widget.core.client.form.validator.MaxNumberValidator;
|
||||
import com.sencha.gxt.widget.core.client.form.validator.MinNumberValidator;
|
||||
import com.sencha.gxt.widget.core.client.grid.CheckBoxSelectionModel;
|
||||
import com.sencha.gxt.widget.core.client.grid.ColumnConfig;
|
||||
import com.sencha.gxt.widget.core.client.grid.ColumnModel;
|
||||
|
@ -105,9 +101,6 @@ import com.sencha.gxt.widget.core.client.toolbar.ToolBar;
|
|||
*/
|
||||
public class ActiveFiltersPanel extends SimpleContainer {
|
||||
|
||||
private static final int TOP_NUMBER_DEFAULT = 10;
|
||||
private static final int TOP_NUMBER_MAX = 50;
|
||||
private static final int TOP_NUMBER_MIN = 1;
|
||||
private EventBus eventBus;
|
||||
private Grid<AccountingFilter> gridFilter;
|
||||
private ListStore<AccountingFilter> storeFilter;
|
||||
|
@ -134,7 +127,7 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
private FieldLabel comboTopFilterKeyLabel;
|
||||
private ToolBar toolBar;
|
||||
|
||||
private FieldLabel showOthersLabel;
|
||||
// private FieldLabel showOthersLabel;
|
||||
private IntegerSpinnerField topNumber;
|
||||
private FieldLabel topNumberLabel;
|
||||
|
||||
|
@ -142,9 +135,9 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
private boolean cancelValue;
|
||||
private AccountingMonitor accountingMonitor;
|
||||
|
||||
private Radio showOthersYes;
|
||||
private Radio showOthersNo;
|
||||
private ToggleGroup showOthersToggle;
|
||||
// private Radio showOthersYes;
|
||||
// private Radio showOthersNo;
|
||||
// private ToggleGroup showOthersToggle;
|
||||
|
||||
public interface FilterKeyPropertiesCombo extends PropertyAccess<FilterKey> {
|
||||
|
||||
|
@ -432,8 +425,8 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
gridScopes.getView().setAutoExpandColumn(labelScopesCol);
|
||||
gridScopes.getView().setSortingEnabled(true);
|
||||
|
||||
//gridScopes.setStateful(true);
|
||||
//gridScopes.setStateId("gridScopesDefault");
|
||||
// gridScopes.setStateful(true);
|
||||
// gridScopes.setStateId("gridScopesDefault");
|
||||
|
||||
scopeFilter = new StringFilter<ContextData>(propsScopeData.label());
|
||||
|
||||
|
@ -442,10 +435,10 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
gridScopesFilters.setLocal(true);
|
||||
gridScopesFilters.addFilter(scopeFilter);
|
||||
|
||||
//GridFilterStateHandler<ContextData> handler = new GridFilterStateHandler<ContextData>(gridScopes,
|
||||
// gridScopesFilters);
|
||||
//handler.loadState();
|
||||
|
||||
// GridFilterStateHandler<ContextData> handler = new
|
||||
// GridFilterStateHandler<ContextData>(gridScopes,
|
||||
// gridScopesFilters);
|
||||
// handler.loadState();
|
||||
|
||||
// ChartTypeSelection
|
||||
storeComboChartType = new ListStore<ChartType>(new ModelKeyProvider<ChartType>() {
|
||||
|
@ -476,33 +469,6 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
addHandlersForComboChartType(comboChartTypeLabelProvider);
|
||||
comboChartTypeLabel = new FieldLabel(comboChartType, "Chart");
|
||||
|
||||
/*
|
||||
* ScopeCombo for Top and Basic GenresDataPropertiesCombo
|
||||
* scopeDataPropertiesCombo =
|
||||
* GWT.create(GenresDataPropertiesCombo.class);
|
||||
*
|
||||
* storeComboScope = new
|
||||
* ListStore<ScopeData>(scopeDataPropertiesCombo.id());
|
||||
*
|
||||
* comboScope = new ComboBox<ScopeData>(storeComboScope,
|
||||
* scopeDataPropertiesCombo.label());
|
||||
*
|
||||
* comboScope.setClearValueOnParseError(false);
|
||||
*
|
||||
* comboScope.setTypeAhead(true);
|
||||
*
|
||||
* comboScope.setTriggerAction(TriggerAction.ALL);
|
||||
*
|
||||
* comboScope.getListView()
|
||||
* .addStyleName(AccountingManagerResources.INSTANCE.
|
||||
* accountingManagerCSS().getScopeListView());
|
||||
*
|
||||
* addHandlersForComboScope(scopeDataPropertiesCombo.label());
|
||||
*
|
||||
* comboScopeLabel = new FieldLabel(comboScope, "Scope");
|
||||
*
|
||||
*/
|
||||
|
||||
// FileterKeyCombo for Top Chart
|
||||
storeComboTopFilterKey = new ListStore<FilterKey>(filterKeyPropertiesCombo.id());
|
||||
|
||||
|
@ -515,44 +481,45 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
|
||||
comboTopFilterKeyLabel = new FieldLabel(comboTopFilterKey, "Key");
|
||||
|
||||
// ShowOthers
|
||||
showOthersYes = new Radio();
|
||||
showOthersYes.setBoxLabel("Yes");
|
||||
|
||||
showOthersNo = new Radio();
|
||||
showOthersNo.setBoxLabel("No");
|
||||
showOthersNo.setValue(true);
|
||||
|
||||
showOthersToggle = new ToggleGroup();
|
||||
showOthersToggle.add(showOthersYes);
|
||||
showOthersToggle.add(showOthersNo);
|
||||
|
||||
showOthersToggle.addValueChangeHandler(new ValueChangeHandler<HasValue<Boolean>>() {
|
||||
|
||||
@Override
|
||||
public void onValueChange(ValueChangeEvent<HasValue<Boolean>> event) {
|
||||
ToggleGroup group = (ToggleGroup) event.getSource();
|
||||
Radio radio = (Radio) group.getValue();
|
||||
Log.debug("ShowOthers selected: " + radio.getBoxLabel());
|
||||
}
|
||||
});
|
||||
|
||||
HBoxLayoutContainer hp = new HBoxLayoutContainer();
|
||||
hp.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE);
|
||||
hp.setPack(BoxLayoutPack.START);
|
||||
hp.add(showOthersYes, new BoxLayoutData(new Margins(0)));
|
||||
hp.add(showOthersNo, new BoxLayoutData(new Margins(0)));
|
||||
|
||||
showOthersLabel = new FieldLabel(hp, "Show Others");
|
||||
/*
|
||||
* ShowOthers showOthersYes = new Radio();
|
||||
* showOthersYes.setBoxLabel("Yes");
|
||||
*
|
||||
* showOthersNo = new Radio(); showOthersNo.setBoxLabel("No");
|
||||
* showOthersNo.setValue(true);
|
||||
*
|
||||
* showOthersToggle = new ToggleGroup();
|
||||
* showOthersToggle.add(showOthersYes);
|
||||
* showOthersToggle.add(showOthersNo);
|
||||
*
|
||||
* showOthersToggle.addValueChangeHandler(new
|
||||
* ValueChangeHandler<HasValue<Boolean>>() {
|
||||
*
|
||||
* @Override public void
|
||||
* onValueChange(ValueChangeEvent<HasValue<Boolean>> event) {
|
||||
* ToggleGroup group = (ToggleGroup) event.getSource(); Radio radio =
|
||||
* (Radio) group.getValue(); Log.debug("ShowOthers selected: " +
|
||||
* radio.getBoxLabel()); } });
|
||||
*
|
||||
* HBoxLayoutContainer hp = new HBoxLayoutContainer();
|
||||
* hp.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE);
|
||||
* hp.setPack(BoxLayoutPack.START); hp.add(showOthersYes, new
|
||||
* BoxLayoutData(new Margins(0))); hp.add(showOthersNo, new
|
||||
* BoxLayoutData(new Margins(0)));
|
||||
*
|
||||
* showOthersLabel = new FieldLabel(hp, "Show Others");
|
||||
*/
|
||||
|
||||
//
|
||||
topNumber = new IntegerSpinnerField();
|
||||
topNumber.setMaxValue(TOP_NUMBER_MAX);
|
||||
topNumber.setMinValue(TOP_NUMBER_MIN);
|
||||
topNumber.setMaxValue(Constants.TOP_NUMBER_MAX);
|
||||
topNumber.setMinValue(Constants.TOP_NUMBER_MIN);
|
||||
topNumber.setAllowNegative(false);
|
||||
topNumber.setAllowBlank(false);
|
||||
topNumber.setValue(TOP_NUMBER_DEFAULT);
|
||||
topNumber.setEditable(false);
|
||||
topNumber.setValue(Constants.TOP_NUMBER_DEFAULT);
|
||||
topNumber.setEditable(true);
|
||||
topNumber.addValidator(new MinNumberValidator<Integer>(Constants.TOP_NUMBER_MIN));
|
||||
topNumber.addValidator(new MaxNumberValidator<Integer>(Constants.TOP_NUMBER_MAX));
|
||||
|
||||
topNumberLabel = new FieldLabel(topNumber, "Number");
|
||||
|
||||
|
@ -562,23 +529,23 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
vlc.add(gridScopes, new VerticalLayoutData(1, -1, new Margins(0)));
|
||||
vlc.add(comboChartTypeLabel, new VerticalLayoutData(1, -1, new Margins(10, 0, 0, 0)));
|
||||
vlc.add(comboTopFilterKeyLabel, new VerticalLayoutData(1, -1, new Margins(0)));
|
||||
vlc.add(showOthersLabel, new VerticalLayoutData(1, -1, new Margins(0)));
|
||||
// vlc.add(showOthersLabel, 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(gridFilter, new VerticalLayoutData(1, 1, new Margins(0)));
|
||||
|
||||
FieldSet fieldSet = new FieldSet();
|
||||
// fieldSet.setHeight("360px");
|
||||
fieldSet.setHeight("480px");
|
||||
fieldSet.setHeadingHtml("<b>Active Filters</b>");
|
||||
fieldSet.setCollapsible(false);
|
||||
fieldSet.add(vlc);
|
||||
|
||||
add(fieldSet, new MarginData(0));
|
||||
//gridScopes.setVisible(true);
|
||||
//comboChartTypeLabel.setVisible(true);
|
||||
gridScopes.setVisible(false);
|
||||
comboChartTypeLabel.setVisible(false);
|
||||
comboTopFilterKeyLabel.setVisible(false);
|
||||
showOthersLabel.setVisible(false);
|
||||
// showOthersLabel.setVisible(false);
|
||||
topNumberLabel.setVisible(false);
|
||||
}
|
||||
|
||||
|
@ -727,24 +694,24 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
storeScopes.setEnableFilters(false);
|
||||
storeScopes.addAll(scopes);
|
||||
storeScopes.commitChanges();
|
||||
|
||||
Log.debug("ScopeFilterActive: "+accountingFilterBasic.getScopeFilterActive());
|
||||
|
||||
Log.debug("ScopeFilterActive: " + accountingFilterBasic.getScopeFilterActive());
|
||||
if (accountingFilterBasic.getScopeFilterActive() != null
|
||||
&& !accountingFilterBasic.getScopeFilterActive().isEmpty()) {
|
||||
scopeFilter.setValue(accountingFilterBasic.getScopeFilterActive());
|
||||
scopeFilter.setActive(true, false);
|
||||
storeScopes.setEnableFilters(true);
|
||||
storeScopes.commitChanges();
|
||||
|
||||
|
||||
} else {
|
||||
scopeFilter.setValue(null);
|
||||
scopeFilter.setActive(false, false);
|
||||
}
|
||||
|
||||
|
||||
smScopes.deselectAll();
|
||||
|
||||
if (accountingFilterBasic.getContext().getContexts() != null
|
||||
&&!accountingFilterBasic.getContext().getContexts().isEmpty()) {
|
||||
&& !accountingFilterBasic.getContext().getContexts().isEmpty()) {
|
||||
ArrayList<ContextData> selected = new ArrayList<>();
|
||||
for (String c : accountingFilterBasic.getContext().getContexts()) {
|
||||
for (ContextData contextData : storeScopes.getAll()) {
|
||||
|
@ -759,15 +726,14 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
Log.debug("Select All Scope");
|
||||
smScopes.selectAll();
|
||||
} else {
|
||||
Log.debug("Select Scope: "+selected);
|
||||
Log.debug("Select Scope: " + selected);
|
||||
smScopes.select(selected, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
smScopes.refresh();
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
repopulatesContexts();
|
||||
}
|
||||
|
@ -808,9 +774,9 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
comboChartType.setValue(ChartType.Basic);
|
||||
comboTopFilterKey.reset();
|
||||
comboTopFilterKeyLabel.setVisible(false);
|
||||
showOthersToggle.reset();
|
||||
showOthersNo.setValue(true);
|
||||
showOthersLabel.setVisible(false);
|
||||
// showOthersToggle.reset();
|
||||
// showOthersNo.setValue(true);
|
||||
// showOthersLabel.setVisible(false);
|
||||
topNumber.reset();
|
||||
topNumberLabel.setVisible(false);
|
||||
forceLayout();
|
||||
|
@ -842,8 +808,8 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
storeScopes.setEnableFilters(false);
|
||||
storeScopes.addAll(scopes);
|
||||
storeScopes.commitChanges();
|
||||
|
||||
Log.debug("ScopeFilterActive: "+accountingFilterTop.getScopeFilterActive());
|
||||
|
||||
Log.debug("ScopeFilterActive: " + accountingFilterTop.getScopeFilterActive());
|
||||
if (accountingFilterTop.getScopeFilterActive() != null
|
||||
&& !accountingFilterTop.getScopeFilterActive().isEmpty()) {
|
||||
scopeFilter.setValue(accountingFilterTop.getScopeFilterActive());
|
||||
|
@ -854,13 +820,11 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
scopeFilter.setValue(null);
|
||||
scopeFilter.setActive(false, false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
smScopes.deselectAll();
|
||||
|
||||
if (accountingFilterTop.getContext().getContexts() != null &&
|
||||
!accountingFilterTop.getContext().getContexts().isEmpty()) {
|
||||
if (accountingFilterTop.getContext().getContexts() != null
|
||||
&& !accountingFilterTop.getContext().getContexts().isEmpty()) {
|
||||
ArrayList<ContextData> selected = new ArrayList<>();
|
||||
for (String c : accountingFilterTop.getContext().getContexts()) {
|
||||
for (ContextData contextData : storeScopes.getAll()) {
|
||||
|
@ -875,15 +839,14 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
Log.debug("Select All Scope");
|
||||
smScopes.selectAll();
|
||||
} else {
|
||||
Log.debug("Select Scope: "+selected);
|
||||
Log.debug("Select Scope: " + selected);
|
||||
smScopes.select(selected, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
smScopes.refresh();
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
repopulatesContexts();
|
||||
}
|
||||
|
@ -916,10 +879,10 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
|
||||
} else {
|
||||
comboTopFilterKey.reset();
|
||||
showOthersToggle.reset();
|
||||
showOthersNo.setValue(true);
|
||||
// showOthersToggle.reset();
|
||||
// showOthersNo.setValue(true);
|
||||
topNumber.reset();
|
||||
topNumber.setValue(TOP_NUMBER_DEFAULT);
|
||||
topNumber.setValue(Constants.TOP_NUMBER_DEFAULT);
|
||||
storeFilter.clear();
|
||||
storeFilter.commitChanges();
|
||||
seq = 0;
|
||||
|
@ -938,7 +901,7 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
storeScopes.setEnableFilters(false);
|
||||
storeScopes.addAll(scopes);
|
||||
storeScopes.commitChanges();
|
||||
|
||||
|
||||
} else {
|
||||
storeScopes.clear();
|
||||
storeScopes.setEnableFilters(false);
|
||||
|
@ -947,14 +910,14 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
|
||||
scopeFilter.setValue(null);
|
||||
scopeFilter.setActive(false, false);
|
||||
|
||||
|
||||
smScopes.deselectAll();
|
||||
|
||||
|
||||
comboTopFilterKey.reset();
|
||||
showOthersToggle.reset();
|
||||
showOthersNo.setValue(true);
|
||||
// showOthersToggle.reset();
|
||||
// showOthersNo.setValue(true);
|
||||
topNumber.reset();
|
||||
topNumber.setValue(TOP_NUMBER_DEFAULT);
|
||||
topNumber.setValue(Constants.TOP_NUMBER_DEFAULT);
|
||||
storeFilter.clear();
|
||||
storeFilter.commitChanges();
|
||||
seq = 0;
|
||||
|
@ -964,10 +927,10 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
gridScopes.setVisible(true);
|
||||
labelScopesCol.setHeader("Scope");
|
||||
gridScopes.getView().refresh(true);
|
||||
|
||||
|
||||
comboChartType.setValue(ChartType.Top);
|
||||
comboTopFilterKeyLabel.setVisible(true);
|
||||
showOthersLabel.setVisible(true);
|
||||
// showOthersLabel.setVisible(true);
|
||||
topNumberLabel.setVisible(true);
|
||||
forceLayout();
|
||||
}
|
||||
|
@ -1103,6 +1066,9 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
|
||||
}
|
||||
|
||||
} catch (NoScopeSelectedException e) {
|
||||
UtilsGXT3.alert("Attention", e.getLocalizedMessage());
|
||||
return null;
|
||||
} catch (Throwable e) {
|
||||
Log.error(e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
|
@ -1112,7 +1078,7 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
}
|
||||
|
||||
// TODO
|
||||
private AccountingFilterDefinition getActiveFiltersForBasic() {
|
||||
private AccountingFilterDefinition getActiveFiltersForBasic() throws NoScopeSelectedException {
|
||||
ArrayList<String> contextsSelected = new ArrayList<String>();
|
||||
if (storeScopes != null && storeScopes.size() > 0 && smScopes != null) {
|
||||
List<ContextData> selected = smScopes.getSelectedItems();
|
||||
|
@ -1120,6 +1086,13 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
contextsSelected.add(cd.getContextData());
|
||||
}
|
||||
}
|
||||
|
||||
if (contextsSelected.isEmpty()) {
|
||||
String msg = "No Scope selected! Please, select a Scope.";
|
||||
Log.info(msg);
|
||||
throw new NoScopeSelectedException(msg);
|
||||
}
|
||||
|
||||
Context context = new Context(contextsSelected);
|
||||
|
||||
Log.debug("Context selected: " + context);
|
||||
|
@ -1152,7 +1125,7 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
}
|
||||
}
|
||||
|
||||
private AccountingFilterDefinition getActiveFiltersForTop() {
|
||||
private AccountingFilterDefinition getActiveFiltersForTop() throws NoScopeSelectedException {
|
||||
ArrayList<String> contextsSelected = new ArrayList<String>();
|
||||
if (storeScopes != null && storeScopes.size() > 0 && smScopes != null) {
|
||||
List<ContextData> selected = smScopes.getSelectedItems();
|
||||
|
@ -1160,6 +1133,13 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
contextsSelected.add(cd.getContextData());
|
||||
}
|
||||
}
|
||||
|
||||
if (contextsSelected.isEmpty()) {
|
||||
String msg = "No Scope selected! Please, select a Scope.";
|
||||
Log.info(msg);
|
||||
throw new NoScopeSelectedException(msg);
|
||||
}
|
||||
|
||||
Context context = new Context(contextsSelected);
|
||||
|
||||
Log.debug("Context selected: " + context);
|
||||
|
@ -1171,14 +1151,32 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
}
|
||||
Log.debug("Scope Filter Active: " + scopeFilterActive);
|
||||
|
||||
Boolean showOthersValue = showOthersYes.getValue();
|
||||
// Boolean showOthersValue = showOthersYes.getValue();
|
||||
Integer topN = topNumber.getCurrentValue();
|
||||
if(topN!=null){
|
||||
if(topN<Constants.TOP_NUMBER_MIN){
|
||||
topN=Constants.TOP_NUMBER_MIN;
|
||||
topNumber.setValue(topN, true, true);
|
||||
topNumber.clearInvalid();
|
||||
} else {
|
||||
if(topN>Constants.TOP_NUMBER_MAX){
|
||||
topN=Constants.TOP_NUMBER_MAX;
|
||||
topNumber.setValue(topN, true, true);
|
||||
topNumber.clearInvalid();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
topN=Constants.TOP_NUMBER_DEFAULT;
|
||||
topNumber.setValue(topN, true, true);
|
||||
topNumber.clearInvalid();
|
||||
}
|
||||
|
||||
FilterKey filterKey = comboTopFilterKey.getCurrentValue();
|
||||
if (filterKey == null) {
|
||||
return new AccountingFilterTop(context, scopeFilterActive, showOthersValue, topN);
|
||||
return new AccountingFilterTop(context, scopeFilterActive, topN);
|
||||
} else {
|
||||
if (storeFilter == null || storeFilter.size() <= 0) {
|
||||
return new AccountingFilterTop(context, scopeFilterActive, filterKey, null, showOthersValue, topN);
|
||||
return new AccountingFilterTop(context, scopeFilterActive, filterKey, null, topN);
|
||||
} else {
|
||||
List<AccountingFilter> filtersActives = storeFilter.getAll();
|
||||
ArrayList<AccountingFilter> filtersReady = new ArrayList<AccountingFilter>();
|
||||
|
@ -1188,10 +1186,11 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
}
|
||||
}
|
||||
if (filtersReady.size() > 0) {
|
||||
return new AccountingFilterTop(context, scopeFilterActive, filterKey, filtersReady, showOthersValue,
|
||||
topN);
|
||||
return new AccountingFilterTop(context, scopeFilterActive, filterKey,
|
||||
filtersReady, topN);
|
||||
} else {
|
||||
return new AccountingFilterTop(context, scopeFilterActive, filterKey, null, showOthersValue, topN);
|
||||
return new AccountingFilterTop(context, scopeFilterActive, filterKey,
|
||||
null, topN);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1222,7 +1221,7 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
*/
|
||||
|
||||
private void addNewFilter(SelectEvent event) {
|
||||
List<AccountingFilter> filtersSet = storeFilter.getAll();
|
||||
// List<AccountingFilter> filtersSet = storeFilter.getAll();
|
||||
FilterKey fk = null;
|
||||
|
||||
if (accountingStateData == null || accountingStateData.getAvailableFilterKeys() == null
|
||||
|
@ -1234,9 +1233,10 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
accountingStateData.getAvailableFilterKeys());
|
||||
List<FilterKey> removableFilterKeys = new ArrayList<FilterKey>();
|
||||
|
||||
for (AccountingFilter filterSet : filtersSet) {
|
||||
removableFilterKeys.add(filterSet.getFilterKey());
|
||||
}
|
||||
/*
|
||||
* for (AccountingFilter filterSet : filtersSet) {
|
||||
* removableFilterKeys.add(filterSet.getFilterKey()); }
|
||||
*/
|
||||
|
||||
if (comboChartType.getCurrentValue() != null
|
||||
&& comboChartType.getCurrentValue().compareTo(ChartType.Top) == 0) {
|
||||
|
@ -1248,14 +1248,6 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
remainingFilterKeys.removeAll(removableFilterKeys);
|
||||
|
||||
if (remainingFilterKeys.size() > 0) {
|
||||
/*
|
||||
* if (comboChartType.getCurrentValue() != null &&
|
||||
* comboChartType.getCurrentValue().compareTo( ChartType.Top) ==
|
||||
* 0) { if(!(store.getAll().size()<2)){
|
||||
* UtilsGXT3.info("Attention",
|
||||
* "You can add at most 2 filters for top chart!"); return; } }
|
||||
*/
|
||||
// fk = remainingFilterKeys.get(0);
|
||||
fk = new FilterKey("");
|
||||
seq++;
|
||||
AccountingFilter newAccountingFilter = new AccountingFilter(seq, fk, "");
|
||||
|
@ -1344,7 +1336,7 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
int rowIndex = cell.getRow();
|
||||
AccountingFilter editingFilter = storeFilter.get(rowIndex);
|
||||
|
||||
List<AccountingFilter> filtersSet = storeFilter.getAll();
|
||||
// List<AccountingFilter> filtersSet = storeFilter.getAll();
|
||||
|
||||
List<FilterKey> remainingFilterKeys = null;
|
||||
if (accountingStateData == null || accountingStateData.getAvailableFilterKeys() == null) {
|
||||
|
@ -1363,11 +1355,12 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
}
|
||||
}
|
||||
|
||||
for (AccountingFilter filterSet : filtersSet) {
|
||||
if (filterSet.getFilterKey().getKey().compareTo(editingFilter.getFilterKey().getKey()) != 0) {
|
||||
setFilterKeys.add(filterSet.getFilterKey());
|
||||
}
|
||||
}
|
||||
/*
|
||||
* for (AccountingFilter filterSet : filtersSet) { if
|
||||
* (filterSet.getFilterKey().getKey().compareTo(editingFilter.
|
||||
* getFilterKey().getKey()) != 0) {
|
||||
* setFilterKeys.add(filterSet.getFilterKey()); } }
|
||||
*/
|
||||
|
||||
remainingFilterKeys.removeAll(setFilterKeys);
|
||||
|
||||
|
@ -1416,9 +1409,9 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
case Basic:
|
||||
comboTopFilterKey.reset();
|
||||
comboTopFilterKeyLabel.setVisible(false);
|
||||
showOthersToggle.reset();
|
||||
showOthersNo.setValue(true);
|
||||
showOthersLabel.setVisible(false);
|
||||
//showOthersToggle.reset();
|
||||
//showOthersNo.setValue(true);
|
||||
//showOthersLabel.setVisible(false);
|
||||
topNumber.reset();
|
||||
topNumberLabel.setVisible(false);
|
||||
storeFilter.clear();
|
||||
|
@ -1433,11 +1426,11 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
comboTopFilterKey.setValue(accountingStateData.getAvailableFilterKeys().get(0));
|
||||
}
|
||||
comboTopFilterKeyLabel.setVisible(true);
|
||||
showOthersToggle.reset();
|
||||
showOthersNo.setValue(true);
|
||||
showOthersLabel.setVisible(true);
|
||||
//showOthersToggle.reset();
|
||||
//showOthersNo.setValue(true);
|
||||
//showOthersLabel.setVisible(true);
|
||||
topNumber.reset();
|
||||
topNumber.setValue(TOP_NUMBER_DEFAULT);
|
||||
topNumber.setValue(Constants.TOP_NUMBER_DEFAULT);
|
||||
topNumberLabel.setVisible(true);
|
||||
storeFilter.clear();
|
||||
storeFilter.commitChanges();
|
||||
|
|
|
@ -92,7 +92,7 @@ public class FiltersPanel extends FramedPanel {
|
|||
AccountingFilterDefinition accountingFilterDefinition = activeFiltersPanel
|
||||
.getActiveFilters();
|
||||
|
||||
if (accountingPeriod != null) {
|
||||
if (accountingPeriod != null && accountingFilterDefinition!=null) {
|
||||
SeriesRequest seriesRequest = new SeriesRequest(accountingPeriod,
|
||||
accountingFilterDefinition);
|
||||
Log.debug("UpdateChart: " + seriesRequest);
|
||||
|
|
|
@ -57,8 +57,7 @@ public class JobChartTopPanel extends SimpleContainer {
|
|||
private static final String TIME_UNIT = "Time Unit";
|
||||
// private static final String MEASURE_TYPE = "Measure";
|
||||
|
||||
private DateTimeFormat dtf = DateTimeFormat
|
||||
.getFormat(PredefinedFormat.YEAR_MONTH_DAY);
|
||||
private DateTimeFormat dtf = DateTimeFormat.getFormat(PredefinedFormat.YEAR_MONTH_DAY);
|
||||
|
||||
private EventBus eventBus;
|
||||
private AccountingClientStateData accountingStateData;
|
||||
|
@ -96,8 +95,7 @@ public class JobChartTopPanel extends SimpleContainer {
|
|||
|
||||
private VerticalLayoutContainer vert;
|
||||
|
||||
public JobChartTopPanel(EventBus eventBus,
|
||||
AccountingClientStateData accountingStateData) {
|
||||
public JobChartTopPanel(EventBus eventBus, AccountingClientStateData accountingStateData) {
|
||||
this.eventBus = eventBus;
|
||||
this.accountingStateData = accountingStateData;
|
||||
forceLayoutOnResize = true;
|
||||
|
@ -109,8 +107,7 @@ public class JobChartTopPanel extends SimpleContainer {
|
|||
ToolBar toolBar = new ToolBar();
|
||||
toolBar.setSpacing(2);
|
||||
// Download
|
||||
final TextButton downloadButton = new TextButton(
|
||||
DownloadConstants.DOWNLOAD,
|
||||
final TextButton downloadButton = new TextButton(DownloadConstants.DOWNLOAD,
|
||||
AccountingManagerResources.INSTANCE.accountingDownload24());
|
||||
// downloadButton.setScale(ButtonScale.MEDIUM);
|
||||
downloadButton.setIconAlign(IconAlign.RIGHT);
|
||||
|
@ -125,8 +122,7 @@ public class JobChartTopPanel extends SimpleContainer {
|
|||
measureButton.setMenu(createMeasureMenu());
|
||||
|
||||
// Unit
|
||||
unitButton = new TextButton(TIME_UNIT,
|
||||
AccountingManagerResources.INSTANCE.accountingUnitms24());
|
||||
unitButton = new TextButton(TIME_UNIT, AccountingManagerResources.INSTANCE.accountingUnitms24());
|
||||
unitButton.setIconAlign(IconAlign.RIGHT);
|
||||
unitButton.setArrowAlign(ButtonArrowAlign.RIGHT);
|
||||
unitButton.setMenu(createUnitMenu());
|
||||
|
@ -145,8 +141,7 @@ public class JobChartTopPanel extends SimpleContainer {
|
|||
//
|
||||
vert = new VerticalLayoutContainer();
|
||||
vert.add(toolBar, new VerticalLayoutData(1, -1, new Margins(0)));
|
||||
vert.add(highchartsLayoutPanel, new VerticalLayoutData(1, 1,
|
||||
new Margins(0)));
|
||||
vert.add(highchartsLayoutPanel, new VerticalLayoutData(1, 1, new Margins(0)));
|
||||
|
||||
add(vert, new MarginData(0));
|
||||
|
||||
|
@ -265,14 +260,11 @@ public class JobChartTopPanel extends SimpleContainer {
|
|||
// TODO
|
||||
durationItem = new MenuItem(JobChartMeasure.Duration.getLabel());
|
||||
durationItem.setHeight(30);
|
||||
operationCountItem = new MenuItem(
|
||||
JobChartMeasure.OperationCount.getLabel());
|
||||
operationCountItem = new MenuItem(JobChartMeasure.OperationCount.getLabel());
|
||||
operationCountItem.setHeight(30);
|
||||
maxInvocationTimeItem = new MenuItem(
|
||||
JobChartMeasure.MaxInvocationTime.getLabel());
|
||||
maxInvocationTimeItem = new MenuItem(JobChartMeasure.MaxInvocationTime.getLabel());
|
||||
maxInvocationTimeItem.setHeight(30);
|
||||
minInvocationTimeItem = new MenuItem(
|
||||
JobChartMeasure.MinInvocationTime.getLabel());
|
||||
minInvocationTimeItem = new MenuItem(JobChartMeasure.MinInvocationTime.getLabel());
|
||||
minInvocationTimeItem.setHeight(30);
|
||||
|
||||
durationItem.addSelectionHandler(new SelectionHandler<Item>() {
|
||||
|
@ -301,8 +293,7 @@ public class JobChartTopPanel extends SimpleContainer {
|
|||
|
||||
@Override
|
||||
public void onSelection(SelectionEvent<Item> event) {
|
||||
measureButton.setText(JobChartMeasure.MaxInvocationTime
|
||||
.getLabel());
|
||||
measureButton.setText(JobChartMeasure.MaxInvocationTime.getLabel());
|
||||
measure = JobChartMeasure.MaxInvocationTime;
|
||||
unitButton.setVisible(true);
|
||||
updateChart();
|
||||
|
@ -313,8 +304,7 @@ public class JobChartTopPanel extends SimpleContainer {
|
|||
|
||||
@Override
|
||||
public void onSelection(SelectionEvent<Item> event) {
|
||||
measureButton.setText(JobChartMeasure.MinInvocationTime
|
||||
.getLabel());
|
||||
measureButton.setText(JobChartMeasure.MinInvocationTime.getLabel());
|
||||
measure = JobChartMeasure.MinInvocationTime;
|
||||
unitButton.setVisible(true);
|
||||
updateChart();
|
||||
|
@ -332,17 +322,13 @@ public class JobChartTopPanel extends SimpleContainer {
|
|||
|
||||
private Menu createUnitMenu() {
|
||||
Menu menuUnit = new Menu();
|
||||
msItem = new MenuItem(TimeUnitMeasure.MILLISECONDS,
|
||||
AccountingManagerResources.INSTANCE.accountingUnitms24());
|
||||
msItem = new MenuItem(TimeUnitMeasure.MILLISECONDS, AccountingManagerResources.INSTANCE.accountingUnitms24());
|
||||
msItem.setHeight(30);
|
||||
sItem = new MenuItem(TimeUnitMeasure.SECONDS,
|
||||
AccountingManagerResources.INSTANCE.accountingUnits24());
|
||||
sItem = new MenuItem(TimeUnitMeasure.SECONDS, AccountingManagerResources.INSTANCE.accountingUnits24());
|
||||
sItem.setHeight(30);
|
||||
mItem = new MenuItem(TimeUnitMeasure.MINUTES,
|
||||
AccountingManagerResources.INSTANCE.accountingUnitm24());
|
||||
mItem = new MenuItem(TimeUnitMeasure.MINUTES, AccountingManagerResources.INSTANCE.accountingUnitm24());
|
||||
mItem.setHeight(30);
|
||||
hItem = new MenuItem(TimeUnitMeasure.HOURS,
|
||||
AccountingManagerResources.INSTANCE.accountingUnith24());
|
||||
hItem = new MenuItem(TimeUnitMeasure.HOURS, AccountingManagerResources.INSTANCE.accountingUnith24());
|
||||
hItem.setHeight(30);
|
||||
|
||||
msItem.addSelectionHandler(new SelectionHandler<Item>() {
|
||||
|
@ -351,8 +337,7 @@ public class JobChartTopPanel extends SimpleContainer {
|
|||
public void onSelection(SelectionEvent<Item> event) {
|
||||
unitMeasure = TimeUnitMeasure.getMilliseconds();
|
||||
unitMeasureLabel = TimeUnitMeasure.MS;
|
||||
unitButton.setIcon(AccountingManagerResources.INSTANCE
|
||||
.accountingUnitms24());
|
||||
unitButton.setIcon(AccountingManagerResources.INSTANCE.accountingUnitms24());
|
||||
updateChart();
|
||||
}
|
||||
});
|
||||
|
@ -363,8 +348,7 @@ public class JobChartTopPanel extends SimpleContainer {
|
|||
public void onSelection(SelectionEvent<Item> event) {
|
||||
unitMeasure = TimeUnitMeasure.getSeconds();
|
||||
unitMeasureLabel = TimeUnitMeasure.S;
|
||||
unitButton.setIcon(AccountingManagerResources.INSTANCE
|
||||
.accountingUnits24());
|
||||
unitButton.setIcon(AccountingManagerResources.INSTANCE.accountingUnits24());
|
||||
updateChart();
|
||||
}
|
||||
});
|
||||
|
@ -375,8 +359,7 @@ public class JobChartTopPanel extends SimpleContainer {
|
|||
public void onSelection(SelectionEvent<Item> event) {
|
||||
unitMeasure = TimeUnitMeasure.getMinutes();
|
||||
unitMeasureLabel = TimeUnitMeasure.M;
|
||||
unitButton.setIcon(AccountingManagerResources.INSTANCE
|
||||
.accountingUnitm24());
|
||||
unitButton.setIcon(AccountingManagerResources.INSTANCE.accountingUnitm24());
|
||||
updateChart();
|
||||
}
|
||||
});
|
||||
|
@ -387,8 +370,7 @@ public class JobChartTopPanel extends SimpleContainer {
|
|||
public void onSelection(SelectionEvent<Item> event) {
|
||||
unitMeasure = TimeUnitMeasure.getHours();
|
||||
unitMeasureLabel = TimeUnitMeasure.H;
|
||||
unitButton.setIcon(AccountingManagerResources.INSTANCE
|
||||
.accountingUnith24());
|
||||
unitButton.setIcon(AccountingManagerResources.INSTANCE.accountingUnith24());
|
||||
updateChart();
|
||||
}
|
||||
});
|
||||
|
@ -402,20 +384,17 @@ public class JobChartTopPanel extends SimpleContainer {
|
|||
}
|
||||
|
||||
private void onDownloadCSV() {
|
||||
ExportRequestEvent event = new ExportRequestEvent(ExportType.CSV,
|
||||
accountingStateData.getAccountingType());
|
||||
ExportRequestEvent event = new ExportRequestEvent(ExportType.CSV, accountingStateData.getAccountingType());
|
||||
eventBus.fireEvent(event);
|
||||
}
|
||||
|
||||
private void onDownloadXML() {
|
||||
ExportRequestEvent event = new ExportRequestEvent(ExportType.XML,
|
||||
accountingStateData.getAccountingType());
|
||||
ExportRequestEvent event = new ExportRequestEvent(ExportType.XML, accountingStateData.getAccountingType());
|
||||
eventBus.fireEvent(event);
|
||||
}
|
||||
|
||||
private void onDownloadJSON() {
|
||||
ExportRequestEvent event = new ExportRequestEvent(ExportType.JSON,
|
||||
accountingStateData.getAccountingType());
|
||||
ExportRequestEvent event = new ExportRequestEvent(ExportType.JSON, accountingStateData.getAccountingType());
|
||||
eventBus.fireEvent(event);
|
||||
}
|
||||
|
||||
|
@ -472,15 +451,13 @@ public class JobChartTopPanel extends SimpleContainer {
|
|||
}-*/;
|
||||
|
||||
private void createChart() {
|
||||
SeriesJob seriesJob = (SeriesJob) accountingStateData
|
||||
.getSeriesResponse();
|
||||
SeriesJob seriesJob = (SeriesJob) accountingStateData.getSeriesResponse();
|
||||
|
||||
if (!(seriesJob.getSeriesJobDefinition() instanceof SeriesJobTop)) {
|
||||
Log.debug("Invalid SeriesJobTop!");
|
||||
return;
|
||||
}
|
||||
SeriesJobTop seriesJobTop = (SeriesJobTop) seriesJob
|
||||
.getSeriesJobDefinition();
|
||||
SeriesJobTop seriesJobTop = (SeriesJobTop) seriesJob.getSeriesJobDefinition();
|
||||
|
||||
HighchartsOptionFactory highchartsFactory = new JsoHighchartsOptionFactory();
|
||||
|
||||
|
@ -491,7 +468,8 @@ public class JobChartTopPanel extends SimpleContainer {
|
|||
options.title().text("Accounting Job Top");
|
||||
|
||||
/*
|
||||
* options.subtitle().text("Click and drag in the plot area to zoom in");
|
||||
* options.subtitle().text("Click and drag in the plot area to zoom in"
|
||||
* );
|
||||
*/
|
||||
|
||||
ArrayString colors = options.colors();
|
||||
|
@ -501,22 +479,13 @@ public class JobChartTopPanel extends SimpleContainer {
|
|||
// yAxis
|
||||
options.setFieldAsJsonObject("yAxis", retrieveYAxis(colors));
|
||||
|
||||
options.plotOptions().setFieldAsJsonObject(
|
||||
"column",
|
||||
"{ " + "\"stacking\": \"normal\"," + "\"dataLabels\": { "
|
||||
+ " \"enabled\": \"true\","
|
||||
options.plotOptions().setFieldAsJsonObject("column",
|
||||
"{ " + "\"stacking\": \"normal\"," + "\"dataLabels\": { " + " \"enabled\": \"true\","
|
||||
+ " \"color\": \"white\", " + " \"style\": {"
|
||||
+ " \"textShadow\": \"0 0 3px black\"" + " }"
|
||||
+ " }" + " }");
|
||||
+ " \"textShadow\": \"0 0 3px black\"" + " }" + " }" + " }");
|
||||
|
||||
ArrayList<SeriesColumn> seriesColumn = new ArrayList<>();
|
||||
if (seriesJobTop.getShowOthers()) {
|
||||
createSeriesColumnShowOthers(seriesJobTop, highchartsFactory,
|
||||
colors, seriesColumn);
|
||||
} else {
|
||||
createSeriesColumnSimple(seriesJobTop, highchartsFactory, colors,
|
||||
seriesColumn);
|
||||
}
|
||||
createSeriesColumnSimple(seriesJobTop, highchartsFactory, colors, seriesColumn);
|
||||
|
||||
for (SeriesColumn serie : seriesColumn) {
|
||||
options.series().addToEnd(serie);
|
||||
|
@ -528,35 +497,28 @@ public class JobChartTopPanel extends SimpleContainer {
|
|||
return;
|
||||
}
|
||||
|
||||
private void createSeriesColumnShowOthers(SeriesJobTop seriesJobTop,
|
||||
HighchartsOptionFactory highchartsFactory, ArrayString colors,
|
||||
ArrayList<SeriesColumn> seriesColumn) {
|
||||
private void createSeriesColumnShowOthers(SeriesJobTop seriesJobTop, HighchartsOptionFactory highchartsFactory,
|
||||
ArrayString colors, ArrayList<SeriesColumn> seriesColumn) {
|
||||
Log.debug("Series ShowOthers");
|
||||
if (accountingStateData.getSeriesRequest().getAccountingPeriod()
|
||||
.getPeriod().compareTo(AccountingPeriodMode.DAILY) == 0
|
||||
|| accountingStateData.getSeriesRequest().getAccountingPeriod()
|
||||
.getPeriod().compareTo(AccountingPeriodMode.HOURLY) == 0
|
||||
|| accountingStateData.getSeriesRequest().getAccountingPeriod()
|
||||
.getPeriod().compareTo(AccountingPeriodMode.MINUTELY) == 0) {
|
||||
if (accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
|
||||
.compareTo(AccountingPeriodMode.DAILY) == 0
|
||||
|| accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
|
||||
.compareTo(AccountingPeriodMode.HOURLY) == 0
|
||||
|| accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
|
||||
.compareTo(AccountingPeriodMode.MINUTELY) == 0) {
|
||||
|
||||
double minRange = ChartTimeMeasure
|
||||
.calculateMinRange(accountingStateData.getSeriesRequest()
|
||||
.getAccountingPeriod());
|
||||
.calculateMinRange(accountingStateData.getSeriesRequest().getAccountingPeriod());
|
||||
|
||||
double interval = ChartTimeMeasure
|
||||
.calculateInterval(accountingStateData.getSeriesRequest()
|
||||
.getAccountingPeriod());
|
||||
.calculateInterval(accountingStateData.getSeriesRequest().getAccountingPeriod());
|
||||
|
||||
Date dateStart = dtf.parse(accountingStateData.getSeriesRequest()
|
||||
.getAccountingPeriod().getStartDate());
|
||||
Date dateStart = dtf.parse(accountingStateData.getSeriesRequest().getAccountingPeriod().getStartDate());
|
||||
|
||||
dateStart.setTime(dateStart.getTime()
|
||||
+ ChartTimeMeasure.timeZoneOffset()
|
||||
* ChartTimeMeasure.MINUTE);
|
||||
dateStart.setTime(dateStart.getTime() + ChartTimeMeasure.timeZoneOffset() * ChartTimeMeasure.MINUTE);
|
||||
|
||||
Log.debug("BuildChart DateStart: "
|
||||
+ DateTimeFormat.getFormat(PredefinedFormat.DATE_TIME_FULL)
|
||||
.format(dateStart));
|
||||
+ DateTimeFormat.getFormat(PredefinedFormat.DATE_TIME_FULL).format(dateStart));
|
||||
|
||||
// xAxis
|
||||
options.xAxis().type("datetime");
|
||||
|
@ -564,31 +526,25 @@ public class JobChartTopPanel extends SimpleContainer {
|
|||
options.tooltip().xDateFormat("Selected Data");
|
||||
|
||||
int i = 0;
|
||||
for (; i < seriesJobTop.getSeriesJobDataTopList().size()
|
||||
&& i < seriesJobTop.getTopNumber(); i++) {
|
||||
SeriesColumn seriesColumnData = highchartsFactory
|
||||
.createSeriesColumn();
|
||||
for (; i < seriesJobTop.getSeriesJobDataTopList().size() && i < seriesJobTop.getTopNumber(); i++) {
|
||||
SeriesColumn seriesColumnData = highchartsFactory.createSeriesColumn();
|
||||
|
||||
seriesColumnData.name(seriesJobTop.getSeriesJobDataTopList()
|
||||
.get(i).getFilterValue().getValue());
|
||||
seriesColumnData.name(seriesJobTop.getSeriesJobDataTopList().get(i).getFilterValue().getValue());
|
||||
seriesColumnData.color(colors.get(i));
|
||||
seriesColumnData.type("column");
|
||||
|
||||
ArrayNumber data = seriesColumnData.dataAsArrayNumber();
|
||||
|
||||
for (SeriesJobData seriesJobData : seriesJobTop
|
||||
.getSeriesJobDataTopList().get(i).getSeries()) {
|
||||
for (SeriesJobData seriesJobData : seriesJobTop.getSeriesJobDataTopList().get(i).getSeries()) {
|
||||
switch (measure) {
|
||||
case Duration:
|
||||
data.push(seriesJobData.getDuration() / unitMeasure);
|
||||
break;
|
||||
case MaxInvocationTime:
|
||||
data.push(seriesJobData.getMaxInvocationTime()
|
||||
/ unitMeasure);
|
||||
data.push(seriesJobData.getMaxInvocationTime() / unitMeasure);
|
||||
break;
|
||||
case MinInvocationTime:
|
||||
data.push(seriesJobData.getMinInvocationTime()
|
||||
/ unitMeasure);
|
||||
data.push(seriesJobData.getMinInvocationTime() / unitMeasure);
|
||||
break;
|
||||
case OperationCount:
|
||||
data.push(seriesJobData.getOperationCount());
|
||||
|
@ -601,77 +557,61 @@ public class JobChartTopPanel extends SimpleContainer {
|
|||
|
||||
}
|
||||
|
||||
seriesColumnData.pointInterval(interval).pointStart(
|
||||
dateStart.getTime());
|
||||
seriesColumnData.pointInterval(interval).pointStart(dateStart.getTime());
|
||||
seriesColumn.add(seriesColumnData);
|
||||
|
||||
}
|
||||
|
||||
if (i < seriesJobTop.getSeriesJobDataTopList().size()) {
|
||||
SeriesColumn seriesColumnData = highchartsFactory
|
||||
.createSeriesColumn();
|
||||
SeriesColumn seriesColumnData = highchartsFactory.createSeriesColumn();
|
||||
|
||||
seriesColumnData.name("Others");
|
||||
seriesColumnData.color(colors.get(i));
|
||||
seriesColumnData.type("column");
|
||||
|
||||
ArrayList<Long> othersData = new ArrayList<>();
|
||||
for (int j = i; j < seriesJobTop.getSeriesJobDataTopList()
|
||||
.size(); j++) {
|
||||
for (int j = i; j < seriesJobTop.getSeriesJobDataTopList().size(); j++) {
|
||||
Long value;
|
||||
for (int k = 0; k < seriesJobTop.getSeriesJobDataTopList()
|
||||
.get(j).getSeries().size(); k++) {
|
||||
SeriesJobData seriesJobData = seriesJobTop
|
||||
.getSeriesJobDataTopList().get(j).getSeries()
|
||||
.get(k);
|
||||
for (int k = 0; k < seriesJobTop.getSeriesJobDataTopList().get(j).getSeries().size(); k++) {
|
||||
SeriesJobData seriesJobData = seriesJobTop.getSeriesJobDataTopList().get(j).getSeries().get(k);
|
||||
if (j == i) {
|
||||
switch (measure) {
|
||||
case Duration:
|
||||
othersData.add(seriesJobData.getDuration()
|
||||
/ unitMeasure);
|
||||
othersData.add(seriesJobData.getDuration() / unitMeasure);
|
||||
break;
|
||||
case MaxInvocationTime:
|
||||
othersData.add(seriesJobData
|
||||
.getMaxInvocationTime() / unitMeasure);
|
||||
othersData.add(seriesJobData.getMaxInvocationTime() / unitMeasure);
|
||||
break;
|
||||
case MinInvocationTime:
|
||||
othersData.add(seriesJobData
|
||||
.getMinInvocationTime() / unitMeasure);
|
||||
othersData.add(seriesJobData.getMinInvocationTime() / unitMeasure);
|
||||
break;
|
||||
case OperationCount:
|
||||
othersData.add(seriesJobData
|
||||
.getOperationCount());
|
||||
othersData.add(seriesJobData.getOperationCount());
|
||||
break;
|
||||
default:
|
||||
othersData.add(seriesJobData.getDuration()
|
||||
/ unitMeasure);
|
||||
othersData.add(seriesJobData.getDuration() / unitMeasure);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
switch (measure) {
|
||||
case Duration:
|
||||
value = (seriesJobData.getDuration() / unitMeasure)
|
||||
+ othersData.get(k);
|
||||
value = (seriesJobData.getDuration() / unitMeasure) + othersData.get(k);
|
||||
othersData.set(k, value);
|
||||
break;
|
||||
case MaxInvocationTime:
|
||||
value = (seriesJobData.getMaxInvocationTime() / unitMeasure)
|
||||
+ othersData.get(k);
|
||||
value = (seriesJobData.getMaxInvocationTime() / unitMeasure) + othersData.get(k);
|
||||
othersData.set(k, value);
|
||||
break;
|
||||
case MinInvocationTime:
|
||||
value = (seriesJobData.getMinInvocationTime() / unitMeasure)
|
||||
+ othersData.get(k);
|
||||
value = (seriesJobData.getMinInvocationTime() / unitMeasure) + othersData.get(k);
|
||||
othersData.set(k, value);
|
||||
break;
|
||||
case OperationCount:
|
||||
value = seriesJobData.getOperationCount()
|
||||
+ othersData.get(k);
|
||||
value = seriesJobData.getOperationCount() + othersData.get(k);
|
||||
othersData.set(k, value);
|
||||
break;
|
||||
default:
|
||||
value = (seriesJobData.getDuration() / unitMeasure)
|
||||
+ othersData.get(k);
|
||||
value = (seriesJobData.getDuration() / unitMeasure) + othersData.get(k);
|
||||
othersData.set(k, value);
|
||||
break;
|
||||
|
||||
|
@ -688,8 +628,7 @@ public class JobChartTopPanel extends SimpleContainer {
|
|||
data.push(value);
|
||||
}
|
||||
|
||||
seriesColumnData.pointInterval(interval).pointStart(
|
||||
dateStart.getTime());
|
||||
seriesColumnData.pointInterval(interval).pointStart(dateStart.getTime());
|
||||
seriesColumn.add(seriesColumnData);
|
||||
|
||||
}
|
||||
|
@ -697,16 +636,15 @@ public class JobChartTopPanel extends SimpleContainer {
|
|||
// xAxis
|
||||
options.xAxis().type("datetime");
|
||||
|
||||
if (accountingStateData.getSeriesRequest().getAccountingPeriod()
|
||||
.getPeriod().compareTo(AccountingPeriodMode.MONTHLY) == 0) {
|
||||
//options.tooltip().xDateFormat("%b, %Y");
|
||||
if (accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
|
||||
.compareTo(AccountingPeriodMode.MONTHLY) == 0) {
|
||||
// options.tooltip().xDateFormat("%b, %Y");
|
||||
options.tooltip().xDateFormat("Selected Data");
|
||||
|
||||
} else {
|
||||
if (accountingStateData.getSeriesRequest()
|
||||
.getAccountingPeriod().getPeriod()
|
||||
if (accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
|
||||
.compareTo(AccountingPeriodMode.YEARLY) == 0) {
|
||||
//options.tooltip().xDateFormat("%Y");
|
||||
// options.tooltip().xDateFormat("%Y");
|
||||
options.tooltip().xDateFormat("Selected Data");
|
||||
|
||||
} else {
|
||||
|
@ -716,20 +654,16 @@ public class JobChartTopPanel extends SimpleContainer {
|
|||
}
|
||||
|
||||
int i = 0;
|
||||
for (; i < seriesJobTop.getSeriesJobDataTopList().size()
|
||||
&& i < seriesJobTop.getTopNumber(); i++) {
|
||||
SeriesColumn seriesColumnData = highchartsFactory
|
||||
.createSeriesColumn();
|
||||
for (; i < seriesJobTop.getSeriesJobDataTopList().size() && i < seriesJobTop.getTopNumber(); i++) {
|
||||
SeriesColumn seriesColumnData = highchartsFactory.createSeriesColumn();
|
||||
|
||||
seriesColumnData.name(seriesJobTop.getSeriesJobDataTopList()
|
||||
.get(i).getFilterValue().getValue());
|
||||
seriesColumnData.name(seriesJobTop.getSeriesJobDataTopList().get(i).getFilterValue().getValue());
|
||||
seriesColumnData.color(colors.get(i));
|
||||
seriesColumnData.type("column");
|
||||
|
||||
Array<Data> arrayData = seriesColumnData.dataAsArrayObject();
|
||||
|
||||
for (SeriesJobData seriesJobData : seriesJobTop
|
||||
.getSeriesJobDataTopList().get(i).getSeries()) {
|
||||
for (SeriesJobData seriesJobData : seriesJobTop.getSeriesJobDataTopList().get(i).getSeries()) {
|
||||
long dateFrom1970 = seriesJobData.getDate().getTime();
|
||||
|
||||
Log.debug("SeriersJobData: " + seriesJobData.getDate());
|
||||
|
@ -745,14 +679,12 @@ public class JobChartTopPanel extends SimpleContainer {
|
|||
break;
|
||||
case MaxInvocationTime:
|
||||
data.x(dateFrom1970);
|
||||
data.y(seriesJobData.getMaxInvocationTime()
|
||||
/ unitMeasure);
|
||||
data.y(seriesJobData.getMaxInvocationTime() / unitMeasure);
|
||||
arrayData.addToEnd(data);
|
||||
break;
|
||||
case MinInvocationTime:
|
||||
data.x(dateFrom1970);
|
||||
data.y(seriesJobData.getMinInvocationTime()
|
||||
/ unitMeasure);
|
||||
data.y(seriesJobData.getMinInvocationTime() / unitMeasure);
|
||||
arrayData.addToEnd(data);
|
||||
break;
|
||||
case OperationCount:
|
||||
|
@ -775,94 +707,72 @@ public class JobChartTopPanel extends SimpleContainer {
|
|||
}
|
||||
|
||||
if (i < seriesJobTop.getSeriesJobDataTopList().size()) {
|
||||
SeriesColumn seriesColumnData = highchartsFactory
|
||||
.createSeriesColumn();
|
||||
SeriesColumn seriesColumnData = highchartsFactory.createSeriesColumn();
|
||||
|
||||
seriesColumnData.name("Others");
|
||||
seriesColumnData.color(colors.get(i));
|
||||
seriesColumnData.type("column");
|
||||
|
||||
ArrayList<ChartDateTimeData> othersData = new ArrayList<>();
|
||||
for (int j = i; j < seriesJobTop.getSeriesJobDataTopList()
|
||||
.size(); j++) {
|
||||
for (int j = i; j < seriesJobTop.getSeriesJobDataTopList().size(); j++) {
|
||||
ChartDateTimeData chartDateTimeData;
|
||||
for (int k = 0; k < seriesJobTop.getSeriesJobDataTopList()
|
||||
.get(j).getSeries().size(); k++) {
|
||||
SeriesJobData seriesJobData = seriesJobTop
|
||||
.getSeriesJobDataTopList().get(j).getSeries()
|
||||
.get(k);
|
||||
for (int k = 0; k < seriesJobTop.getSeriesJobDataTopList().get(j).getSeries().size(); k++) {
|
||||
SeriesJobData seriesJobData = seriesJobTop.getSeriesJobDataTopList().get(j).getSeries().get(k);
|
||||
if (j == i) {
|
||||
switch (measure) {
|
||||
case Duration:
|
||||
chartDateTimeData = new ChartDateTimeData(
|
||||
seriesJobData.getDate(),
|
||||
seriesJobData.getDuration()
|
||||
/ unitMeasure);
|
||||
chartDateTimeData = new ChartDateTimeData(seriesJobData.getDate(),
|
||||
seriesJobData.getDuration() / unitMeasure);
|
||||
othersData.add(chartDateTimeData);
|
||||
break;
|
||||
case MaxInvocationTime:
|
||||
chartDateTimeData = new ChartDateTimeData(
|
||||
seriesJobData.getDate(),
|
||||
seriesJobData.getMaxInvocationTime()
|
||||
/ unitMeasure);
|
||||
chartDateTimeData = new ChartDateTimeData(seriesJobData.getDate(),
|
||||
seriesJobData.getMaxInvocationTime() / unitMeasure);
|
||||
othersData.add(chartDateTimeData);
|
||||
break;
|
||||
case MinInvocationTime:
|
||||
chartDateTimeData = new ChartDateTimeData(
|
||||
seriesJobData.getDate(),
|
||||
seriesJobData.getMinInvocationTime()
|
||||
/ unitMeasure);
|
||||
chartDateTimeData = new ChartDateTimeData(seriesJobData.getDate(),
|
||||
seriesJobData.getMinInvocationTime() / unitMeasure);
|
||||
othersData.add(chartDateTimeData);
|
||||
break;
|
||||
case OperationCount:
|
||||
chartDateTimeData = new ChartDateTimeData(
|
||||
seriesJobData.getDate(),
|
||||
chartDateTimeData = new ChartDateTimeData(seriesJobData.getDate(),
|
||||
seriesJobData.getOperationCount());
|
||||
othersData.add(chartDateTimeData);
|
||||
break;
|
||||
default:
|
||||
chartDateTimeData = new ChartDateTimeData(
|
||||
seriesJobData.getDate(),
|
||||
seriesJobData.getDuration()
|
||||
/ unitMeasure);
|
||||
chartDateTimeData = new ChartDateTimeData(seriesJobData.getDate(),
|
||||
seriesJobData.getDuration() / unitMeasure);
|
||||
othersData.add(chartDateTimeData);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
switch (measure) {
|
||||
case Duration:
|
||||
chartDateTimeData = new ChartDateTimeData(
|
||||
seriesJobData.getDate(),
|
||||
(seriesJobData.getDuration() / unitMeasure)
|
||||
+ othersData.get(k).getValue());
|
||||
chartDateTimeData = new ChartDateTimeData(seriesJobData.getDate(),
|
||||
(seriesJobData.getDuration() / unitMeasure) + othersData.get(k).getValue());
|
||||
othersData.set(k, chartDateTimeData);
|
||||
break;
|
||||
case MaxInvocationTime:
|
||||
chartDateTimeData = new ChartDateTimeData(
|
||||
seriesJobData.getDate(),
|
||||
chartDateTimeData = new ChartDateTimeData(seriesJobData.getDate(),
|
||||
(seriesJobData.getMaxInvocationTime() / unitMeasure)
|
||||
+ othersData.get(k).getValue());
|
||||
othersData.set(k, chartDateTimeData);
|
||||
break;
|
||||
case MinInvocationTime:
|
||||
chartDateTimeData = new ChartDateTimeData(
|
||||
seriesJobData.getDate(),
|
||||
chartDateTimeData = new ChartDateTimeData(seriesJobData.getDate(),
|
||||
(seriesJobData.getMinInvocationTime() / unitMeasure)
|
||||
+ othersData.get(k).getValue());
|
||||
othersData.set(k, chartDateTimeData);
|
||||
break;
|
||||
case OperationCount:
|
||||
chartDateTimeData = new ChartDateTimeData(
|
||||
seriesJobData.getDate(),
|
||||
seriesJobData.getOperationCount()
|
||||
+ othersData.get(k).getValue());
|
||||
chartDateTimeData = new ChartDateTimeData(seriesJobData.getDate(),
|
||||
seriesJobData.getOperationCount() + othersData.get(k).getValue());
|
||||
othersData.set(k, chartDateTimeData);
|
||||
break;
|
||||
default:
|
||||
chartDateTimeData = new ChartDateTimeData(
|
||||
seriesJobData.getDate(),
|
||||
(seriesJobData.getDuration() / unitMeasure)
|
||||
+ othersData.get(k).getValue());
|
||||
chartDateTimeData = new ChartDateTimeData(seriesJobData.getDate(),
|
||||
(seriesJobData.getDuration() / unitMeasure) + othersData.get(k).getValue());
|
||||
othersData.set(k, chartDateTimeData);
|
||||
break;
|
||||
|
||||
|
@ -878,8 +788,7 @@ public class JobChartTopPanel extends SimpleContainer {
|
|||
for (ChartDateTimeData chartDateTimeData : othersData) {
|
||||
long dateFrom1970 = chartDateTimeData.getDate().getTime();
|
||||
|
||||
Log.debug("SeriersOthersData: "
|
||||
+ chartDateTimeData.getDate());
|
||||
Log.debug("SeriersOthersData: " + chartDateTimeData.getDate());
|
||||
Log.debug("SeriersOthersData: " + dateFrom1970);
|
||||
|
||||
Data data = highchartsFactory.createSeriesColumnData();
|
||||
|
@ -896,65 +805,53 @@ public class JobChartTopPanel extends SimpleContainer {
|
|||
}
|
||||
}
|
||||
|
||||
private void createSeriesColumnSimple(SeriesJobTop seriesJobTop,
|
||||
HighchartsOptionFactory highchartsFactory, ArrayString colors,
|
||||
ArrayList<SeriesColumn> seriesColumn) {
|
||||
private void createSeriesColumnSimple(SeriesJobTop seriesJobTop, HighchartsOptionFactory highchartsFactory,
|
||||
ArrayString colors, ArrayList<SeriesColumn> seriesColumn) {
|
||||
Log.debug("Series Simple");
|
||||
if (accountingStateData.getSeriesRequest().getAccountingPeriod()
|
||||
.getPeriod().compareTo(AccountingPeriodMode.DAILY) == 0
|
||||
|| accountingStateData.getSeriesRequest().getAccountingPeriod()
|
||||
.getPeriod().compareTo(AccountingPeriodMode.HOURLY) == 0
|
||||
|| accountingStateData.getSeriesRequest().getAccountingPeriod()
|
||||
.getPeriod().compareTo(AccountingPeriodMode.MINUTELY) == 0) {
|
||||
if (accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
|
||||
.compareTo(AccountingPeriodMode.DAILY) == 0
|
||||
|| accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
|
||||
.compareTo(AccountingPeriodMode.HOURLY) == 0
|
||||
|| accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
|
||||
.compareTo(AccountingPeriodMode.MINUTELY) == 0) {
|
||||
|
||||
double minRange = ChartTimeMeasure
|
||||
.calculateMinRange(accountingStateData.getSeriesRequest()
|
||||
.getAccountingPeriod());
|
||||
.calculateMinRange(accountingStateData.getSeriesRequest().getAccountingPeriod());
|
||||
|
||||
double interval = ChartTimeMeasure
|
||||
.calculateInterval(accountingStateData.getSeriesRequest()
|
||||
.getAccountingPeriod());
|
||||
.calculateInterval(accountingStateData.getSeriesRequest().getAccountingPeriod());
|
||||
|
||||
Date dateStart = dtf.parse(accountingStateData.getSeriesRequest()
|
||||
.getAccountingPeriod().getStartDate());
|
||||
Date dateStart = dtf.parse(accountingStateData.getSeriesRequest().getAccountingPeriod().getStartDate());
|
||||
|
||||
dateStart.setTime(dateStart.getTime()
|
||||
+ ChartTimeMeasure.timeZoneOffset()
|
||||
* ChartTimeMeasure.MINUTE);
|
||||
dateStart.setTime(dateStart.getTime() + ChartTimeMeasure.timeZoneOffset() * ChartTimeMeasure.MINUTE);
|
||||
|
||||
Log.debug("BuildChart DateStart: "
|
||||
+ DateTimeFormat.getFormat(PredefinedFormat.DATE_TIME_FULL)
|
||||
.format(dateStart));
|
||||
+ DateTimeFormat.getFormat(PredefinedFormat.DATE_TIME_FULL).format(dateStart));
|
||||
|
||||
// xAxis
|
||||
options.xAxis().type("datetime");
|
||||
options.xAxis().minRange(minRange);
|
||||
options.tooltip().xDateFormat("Selected Data");
|
||||
|
||||
for (int i = 0; i < seriesJobTop.getSeriesJobDataTopList().size(); i++) {
|
||||
SeriesColumn seriesColumnData = highchartsFactory
|
||||
.createSeriesColumn();
|
||||
|
||||
seriesColumnData.name(seriesJobTop.getSeriesJobDataTopList()
|
||||
.get(i).getFilterValue().getValue());
|
||||
for (int i = 0; i < seriesJobTop.getSeriesJobDataTopList().size(); i++) {
|
||||
SeriesColumn seriesColumnData = highchartsFactory.createSeriesColumn();
|
||||
|
||||
seriesColumnData.name(seriesJobTop.getSeriesJobDataTopList().get(i).getFilterValue().getValue());
|
||||
seriesColumnData.color(colors.get(i));
|
||||
seriesColumnData.type("column");
|
||||
|
||||
ArrayNumber data = seriesColumnData.dataAsArrayNumber();
|
||||
|
||||
for (SeriesJobData seriesJobData : seriesJobTop
|
||||
.getSeriesJobDataTopList().get(i).getSeries()) {
|
||||
for (SeriesJobData seriesJobData : seriesJobTop.getSeriesJobDataTopList().get(i).getSeries()) {
|
||||
switch (measure) {
|
||||
case Duration:
|
||||
data.push(seriesJobData.getDuration() / unitMeasure);
|
||||
break;
|
||||
case MaxInvocationTime:
|
||||
data.push(seriesJobData.getMaxInvocationTime()
|
||||
/ unitMeasure);
|
||||
data.push(seriesJobData.getMaxInvocationTime() / unitMeasure);
|
||||
break;
|
||||
case MinInvocationTime:
|
||||
data.push(seriesJobData.getMinInvocationTime()
|
||||
/ unitMeasure);
|
||||
data.push(seriesJobData.getMinInvocationTime() / unitMeasure);
|
||||
break;
|
||||
case OperationCount:
|
||||
data.push(seriesJobData.getOperationCount());
|
||||
|
@ -967,8 +864,7 @@ public class JobChartTopPanel extends SimpleContainer {
|
|||
|
||||
}
|
||||
|
||||
seriesColumnData.pointInterval(interval).pointStart(
|
||||
dateStart.getTime());
|
||||
seriesColumnData.pointInterval(interval).pointStart(dateStart.getTime());
|
||||
seriesColumn.add(seriesColumnData);
|
||||
|
||||
}
|
||||
|
@ -976,16 +872,15 @@ public class JobChartTopPanel extends SimpleContainer {
|
|||
// xAxis
|
||||
options.xAxis().type("datetime");
|
||||
|
||||
if (accountingStateData.getSeriesRequest().getAccountingPeriod()
|
||||
.getPeriod().compareTo(AccountingPeriodMode.MONTHLY) == 0) {
|
||||
//options.tooltip().xDateFormat("%b, %Y");
|
||||
if (accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
|
||||
.compareTo(AccountingPeriodMode.MONTHLY) == 0) {
|
||||
// options.tooltip().xDateFormat("%b, %Y");
|
||||
options.tooltip().xDateFormat("Selected Data");
|
||||
|
||||
} else {
|
||||
if (accountingStateData.getSeriesRequest()
|
||||
.getAccountingPeriod().getPeriod()
|
||||
if (accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
|
||||
.compareTo(AccountingPeriodMode.YEARLY) == 0) {
|
||||
//options.tooltip().xDateFormat("%Y");
|
||||
// options.tooltip().xDateFormat("%Y");
|
||||
options.tooltip().xDateFormat("Selected Data");
|
||||
|
||||
} else {
|
||||
|
@ -995,18 +890,15 @@ public class JobChartTopPanel extends SimpleContainer {
|
|||
}
|
||||
|
||||
for (int i = 0; i < seriesJobTop.getSeriesJobDataTopList().size(); i++) {
|
||||
SeriesColumn seriesColumnData = highchartsFactory
|
||||
.createSeriesColumn();
|
||||
SeriesColumn seriesColumnData = highchartsFactory.createSeriesColumn();
|
||||
|
||||
seriesColumnData.name(seriesJobTop.getSeriesJobDataTopList()
|
||||
.get(i).getFilterValue().getValue());
|
||||
seriesColumnData.name(seriesJobTop.getSeriesJobDataTopList().get(i).getFilterValue().getValue());
|
||||
seriesColumnData.color(colors.get(i));
|
||||
seriesColumnData.type("column");
|
||||
|
||||
Array<Data> arrayData = seriesColumnData.dataAsArrayObject();
|
||||
|
||||
for (SeriesJobData seriesJobData : seriesJobTop
|
||||
.getSeriesJobDataTopList().get(i).getSeries()) {
|
||||
for (SeriesJobData seriesJobData : seriesJobTop.getSeriesJobDataTopList().get(i).getSeries()) {
|
||||
long dateFrom1970 = seriesJobData.getDate().getTime();
|
||||
|
||||
Log.debug("SeriersJobData: " + seriesJobData.getDate());
|
||||
|
@ -1022,14 +914,12 @@ public class JobChartTopPanel extends SimpleContainer {
|
|||
break;
|
||||
case MaxInvocationTime:
|
||||
data.x(dateFrom1970);
|
||||
data.y(seriesJobData.getMaxInvocationTime()
|
||||
/ unitMeasure);
|
||||
data.y(seriesJobData.getMaxInvocationTime() / unitMeasure);
|
||||
arrayData.addToEnd(data);
|
||||
break;
|
||||
case MinInvocationTime:
|
||||
data.x(dateFrom1970);
|
||||
data.y(seriesJobData.getMinInvocationTime()
|
||||
/ unitMeasure);
|
||||
data.y(seriesJobData.getMinInvocationTime() / unitMeasure);
|
||||
arrayData.addToEnd(data);
|
||||
break;
|
||||
case OperationCount:
|
||||
|
@ -1057,67 +947,44 @@ public class JobChartTopPanel extends SimpleContainer {
|
|||
private String retrieveYAxis(ArrayString colors) {
|
||||
switch (measure) {
|
||||
case Duration:
|
||||
return "[{" + " \"id\": \"" + JobChartMeasure.Duration.name()
|
||||
+ "\"," + " \"labels\": {" + " \"format\": \"{value} "
|
||||
+ unitMeasureLabel + "\"," + " \"style\": {"
|
||||
+ " \"color\": \"" + colors.get(1) + "\"" + " }"
|
||||
+ " }," + " \"stackLabels\": {" + " \"enabled\": \"true\","
|
||||
+ " \"style\": {" + " \"fontWeight\": \"bold\","
|
||||
+ " \"color\": \"gray\"" + " } " + " },"
|
||||
+ " \"title\": { " + " \"text\": \""
|
||||
+ JobChartMeasure.Duration.getLabel() + "\","
|
||||
+ " \"style\": {" + " \"color\": \""
|
||||
return "[{" + " \"id\": \"" + JobChartMeasure.Duration.name() + "\"," + " \"labels\": {"
|
||||
+ " \"format\": \"{value} " + unitMeasureLabel + "\"," + " \"style\": {"
|
||||
+ " \"color\": \"" + colors.get(1) + "\"" + " }" + " }," + " \"stackLabels\": {"
|
||||
+ " \"enabled\": \"true\"," + " \"style\": {" + " \"fontWeight\": \"bold\","
|
||||
+ " \"color\": \"gray\"" + " } " + " }," + " \"title\": { " + " \"text\": \""
|
||||
+ JobChartMeasure.Duration.getLabel() + "\"," + " \"style\": {" + " \"color\": \""
|
||||
+ colors.get(1) + "\"" + " }" + " }" + "}]";
|
||||
case MaxInvocationTime:
|
||||
return "[{" + " \"id\": \""
|
||||
+ JobChartMeasure.MaxInvocationTime.name() + "\","
|
||||
+ " \"labels\": {" + " \"format\": \"{value} "
|
||||
+ unitMeasureLabel + "\"," + " \"style\": {"
|
||||
+ " \"color\": \"" + colors.get(1) + "\"" + " }"
|
||||
+ " }," + " \"stackLabels\": {" + " \"enabled\": \"true\","
|
||||
+ " \"style\": {" + " \"fontWeight\": \"bold\","
|
||||
+ " \"color\": \"gray\"" + " } " + " },"
|
||||
+ " \"title\": { " + " \"text\": \""
|
||||
+ JobChartMeasure.MaxInvocationTime.getLabel() + "\","
|
||||
+ " \"style\": {" + " \"color\": \""
|
||||
return "[{" + " \"id\": \"" + JobChartMeasure.MaxInvocationTime.name() + "\"," + " \"labels\": {"
|
||||
+ " \"format\": \"{value} " + unitMeasureLabel + "\"," + " \"style\": {"
|
||||
+ " \"color\": \"" + colors.get(1) + "\"" + " }" + " }," + " \"stackLabels\": {"
|
||||
+ " \"enabled\": \"true\"," + " \"style\": {" + " \"fontWeight\": \"bold\","
|
||||
+ " \"color\": \"gray\"" + " } " + " }," + " \"title\": { " + " \"text\": \""
|
||||
+ JobChartMeasure.MaxInvocationTime.getLabel() + "\"," + " \"style\": {" + " \"color\": \""
|
||||
+ colors.get(1) + "\"" + " }" + " }" + "}]";
|
||||
case MinInvocationTime:
|
||||
return "[{" + " \"id\": \""
|
||||
+ JobChartMeasure.MinInvocationTime.name() + "\","
|
||||
+ " \"labels\": {" + " \"format\": \"{value} "
|
||||
+ unitMeasureLabel + "\"," + " \"style\": {"
|
||||
+ " \"color\": \"" + colors.get(1) + "\"" + " }"
|
||||
+ " }," + " \"stackLabels\": {" + " \"enabled\": \"true\","
|
||||
+ " \"style\": {" + " \"fontWeight\": \"bold\","
|
||||
+ " \"color\": \"gray\"" + " } " + " },"
|
||||
+ " \"title\": { " + " \"text\": \""
|
||||
+ JobChartMeasure.MinInvocationTime.getLabel() + "\","
|
||||
+ " \"style\": {" + " \"color\": \""
|
||||
return "[{" + " \"id\": \"" + JobChartMeasure.MinInvocationTime.name() + "\"," + " \"labels\": {"
|
||||
+ " \"format\": \"{value} " + unitMeasureLabel + "\"," + " \"style\": {"
|
||||
+ " \"color\": \"" + colors.get(1) + "\"" + " }" + " }," + " \"stackLabels\": {"
|
||||
+ " \"enabled\": \"true\"," + " \"style\": {" + " \"fontWeight\": \"bold\","
|
||||
+ " \"color\": \"gray\"" + " } " + " }," + " \"title\": { " + " \"text\": \""
|
||||
+ JobChartMeasure.MinInvocationTime.getLabel() + "\"," + " \"style\": {" + " \"color\": \""
|
||||
+ colors.get(1) + "\"" + " }" + " }" + "}]";
|
||||
case OperationCount:
|
||||
return "[{" + " \"id\": \"" + JobChartMeasure.OperationCount.name()
|
||||
+ "\"," + " \"labels\": { "
|
||||
+ " \"format\": \"{value}\"," + " \"style\": { "
|
||||
+ " \"color\": \"" + colors.get(1) + "\"" + " }"
|
||||
+ " }," + " \"stackLabels\": {" + " \"enabled\": \"true\","
|
||||
+ " \"style\": {" + " \"fontWeight\": \"bold\","
|
||||
+ " \"color\": \"gray\"" + " } " + " },"
|
||||
+ " \"title\": { " + " \"text\": \""
|
||||
+ JobChartMeasure.OperationCount.getLabel() + "\","
|
||||
+ " \"style\": {" + " \"color\": \""
|
||||
+ colors.get(1) + "\"" + " }" + " }" + "}]";
|
||||
return "[{" + " \"id\": \"" + JobChartMeasure.OperationCount.name() + "\"," + " \"labels\": { "
|
||||
+ " \"format\": \"{value}\"," + " \"style\": { " + " \"color\": \"" + colors.get(1)
|
||||
+ "\"" + " }" + " }," + " \"stackLabels\": {" + " \"enabled\": \"true\"," + " \"style\": {"
|
||||
+ " \"fontWeight\": \"bold\"," + " \"color\": \"gray\"" + " } " + " },"
|
||||
+ " \"title\": { " + " \"text\": \"" + JobChartMeasure.OperationCount.getLabel() + "\","
|
||||
+ " \"style\": {" + " \"color\": \"" + colors.get(1) + "\"" + " }" + " }" + "}]";
|
||||
|
||||
default:
|
||||
return "[{" + " \"id\": \"" + JobChartMeasure.Duration.name()
|
||||
+ "\"," + " \"labels\": {" + " \"format\": \"{value} "
|
||||
+ unitMeasureLabel + "\"," + " \"style\": {"
|
||||
+ " \"color\": \"" + colors.get(1) + "\"" + " }"
|
||||
+ " }," + " \"stackLabels\": {" + " \"enabled\": \"true\","
|
||||
+ " \"style\": {" + " \"fontWeight\": \"bold\","
|
||||
+ " \"color\": \"gray\"" + " } " + " },"
|
||||
+ " \"title\": { " + " \"text\": \""
|
||||
+ JobChartMeasure.Duration.getLabel() + "\","
|
||||
+ " \"style\": {" + " \"color\": \""
|
||||
return "[{" + " \"id\": \"" + JobChartMeasure.Duration.name() + "\"," + " \"labels\": {"
|
||||
+ " \"format\": \"{value} " + unitMeasureLabel + "\"," + " \"style\": {"
|
||||
+ " \"color\": \"" + colors.get(1) + "\"" + " }" + " }," + " \"stackLabels\": {"
|
||||
+ " \"enabled\": \"true\"," + " \"style\": {" + " \"fontWeight\": \"bold\","
|
||||
+ " \"color\": \"gray\"" + " } " + " }," + " \"title\": { " + " \"text\": \""
|
||||
+ JobChartMeasure.Duration.getLabel() + "\"," + " \"style\": {" + " \"color\": \""
|
||||
+ colors.get(1) + "\"" + " }" + " }" + "}]";
|
||||
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -57,8 +57,7 @@ public class StorageChartTopPanel extends SimpleContainer {
|
|||
private static final String DATA_VOLUME_UNIT = "Data Volume Unit";
|
||||
// private static final String MEASURE_TYPE = "Measure";
|
||||
|
||||
private DateTimeFormat dtf = DateTimeFormat
|
||||
.getFormat(PredefinedFormat.YEAR_MONTH_DAY);
|
||||
private DateTimeFormat dtf = DateTimeFormat.getFormat(PredefinedFormat.YEAR_MONTH_DAY);
|
||||
|
||||
private EventBus eventBus;
|
||||
private AccountingClientStateData accountingStateData;
|
||||
|
@ -94,8 +93,7 @@ public class StorageChartTopPanel extends SimpleContainer {
|
|||
|
||||
private VerticalLayoutContainer vert;
|
||||
|
||||
public StorageChartTopPanel(EventBus eventBus,
|
||||
AccountingClientStateData accountingStateData) {
|
||||
public StorageChartTopPanel(EventBus eventBus, AccountingClientStateData accountingStateData) {
|
||||
this.eventBus = eventBus;
|
||||
this.accountingStateData = accountingStateData;
|
||||
forceLayoutOnResize = true;
|
||||
|
@ -107,8 +105,7 @@ public class StorageChartTopPanel extends SimpleContainer {
|
|||
ToolBar toolBar = new ToolBar();
|
||||
toolBar.setSpacing(2);
|
||||
// Download
|
||||
final TextButton downloadButton = new TextButton(
|
||||
DownloadConstants.DOWNLOAD,
|
||||
final TextButton downloadButton = new TextButton(DownloadConstants.DOWNLOAD,
|
||||
AccountingManagerResources.INSTANCE.accountingDownload24());
|
||||
// downloadButton.setScale(ButtonScale.MEDIUM);
|
||||
downloadButton.setIconAlign(IconAlign.RIGHT);
|
||||
|
@ -116,16 +113,14 @@ public class StorageChartTopPanel extends SimpleContainer {
|
|||
downloadButton.setMenu(createDownloadMenu());
|
||||
|
||||
// Measure
|
||||
measureButton = new TextButton(
|
||||
StorageChartMeasure.DataVolume.getLabel(),
|
||||
measureButton = new TextButton(StorageChartMeasure.DataVolume.getLabel(),
|
||||
AccountingManagerResources.INSTANCE.accountingByte24());
|
||||
measureButton.setIconAlign(IconAlign.RIGHT);
|
||||
measureButton.setArrowAlign(ButtonArrowAlign.RIGHT);
|
||||
measureButton.setMenu(createMeasureMenu());
|
||||
|
||||
// Unit
|
||||
unitButton = new TextButton(DATA_VOLUME_UNIT,
|
||||
AccountingManagerResources.INSTANCE.accountingUnitMB24());
|
||||
unitButton = new TextButton(DATA_VOLUME_UNIT, AccountingManagerResources.INSTANCE.accountingUnitMB24());
|
||||
unitButton.setIconAlign(IconAlign.RIGHT);
|
||||
unitButton.setArrowAlign(ButtonArrowAlign.RIGHT);
|
||||
unitButton.setMenu(createUnitMenu());
|
||||
|
@ -143,8 +138,7 @@ public class StorageChartTopPanel extends SimpleContainer {
|
|||
//
|
||||
vert = new VerticalLayoutContainer();
|
||||
vert.add(toolBar, new VerticalLayoutData(1, -1, new Margins(0)));
|
||||
vert.add(highchartsLayoutPanel, new VerticalLayoutData(1, 1,
|
||||
new Margins(0)));
|
||||
vert.add(highchartsLayoutPanel, new VerticalLayoutData(1, 1, new Margins(0)));
|
||||
|
||||
add(vert, new MarginData(0));
|
||||
|
||||
|
@ -273,8 +267,7 @@ public class StorageChartTopPanel extends SimpleContainer {
|
|||
Menu menuMeasure = new Menu();
|
||||
dataVolumeItem = new MenuItem(StorageChartMeasure.DataVolume.getLabel());
|
||||
dataVolumeItem.setHeight(30);
|
||||
operationCountItem = new MenuItem(
|
||||
StorageChartMeasure.OperationCount.getLabel());
|
||||
operationCountItem = new MenuItem(StorageChartMeasure.OperationCount.getLabel());
|
||||
operationCountItem.setHeight(30);
|
||||
|
||||
dataVolumeItem.addSelectionHandler(new SelectionHandler<Item>() {
|
||||
|
@ -292,8 +285,7 @@ public class StorageChartTopPanel extends SimpleContainer {
|
|||
|
||||
@Override
|
||||
public void onSelection(SelectionEvent<Item> event) {
|
||||
measureButton.setText(StorageChartMeasure.OperationCount
|
||||
.getLabel());
|
||||
measureButton.setText(StorageChartMeasure.OperationCount.getLabel());
|
||||
measure = StorageChartMeasure.OperationCount;
|
||||
unitButton.setVisible(false);
|
||||
updateChart();
|
||||
|
@ -309,17 +301,13 @@ public class StorageChartTopPanel extends SimpleContainer {
|
|||
|
||||
private Menu createUnitMenu() {
|
||||
Menu menuUnit = new Menu();
|
||||
kBItem = new MenuItem(ByteUnitMeasure.KILOBYTE,
|
||||
AccountingManagerResources.INSTANCE.accountingUnitkB24());
|
||||
kBItem = new MenuItem(ByteUnitMeasure.KILOBYTE, AccountingManagerResources.INSTANCE.accountingUnitkB24());
|
||||
kBItem.setHeight(30);
|
||||
MBItem = new MenuItem(ByteUnitMeasure.MEGABYTE,
|
||||
AccountingManagerResources.INSTANCE.accountingUnitMB24());
|
||||
MBItem = new MenuItem(ByteUnitMeasure.MEGABYTE, AccountingManagerResources.INSTANCE.accountingUnitMB24());
|
||||
MBItem.setHeight(30);
|
||||
GBItem = new MenuItem(ByteUnitMeasure.GIGABYTE,
|
||||
AccountingManagerResources.INSTANCE.accountingUnitGB24());
|
||||
GBItem = new MenuItem(ByteUnitMeasure.GIGABYTE, AccountingManagerResources.INSTANCE.accountingUnitGB24());
|
||||
GBItem.setHeight(30);
|
||||
TBItem = new MenuItem(ByteUnitMeasure.TERABYTE,
|
||||
AccountingManagerResources.INSTANCE.accountingUnitTB24());
|
||||
TBItem = new MenuItem(ByteUnitMeasure.TERABYTE, AccountingManagerResources.INSTANCE.accountingUnitTB24());
|
||||
TBItem.setHeight(30);
|
||||
|
||||
kBItem.addSelectionHandler(new SelectionHandler<Item>() {
|
||||
|
@ -328,8 +316,7 @@ public class StorageChartTopPanel extends SimpleContainer {
|
|||
public void onSelection(SelectionEvent<Item> event) {
|
||||
unitMeasure = ByteUnitMeasure.getKiloByteDimForStorage();
|
||||
unitMeasureLabel = ByteUnitMeasure.kB;
|
||||
unitButton.setIcon(AccountingManagerResources.INSTANCE
|
||||
.accountingUnitkB24());
|
||||
unitButton.setIcon(AccountingManagerResources.INSTANCE.accountingUnitkB24());
|
||||
updateChart();
|
||||
}
|
||||
});
|
||||
|
@ -340,8 +327,7 @@ public class StorageChartTopPanel extends SimpleContainer {
|
|||
public void onSelection(SelectionEvent<Item> event) {
|
||||
unitMeasure = ByteUnitMeasure.getMegaByteDimForStorage();
|
||||
unitMeasureLabel = ByteUnitMeasure.MB;
|
||||
unitButton.setIcon(AccountingManagerResources.INSTANCE
|
||||
.accountingUnitMB24());
|
||||
unitButton.setIcon(AccountingManagerResources.INSTANCE.accountingUnitMB24());
|
||||
updateChart();
|
||||
}
|
||||
});
|
||||
|
@ -352,8 +338,7 @@ public class StorageChartTopPanel extends SimpleContainer {
|
|||
public void onSelection(SelectionEvent<Item> event) {
|
||||
unitMeasure = ByteUnitMeasure.getGigaByteDimForStorage();
|
||||
unitMeasureLabel = ByteUnitMeasure.GB;
|
||||
unitButton.setIcon(AccountingManagerResources.INSTANCE
|
||||
.accountingUnitGB24());
|
||||
unitButton.setIcon(AccountingManagerResources.INSTANCE.accountingUnitGB24());
|
||||
updateChart();
|
||||
}
|
||||
});
|
||||
|
@ -364,8 +349,7 @@ public class StorageChartTopPanel extends SimpleContainer {
|
|||
public void onSelection(SelectionEvent<Item> event) {
|
||||
unitMeasure = ByteUnitMeasure.getTeraByteDimForStorage();
|
||||
unitMeasureLabel = ByteUnitMeasure.TB;
|
||||
unitButton.setIcon(AccountingManagerResources.INSTANCE
|
||||
.accountingUnitTB24());
|
||||
unitButton.setIcon(AccountingManagerResources.INSTANCE.accountingUnitTB24());
|
||||
updateChart();
|
||||
}
|
||||
});
|
||||
|
@ -379,20 +363,17 @@ public class StorageChartTopPanel extends SimpleContainer {
|
|||
}
|
||||
|
||||
private void onDownloadCSV() {
|
||||
ExportRequestEvent event = new ExportRequestEvent(ExportType.CSV,
|
||||
accountingStateData.getAccountingType());
|
||||
ExportRequestEvent event = new ExportRequestEvent(ExportType.CSV, accountingStateData.getAccountingType());
|
||||
eventBus.fireEvent(event);
|
||||
}
|
||||
|
||||
private void onDownloadXML() {
|
||||
ExportRequestEvent event = new ExportRequestEvent(ExportType.XML,
|
||||
accountingStateData.getAccountingType());
|
||||
ExportRequestEvent event = new ExportRequestEvent(ExportType.XML, accountingStateData.getAccountingType());
|
||||
eventBus.fireEvent(event);
|
||||
}
|
||||
|
||||
private void onDownloadJSON() {
|
||||
ExportRequestEvent event = new ExportRequestEvent(ExportType.JSON,
|
||||
accountingStateData.getAccountingType());
|
||||
ExportRequestEvent event = new ExportRequestEvent(ExportType.JSON, accountingStateData.getAccountingType());
|
||||
eventBus.fireEvent(event);
|
||||
}
|
||||
|
||||
|
@ -449,15 +430,13 @@ public class StorageChartTopPanel extends SimpleContainer {
|
|||
}-*/;
|
||||
|
||||
private void createChart() {
|
||||
SeriesStorage seriesStorage = (SeriesStorage) accountingStateData
|
||||
.getSeriesResponse();
|
||||
SeriesStorage seriesStorage = (SeriesStorage) accountingStateData.getSeriesResponse();
|
||||
|
||||
if (!(seriesStorage.getSeriesStorageDefinition() instanceof SeriesStorageTop)) {
|
||||
Log.debug("Invalid SeriesStorageTop!");
|
||||
return;
|
||||
}
|
||||
SeriesStorageTop seriesStorageTop = (SeriesStorageTop) seriesStorage
|
||||
.getSeriesStorageDefinition();
|
||||
SeriesStorageTop seriesStorageTop = (SeriesStorageTop) seriesStorage.getSeriesStorageDefinition();
|
||||
|
||||
HighchartsOptionFactory highchartsFactory = new JsoHighchartsOptionFactory();
|
||||
|
||||
|
@ -468,7 +447,8 @@ public class StorageChartTopPanel extends SimpleContainer {
|
|||
options.title().text("Accounting Storage Top");
|
||||
|
||||
/*
|
||||
* options.subtitle().text("Click and drag in the plot area to zoom in");
|
||||
* options.subtitle().text("Click and drag in the plot area to zoom in"
|
||||
* );
|
||||
*/
|
||||
|
||||
ArrayString colors = options.colors();
|
||||
|
@ -478,22 +458,14 @@ public class StorageChartTopPanel extends SimpleContainer {
|
|||
// yAxis
|
||||
options.setFieldAsJsonObject("yAxis", retrieveYAxis(colors));
|
||||
|
||||
options.plotOptions().setFieldAsJsonObject(
|
||||
"column",
|
||||
"{ " + "\"stacking\": \"normal\"," + "\"dataLabels\": { "
|
||||
+ " \"enabled\": \"true\","
|
||||
options.plotOptions().setFieldAsJsonObject("column",
|
||||
"{ " + "\"stacking\": \"normal\"," + "\"dataLabels\": { " + " \"enabled\": \"true\","
|
||||
+ " \"color\": \"white\", " + " \"style\": {"
|
||||
+ " \"textShadow\": \"0 0 3px black\"" + " }"
|
||||
+ " }" + " }");
|
||||
+ " \"textShadow\": \"0 0 3px black\"" + " }" + " }" + " }");
|
||||
|
||||
ArrayList<SeriesColumn> seriesColumn = new ArrayList<>();
|
||||
if (seriesStorageTop.getShowOthers()) {
|
||||
createSeriesColumnShowOthers(seriesStorageTop, highchartsFactory,
|
||||
colors, seriesColumn);
|
||||
} else {
|
||||
createSeriesColumnSimple(seriesStorageTop, highchartsFactory,
|
||||
colors, seriesColumn);
|
||||
}
|
||||
|
||||
createSeriesColumnSimple(seriesStorageTop, highchartsFactory, colors, seriesColumn);
|
||||
|
||||
for (SeriesColumn serie : seriesColumn) {
|
||||
options.series().addToEnd(serie);
|
||||
|
@ -505,62 +477,51 @@ public class StorageChartTopPanel extends SimpleContainer {
|
|||
return;
|
||||
}
|
||||
|
||||
private void createSeriesColumnShowOthers(
|
||||
SeriesStorageTop seriesStorageTop,
|
||||
HighchartsOptionFactory highchartsFactory, ArrayString colors,
|
||||
ArrayList<SeriesColumn> seriesColumn) {
|
||||
private void createSeriesColumnShowOthers(SeriesStorageTop seriesStorageTop,
|
||||
HighchartsOptionFactory highchartsFactory, ArrayString colors, ArrayList<SeriesColumn> seriesColumn) {
|
||||
Log.debug("Series ShowOthers");
|
||||
if (accountingStateData.getSeriesRequest().getAccountingPeriod()
|
||||
.getPeriod().compareTo(AccountingPeriodMode.DAILY) == 0
|
||||
|| accountingStateData.getSeriesRequest().getAccountingPeriod()
|
||||
.getPeriod().compareTo(AccountingPeriodMode.HOURLY) == 0
|
||||
|| accountingStateData.getSeriesRequest().getAccountingPeriod()
|
||||
.getPeriod().compareTo(AccountingPeriodMode.MINUTELY) == 0) {
|
||||
if (accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
|
||||
.compareTo(AccountingPeriodMode.DAILY) == 0
|
||||
|| accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
|
||||
.compareTo(AccountingPeriodMode.HOURLY) == 0
|
||||
|| accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
|
||||
.compareTo(AccountingPeriodMode.MINUTELY) == 0) {
|
||||
|
||||
double minRange = ChartTimeMeasure
|
||||
.calculateMinRange(accountingStateData.getSeriesRequest()
|
||||
.getAccountingPeriod());
|
||||
.calculateMinRange(accountingStateData.getSeriesRequest().getAccountingPeriod());
|
||||
|
||||
double interval = ChartTimeMeasure
|
||||
.calculateInterval(accountingStateData.getSeriesRequest()
|
||||
.getAccountingPeriod());
|
||||
.calculateInterval(accountingStateData.getSeriesRequest().getAccountingPeriod());
|
||||
|
||||
Date dateStart = dtf.parse(accountingStateData.getSeriesRequest()
|
||||
.getAccountingPeriod().getStartDate());
|
||||
Date dateStart = dtf.parse(accountingStateData.getSeriesRequest().getAccountingPeriod().getStartDate());
|
||||
|
||||
dateStart.setTime(dateStart.getTime()
|
||||
+ ChartTimeMeasure.timeZoneOffset()
|
||||
* ChartTimeMeasure.MINUTE);
|
||||
dateStart.setTime(dateStart.getTime() + ChartTimeMeasure.timeZoneOffset() * ChartTimeMeasure.MINUTE);
|
||||
|
||||
Log.debug("BuildChart DateStart: "
|
||||
+ DateTimeFormat.getFormat(PredefinedFormat.DATE_TIME_FULL)
|
||||
.format(dateStart));
|
||||
+ DateTimeFormat.getFormat(PredefinedFormat.DATE_TIME_FULL).format(dateStart));
|
||||
|
||||
// xAxis
|
||||
options.xAxis().type("datetime");
|
||||
options.xAxis().minRange(minRange);
|
||||
options.tooltip().xDateFormat("Selected Data");
|
||||
|
||||
|
||||
int i = 0;
|
||||
for (; i < seriesStorageTop.getSeriesStorageDataTopList().size()
|
||||
&& i < seriesStorageTop.getTopNumber(); i++) {
|
||||
SeriesColumn seriesColumnData = highchartsFactory
|
||||
.createSeriesColumn();
|
||||
SeriesColumn seriesColumnData = highchartsFactory.createSeriesColumn();
|
||||
|
||||
seriesColumnData.name(seriesStorageTop
|
||||
.getSeriesStorageDataTopList().get(i).getFilterValue()
|
||||
.getValue());
|
||||
seriesColumnData
|
||||
.name(seriesStorageTop.getSeriesStorageDataTopList().get(i).getFilterValue().getValue());
|
||||
seriesColumnData.color(colors.get(i));
|
||||
seriesColumnData.type("column");
|
||||
|
||||
ArrayNumber data = seriesColumnData.dataAsArrayNumber();
|
||||
|
||||
for (SeriesStorageData seriesStorageData : seriesStorageTop
|
||||
.getSeriesStorageDataTopList().get(i).getSeries()) {
|
||||
for (SeriesStorageData seriesStorageData : seriesStorageTop.getSeriesStorageDataTopList().get(i)
|
||||
.getSeries()) {
|
||||
switch (measure) {
|
||||
case DataVolume:
|
||||
data.push(seriesStorageData.getDataVolume()
|
||||
/ unitMeasure);
|
||||
data.push(seriesStorageData.getDataVolume() / unitMeasure);
|
||||
break;
|
||||
case OperationCount:
|
||||
data.push(seriesStorageData.getOperationCount());
|
||||
|
@ -573,43 +534,34 @@ public class StorageChartTopPanel extends SimpleContainer {
|
|||
|
||||
}
|
||||
|
||||
seriesColumnData.pointInterval(interval).pointStart(
|
||||
dateStart.getTime());
|
||||
seriesColumnData.pointInterval(interval).pointStart(dateStart.getTime());
|
||||
seriesColumn.add(seriesColumnData);
|
||||
|
||||
}
|
||||
|
||||
if (i < seriesStorageTop.getSeriesStorageDataTopList().size()) {
|
||||
SeriesColumn seriesColumnData = highchartsFactory
|
||||
.createSeriesColumn();
|
||||
SeriesColumn seriesColumnData = highchartsFactory.createSeriesColumn();
|
||||
|
||||
seriesColumnData.name("Others");
|
||||
seriesColumnData.color(colors.get(i));
|
||||
seriesColumnData.type("column");
|
||||
|
||||
ArrayList<Long> othersData = new ArrayList<>();
|
||||
for (int j = i; j < seriesStorageTop
|
||||
.getSeriesStorageDataTopList().size(); j++) {
|
||||
for (int j = i; j < seriesStorageTop.getSeriesStorageDataTopList().size(); j++) {
|
||||
Long value;
|
||||
for (int k = 0; k < seriesStorageTop
|
||||
.getSeriesStorageDataTopList().get(j).getSeries()
|
||||
.size(); k++) {
|
||||
SeriesStorageData seriesStorageData = seriesStorageTop
|
||||
.getSeriesStorageDataTopList().get(j)
|
||||
for (int k = 0; k < seriesStorageTop.getSeriesStorageDataTopList().get(j).getSeries().size(); k++) {
|
||||
SeriesStorageData seriesStorageData = seriesStorageTop.getSeriesStorageDataTopList().get(j)
|
||||
.getSeries().get(k);
|
||||
if (j == i) {
|
||||
switch (measure) {
|
||||
case DataVolume:
|
||||
othersData.add(seriesStorageData
|
||||
.getDataVolume() / unitMeasure);
|
||||
othersData.add(seriesStorageData.getDataVolume() / unitMeasure);
|
||||
break;
|
||||
case OperationCount:
|
||||
othersData.add(seriesStorageData
|
||||
.getOperationCount());
|
||||
othersData.add(seriesStorageData.getOperationCount());
|
||||
break;
|
||||
default:
|
||||
othersData.add(seriesStorageData
|
||||
.getDataVolume() / unitMeasure);
|
||||
othersData.add(seriesStorageData.getDataVolume() / unitMeasure);
|
||||
break;
|
||||
|
||||
}
|
||||
|
@ -617,18 +569,15 @@ public class StorageChartTopPanel extends SimpleContainer {
|
|||
switch (measure) {
|
||||
case DataVolume:
|
||||
|
||||
value = seriesStorageData.getDataVolume()
|
||||
/ unitMeasure + othersData.get(k);
|
||||
value = seriesStorageData.getDataVolume() / unitMeasure + othersData.get(k);
|
||||
othersData.set(k, value);
|
||||
break;
|
||||
case OperationCount:
|
||||
value = seriesStorageData.getOperationCount()
|
||||
+ othersData.get(k);
|
||||
value = seriesStorageData.getOperationCount() + othersData.get(k);
|
||||
othersData.set(k, value);
|
||||
break;
|
||||
default:
|
||||
value = seriesStorageData.getDataVolume()
|
||||
/ unitMeasure + othersData.get(k);
|
||||
value = seriesStorageData.getDataVolume() / unitMeasure + othersData.get(k);
|
||||
othersData.set(k, value);
|
||||
break;
|
||||
|
||||
|
@ -644,8 +593,7 @@ public class StorageChartTopPanel extends SimpleContainer {
|
|||
data.push(value);
|
||||
}
|
||||
|
||||
seriesColumnData.pointInterval(interval).pointStart(
|
||||
dateStart.getTime());
|
||||
seriesColumnData.pointInterval(interval).pointStart(dateStart.getTime());
|
||||
seriesColumn.add(seriesColumnData);
|
||||
}
|
||||
|
||||
|
@ -653,16 +601,15 @@ public class StorageChartTopPanel extends SimpleContainer {
|
|||
// xAxis
|
||||
options.xAxis().type("datetime");
|
||||
|
||||
if (accountingStateData.getSeriesRequest().getAccountingPeriod()
|
||||
.getPeriod().compareTo(AccountingPeriodMode.MONTHLY) == 0) {
|
||||
//options.tooltip().xDateFormat("%b, %Y");
|
||||
if (accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
|
||||
.compareTo(AccountingPeriodMode.MONTHLY) == 0) {
|
||||
// options.tooltip().xDateFormat("%b, %Y");
|
||||
options.tooltip().xDateFormat("Selected Data");
|
||||
|
||||
} else {
|
||||
if (accountingStateData.getSeriesRequest()
|
||||
.getAccountingPeriod().getPeriod()
|
||||
if (accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
|
||||
.compareTo(AccountingPeriodMode.YEARLY) == 0) {
|
||||
//options.tooltip().xDateFormat("%Y");
|
||||
// options.tooltip().xDateFormat("%Y");
|
||||
options.tooltip().xDateFormat("Selected Data");
|
||||
|
||||
} else {
|
||||
|
@ -674,23 +621,20 @@ public class StorageChartTopPanel extends SimpleContainer {
|
|||
int i = 0;
|
||||
for (; i < seriesStorageTop.getSeriesStorageDataTopList().size()
|
||||
&& i < seriesStorageTop.getTopNumber(); i++) {
|
||||
SeriesColumn seriesColumnData = highchartsFactory
|
||||
.createSeriesColumn();
|
||||
SeriesColumn seriesColumnData = highchartsFactory.createSeriesColumn();
|
||||
|
||||
seriesColumnData.name(seriesStorageTop
|
||||
.getSeriesStorageDataTopList().get(i).getFilterValue()
|
||||
.getValue());
|
||||
seriesColumnData
|
||||
.name(seriesStorageTop.getSeriesStorageDataTopList().get(i).getFilterValue().getValue());
|
||||
seriesColumnData.color(colors.get(i));
|
||||
seriesColumnData.type("column");
|
||||
|
||||
Array<Data> arrayData = seriesColumnData.dataAsArrayObject();
|
||||
|
||||
for (SeriesStorageData seriesStorageData : seriesStorageTop
|
||||
.getSeriesStorageDataTopList().get(i).getSeries()) {
|
||||
for (SeriesStorageData seriesStorageData : seriesStorageTop.getSeriesStorageDataTopList().get(i)
|
||||
.getSeries()) {
|
||||
long dateFrom1970 = seriesStorageData.getDate().getTime();
|
||||
|
||||
Log.debug("SeriersStorageData: "
|
||||
+ seriesStorageData.getDate());
|
||||
Log.debug("SeriersStorageData: " + seriesStorageData.getDate());
|
||||
Log.debug("SeriersStorageData: " + dateFrom1970);
|
||||
|
||||
Data data = highchartsFactory.createSeriesColumnData();
|
||||
|
@ -721,65 +665,51 @@ public class StorageChartTopPanel extends SimpleContainer {
|
|||
}
|
||||
|
||||
if (i < seriesStorageTop.getSeriesStorageDataTopList().size()) {
|
||||
SeriesColumn seriesColumnData = highchartsFactory
|
||||
.createSeriesColumn();
|
||||
SeriesColumn seriesColumnData = highchartsFactory.createSeriesColumn();
|
||||
|
||||
seriesColumnData.name("Others");
|
||||
seriesColumnData.color(colors.get(i));
|
||||
seriesColumnData.type("column");
|
||||
|
||||
ArrayList<ChartDateTimeData> othersData = new ArrayList<>();
|
||||
for (int j = i; j < seriesStorageTop
|
||||
.getSeriesStorageDataTopList().size(); j++) {
|
||||
for (int j = i; j < seriesStorageTop.getSeriesStorageDataTopList().size(); j++) {
|
||||
ChartDateTimeData chartDateTimeData;
|
||||
for (int k = 0; k < seriesStorageTop
|
||||
.getSeriesStorageDataTopList().get(j).getSeries()
|
||||
.size(); k++) {
|
||||
SeriesStorageData seriesStorageData = seriesStorageTop
|
||||
.getSeriesStorageDataTopList().get(j)
|
||||
for (int k = 0; k < seriesStorageTop.getSeriesStorageDataTopList().get(j).getSeries().size(); k++) {
|
||||
SeriesStorageData seriesStorageData = seriesStorageTop.getSeriesStorageDataTopList().get(j)
|
||||
.getSeries().get(k);
|
||||
if (j == i) {
|
||||
switch (measure) {
|
||||
case DataVolume:
|
||||
chartDateTimeData = new ChartDateTimeData(
|
||||
seriesStorageData.getDate(),
|
||||
seriesStorageData.getDataVolume()
|
||||
/ unitMeasure);
|
||||
chartDateTimeData = new ChartDateTimeData(seriesStorageData.getDate(),
|
||||
seriesStorageData.getDataVolume() / unitMeasure);
|
||||
othersData.add(chartDateTimeData);
|
||||
break;
|
||||
case OperationCount:
|
||||
chartDateTimeData = new ChartDateTimeData(
|
||||
seriesStorageData.getDate(),
|
||||
chartDateTimeData = new ChartDateTimeData(seriesStorageData.getDate(),
|
||||
seriesStorageData.getOperationCount());
|
||||
othersData.add(chartDateTimeData);
|
||||
break;
|
||||
default:
|
||||
chartDateTimeData = new ChartDateTimeData(
|
||||
seriesStorageData.getDate(),
|
||||
seriesStorageData.getDataVolume()
|
||||
/ unitMeasure);
|
||||
chartDateTimeData = new ChartDateTimeData(seriesStorageData.getDate(),
|
||||
seriesStorageData.getDataVolume() / unitMeasure);
|
||||
othersData.add(chartDateTimeData);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
switch (measure) {
|
||||
case DataVolume:
|
||||
chartDateTimeData = new ChartDateTimeData(
|
||||
seriesStorageData.getDate(),
|
||||
chartDateTimeData = new ChartDateTimeData(seriesStorageData.getDate(),
|
||||
(seriesStorageData.getDataVolume() / unitMeasure)
|
||||
+ othersData.get(k).getValue());
|
||||
othersData.set(k, chartDateTimeData);
|
||||
break;
|
||||
case OperationCount:
|
||||
chartDateTimeData = new ChartDateTimeData(
|
||||
seriesStorageData.getDate(),
|
||||
seriesStorageData.getOperationCount()
|
||||
+ othersData.get(k).getValue());
|
||||
chartDateTimeData = new ChartDateTimeData(seriesStorageData.getDate(),
|
||||
seriesStorageData.getOperationCount() + othersData.get(k).getValue());
|
||||
othersData.set(k, chartDateTimeData);
|
||||
break;
|
||||
default:
|
||||
chartDateTimeData = new ChartDateTimeData(
|
||||
seriesStorageData.getDate(),
|
||||
chartDateTimeData = new ChartDateTimeData(seriesStorageData.getDate(),
|
||||
(seriesStorageData.getDataVolume() / unitMeasure)
|
||||
+ othersData.get(k).getValue());
|
||||
othersData.set(k, chartDateTimeData);
|
||||
|
@ -796,8 +726,7 @@ public class StorageChartTopPanel extends SimpleContainer {
|
|||
for (ChartDateTimeData chartDateTimeData : othersData) {
|
||||
long dateFrom1970 = chartDateTimeData.getDate().getTime();
|
||||
|
||||
Log.debug("SeriersOthersData: "
|
||||
+ chartDateTimeData.getDate());
|
||||
Log.debug("SeriersOthersData: " + chartDateTimeData.getDate());
|
||||
Log.debug("SeriersOthersData: " + dateFrom1970);
|
||||
|
||||
Data data = highchartsFactory.createSeriesColumnData();
|
||||
|
@ -815,61 +744,50 @@ public class StorageChartTopPanel extends SimpleContainer {
|
|||
|
||||
}
|
||||
|
||||
private void createSeriesColumnSimple(SeriesStorageTop seriesStorageTop,
|
||||
HighchartsOptionFactory highchartsFactory, ArrayString colors,
|
||||
ArrayList<SeriesColumn> seriesColumn) {
|
||||
private void createSeriesColumnSimple(SeriesStorageTop seriesStorageTop, HighchartsOptionFactory highchartsFactory,
|
||||
ArrayString colors, ArrayList<SeriesColumn> seriesColumn) {
|
||||
|
||||
Log.debug("Series Simple");
|
||||
if (accountingStateData.getSeriesRequest().getAccountingPeriod()
|
||||
.getPeriod().compareTo(AccountingPeriodMode.DAILY) == 0
|
||||
|| accountingStateData.getSeriesRequest().getAccountingPeriod()
|
||||
.getPeriod().compareTo(AccountingPeriodMode.HOURLY) == 0
|
||||
|| accountingStateData.getSeriesRequest().getAccountingPeriod()
|
||||
.getPeriod().compareTo(AccountingPeriodMode.MINUTELY) == 0) {
|
||||
if (accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
|
||||
.compareTo(AccountingPeriodMode.DAILY) == 0
|
||||
|| accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
|
||||
.compareTo(AccountingPeriodMode.HOURLY) == 0
|
||||
|| accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
|
||||
.compareTo(AccountingPeriodMode.MINUTELY) == 0) {
|
||||
|
||||
double minRange = ChartTimeMeasure
|
||||
.calculateMinRange(accountingStateData.getSeriesRequest()
|
||||
.getAccountingPeriod());
|
||||
.calculateMinRange(accountingStateData.getSeriesRequest().getAccountingPeriod());
|
||||
|
||||
double interval = ChartTimeMeasure
|
||||
.calculateInterval(accountingStateData.getSeriesRequest()
|
||||
.getAccountingPeriod());
|
||||
.calculateInterval(accountingStateData.getSeriesRequest().getAccountingPeriod());
|
||||
|
||||
Date dateStart = dtf.parse(accountingStateData.getSeriesRequest()
|
||||
.getAccountingPeriod().getStartDate());
|
||||
Date dateStart = dtf.parse(accountingStateData.getSeriesRequest().getAccountingPeriod().getStartDate());
|
||||
|
||||
dateStart.setTime(dateStart.getTime()
|
||||
+ ChartTimeMeasure.timeZoneOffset()
|
||||
* ChartTimeMeasure.MINUTE);
|
||||
dateStart.setTime(dateStart.getTime() + ChartTimeMeasure.timeZoneOffset() * ChartTimeMeasure.MINUTE);
|
||||
|
||||
Log.debug("BuildChart DateStart: "
|
||||
+ DateTimeFormat.getFormat(PredefinedFormat.DATE_TIME_FULL)
|
||||
.format(dateStart));
|
||||
+ DateTimeFormat.getFormat(PredefinedFormat.DATE_TIME_FULL).format(dateStart));
|
||||
|
||||
// xAxis
|
||||
options.xAxis().type("datetime");
|
||||
options.xAxis().minRange(minRange);
|
||||
options.tooltip().xDateFormat("Selected Data");
|
||||
|
||||
for (int i = 0; i < seriesStorageTop.getSeriesStorageDataTopList()
|
||||
.size(); i++) {
|
||||
SeriesColumn seriesColumnData = highchartsFactory
|
||||
.createSeriesColumn();
|
||||
|
||||
seriesColumnData.name(seriesStorageTop
|
||||
.getSeriesStorageDataTopList().get(i).getFilterValue()
|
||||
.getValue());
|
||||
for (int i = 0; i < seriesStorageTop.getSeriesStorageDataTopList().size(); i++) {
|
||||
SeriesColumn seriesColumnData = highchartsFactory.createSeriesColumn();
|
||||
|
||||
seriesColumnData
|
||||
.name(seriesStorageTop.getSeriesStorageDataTopList().get(i).getFilterValue().getValue());
|
||||
seriesColumnData.color(colors.get(i));
|
||||
seriesColumnData.type("column");
|
||||
|
||||
ArrayNumber data = seriesColumnData.dataAsArrayNumber();
|
||||
|
||||
for (SeriesStorageData seriesStorageData : seriesStorageTop
|
||||
.getSeriesStorageDataTopList().get(i).getSeries()) {
|
||||
for (SeriesStorageData seriesStorageData : seriesStorageTop.getSeriesStorageDataTopList().get(i)
|
||||
.getSeries()) {
|
||||
switch (measure) {
|
||||
case DataVolume:
|
||||
data.push(seriesStorageData.getDataVolume()
|
||||
/ unitMeasure);
|
||||
data.push(seriesStorageData.getDataVolume() / unitMeasure);
|
||||
break;
|
||||
case OperationCount:
|
||||
data.push(seriesStorageData.getOperationCount());
|
||||
|
@ -882,8 +800,7 @@ public class StorageChartTopPanel extends SimpleContainer {
|
|||
|
||||
}
|
||||
|
||||
seriesColumnData.pointInterval(interval).pointStart(
|
||||
dateStart.getTime());
|
||||
seriesColumnData.pointInterval(interval).pointStart(dateStart.getTime());
|
||||
seriesColumn.add(seriesColumnData);
|
||||
|
||||
}
|
||||
|
@ -892,16 +809,15 @@ public class StorageChartTopPanel extends SimpleContainer {
|
|||
// xAxis
|
||||
options.xAxis().type("datetime");
|
||||
|
||||
if (accountingStateData.getSeriesRequest().getAccountingPeriod()
|
||||
.getPeriod().compareTo(AccountingPeriodMode.MONTHLY) == 0) {
|
||||
//options.tooltip().xDateFormat("%b, %Y");
|
||||
if (accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
|
||||
.compareTo(AccountingPeriodMode.MONTHLY) == 0) {
|
||||
// options.tooltip().xDateFormat("%b, %Y");
|
||||
options.tooltip().xDateFormat("Selected Data");
|
||||
|
||||
} else {
|
||||
if (accountingStateData.getSeriesRequest()
|
||||
.getAccountingPeriod().getPeriod()
|
||||
if (accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
|
||||
.compareTo(AccountingPeriodMode.YEARLY) == 0) {
|
||||
//options.tooltip().xDateFormat("%Y");
|
||||
// options.tooltip().xDateFormat("%Y");
|
||||
options.tooltip().xDateFormat("Selected Data");
|
||||
|
||||
} else {
|
||||
|
@ -910,25 +826,21 @@ public class StorageChartTopPanel extends SimpleContainer {
|
|||
|
||||
}
|
||||
|
||||
for (int i = 0; i < seriesStorageTop.getSeriesStorageDataTopList()
|
||||
.size(); i++) {
|
||||
SeriesColumn seriesColumnData = highchartsFactory
|
||||
.createSeriesColumn();
|
||||
for (int i = 0; i < seriesStorageTop.getSeriesStorageDataTopList().size(); i++) {
|
||||
SeriesColumn seriesColumnData = highchartsFactory.createSeriesColumn();
|
||||
|
||||
seriesColumnData.name(seriesStorageTop
|
||||
.getSeriesStorageDataTopList().get(i).getFilterValue()
|
||||
.getValue());
|
||||
seriesColumnData
|
||||
.name(seriesStorageTop.getSeriesStorageDataTopList().get(i).getFilterValue().getValue());
|
||||
seriesColumnData.color(colors.get(i));
|
||||
seriesColumnData.type("column");
|
||||
|
||||
Array<Data> arrayData = seriesColumnData.dataAsArrayObject();
|
||||
|
||||
for (SeriesStorageData seriesStorageData : seriesStorageTop
|
||||
.getSeriesStorageDataTopList().get(i).getSeries()) {
|
||||
for (SeriesStorageData seriesStorageData : seriesStorageTop.getSeriesStorageDataTopList().get(i)
|
||||
.getSeries()) {
|
||||
long dateFrom1970 = seriesStorageData.getDate().getTime();
|
||||
|
||||
Log.debug("SeriersStorageData: "
|
||||
+ seriesStorageData.getDate());
|
||||
Log.debug("SeriersStorageData: " + seriesStorageData.getDate());
|
||||
Log.debug("SeriersStorageData: " + dateFrom1970);
|
||||
|
||||
Data data = highchartsFactory.createSeriesColumnData();
|
||||
|
@ -964,43 +876,29 @@ public class StorageChartTopPanel extends SimpleContainer {
|
|||
private String retrieveYAxis(ArrayString colors) {
|
||||
switch (measure) {
|
||||
case DataVolume:
|
||||
return "[{" + " \"id\": \"" + StorageChartMeasure.DataVolume.name()
|
||||
+ "\"," + " \"labels\": {" + " \"format\": \"{value} "
|
||||
+ unitMeasureLabel + "\"," + " \"style\": {"
|
||||
+ " \"color\": \"" + colors.get(1) + "\"" + " }"
|
||||
+ " }," + " \"stackLabels\": {" + " \"enabled\": \"true\","
|
||||
+ " \"style\": {" + " \"fontWeight\": \"bold\","
|
||||
+ " \"color\": \"gray\"" + " } " + " },"
|
||||
+ " \"title\": { " + " \"text\": \""
|
||||
+ StorageChartMeasure.DataVolume.getLabel() + "\","
|
||||
+ " \"style\": {" + " \"color\": \""
|
||||
return "[{" + " \"id\": \"" + StorageChartMeasure.DataVolume.name() + "\"," + " \"labels\": {"
|
||||
+ " \"format\": \"{value} " + unitMeasureLabel + "\"," + " \"style\": {"
|
||||
+ " \"color\": \"" + colors.get(1) + "\"" + " }" + " }," + " \"stackLabels\": {"
|
||||
+ " \"enabled\": \"true\"," + " \"style\": {" + " \"fontWeight\": \"bold\","
|
||||
+ " \"color\": \"gray\"" + " } " + " }," + " \"title\": { " + " \"text\": \""
|
||||
+ StorageChartMeasure.DataVolume.getLabel() + "\"," + " \"style\": {" + " \"color\": \""
|
||||
+ colors.get(1) + "\"" + " }" + " }" + "}]";
|
||||
|
||||
case OperationCount:
|
||||
return "[{" + " \"id\": \""
|
||||
+ StorageChartMeasure.OperationCount.name() + "\","
|
||||
+ " \"labels\": { " + " \"format\": \"{value}\","
|
||||
+ " \"style\": { " + " \"color\": \""
|
||||
+ colors.get(1) + "\"" + " }" + " },"
|
||||
+ " \"stackLabels\": {" + " \"enabled\": \"true\","
|
||||
+ " \"style\": {" + " \"fontWeight\": \"bold\","
|
||||
+ " \"color\": \"gray\"" + " } " + " },"
|
||||
+ " \"title\": { " + " \"text\": \""
|
||||
+ StorageChartMeasure.OperationCount.getLabel() + "\","
|
||||
+ " \"style\": {" + " \"color\": \""
|
||||
+ colors.get(1) + "\"" + " }" + " }" + "}]";
|
||||
return "[{" + " \"id\": \"" + StorageChartMeasure.OperationCount.name() + "\"," + " \"labels\": { "
|
||||
+ " \"format\": \"{value}\"," + " \"style\": { " + " \"color\": \"" + colors.get(1)
|
||||
+ "\"" + " }" + " }," + " \"stackLabels\": {" + " \"enabled\": \"true\"," + " \"style\": {"
|
||||
+ " \"fontWeight\": \"bold\"," + " \"color\": \"gray\"" + " } " + " },"
|
||||
+ " \"title\": { " + " \"text\": \"" + StorageChartMeasure.OperationCount.getLabel() + "\","
|
||||
+ " \"style\": {" + " \"color\": \"" + colors.get(1) + "\"" + " }" + " }" + "}]";
|
||||
|
||||
default:
|
||||
return "[{" + " \"id\": \"" + StorageChartMeasure.DataVolume.name()
|
||||
+ "\"," + " \"labels\": {" + " \"format\": \"{value} "
|
||||
+ unitMeasureLabel + "\"," + " \"style\": {"
|
||||
+ " \"color\": \"" + colors.get(1) + "\"" + " }"
|
||||
+ " }," + " \"stackLabels\": {" + " \"enabled\": \"true\","
|
||||
+ " \"style\": {" + " \"fontWeight\": \"bold\","
|
||||
+ " \"color\": \"gray\"" + " } " + " },"
|
||||
+ " \"title\": { " + " \"text\": \""
|
||||
+ StorageChartMeasure.DataVolume.getLabel() + "\","
|
||||
+ " \"style\": {" + " \"color\": \""
|
||||
return "[{" + " \"id\": \"" + StorageChartMeasure.DataVolume.name() + "\"," + " \"labels\": {"
|
||||
+ " \"format\": \"{value} " + unitMeasureLabel + "\"," + " \"style\": {"
|
||||
+ " \"color\": \"" + colors.get(1) + "\"" + " }" + " }," + " \"stackLabels\": {"
|
||||
+ " \"enabled\": \"true\"," + " \"style\": {" + " \"fontWeight\": \"bold\","
|
||||
+ " \"color\": \"gray\"" + " } " + " }," + " \"title\": { " + " \"text\": \""
|
||||
+ StorageChartMeasure.DataVolume.getLabel() + "\"," + " \"style\": {" + " \"color\": \""
|
||||
+ colors.get(1) + "\"" + " }" + " }" + "}]";
|
||||
|
||||
}
|
||||
|
|
|
@ -53,8 +53,7 @@ import org.slf4j.LoggerFactory;
|
|||
*
|
||||
*/
|
||||
public class AccountingCallerTester implements AccountingCallerInterface {
|
||||
private static Logger logger = LoggerFactory
|
||||
.getLogger(AccountingCallerTester.class);
|
||||
private static Logger logger = LoggerFactory.getLogger(AccountingCallerTester.class);
|
||||
|
||||
protected SimpleDateFormat sdf = new SimpleDateFormat("yyyy MMMMM dd");
|
||||
|
||||
|
@ -62,11 +61,9 @@ public class AccountingCallerTester implements AccountingCallerInterface {
|
|||
super();
|
||||
}
|
||||
|
||||
public ArrayList<FilterKey> getFilterKeys(AccountingType accountingType)
|
||||
throws ServiceException {
|
||||
public ArrayList<FilterKey> getFilterKeys(AccountingType accountingType) throws ServiceException {
|
||||
try {
|
||||
logger.debug("getFilterKeys(): [AccountingType=" + accountingType
|
||||
+ "]");
|
||||
logger.debug("getFilterKeys(): [AccountingType=" + accountingType + "]");
|
||||
if (accountingType == null) {
|
||||
return new ArrayList<FilterKey>();
|
||||
}
|
||||
|
@ -93,17 +90,13 @@ public class AccountingCallerTester implements AccountingCallerInterface {
|
|||
}
|
||||
}
|
||||
|
||||
public FilterValuesResponse getFilterValues(
|
||||
FilterValuesRequest filterValuesRequest) throws ServiceException {
|
||||
public FilterValuesResponse getFilterValues(FilterValuesRequest filterValuesRequest) throws ServiceException {
|
||||
try {
|
||||
logger.debug("getFilterValue(): [FilterValueRequest="
|
||||
+ filterValuesRequest + "]");
|
||||
logger.debug("getFilterValue(): [FilterValueRequest=" + filterValuesRequest + "]");
|
||||
FilterValuesResponse filterValuesResponse = null;
|
||||
if (filterValuesRequest == null
|
||||
|| filterValuesRequest.getAccountingType() == null
|
||||
if (filterValuesRequest == null || filterValuesRequest.getAccountingType() == null
|
||||
|| filterValuesRequest.getFilterKey() == null) {
|
||||
filterValuesResponse = new FilterValuesResponse(
|
||||
new ArrayList<FilterValue>());
|
||||
filterValuesResponse = new FilterValuesResponse(new ArrayList<FilterValue>());
|
||||
return filterValuesResponse;
|
||||
|
||||
}
|
||||
|
@ -132,42 +125,36 @@ public class AccountingCallerTester implements AccountingCallerInterface {
|
|||
filterValuesResponse = new FilterValuesResponse(filterValues);
|
||||
return filterValuesResponse;
|
||||
} catch (Throwable e) {
|
||||
logger.error("Error in getFilterValues(): "
|
||||
+ e.getLocalizedMessage());
|
||||
logger.error("Error in getFilterValues(): " + e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
throw new ServiceException("No values available!");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public SeriesResponse getSeries(AccountingType accountingType,
|
||||
SeriesRequest seriesRequest) throws ServiceException {
|
||||
public SeriesResponse getSeries(AccountingType accountingType, SeriesRequest seriesRequest)
|
||||
throws ServiceException {
|
||||
try {
|
||||
logger.debug("getSeries(): [AccountingType=" + accountingType
|
||||
+ " , seriesRequest=" + seriesRequest + "]");
|
||||
logger.debug("getSeries(): [AccountingType=" + accountingType + " , seriesRequest=" + seriesRequest + "]");
|
||||
SeriesResponse seriesResponse = null;
|
||||
|
||||
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 ServiceException("Start Date not valid!");
|
||||
}
|
||||
|
||||
Calendar endCalendar = GregorianCalendar
|
||||
.getInstance(TemporalConstraint.DEFAULT_TIME_ZONE);
|
||||
Calendar endCalendar = GregorianCalendar.getInstance(TemporalConstraint.DEFAULT_TIME_ZONE);
|
||||
|
||||
// GregorianCalendar endCalendar = new GregorianCalendar();
|
||||
// .getInstance(TemporalConstraint.DEFAULT_TIME_ZONE);
|
||||
|
||||
// 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 ServiceException("End Date not valid!");
|
||||
|
@ -176,20 +163,16 @@ public class AccountingCallerTester implements AccountingCallerInterface {
|
|||
switch (accountingType) {
|
||||
case JOB:
|
||||
SeriesJobDefinition serieJobDefinition = null;
|
||||
if (seriesRequest.getAccountingFilterDefinition()
|
||||
.getChartType() != null) {
|
||||
if (seriesRequest.getAccountingFilterDefinition().getChartType() != null) {
|
||||
ArrayList<SeriesJobData> seriesJobData = new ArrayList<>();
|
||||
for (int i = 0; i < 30; i++) {
|
||||
SeriesJobData data = new SeriesJobData(new Date(),
|
||||
new Double(10 * Math.random()).longValue(),
|
||||
new Double(10 * Math.random()).longValue(),
|
||||
new Double(10 * Math.random()).longValue(),
|
||||
SeriesJobData data = new SeriesJobData(new Date(), new Double(10 * Math.random()).longValue(),
|
||||
new Double(10 * Math.random()).longValue(), new Double(10 * Math.random()).longValue(),
|
||||
new Double(100 * Math.random()).longValue());
|
||||
seriesJobData.add(data);
|
||||
|
||||
}
|
||||
switch (seriesRequest.getAccountingFilterDefinition()
|
||||
.getChartType()) {
|
||||
switch (seriesRequest.getAccountingFilterDefinition().getChartType()) {
|
||||
case Basic:
|
||||
serieJobDefinition = new SeriesJobBasic(seriesJobData);
|
||||
break;
|
||||
|
@ -198,29 +181,13 @@ public class AccountingCallerTester implements AccountingCallerInterface {
|
|||
.getAccountingFilterDefinition();
|
||||
|
||||
ArrayList<SeriesJobDataTop> seriesJobDataTopList = new ArrayList<>();
|
||||
if (accountingFilterTop.getShowOthers()) {
|
||||
for (int i = 0; i < 40; i++) {
|
||||
for (int i = 0; i < accountingFilterTop.getTopNumber(); i++) {
|
||||
|
||||
SeriesJobDataTop seriesJobDataTop = new SeriesJobDataTop(
|
||||
new FilterValue("User" + i),
|
||||
seriesJobData);
|
||||
seriesJobDataTopList.add(seriesJobDataTop);
|
||||
}
|
||||
} else {
|
||||
for (int i = 0; i < accountingFilterTop
|
||||
.getTopNumber(); i++) {
|
||||
|
||||
SeriesJobDataTop seriesJobDataTop = new SeriesJobDataTop(
|
||||
new FilterValue("User" + i),
|
||||
seriesJobData);
|
||||
seriesJobDataTopList.add(seriesJobDataTop);
|
||||
}
|
||||
SeriesJobDataTop seriesJobDataTop = new SeriesJobDataTop(new FilterValue("User" + i),
|
||||
seriesJobData);
|
||||
seriesJobDataTopList.add(seriesJobDataTop);
|
||||
}
|
||||
|
||||
serieJobDefinition = new SeriesJobTop(
|
||||
accountingFilterTop.getShowOthers(),
|
||||
accountingFilterTop.getTopNumber(),
|
||||
seriesJobDataTopList);
|
||||
serieJobDefinition = new SeriesJobTop(accountingFilterTop.getTopNumber(), seriesJobDataTopList);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -236,49 +203,39 @@ public class AccountingCallerTester implements AccountingCallerInterface {
|
|||
break;
|
||||
case SERVICE:
|
||||
SeriesServiceDefinition serieServiceDefinition = null;
|
||||
if (seriesRequest.getAccountingFilterDefinition()
|
||||
.getChartType() != null) {
|
||||
if (seriesRequest.getAccountingFilterDefinition().getChartType() != null) {
|
||||
ArrayList<SeriesServiceData> seriesServiceData = new ArrayList<>();
|
||||
switch (seriesRequest.getAccountingPeriod().getPeriod()) {
|
||||
case DAILY:
|
||||
case HOURLY:
|
||||
case MINUTELY:
|
||||
for (int i = 0; i < 30; i++) {
|
||||
SeriesServiceData data = new SeriesServiceData(
|
||||
new Date(),
|
||||
SeriesServiceData data = new SeriesServiceData(new Date(),
|
||||
new Double(50 * Math.random()).longValue(),
|
||||
new Double(10000 * Math.random())
|
||||
.longValue(), new Double(
|
||||
10000 * Math.random()).longValue(),
|
||||
new Double(10000 * Math.random())
|
||||
.longValue());
|
||||
new Double(10000 * Math.random()).longValue(),
|
||||
new Double(10000 * Math.random()).longValue(),
|
||||
new Double(10000 * Math.random()).longValue());
|
||||
seriesServiceData.add(data);
|
||||
}
|
||||
break;
|
||||
case MONTHLY:
|
||||
while (startCalendar.compareTo(endCalendar) <= 0) {
|
||||
SeriesServiceData data = new SeriesServiceData(
|
||||
startCalendar.getTime(), new Double(
|
||||
50 * Math.random()).longValue(),
|
||||
new Double(10000 * Math.random())
|
||||
.longValue(), new Double(
|
||||
10000 * Math.random()).longValue(),
|
||||
new Double(10000 * Math.random())
|
||||
.longValue());
|
||||
SeriesServiceData data = new SeriesServiceData(startCalendar.getTime(),
|
||||
new Double(50 * Math.random()).longValue(),
|
||||
new Double(10000 * Math.random()).longValue(),
|
||||
new Double(10000 * Math.random()).longValue(),
|
||||
new Double(10000 * Math.random()).longValue());
|
||||
seriesServiceData.add(data);
|
||||
startCalendar.add(Calendar.MONTH, 1);
|
||||
}
|
||||
break;
|
||||
case YEARLY:
|
||||
while (startCalendar.compareTo(endCalendar) <= 0) {
|
||||
SeriesServiceData data = new SeriesServiceData(
|
||||
startCalendar.getTime(), new Double(
|
||||
50 * Math.random()).longValue(),
|
||||
new Double(10000 * Math.random())
|
||||
.longValue(), new Double(
|
||||
10000 * Math.random()).longValue(),
|
||||
new Double(10000 * Math.random())
|
||||
.longValue());
|
||||
SeriesServiceData data = new SeriesServiceData(startCalendar.getTime(),
|
||||
new Double(50 * Math.random()).longValue(),
|
||||
new Double(10000 * Math.random()).longValue(),
|
||||
new Double(10000 * Math.random()).longValue(),
|
||||
new Double(10000 * Math.random()).longValue());
|
||||
seriesServiceData.add(data);
|
||||
startCalendar.add(Calendar.YEAR, 1);
|
||||
}
|
||||
|
@ -288,96 +245,23 @@ public class AccountingCallerTester implements AccountingCallerInterface {
|
|||
|
||||
}
|
||||
|
||||
switch (seriesRequest.getAccountingFilterDefinition()
|
||||
.getChartType()) {
|
||||
switch (seriesRequest.getAccountingFilterDefinition().getChartType()) {
|
||||
case Basic:
|
||||
serieServiceDefinition = new SeriesServiceBasic(
|
||||
seriesServiceData);
|
||||
serieServiceDefinition = new SeriesServiceBasic(seriesServiceData);
|
||||
break;
|
||||
case Top:
|
||||
AccountingFilterTop accountingFilterTop = (AccountingFilterTop) seriesRequest
|
||||
.getAccountingFilterDefinition();
|
||||
ArrayList<SeriesServiceDataTop> seriesServiceDataTopList = new ArrayList<>();
|
||||
|
||||
if (accountingFilterTop.getShowOthers()) {
|
||||
for (int i = 0; i < accountingFilterTop.getTopNumber(); i++) {
|
||||
|
||||
try {
|
||||
startCalendar.setTime(sdf.parse(seriesRequest
|
||||
.getAccountingPeriod().getStartDate()));
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
throw new ServiceException(
|
||||
"Start Date not valid!");
|
||||
}
|
||||
|
||||
try {
|
||||
endCalendar.setTime(sdf.parse(seriesRequest
|
||||
.getAccountingPeriod().getEndDate()));
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
throw new ServiceException(
|
||||
"End Date not valid!");
|
||||
}
|
||||
|
||||
int k = 0;
|
||||
|
||||
switch (seriesRequest.getAccountingPeriod()
|
||||
.getPeriod()) {
|
||||
case DAILY:
|
||||
case HOURLY:
|
||||
case MINUTELY:
|
||||
for (int i = 0; i < 40; i++) {
|
||||
|
||||
SeriesServiceDataTop seriesServiceDataTop1 = new SeriesServiceDataTop(
|
||||
new FilterValue("User" + i),
|
||||
seriesServiceData);
|
||||
seriesServiceDataTopList
|
||||
.add(seriesServiceDataTop1);
|
||||
}
|
||||
break;
|
||||
case MONTHLY:
|
||||
k = 0;
|
||||
while (startCalendar.compareTo(endCalendar) <= 0) {
|
||||
SeriesServiceDataTop seriesServiceDataTop1 = new SeriesServiceDataTop(
|
||||
new FilterValue("User" + k),
|
||||
seriesServiceData);
|
||||
seriesServiceDataTopList
|
||||
.add(seriesServiceDataTop1);
|
||||
startCalendar.add(Calendar.MONTH, 1);
|
||||
k++;
|
||||
}
|
||||
break;
|
||||
case YEARLY:
|
||||
k = 0;
|
||||
while (startCalendar.compareTo(endCalendar) <= 0) {
|
||||
SeriesServiceDataTop seriesServiceDataTop1 = new SeriesServiceDataTop(
|
||||
new FilterValue("User" + k),
|
||||
seriesServiceData);
|
||||
seriesServiceDataTopList
|
||||
.add(seriesServiceDataTop1);
|
||||
startCalendar.add(Calendar.YEAR, 1);
|
||||
k++;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
|
||||
for (int i = 0; i < accountingFilterTop
|
||||
.getTopNumber(); i++) {
|
||||
|
||||
SeriesServiceDataTop seriesServiceDataTop1 = new SeriesServiceDataTop(
|
||||
new FilterValue("User" + i),
|
||||
seriesServiceData);
|
||||
seriesServiceDataTopList
|
||||
.add(seriesServiceDataTop1);
|
||||
}
|
||||
SeriesServiceDataTop seriesServiceDataTop1 = new SeriesServiceDataTop(
|
||||
new FilterValue("User" + i), seriesServiceData);
|
||||
seriesServiceDataTopList.add(seriesServiceDataTop1);
|
||||
}
|
||||
|
||||
serieServiceDefinition = new SeriesServiceTop(
|
||||
accountingFilterTop.getShowOthers(),
|
||||
accountingFilterTop.getTopNumber(),
|
||||
serieServiceDefinition = new SeriesServiceTop(accountingFilterTop.getTopNumber(),
|
||||
seriesServiceDataTopList);
|
||||
break;
|
||||
|
||||
|
@ -392,34 +276,30 @@ public class AccountingCallerTester implements AccountingCallerInterface {
|
|||
break;
|
||||
case SPACE:
|
||||
SeriesSpaceDefinition serieSpaceDefinition = null;
|
||||
if (seriesRequest.getAccountingFilterDefinition()
|
||||
.getChartType() != null) {
|
||||
if (seriesRequest.getAccountingFilterDefinition().getChartType() != null) {
|
||||
ArrayList<SeriesSpaceData> seriesSpaceData = new ArrayList<>();
|
||||
switch (seriesRequest.getAccountingPeriod().getPeriod()) {
|
||||
case DAILY:
|
||||
case HOURLY:
|
||||
case MINUTELY:
|
||||
for (int i = 0; i < 30; i++) {
|
||||
SeriesSpaceData data = new SeriesSpaceData(
|
||||
new Date(), new Double(
|
||||
10000 * Math.random()).longValue());
|
||||
SeriesSpaceData data = new SeriesSpaceData(new Date(),
|
||||
new Double(10000 * Math.random()).longValue());
|
||||
seriesSpaceData.add(data);
|
||||
}
|
||||
break;
|
||||
case MONTHLY:
|
||||
while (startCalendar.compareTo(endCalendar) <= 0) {
|
||||
SeriesSpaceData data = new SeriesSpaceData(
|
||||
startCalendar.getTime(), new Double(
|
||||
10000 * Math.random()).longValue());
|
||||
SeriesSpaceData data = new SeriesSpaceData(startCalendar.getTime(),
|
||||
new Double(10000 * Math.random()).longValue());
|
||||
seriesSpaceData.add(data);
|
||||
startCalendar.add(Calendar.MONTH, 1);
|
||||
}
|
||||
break;
|
||||
case YEARLY:
|
||||
while (startCalendar.compareTo(endCalendar) <= 0) {
|
||||
SeriesSpaceData data = new SeriesSpaceData(
|
||||
startCalendar.getTime(), new Double(
|
||||
10000 * Math.random()).longValue());
|
||||
SeriesSpaceData data = new SeriesSpaceData(startCalendar.getTime(),
|
||||
new Double(10000 * Math.random()).longValue());
|
||||
seriesSpaceData.add(data);
|
||||
startCalendar.add(Calendar.YEAR, 1);
|
||||
}
|
||||
|
@ -429,8 +309,7 @@ public class AccountingCallerTester implements AccountingCallerInterface {
|
|||
|
||||
}
|
||||
|
||||
switch (seriesRequest.getAccountingFilterDefinition()
|
||||
.getChartType()) {
|
||||
switch (seriesRequest.getAccountingFilterDefinition().getChartType()) {
|
||||
case Basic:
|
||||
case Top:
|
||||
case Spaces:
|
||||
|
@ -443,15 +322,13 @@ public class AccountingCallerTester implements AccountingCallerInterface {
|
|||
for (int i = 1; i < 3; i++) {
|
||||
String space = new String("Space" + i);
|
||||
spacesList.add(space);
|
||||
SeriesSpaceDataSpaces seriesSpaceDataSpaces = new SeriesSpaceDataSpaces(
|
||||
space, seriesSpaceData);
|
||||
seriesSpaceDataSpacesList
|
||||
.add(seriesSpaceDataSpaces);
|
||||
SeriesSpaceDataSpaces seriesSpaceDataSpaces = new SeriesSpaceDataSpaces(space,
|
||||
seriesSpaceData);
|
||||
seriesSpaceDataSpacesList.add(seriesSpaceDataSpaces);
|
||||
}
|
||||
|
||||
Spaces spaces=new Spaces(spacesList);
|
||||
serieSpaceDefinition = new SeriesSpaceSpaces(
|
||||
spaces, seriesSpaceDataSpacesList);
|
||||
Spaces spaces = new Spaces(spacesList);
|
||||
serieSpaceDefinition = new SeriesSpaceSpaces(spaces, seriesSpaceDataSpacesList);
|
||||
|
||||
default:
|
||||
break;
|
||||
|
@ -465,17 +342,14 @@ public class AccountingCallerTester implements AccountingCallerInterface {
|
|||
|
||||
case STORAGE:
|
||||
SeriesStorageDefinition serieStorageDefinition = null;
|
||||
if (seriesRequest.getAccountingFilterDefinition()
|
||||
.getChartType() != null) {
|
||||
if (seriesRequest.getAccountingFilterDefinition().getChartType() != null) {
|
||||
ArrayList<SeriesStorageData> seriesStorageData = new ArrayList<>();
|
||||
for (int i = 0; i < 30; i++) {
|
||||
|
||||
// Valori variabili
|
||||
SeriesStorageData data = new SeriesStorageData(
|
||||
new Date(),
|
||||
new Double(1024 * 1024 * Math.random())
|
||||
.longValue(), new Double(
|
||||
100 * Math.random()).longValue());
|
||||
SeriesStorageData data = new SeriesStorageData(new Date(),
|
||||
new Double(1024 * 1024 * Math.random()).longValue(),
|
||||
new Double(100 * Math.random()).longValue());
|
||||
|
||||
// Valori Fissi
|
||||
/*
|
||||
|
@ -487,45 +361,27 @@ public class AccountingCallerTester implements AccountingCallerInterface {
|
|||
seriesStorageData.add(data);
|
||||
|
||||
}
|
||||
switch (seriesRequest.getAccountingFilterDefinition()
|
||||
.getChartType()) {
|
||||
switch (seriesRequest.getAccountingFilterDefinition().getChartType()) {
|
||||
case Basic:
|
||||
for (SeriesStorageData serieStorageData : seriesStorageData) {
|
||||
serieStorageData.setDataVolume(serieStorageData
|
||||
.getDataVolume() * 1000);
|
||||
serieStorageData.setOperationCount(serieStorageData
|
||||
.getOperationCount() * 1000);
|
||||
serieStorageData.setDataVolume(serieStorageData.getDataVolume() * 1000);
|
||||
serieStorageData.setOperationCount(serieStorageData.getOperationCount() * 1000);
|
||||
}
|
||||
|
||||
serieStorageDefinition = new SeriesStorageBasic(
|
||||
seriesStorageData);
|
||||
serieStorageDefinition = new SeriesStorageBasic(seriesStorageData);
|
||||
break;
|
||||
case Top:
|
||||
AccountingFilterTop accountingFilterTop = (AccountingFilterTop) seriesRequest
|
||||
.getAccountingFilterDefinition();
|
||||
ArrayList<SeriesStorageDataTop> seriesStorageDataTopList = new ArrayList<>();
|
||||
if (accountingFilterTop.getShowOthers()) {
|
||||
for (int i = 0; i < 1000; i++) {
|
||||
SeriesStorageDataTop seriesStorageDataTop = new SeriesStorageDataTop(
|
||||
new FilterValue("User" + i),
|
||||
seriesStorageData);
|
||||
seriesStorageDataTopList
|
||||
.add(seriesStorageDataTop);
|
||||
}
|
||||
} else {
|
||||
|
||||
for (int i = 0; i < accountingFilterTop
|
||||
.getTopNumber(); i++) {
|
||||
SeriesStorageDataTop seriesStorageDataTop = new SeriesStorageDataTop(
|
||||
new FilterValue("User" + i),
|
||||
seriesStorageData);
|
||||
seriesStorageDataTopList
|
||||
.add(seriesStorageDataTop);
|
||||
}
|
||||
for (int i = 0; i < accountingFilterTop.getTopNumber(); i++) {
|
||||
SeriesStorageDataTop seriesStorageDataTop = new SeriesStorageDataTop(
|
||||
new FilterValue("User" + i), seriesStorageData);
|
||||
seriesStorageDataTopList.add(seriesStorageDataTop);
|
||||
}
|
||||
serieStorageDefinition = new SeriesStorageTop(
|
||||
accountingFilterTop.getShowOthers(),
|
||||
accountingFilterTop.getTopNumber(),
|
||||
|
||||
serieStorageDefinition = new SeriesStorageTop(accountingFilterTop.getTopNumber(),
|
||||
seriesStorageDataTopList);
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -43,38 +43,36 @@ public class AccountingCommandTop implements AccountingCommand<SeriesResponse> {
|
|||
public SeriesResponse execute() throws ServiceException {
|
||||
try {
|
||||
|
||||
//if (accountingQueryTop.getScope() != null && !accountingQueryTop.getScope().isEmpty()) {
|
||||
// AccountingPersistenceQueryFactory.getForcedQueryScope().set(accountingQueryTop.getScope());
|
||||
//}
|
||||
// if (accountingQueryTop.getScope() != null &&
|
||||
// !accountingQueryTop.getScope().isEmpty()) {
|
||||
// AccountingPersistenceQueryFactory.getForcedQueryScope().set(accountingQueryTop.getScope());
|
||||
// }
|
||||
|
||||
AccountingPersistenceQuery apq = AccountingPersistenceQueryFactory.getInstance();
|
||||
|
||||
logger.debug("Query TopValues: " + accountingQueryTop.getFilterKey().getKey());
|
||||
|
||||
SortedMap<NumberedFilter, SortedMap<Calendar, Info>> topSM;
|
||||
|
||||
|
||||
logger.debug("Execute Top()");
|
||||
apq.setRequestedRecords(accountingQueryTop.getType());
|
||||
|
||||
HashSet<String> ctx=null;
|
||||
if(accountingQueryTop.getContext()!=null&&accountingQueryTop.getContext().getContexts()!=null
|
||||
&&!accountingQueryTop.getContext().getContexts().isEmpty()){
|
||||
ctx=new HashSet<String>(accountingQueryTop.getContext().getContexts());
|
||||
|
||||
HashSet<String> ctx = null;
|
||||
if (accountingQueryTop.getContext() != null && accountingQueryTop.getContext().getContexts() != null
|
||||
&& !accountingQueryTop.getContext().getContexts().isEmpty()) {
|
||||
ctx = new HashSet<String>(accountingQueryTop.getContext().getContexts());
|
||||
}
|
||||
apq.setContexts(ctx);
|
||||
apq.setTemporalConstraint(accountingQueryTop.getTemporalConstraint());
|
||||
apq.setFilters(accountingQueryTop.getFilters());
|
||||
|
||||
if (accountingQueryTop.getShowOthers()) {
|
||||
topSM = apq.getTopValues(accountingQueryTop.getFilterKey().getKey(), null, true, 0);
|
||||
} else {
|
||||
topSM = apq.getTopValues(accountingQueryTop.getFilterKey().getKey(), null, true,
|
||||
accountingQueryTop.getTopNumber());
|
||||
}
|
||||
|
||||
//if (accountingQueryTop.getScope() != null && !accountingQueryTop.getScope().isEmpty()) {
|
||||
// AccountingPersistenceQueryFactory.getForcedQueryScope().remove();
|
||||
//}
|
||||
topSM = apq.getTopValues(accountingQueryTop.getFilterKey().getKey(), null, true,
|
||||
accountingQueryTop.getTopNumber());
|
||||
|
||||
// if (accountingQueryTop.getScope() != null &&
|
||||
// !accountingQueryTop.getScope().isEmpty()) {
|
||||
// AccountingPersistenceQueryFactory.getForcedQueryScope().remove();
|
||||
// }
|
||||
|
||||
if (topSM == null) {
|
||||
throw new ServiceException("Error retrieving info for top: sorted map is null!");
|
||||
|
@ -111,20 +109,15 @@ public class AccountingCommandTop implements AccountingCommand<SeriesResponse> {
|
|||
|
||||
switch (accountingType) {
|
||||
case JOB:
|
||||
return new SeriesResponse4JobTop(accountingQueryTop.getShowOthers(), accountingQueryTop.getTopNumber(),
|
||||
topSM);
|
||||
return new SeriesResponse4JobTop(accountingQueryTop.getTopNumber(), topSM);
|
||||
case PORTLET:
|
||||
return new SeriesResponse4PortletTop(accountingQueryTop.getShowOthers(), accountingQueryTop.getTopNumber(),
|
||||
topSM);
|
||||
return new SeriesResponse4PortletTop(accountingQueryTop.getTopNumber(), topSM);
|
||||
case SERVICE:
|
||||
return new SeriesResponse4ServiceTop(accountingQueryTop.getShowOthers(), accountingQueryTop.getTopNumber(),
|
||||
topSM);
|
||||
return new SeriesResponse4ServiceTop(accountingQueryTop.getTopNumber(), topSM);
|
||||
case STORAGE:
|
||||
return new SeriesResponse4StorageTop(accountingQueryTop.getShowOthers(), accountingQueryTop.getTopNumber(),
|
||||
topSM);
|
||||
return new SeriesResponse4StorageTop(accountingQueryTop.getTopNumber(), topSM);
|
||||
case TASK:
|
||||
return new SeriesResponse4TaskTop(accountingQueryTop.getShowOthers(), accountingQueryTop.getTopNumber(),
|
||||
topSM);
|
||||
return new SeriesResponse4TaskTop(accountingQueryTop.getTopNumber(), topSM);
|
||||
default:
|
||||
throw new ServiceException("Error request type is unknow!");
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@ public class AccountingQuery4Job extends AccountingQueryBuilder {
|
|||
}
|
||||
}
|
||||
invocation = new AccountingQueryTop(AggregatedJobUsageRecord.class, accountingFilterTop.getContext(),
|
||||
accountingFilterTop.getFilterKey(), accountingFilterTop.getShowOthers(),
|
||||
accountingFilterTop.getFilterKey(),
|
||||
accountingFilterTop.getTopNumber(), temporalConstraint, filters);
|
||||
} else {
|
||||
logger.error("Invalid Request: " + seriesRequest);
|
||||
|
|
|
@ -93,8 +93,7 @@ public class AccountingQuery4Portlet extends AccountingQueryBuilder {
|
|||
}
|
||||
invocation = new AccountingQueryTop(AggregatedPortletUsageRecord.class,
|
||||
accountingFilterTop.getContext(), accountingFilterTop.getFilterKey(),
|
||||
accountingFilterTop.getShowOthers(), accountingFilterTop.getTopNumber(), temporalConstraint,
|
||||
filters);
|
||||
accountingFilterTop.getTopNumber(), temporalConstraint, filters);
|
||||
} else {
|
||||
logger.error("Invalid Request: " + seriesRequest);
|
||||
throw new ServiceException("Invalid Request!");
|
||||
|
|
|
@ -94,8 +94,7 @@ public class AccountingQuery4Service extends AccountingQueryBuilder {
|
|||
}
|
||||
invocation = new AccountingQueryTop(AggregatedServiceUsageRecord.class,
|
||||
accountingFilterTop.getContext(), accountingFilterTop.getFilterKey(),
|
||||
accountingFilterTop.getShowOthers(), accountingFilterTop.getTopNumber(), temporalConstraint,
|
||||
filters);
|
||||
accountingFilterTop.getTopNumber(), temporalConstraint, filters);
|
||||
} else {
|
||||
logger.error("Invalid Request: " + seriesRequest);
|
||||
throw new ServiceException("Invalid Request!");
|
||||
|
|
|
@ -94,8 +94,7 @@ public class AccountingQuery4Storage extends AccountingQueryBuilder {
|
|||
}
|
||||
invocation = new AccountingQueryTop(AggregatedStorageUsageRecord.class,
|
||||
accountingFilterTop.getContext(), accountingFilterTop.getFilterKey(),
|
||||
accountingFilterTop.getShowOthers(), accountingFilterTop.getTopNumber(), temporalConstraint,
|
||||
filters);
|
||||
accountingFilterTop.getTopNumber(), temporalConstraint, filters);
|
||||
} else {
|
||||
logger.error("Invalid Request: " + seriesRequest);
|
||||
throw new ServiceException("Invalid Request!");
|
||||
|
|
|
@ -20,12 +20,11 @@ public class AccountingQueryTop extends AccountingQuery {
|
|||
private Context context;
|
||||
private FilterKey filterKey;
|
||||
private Integer topNumber;
|
||||
private Boolean showOthers;
|
||||
private TemporalConstraint temporalConstraint;
|
||||
private ArrayList<Filter> filters;
|
||||
|
||||
public AccountingQueryTop(Class<? extends AggregatedUsageRecord<?, ?>> type, Context context, FilterKey filterKey,
|
||||
Boolean showOthers, Integer topNumber, TemporalConstraint temporalConstraint, ArrayList<Filter> filters) {
|
||||
Integer topNumber, TemporalConstraint temporalConstraint, ArrayList<Filter> filters) {
|
||||
super();
|
||||
chartType = ChartType.Top;
|
||||
this.type = type;
|
||||
|
@ -33,7 +32,6 @@ public class AccountingQueryTop extends AccountingQuery {
|
|||
this.temporalConstraint = temporalConstraint;
|
||||
this.filters = filters;
|
||||
this.filterKey = filterKey;
|
||||
this.showOthers = showOthers;
|
||||
this.topNumber = topNumber;
|
||||
}
|
||||
|
||||
|
@ -44,7 +42,7 @@ public class AccountingQueryTop extends AccountingQuery {
|
|||
public void setType(Class<? extends AggregatedUsageRecord<?, ?>> type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
|
||||
public Context getContext() {
|
||||
return context;
|
||||
}
|
||||
|
@ -77,14 +75,6 @@ public class AccountingQueryTop extends AccountingQuery {
|
|||
this.filterKey = filterKey;
|
||||
}
|
||||
|
||||
public Boolean getShowOthers() {
|
||||
return showOthers;
|
||||
}
|
||||
|
||||
public void setShowOthers(Boolean showOthers) {
|
||||
this.showOthers = showOthers;
|
||||
}
|
||||
|
||||
public Integer getTopNumber() {
|
||||
return topNumber;
|
||||
}
|
||||
|
@ -96,9 +86,8 @@ public class AccountingQueryTop extends AccountingQuery {
|
|||
@Override
|
||||
public String toString() {
|
||||
return "AccountingQueryTop [type=" + type + ", context=" + context + ", filterKey=" + filterKey + ", topNumber="
|
||||
+ topNumber + ", showOthers=" + showOthers + ", temporalConstraint=" + temporalConstraint + ", filters="
|
||||
+ filters + ", chartType=" + chartType + "]";
|
||||
+ topNumber + ", temporalConstraint=" + temporalConstraint + ", filters=" + filters + ", chartType="
|
||||
+ chartType + "]";
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -27,13 +27,11 @@ import org.slf4j.LoggerFactory;
|
|||
public class SeriesResponse4JobTop extends SeriesResponseBuilder {
|
||||
protected static Logger logger = LoggerFactory
|
||||
.getLogger(SeriesResponse4JobTop.class);
|
||||
private Boolean showOthers;
|
||||
private Integer topNumber;
|
||||
private SortedMap<NumberedFilter, SortedMap<Calendar, Info>> topSM;
|
||||
|
||||
public SeriesResponse4JobTop(Boolean showOthers, Integer topNumber,
|
||||
public SeriesResponse4JobTop(Integer topNumber,
|
||||
SortedMap<NumberedFilter, SortedMap<Calendar, Info>> topSM) {
|
||||
this.showOthers = showOthers;
|
||||
this.topNumber = topNumber;
|
||||
this.topSM = topSM;
|
||||
}
|
||||
|
@ -76,7 +74,7 @@ public class SeriesResponse4JobTop extends SeriesResponseBuilder {
|
|||
|
||||
}
|
||||
|
||||
SeriesJobTop seriesJobTop = new SeriesJobTop(showOthers,topNumber,
|
||||
SeriesJobTop seriesJobTop = new SeriesJobTop(topNumber,
|
||||
seriesJobDataTopList);
|
||||
SeriesJob seriesService = new SeriesJob(seriesJobTop);
|
||||
|
||||
|
|
|
@ -27,13 +27,11 @@ import org.slf4j.LoggerFactory;
|
|||
public class SeriesResponse4PortletTop extends SeriesResponseBuilder {
|
||||
protected static Logger logger = LoggerFactory
|
||||
.getLogger(SeriesResponse4PortletTop.class);
|
||||
private Boolean showOthers;
|
||||
private Integer topNumber;
|
||||
private SortedMap<NumberedFilter, SortedMap<Calendar, Info>> topSM;
|
||||
|
||||
public SeriesResponse4PortletTop(Boolean showOthers, Integer topNumber,
|
||||
public SeriesResponse4PortletTop(Integer topNumber,
|
||||
SortedMap<NumberedFilter, SortedMap<Calendar, Info>> topSM) {
|
||||
this.showOthers = showOthers;
|
||||
this.topNumber = topNumber;
|
||||
this.topSM = topSM;
|
||||
}
|
||||
|
@ -72,8 +70,7 @@ public class SeriesResponse4PortletTop extends SeriesResponseBuilder {
|
|||
|
||||
}
|
||||
|
||||
SeriesPortletTop seriesPortletTop = new SeriesPortletTop(
|
||||
showOthers, topNumber, seriesPortletDataTopList);
|
||||
SeriesPortletTop seriesPortletTop = new SeriesPortletTop(topNumber, seriesPortletDataTopList);
|
||||
SeriesPortlet seriesPortlet = new SeriesPortlet(seriesPortletTop);
|
||||
|
||||
seriesResponseSpec.setSr(seriesPortlet);
|
||||
|
|
|
@ -20,20 +20,16 @@ import org.slf4j.LoggerFactory;
|
|||
/**
|
||||
* Top Series Response 4 Service
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class SeriesResponse4ServiceTop extends SeriesResponseBuilder {
|
||||
protected static Logger logger = LoggerFactory
|
||||
.getLogger(SeriesResponse4ServiceTop.class);
|
||||
private Boolean showOthers;
|
||||
protected static Logger logger = LoggerFactory.getLogger(SeriesResponse4ServiceTop.class);
|
||||
private Integer topNumber;
|
||||
private SortedMap<NumberedFilter, SortedMap<Calendar, Info>> topSM;
|
||||
|
||||
public SeriesResponse4ServiceTop(Boolean showOthers, Integer topNumber,
|
||||
SortedMap<NumberedFilter, SortedMap<Calendar, Info>> topSM) {
|
||||
this.showOthers = showOthers;
|
||||
public SeriesResponse4ServiceTop(Integer topNumber, SortedMap<NumberedFilter, SortedMap<Calendar, Info>> topSM) {
|
||||
this.topNumber = topNumber;
|
||||
this.topSM = topSM;
|
||||
}
|
||||
|
@ -54,17 +50,12 @@ public class SeriesResponse4ServiceTop extends SeriesResponseBuilder {
|
|||
SortedMap<Calendar, Info> infos = topSM.get(topValue);
|
||||
for (Info info : infos.values()) {
|
||||
JsonNode jso = info.getValue();
|
||||
Long duration = jso
|
||||
.get(AggregatedServiceUsageRecord.DURATION).asLong();
|
||||
Long operationCount = jso
|
||||
.get(AggregatedServiceUsageRecord.OPERATION_COUNT).asLong();
|
||||
Long maxInvocationTime = jso
|
||||
.get(AggregatedServiceUsageRecord.MAX_INVOCATION_TIME).asLong();
|
||||
Long minInvocationTime = jso
|
||||
.get(AggregatedServiceUsageRecord.MIN_INVOCATION_TIME).asLong();
|
||||
Long duration = jso.get(AggregatedServiceUsageRecord.DURATION).asLong();
|
||||
Long operationCount = jso.get(AggregatedServiceUsageRecord.OPERATION_COUNT).asLong();
|
||||
Long maxInvocationTime = jso.get(AggregatedServiceUsageRecord.MAX_INVOCATION_TIME).asLong();
|
||||
Long minInvocationTime = jso.get(AggregatedServiceUsageRecord.MIN_INVOCATION_TIME).asLong();
|
||||
|
||||
series.add(new SeriesServiceData(info.getCalendar()
|
||||
.getTime(), operationCount, duration,
|
||||
series.add(new SeriesServiceData(info.getCalendar().getTime(), operationCount, duration,
|
||||
maxInvocationTime, minInvocationTime));
|
||||
|
||||
}
|
||||
|
@ -74,19 +65,16 @@ public class SeriesResponse4ServiceTop extends SeriesResponseBuilder {
|
|||
|
||||
}
|
||||
|
||||
SeriesServiceTop seriesServiceTop = new SeriesServiceTop(
|
||||
showOthers, topNumber, seriesServiceDataTopList);
|
||||
SeriesServiceTop seriesServiceTop = new SeriesServiceTop(topNumber, seriesServiceDataTopList);
|
||||
SeriesService seriesService = new SeriesService(seriesServiceTop);
|
||||
|
||||
seriesResponseSpec.setSr(seriesService);
|
||||
|
||||
} catch (Throwable e) {
|
||||
logger.error("Error creating series for service accounting top chart: "
|
||||
+ e.getLocalizedMessage());
|
||||
logger.error("Error creating series for service accounting top chart: " + e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
throw new ServiceException(
|
||||
"Error creating series for service accounting top chart: "
|
||||
+ e.getLocalizedMessage());
|
||||
"Error creating series for service accounting top chart: " + e.getLocalizedMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -6,14 +6,13 @@ import java.util.SortedMap;
|
|||
|
||||
import org.gcube.accounting.analytics.Filter;
|
||||
import org.gcube.accounting.analytics.Info;
|
||||
import org.gcube.accounting.datamodel.aggregation.AggregatedServiceUsageRecord;
|
||||
import org.gcube.accounting.datamodel.aggregation.AggregatedStorageStatusRecord;
|
||||
import org.gcube.com.fasterxml.jackson.databind.JsonNode;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.Spaces;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesSpace;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.space.SeriesSpaceSpaces;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.space.SeriesSpaceData;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.space.SeriesSpaceDataSpaces;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.space.SeriesSpaceSpaces;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.exception.ServiceException;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
|
|
@ -20,20 +20,16 @@ import org.slf4j.LoggerFactory;
|
|||
/**
|
||||
* Top Series Response 4 Storage
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class SeriesResponse4StorageTop extends SeriesResponseBuilder {
|
||||
protected static Logger logger = LoggerFactory
|
||||
.getLogger(SeriesResponse4StorageTop.class);
|
||||
private Boolean showOthers;
|
||||
protected static Logger logger = LoggerFactory.getLogger(SeriesResponse4StorageTop.class);
|
||||
private Integer topNumber;
|
||||
private SortedMap<NumberedFilter, SortedMap<Calendar, Info>> topSM;
|
||||
|
||||
public SeriesResponse4StorageTop(Boolean showOthers, Integer topNumber,
|
||||
SortedMap<NumberedFilter, SortedMap<Calendar, Info>> topSM) {
|
||||
this.showOthers = showOthers;
|
||||
public SeriesResponse4StorageTop(Integer topNumber, SortedMap<NumberedFilter, SortedMap<Calendar, Info>> topSM) {
|
||||
this.topNumber = topNumber;
|
||||
this.topSM = topSM;
|
||||
|
||||
|
@ -55,12 +51,9 @@ public class SeriesResponse4StorageTop extends SeriesResponseBuilder {
|
|||
SortedMap<Calendar, Info> infos = topSM.get(topValue);
|
||||
for (Info info : infos.values()) {
|
||||
JsonNode jso = info.getValue();
|
||||
Long dataVolume = jso
|
||||
.get(AggregatedStorageUsageRecord.DATA_VOLUME).asLong();
|
||||
Long operationCount = jso
|
||||
.get(AggregatedStorageUsageRecord.OPERATION_COUNT).asLong();
|
||||
series.add(new SeriesStorageData(info.getCalendar()
|
||||
.getTime(), dataVolume, operationCount));
|
||||
Long dataVolume = jso.get(AggregatedStorageUsageRecord.DATA_VOLUME).asLong();
|
||||
Long operationCount = jso.get(AggregatedStorageUsageRecord.OPERATION_COUNT).asLong();
|
||||
series.add(new SeriesStorageData(info.getCalendar().getTime(), dataVolume, operationCount));
|
||||
|
||||
}
|
||||
SeriesStorageDataTop seriesStorageDataTop = new SeriesStorageDataTop(
|
||||
|
@ -69,18 +62,15 @@ public class SeriesResponse4StorageTop extends SeriesResponseBuilder {
|
|||
|
||||
}
|
||||
|
||||
SeriesStorageTop seriesStorageTop = new SeriesStorageTop(
|
||||
showOthers, topNumber, seriesStorageDataTopList);
|
||||
SeriesStorageTop seriesStorageTop = new SeriesStorageTop(topNumber, seriesStorageDataTopList);
|
||||
SeriesStorage seriesStorage = new SeriesStorage(seriesStorageTop);
|
||||
|
||||
seriesResponseSpec.setSr(seriesStorage);
|
||||
} catch (Throwable e) {
|
||||
logger.error("Error creating series for storage accounting top chart: "
|
||||
+ e.getLocalizedMessage());
|
||||
logger.error("Error creating series for storage accounting top chart: " + e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
throw new ServiceException(
|
||||
"Error creating series for storage accounting basic chart: "
|
||||
+ e.getLocalizedMessage());
|
||||
"Error creating series for storage accounting basic chart: " + e.getLocalizedMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,20 +20,16 @@ import org.slf4j.LoggerFactory;
|
|||
/**
|
||||
* Top Series Response 4 Task
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class SeriesResponse4TaskTop extends SeriesResponseBuilder {
|
||||
protected static Logger logger = LoggerFactory
|
||||
.getLogger(SeriesResponse4TaskTop.class);
|
||||
private Boolean showOthers;
|
||||
protected static Logger logger = LoggerFactory.getLogger(SeriesResponse4TaskTop.class);
|
||||
private Integer topNumber;
|
||||
private SortedMap<NumberedFilter, SortedMap<Calendar, Info>> topSM;
|
||||
|
||||
public SeriesResponse4TaskTop(Boolean showOthers, Integer topNumber,
|
||||
SortedMap<NumberedFilter, SortedMap<Calendar, Info>> topSM) {
|
||||
this.showOthers = showOthers;
|
||||
public SeriesResponse4TaskTop(Integer topNumber, SortedMap<NumberedFilter, SortedMap<Calendar, Info>> topSM) {
|
||||
this.topNumber = topNumber;
|
||||
this.topSM = topSM;
|
||||
}
|
||||
|
@ -57,35 +53,33 @@ public class SeriesResponse4TaskTop extends SeriesResponseBuilder {
|
|||
JsonNode jso = info.getValue();
|
||||
// Long duration =
|
||||
// jso.getLong(AggregatedTaskUsageRecord.DURATION);
|
||||
//Long operationCount = jso
|
||||
// .getLong(AggregatedTaskUsageRecord.OPERATION_COUNT);
|
||||
// Long operationCount = jso
|
||||
// .getLong(AggregatedTaskUsageRecord.OPERATION_COUNT);
|
||||
// Long maxInvocationTime =
|
||||
// jso.getLong(AggregatedTaskUsageRecord.MAX_INVOCATION_TIME);
|
||||
// Long minInvocationTime =
|
||||
// jso.getLong(AggregatedTaskUsageRecord.MIN_INVOCATION_TIME);
|
||||
|
||||
//series.add(new SeriesTaskData(info.getCalendar().getTime(),
|
||||
// operationCount));
|
||||
// series.add(new
|
||||
// SeriesTaskData(info.getCalendar().getTime(),
|
||||
// operationCount));
|
||||
}
|
||||
SeriesTaskDataTop seriesTaskDataTop = new SeriesTaskDataTop(
|
||||
new FilterValue(topValue.getValue()), series);
|
||||
SeriesTaskDataTop seriesTaskDataTop = new SeriesTaskDataTop(new FilterValue(topValue.getValue()),
|
||||
series);
|
||||
seriesTaskDataTopList.add(seriesTaskDataTop);
|
||||
|
||||
}
|
||||
|
||||
SeriesTaskTop seriesTaskTop = new SeriesTaskTop(showOthers,
|
||||
topNumber, seriesTaskDataTopList);
|
||||
SeriesTaskTop seriesTaskTop = new SeriesTaskTop(topNumber, seriesTaskDataTopList);
|
||||
SeriesTask seriesTask = new SeriesTask(seriesTaskTop);
|
||||
|
||||
seriesResponseSpec.setSr(seriesTask);
|
||||
|
||||
} catch (Throwable e) {
|
||||
logger.error("Error creating series for portlet accounting top chart: "
|
||||
+ e.getLocalizedMessage());
|
||||
logger.error("Error creating series for portlet accounting top chart: " + e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
throw new ServiceException(
|
||||
"Error creating series for portlet accounting top chart: "
|
||||
+ e.getLocalizedMessage());
|
||||
"Error creating series for portlet accounting top chart: " + e.getLocalizedMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,5 +48,10 @@ public class Constants {
|
|||
public static final int CLIENT_MONITOR_TIME_OUT_PERIODMILLIS = 1800000;
|
||||
public static final int DAEMON_SLEEP_MILLIS = 1000;
|
||||
|
||||
//Top Number
|
||||
public static final int TOP_NUMBER_DEFAULT = 10;
|
||||
public static final int TOP_NUMBER_MAX = 50;
|
||||
public static final int TOP_NUMBER_MIN = 1;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -3,6 +3,8 @@ package org.gcube.portlets.admin.accountingmanager.shared.data;
|
|||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.Constants;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
|
@ -15,7 +17,6 @@ public class AccountingFilterTop extends AccountingFilterDefinition implements S
|
|||
private Context context;
|
||||
private String scopeFilterActive;
|
||||
private FilterKey filterKey;
|
||||
private Boolean showOthers;
|
||||
private Integer topNumber;
|
||||
private ArrayList<AccountingFilter> filters;
|
||||
|
||||
|
@ -24,31 +25,28 @@ public class AccountingFilterTop extends AccountingFilterDefinition implements S
|
|||
this.chartType = ChartType.Top;
|
||||
context = null;
|
||||
scopeFilterActive = null;
|
||||
showOthers = false;
|
||||
topNumber = 5;
|
||||
topNumber = Constants.TOP_NUMBER_DEFAULT;
|
||||
filterKey = null;
|
||||
filters = null;
|
||||
|
||||
}
|
||||
|
||||
public AccountingFilterTop(Context context, Boolean showOthers, Integer topNumber) {
|
||||
public AccountingFilterTop(Context context, Integer topNumber) {
|
||||
super();
|
||||
this.chartType = ChartType.Top;
|
||||
this.context = context;
|
||||
this.scopeFilterActive = null;
|
||||
this.showOthers = showOthers;
|
||||
this.topNumber = topNumber;
|
||||
filterKey = null;
|
||||
filters = null;
|
||||
|
||||
}
|
||||
|
||||
public AccountingFilterTop(Context context, String scopeFilterActive, Boolean showOthers, Integer topNumber) {
|
||||
public AccountingFilterTop(Context context, String scopeFilterActive, Integer topNumber) {
|
||||
super();
|
||||
this.chartType = ChartType.Top;
|
||||
this.context = context;
|
||||
this.scopeFilterActive = scopeFilterActive;
|
||||
this.showOthers = showOthers;
|
||||
this.topNumber = topNumber;
|
||||
filterKey = null;
|
||||
filters = null;
|
||||
|
@ -56,26 +54,24 @@ public class AccountingFilterTop extends AccountingFilterDefinition implements S
|
|||
}
|
||||
|
||||
public AccountingFilterTop(Context context, FilterKey filterKey, ArrayList<AccountingFilter> filters,
|
||||
Boolean showOthers, Integer topNumber) {
|
||||
Integer topNumber) {
|
||||
super();
|
||||
chartType = ChartType.Top;
|
||||
this.context = context;
|
||||
this.scopeFilterActive = null;
|
||||
this.filterKey = filterKey;
|
||||
this.filters = filters;
|
||||
this.showOthers = showOthers;
|
||||
this.topNumber = topNumber;
|
||||
}
|
||||
|
||||
public AccountingFilterTop(Context context, String scopeFilterActive, FilterKey filterKey,
|
||||
ArrayList<AccountingFilter> filters, Boolean showOthers, Integer topNumber) {
|
||||
ArrayList<AccountingFilter> filters, Integer topNumber) {
|
||||
super();
|
||||
chartType = ChartType.Top;
|
||||
this.context = context;
|
||||
this.scopeFilterActive = scopeFilterActive;
|
||||
this.filterKey = filterKey;
|
||||
this.filters = filters;
|
||||
this.showOthers = showOthers;
|
||||
this.topNumber = topNumber;
|
||||
}
|
||||
|
||||
|
@ -95,14 +91,6 @@ public class AccountingFilterTop extends AccountingFilterDefinition implements S
|
|||
this.filterKey = filterKey;
|
||||
}
|
||||
|
||||
public Boolean getShowOthers() {
|
||||
return showOthers;
|
||||
}
|
||||
|
||||
public void setShowOthers(Boolean showOthers) {
|
||||
this.showOthers = showOthers;
|
||||
}
|
||||
|
||||
public Integer getTopNumber() {
|
||||
return topNumber;
|
||||
}
|
||||
|
@ -130,9 +118,7 @@ public class AccountingFilterTop extends AccountingFilterDefinition implements S
|
|||
@Override
|
||||
public String toString() {
|
||||
return "AccountingFilterTop [context=" + context + ", scopeFilterActive=" + scopeFilterActive + ", filterKey="
|
||||
+ filterKey + ", showOthers=" + showOthers + ", topNumber=" + topNumber + ", filters=" + filters
|
||||
+ ", chartType=" + chartType + "]";
|
||||
+ filterKey + ", topNumber=" + topNumber + ", filters=" + filters + ", chartType=" + chartType + "]";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -2,11 +2,12 @@ package org.gcube.portlets.admin.accountingmanager.shared.data.response.job;
|
|||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.Constants;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.ChartType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
@ -14,33 +15,21 @@ public class SeriesJobTop extends SeriesJobDefinition {
|
|||
|
||||
private static final long serialVersionUID = -2350334263342186590L;
|
||||
private ArrayList<SeriesJobDataTop> seriesJobDataTopList;
|
||||
private Boolean showOthers;
|
||||
private Integer topNumber;
|
||||
|
||||
public SeriesJobTop() {
|
||||
super();
|
||||
this.chartType = ChartType.Top;
|
||||
this.showOthers = false;
|
||||
this.topNumber = 5;
|
||||
this.topNumber = Constants.TOP_NUMBER_DEFAULT;
|
||||
}
|
||||
|
||||
public SeriesJobTop(Boolean showOthers, Integer topNumber,
|
||||
ArrayList<SeriesJobDataTop> seriesJobDataTopList) {
|
||||
public SeriesJobTop(Integer topNumber, ArrayList<SeriesJobDataTop> seriesJobDataTopList) {
|
||||
super();
|
||||
this.chartType = ChartType.Top;
|
||||
this.showOthers = showOthers;
|
||||
this.topNumber = topNumber;
|
||||
this.seriesJobDataTopList = seriesJobDataTopList;
|
||||
}
|
||||
|
||||
public Boolean getShowOthers() {
|
||||
return showOthers;
|
||||
}
|
||||
|
||||
public void setShowOthers(Boolean showOthers) {
|
||||
this.showOthers = showOthers;
|
||||
}
|
||||
|
||||
public Integer getTopNumber() {
|
||||
return topNumber;
|
||||
}
|
||||
|
@ -53,16 +42,14 @@ public class SeriesJobTop extends SeriesJobDefinition {
|
|||
return seriesJobDataTopList;
|
||||
}
|
||||
|
||||
public void setSeriesJobDataTopList(
|
||||
ArrayList<SeriesJobDataTop> seriesJobDataTopList) {
|
||||
public void setSeriesJobDataTopList(ArrayList<SeriesJobDataTop> seriesJobDataTopList) {
|
||||
this.seriesJobDataTopList = seriesJobDataTopList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SeriesJobTop [seriesJobDataTopList=" + seriesJobDataTopList
|
||||
+ ", showOthers=" + showOthers + ", topNumber=" + topNumber
|
||||
+ "]";
|
||||
return "SeriesJobTop [seriesJobDataTopList=" + seriesJobDataTopList + ", topNumber=" + topNumber
|
||||
+ ", chartType=" + chartType + "]";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -2,45 +2,34 @@ package org.gcube.portlets.admin.accountingmanager.shared.data.response.portlet;
|
|||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.Constants;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.ChartType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class SeriesPortletTop extends SeriesPortletDefinition {
|
||||
|
||||
private static final long serialVersionUID = -2350334263342186590L;
|
||||
private Boolean showOthers;
|
||||
private Integer topNumber;
|
||||
private ArrayList<SeriesPortletDataTop> seriesPortletDataTopList;
|
||||
|
||||
public SeriesPortletTop() {
|
||||
super();
|
||||
this.chartType = ChartType.Top;
|
||||
this.showOthers = false;
|
||||
this.topNumber = 5;
|
||||
this.topNumber = Constants.TOP_NUMBER_DEFAULT;
|
||||
}
|
||||
|
||||
public SeriesPortletTop(Boolean showOthers, Integer topNumber,
|
||||
ArrayList<SeriesPortletDataTop> seriesPortletDataTopList) {
|
||||
public SeriesPortletTop(Integer topNumber, ArrayList<SeriesPortletDataTop> seriesPortletDataTopList) {
|
||||
super();
|
||||
this.chartType = ChartType.Top;
|
||||
this.showOthers = showOthers;
|
||||
this.topNumber = topNumber;
|
||||
this.seriesPortletDataTopList = seriesPortletDataTopList;
|
||||
}
|
||||
|
||||
public Boolean getShowOthers() {
|
||||
return showOthers;
|
||||
}
|
||||
|
||||
public void setShowOthers(Boolean showOthers) {
|
||||
this.showOthers = showOthers;
|
||||
}
|
||||
|
||||
public Integer getTopNumber() {
|
||||
return topNumber;
|
||||
}
|
||||
|
@ -53,16 +42,14 @@ public class SeriesPortletTop extends SeriesPortletDefinition {
|
|||
return seriesPortletDataTopList;
|
||||
}
|
||||
|
||||
public void setSeriesPortletDataTopList(
|
||||
ArrayList<SeriesPortletDataTop> seriesPortletDataTopList) {
|
||||
public void setSeriesPortletDataTopList(ArrayList<SeriesPortletDataTop> seriesPortletDataTopList) {
|
||||
this.seriesPortletDataTopList = seriesPortletDataTopList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SeriesPortletTop [showOthers=" + showOthers + ", topNumber="
|
||||
+ topNumber + ", seriesPortletDataTopList="
|
||||
+ seriesPortletDataTopList + "]";
|
||||
return "SeriesPortletTop [topNumber=" + topNumber + ", seriesPortletDataTopList=" + seriesPortletDataTopList
|
||||
+ "]";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -2,46 +2,35 @@ package org.gcube.portlets.admin.accountingmanager.shared.data.response.service;
|
|||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.Constants;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.ChartType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class SeriesServiceTop extends SeriesServiceDefinition {
|
||||
|
||||
private static final long serialVersionUID = -2350334263342186590L;
|
||||
private Boolean showOthers;
|
||||
private Integer topNumber;
|
||||
private ArrayList<SeriesServiceDataTop> seriesServiceDataTopList;
|
||||
|
||||
public SeriesServiceTop() {
|
||||
super();
|
||||
this.chartType = ChartType.Top;
|
||||
this.showOthers = false;
|
||||
this.topNumber = 5;
|
||||
|
||||
this.topNumber = Constants.TOP_NUMBER_DEFAULT;
|
||||
|
||||
}
|
||||
|
||||
public SeriesServiceTop(Boolean showOthers, Integer topNumber,
|
||||
ArrayList<SeriesServiceDataTop> seriesServiceDataTopList) {
|
||||
public SeriesServiceTop(Integer topNumber, ArrayList<SeriesServiceDataTop> seriesServiceDataTopList) {
|
||||
super();
|
||||
this.chartType = ChartType.Top;
|
||||
this.showOthers = showOthers;
|
||||
this.topNumber = topNumber;
|
||||
this.seriesServiceDataTopList = seriesServiceDataTopList;
|
||||
}
|
||||
|
||||
public Boolean getShowOthers() {
|
||||
return showOthers;
|
||||
}
|
||||
|
||||
public void setShowOthers(Boolean showOthers) {
|
||||
this.showOthers = showOthers;
|
||||
}
|
||||
|
||||
public Integer getTopNumber() {
|
||||
return topNumber;
|
||||
}
|
||||
|
@ -54,16 +43,14 @@ public class SeriesServiceTop extends SeriesServiceDefinition {
|
|||
return seriesServiceDataTopList;
|
||||
}
|
||||
|
||||
public void setSeriesServiceDataTopList(
|
||||
ArrayList<SeriesServiceDataTop> seriesServiceDataTopList) {
|
||||
public void setSeriesServiceDataTopList(ArrayList<SeriesServiceDataTop> seriesServiceDataTopList) {
|
||||
this.seriesServiceDataTopList = seriesServiceDataTopList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SeriesServiceTop [showOthers=" + showOthers + ", topNumber="
|
||||
+ topNumber + ", seriesServiceDataTopList="
|
||||
+ seriesServiceDataTopList + "]";
|
||||
return "SeriesServiceTop [topNumber=" + topNumber + ", seriesServiceDataTopList=" + seriesServiceDataTopList
|
||||
+ ", chartType=" + chartType + "]";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -2,46 +2,35 @@ package org.gcube.portlets.admin.accountingmanager.shared.data.response.storage;
|
|||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.Constants;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.ChartType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class SeriesStorageTop extends SeriesStorageDefinition {
|
||||
|
||||
private static final long serialVersionUID = -5477545972037227361L;
|
||||
private Boolean showOthers;
|
||||
private Integer topNumber;
|
||||
private ArrayList<SeriesStorageDataTop> seriesStorageDataTopList;
|
||||
|
||||
public SeriesStorageTop() {
|
||||
super();
|
||||
this.chartType = ChartType.Top;
|
||||
this.showOthers = false;
|
||||
this.topNumber = 5;
|
||||
|
||||
this.topNumber = Constants.TOP_NUMBER_DEFAULT;
|
||||
|
||||
}
|
||||
|
||||
public SeriesStorageTop(Boolean showOthers, Integer topNumber,
|
||||
ArrayList<SeriesStorageDataTop> seriesStorageDataTopList) {
|
||||
public SeriesStorageTop(Integer topNumber, ArrayList<SeriesStorageDataTop> seriesStorageDataTopList) {
|
||||
super();
|
||||
this.chartType = ChartType.Top;
|
||||
this.showOthers = showOthers;
|
||||
this.topNumber = topNumber;
|
||||
this.seriesStorageDataTopList = seriesStorageDataTopList;
|
||||
}
|
||||
|
||||
public Boolean getShowOthers() {
|
||||
return showOthers;
|
||||
}
|
||||
|
||||
public void setShowOthers(Boolean showOthers) {
|
||||
this.showOthers = showOthers;
|
||||
}
|
||||
|
||||
public Integer getTopNumber() {
|
||||
return topNumber;
|
||||
}
|
||||
|
@ -54,16 +43,14 @@ public class SeriesStorageTop extends SeriesStorageDefinition {
|
|||
return seriesStorageDataTopList;
|
||||
}
|
||||
|
||||
public void setSeriesStorageDataTopList(
|
||||
ArrayList<SeriesStorageDataTop> seriesStorageDataTopList) {
|
||||
public void setSeriesStorageDataTopList(ArrayList<SeriesStorageDataTop> seriesStorageDataTopList) {
|
||||
this.seriesStorageDataTopList = seriesStorageDataTopList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SeriesStorageTop [showOthers=" + showOthers + ", topNumber="
|
||||
+ topNumber + ", seriesStorageDataTopList="
|
||||
+ seriesStorageDataTopList + "]";
|
||||
return "SeriesStorageTop [topNumber=" + topNumber + ", seriesStorageDataTopList=" + seriesStorageDataTopList
|
||||
+ ", chartType=" + chartType + "]";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -2,46 +2,35 @@ package org.gcube.portlets.admin.accountingmanager.shared.data.response.task;
|
|||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.Constants;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.ChartType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class SeriesTaskTop extends SeriesTaskDefinition {
|
||||
|
||||
private static final long serialVersionUID = 6805210072384752359L;
|
||||
private Boolean showOthers;
|
||||
private Integer topNumber;
|
||||
private ArrayList<SeriesTaskDataTop> seriesTaskDataTopList;
|
||||
|
||||
public SeriesTaskTop() {
|
||||
super();
|
||||
this.chartType = ChartType.Top;
|
||||
this.showOthers = false;
|
||||
this.topNumber = 5;
|
||||
this.topNumber = Constants.TOP_NUMBER_DEFAULT;
|
||||
|
||||
}
|
||||
|
||||
public SeriesTaskTop(Boolean showOthers, Integer topNumber,
|
||||
ArrayList<SeriesTaskDataTop> seriesTaskDataTopList) {
|
||||
public SeriesTaskTop(Integer topNumber, ArrayList<SeriesTaskDataTop> seriesTaskDataTopList) {
|
||||
super();
|
||||
this.chartType = ChartType.Top;
|
||||
this.showOthers = showOthers;
|
||||
this.topNumber = topNumber;
|
||||
this.seriesTaskDataTopList = seriesTaskDataTopList;
|
||||
}
|
||||
|
||||
public Boolean getShowOthers() {
|
||||
return showOthers;
|
||||
}
|
||||
|
||||
public void setShowOthers(Boolean showOthers) {
|
||||
this.showOthers = showOthers;
|
||||
}
|
||||
|
||||
public Integer getTopNumber() {
|
||||
return topNumber;
|
||||
}
|
||||
|
@ -54,16 +43,14 @@ public class SeriesTaskTop extends SeriesTaskDefinition {
|
|||
return seriesTaskDataTopList;
|
||||
}
|
||||
|
||||
public void setSeriesTaskDataTopList(
|
||||
ArrayList<SeriesTaskDataTop> seriesTaskDataTopList) {
|
||||
public void setSeriesTaskDataTopList(ArrayList<SeriesTaskDataTop> seriesTaskDataTopList) {
|
||||
this.seriesTaskDataTopList = seriesTaskDataTopList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SeriesTaskTop [showOthers=" + showOthers + ", topNumber="
|
||||
+ topNumber + ", seriesTaskDataTopList="
|
||||
+ seriesTaskDataTopList + "]";
|
||||
return "SeriesTaskTop [topNumber=" + topNumber + ", seriesTaskDataTopList=" + seriesTaskDataTopList
|
||||
+ ", chartType=" + chartType + "]";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package org.gcube.portlets.admin.accountingmanager.shared.exception;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class NoScopeSelectedException extends Exception {
|
||||
|
||||
private static final long serialVersionUID = -8737011216478988776L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public NoScopeSelectedException() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param message
|
||||
* message
|
||||
*/
|
||||
public NoScopeSelectedException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public NoScopeSelectedException(String message, Throwable t) {
|
||||
super(message, t);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue