Compare commits

..

No commits in common. "master" and "r5.4.0" have entirely different histories.

417 changed files with 7202 additions and 1721 deletions

6
.classpath Executable file → Normal file
View File

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="src" output="target/accounting-manager-1.16.0-SNAPSHOT/WEB-INF/classes" path="src/main/java"> <classpathentry kind="src" output="target/accounting-manager-1.13.0/WEB-INF/classes" path="src/main/java">
<attributes> <attributes>
<attribute name="optional" value="true"/> <attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry excluding="**" kind="src" output="target/accounting-manager-1.16.0-SNAPSHOT/WEB-INF/classes" path="src/main/resources"> <classpathentry excluding="**" kind="src" output="target/accounting-manager-1.13.0/WEB-INF/classes" path="src/main/resources">
<attributes> <attributes>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
@ -45,5 +45,5 @@
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="output" path="target/accounting-manager-1.16.0-SNAPSHOT/WEB-INF/classes"/> <classpathentry kind="output" path="target/accounting-manager-1.13.0/WEB-INF/classes"/>
</classpath> </classpath>

0
.gitignore vendored Executable file → Normal file
View File

0
.project Executable file → Normal file
View File

0
.settings/com.google.appengine.eclipse.core.prefs Executable file → Normal file
View File

0
.settings/com.google.gdt.eclipse.core.prefs Executable file → Normal file
View File

0
.settings/org.eclipse.core.resources.prefs Executable file → Normal file
View File

0
.settings/org.eclipse.jdt.core.prefs Executable file → Normal file
View File

0
.settings/org.eclipse.m2e.core.prefs Executable file → Normal file
View File

2
.settings/org.eclipse.wst.common.component Executable file → Normal file
View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0"> <?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="accounting-manager-1.16.0-SNAPSHOT"> <wb-module deploy-name="accounting-manager-1.13.0">
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/> <wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/> <wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>

View File

View File

0
.settings/org.eclipse.wst.validation.prefs Executable file → Normal file
View File

13
CHANGELOG.md Executable file → Normal file
View File

@ -3,19 +3,6 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
# Changelog for "accounting-manager" # Changelog for "accounting-manager"
## [v1.16.0-SNAPSHOT] - 2022-05-20
### Features
- Updated pom for StorageHub 2
## [v1.15.0] - 2021-11-30
### Features
- Improve query support of the new persistence [#21354]
## [v1.14.0] - 2021-06-28 ## [v1.14.0] - 2021-06-28
### Fixes ### Fixes

0
FUNDING.md Executable file → Normal file
View File

0
LICENSE.md Executable file → Normal file
View File

0
README.md Executable file → Normal file
View File

0
accountingman.launch Executable file → Normal file
View File

8
changelog.xml Executable file → Normal file
View File

@ -1,12 +1,4 @@
<ReleaseNotes> <ReleaseNotes>
<Changeset component="org.gcube.portlets.admin.accounting-manager.1-16-0"
date="2022-05-20">
<Change>Updated pom for Storage Hub 2</Change>
</Changeset>
<Changeset component="org.gcube.portlets.admin.accounting-manager.1-15-0"
date="2021-11-30">
<Change>Improve query support of the new persistence [#21354]</Change>
</Changeset>
<Changeset component="org.gcube.portlets.admin.accounting-manager.1-14-0" <Changeset component="org.gcube.portlets.admin.accounting-manager.1-14-0"
date="2021-06-28"> date="2021-06-28">
<Change>Fixed display errors generated in Root scope [#21729]</Change> <Change>Fixed display errors generated in Root scope [#21729]</Change>

0
descriptor.xml Executable file → Normal file
View File

24
pom.xml Executable file → Normal file
View File

@ -15,7 +15,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.gcube.portlets.admin</groupId> <groupId>org.gcube.portlets.admin</groupId>
<artifactId>accounting-manager</artifactId> <artifactId>accounting-manager</artifactId>
<version>1.16.0-SNAPSHOT</version> <version>1.14.0</version>
<packaging>war</packaging> <packaging>war</packaging>
@ -108,7 +108,7 @@
<dependency> <dependency>
<groupId>org.gcube.accounting</groupId> <groupId>org.gcube.accounting</groupId>
<artifactId>accounting-lib</artifactId> <artifactId>accounting-lib</artifactId>
<scope>provided</scope> <version>[4.0.0,5.0.0-SNAPSHOT)</version>
</dependency> </dependency>
</dependencies> </dependencies>
@ -235,13 +235,6 @@
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<!-- Document Store Lib -->
<dependency>
<groupId>org.gcube.data.publishing</groupId>
<artifactId>document-store-lib</artifactId>
<scope>provided</scope>
</dependency>
<!-- Accounting Lib --> <!-- Accounting Lib -->
<dependency> <dependency>
<groupId>org.gcube.accounting</groupId> <groupId>org.gcube.accounting</groupId>
@ -253,7 +246,14 @@
<dependency> <dependency>
<groupId>org.gcube.accounting</groupId> <groupId>org.gcube.accounting</groupId>
<artifactId>accounting-analytics</artifactId> <artifactId>accounting-analytics</artifactId>
<version>[4.0.0-SNAPSHOT,5.0.0-SNAPSHOT)</version> <version>[3.0.0,4.0.0-SNAPSHOT)</version>
</dependency>
<!-- Document Store Lib -->
<dependency>
<groupId>org.gcube.data.publishing</groupId>
<artifactId>document-store-lib</artifactId>
<scope>provided</scope>
</dependency> </dependency>
@ -261,7 +261,7 @@
<dependency> <dependency>
<groupId>org.gcube.accounting</groupId> <groupId>org.gcube.accounting</groupId>
<artifactId>accounting-analytics-persistence-postgresql</artifactId> <artifactId>accounting-analytics-persistence-postgresql</artifactId>
<version>[2.0.0-SNAPSHOT,3.0.0-SNAPSHOT)</version> <version>[1.0.0,2.0.0-SNAPSHOT)</version>
<scope>runtime</scope> <scope>runtime</scope>
</dependency> </dependency>
@ -445,7 +445,7 @@
<dependency> <dependency>
<groupId>org.gcube.distribution</groupId> <groupId>org.gcube.distribution</groupId>
<artifactId>maven-portal-bom</artifactId> <artifactId>maven-portal-bom</artifactId>
<version>3.7.0-SNAPSHOT</version> <version>3.6.3</version>
<type>pom</type> <type>pom</type>
<scope>import</scope> <scope>import</scope>
</dependency> </dependency>

0
profile.xml Executable file → Normal file
View File

View File

@ -46,8 +46,7 @@
<!-- <set-configuration-property name="CssResource.style" value="pretty"/> --> <!-- <set-configuration-property name="CssResource.style" value="pretty"/> -->
<!-- <!-- <set-property name="log_DivLogger" value="ENABLED" /> <set-property
<set-property name="log_DivLogger" value="ENABLED" /> <set-property
name="log_ConsoleLogger" value="ENABLED" /> <set-property name="log_GWTLogger" name="log_ConsoleLogger" value="ENABLED" /> <set-property name="log_GWTLogger"
value="ENABLED" /> <set-property name="log_SystemLogger" value="ENABLED" value="ENABLED" /> <set-property name="log_SystemLogger" value="ENABLED"
/> --> /> -->
@ -57,7 +56,8 @@
<set-property name="log_ConsoleLogger" value="DISABLED" /> <set-property name="log_ConsoleLogger" value="DISABLED" />
<set-property name="log_GWTLogger" value="DISABLED" /> <set-property name="log_GWTLogger" value="DISABLED" />
<set-property name="log_SystemLogger" value="DISABLED" /> <set-property name="log_SystemLogger" value="DISABLED" />
<!-- Specify the paths for translatable code --> <!-- Specify the paths for translatable code -->
<source path='client' /> <source path='client' />

View File

@ -430,8 +430,7 @@ public class AccountingManagerController {
AccountingClientStateData accountingStateData = accountingState.getState(accountingType); AccountingClientStateData accountingStateData = accountingState.getState(accountingType);
SeriesRequest seriesRequest = null; SeriesRequest seriesRequest = null;
Context defaultContext=availableContext;
switch (accountingType) { switch (accountingType) {
case JOB: case JOB:
case PORTLET: case PORTLET:
@ -440,8 +439,9 @@ public class AccountingManagerController {
case TASK: case TASK:
seriesRequest = new SeriesRequest( seriesRequest = new SeriesRequest(
new AccountingPeriod(dtf.format(lastMonth), dtf.format(date), AccountingPeriodMode.DAILY), new AccountingPeriod(dtf.format(lastMonth), dtf.format(date), AccountingPeriodMode.DAILY),
new AccountingFilterBasic(defaultContext)); new AccountingFilterBasic());
Log.debug("DefaultSeriesRequest: " + seriesRequest); Log.debug("DefaultSeriesRequest: " + seriesRequest);
break; break;
case SPACE: case SPACE:
accountingStateData.setAvailableSpaces(spaces); accountingStateData.setAvailableSpaces(spaces);

File diff suppressed because it is too large Load Diff

View File

@ -92,7 +92,7 @@ public class FiltersPanel extends FramedPanel {
AccountingFilterDefinition accountingFilterDefinition = activeFiltersPanel AccountingFilterDefinition accountingFilterDefinition = activeFiltersPanel
.getActiveFilters(); .getActiveFilters();
if (accountingPeriod != null && accountingFilterDefinition!=null) { if (accountingPeriod != null) {
SeriesRequest seriesRequest = new SeriesRequest(accountingPeriod, SeriesRequest seriesRequest = new SeriesRequest(accountingPeriod,
accountingFilterDefinition); accountingFilterDefinition);
Log.debug("UpdateChart: " + seriesRequest); Log.debug("UpdateChart: " + seriesRequest);

View File

@ -1,6 +1,7 @@
package org.gcube.portlets.admin.accountingmanager.client.maindata.charts; package org.gcube.portlets.admin.accountingmanager.client.maindata.charts;
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.job.JobChartBasicPanel; import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.job.JobChartBasicPanel;
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.job.JobChartContextPanel;
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.job.JobChartTopPanel; import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.job.JobChartTopPanel;
import org.gcube.portlets.admin.accountingmanager.client.state.AccountingClientStateData; import org.gcube.portlets.admin.accountingmanager.client.state.AccountingClientStateData;
import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesJob; import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesJob;
@ -12,7 +13,7 @@ import com.sencha.gxt.widget.core.client.container.SimpleContainer;
/** /**
* Accounting Chart 4 Job * Accounting Chart 4 Job
* *
* @author Giancarlo Panichi * @author Giancarlo Panichi
* *
* *
*/ */
@ -21,7 +22,8 @@ public class AccountingChart4Job extends AccountingChartBuilder {
private AccountingClientStateData accountingStateData; private AccountingClientStateData accountingStateData;
private EventBus eventBus; private EventBus eventBus;
public AccountingChart4Job(EventBus eventBus, AccountingClientStateData accountingStateData) { public AccountingChart4Job(EventBus eventBus,
AccountingClientStateData accountingStateData) {
this.eventBus = eventBus; this.eventBus = eventBus;
this.accountingStateData = accountingStateData; this.accountingStateData = accountingStateData;
} }
@ -30,8 +32,10 @@ public class AccountingChart4Job extends AccountingChartBuilder {
public void buildChart() throws ChartDrawException { public void buildChart() throws ChartDrawException {
AccountingChartPanel accountingChartPanel = null; AccountingChartPanel accountingChartPanel = null;
if (accountingStateData == null || accountingStateData.getAccountingType() == null if (accountingStateData == null
|| accountingStateData.getSeriesRequest() == null || accountingStateData.getSeriesResponse() == null) { || accountingStateData.getAccountingType() == null
|| accountingStateData.getSeriesRequest() == null
|| accountingStateData.getSeriesResponse() == null) {
accountingChartSpec.setChart(accountingChartPanel); accountingChartSpec.setChart(accountingChartPanel);
return; return;
} }
@ -51,18 +55,25 @@ public class AccountingChart4Job extends AccountingChartBuilder {
private SimpleContainer createJobChartPanel() throws ChartDrawException { private SimpleContainer createJobChartPanel() throws ChartDrawException {
if (accountingStateData == null || accountingStateData.getSeriesRequest() == null if (accountingStateData == null
|| accountingStateData.getSeriesRequest().getAccountingFilterDefinition() == null || accountingStateData.getSeriesRequest() == null
|| accountingStateData.getSeriesRequest().getAccountingFilterDefinition().getChartType() == null) { || accountingStateData.getSeriesRequest()
.getAccountingFilterDefinition() == null
|| accountingStateData.getSeriesRequest()
.getAccountingFilterDefinition().getChartType() == null) {
return null; return null;
} }
switch (accountingStateData.getSeriesRequest().getAccountingFilterDefinition().getChartType()) { switch (accountingStateData.getSeriesRequest()
.getAccountingFilterDefinition().getChartType()) {
case Top: case Top:
return new JobChartTopPanel(eventBus, accountingStateData); return new JobChartTopPanel(eventBus, accountingStateData);
case Basic: case Basic:
return new JobChartBasicPanel(eventBus, accountingStateData); return new JobChartBasicPanel(eventBus, accountingStateData);
case Context:
return new JobChartContextPanel(eventBus, accountingStateData);
default: default:
return null; return null;
} }

View File

@ -1,6 +1,7 @@
package org.gcube.portlets.admin.accountingmanager.client.maindata.charts; package org.gcube.portlets.admin.accountingmanager.client.maindata.charts;
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.service.ServiceChartBasicPanel; import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.service.ServiceChartBasicPanel;
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.service.ServiceChartContextPanel;
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.service.ServiceChartTopPanel; import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.service.ServiceChartTopPanel;
import org.gcube.portlets.admin.accountingmanager.client.state.AccountingClientStateData; import org.gcube.portlets.admin.accountingmanager.client.state.AccountingClientStateData;
import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesService; import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesService;
@ -12,16 +13,17 @@ import com.sencha.gxt.widget.core.client.container.SimpleContainer;
/** /**
* Accounting Chart 4 Service * Accounting Chart 4 Service
* *
* @author Giancarlo Panichi * @author Giancarlo Panichi
* *
* *
*/ */
public class AccountingChart4Service extends AccountingChartBuilder { public class AccountingChart4Service extends AccountingChartBuilder {
private EventBus eventBus; private EventBus eventBus;
private AccountingClientStateData accountingStateData; private AccountingClientStateData accountingStateData;
public AccountingChart4Service(EventBus eventBus, AccountingClientStateData accountingStateData) { public AccountingChart4Service(EventBus eventBus, AccountingClientStateData accountingStateData) {
this.eventBus = eventBus; this.eventBus=eventBus;
this.accountingStateData = accountingStateData; this.accountingStateData = accountingStateData;
} }
@ -29,8 +31,10 @@ public class AccountingChart4Service extends AccountingChartBuilder {
public void buildChart() throws ChartDrawException { public void buildChart() throws ChartDrawException {
AccountingChartPanel accountingChartPanel = null; AccountingChartPanel accountingChartPanel = null;
if (accountingStateData == null || accountingStateData.getAccountingType() == null if (accountingStateData == null
|| accountingStateData.getSeriesRequest() == null || accountingStateData.getSeriesResponse() == null) { || accountingStateData.getAccountingType() == null
|| accountingStateData.getSeriesRequest() == null
|| accountingStateData.getSeriesResponse() == null) {
accountingChartSpec.setChart(accountingChartPanel); accountingChartSpec.setChart(accountingChartPanel);
return; return;
} }
@ -48,20 +52,28 @@ public class AccountingChart4Service extends AccountingChartBuilder {
} }
private SimpleContainer createServiceChartPanel() throws ChartDrawException { private SimpleContainer createServiceChartPanel()
throws ChartDrawException {
if (accountingStateData == null || accountingStateData.getSeriesRequest() == null if (accountingStateData == null
|| accountingStateData.getSeriesRequest().getAccountingFilterDefinition() == null || accountingStateData.getSeriesRequest() == null
|| accountingStateData.getSeriesRequest().getAccountingFilterDefinition().getChartType() == null) { || accountingStateData.getSeriesRequest()
.getAccountingFilterDefinition() == null
|| accountingStateData.getSeriesRequest()
.getAccountingFilterDefinition().getChartType() == null) {
return null; return null;
} }
switch (accountingStateData.getSeriesRequest().getAccountingFilterDefinition().getChartType()) { switch (accountingStateData.getSeriesRequest()
.getAccountingFilterDefinition().getChartType()) {
case Top: case Top:
return new ServiceChartTopPanel(eventBus, accountingStateData); return new ServiceChartTopPanel(eventBus,accountingStateData);
case Basic: case Basic:
return new ServiceChartBasicPanel(eventBus, accountingStateData); return new ServiceChartBasicPanel(eventBus, accountingStateData);
case Context:
return new ServiceChartContextPanel(eventBus, accountingStateData);
default: default:
return null; return null;

View File

@ -1,6 +1,7 @@
package org.gcube.portlets.admin.accountingmanager.client.maindata.charts; package org.gcube.portlets.admin.accountingmanager.client.maindata.charts;
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.storage.StorageChartBasicPanel; import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.storage.StorageChartBasicPanel;
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.storage.StorageChartContextPanel;
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.storage.StorageChartTopPanel; import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.storage.StorageChartTopPanel;
import org.gcube.portlets.admin.accountingmanager.client.state.AccountingClientStateData; import org.gcube.portlets.admin.accountingmanager.client.state.AccountingClientStateData;
import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesStorage; import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesStorage;
@ -12,7 +13,7 @@ import com.sencha.gxt.widget.core.client.container.SimpleContainer;
/** /**
* Accounting Chart 4 Storage * Accounting Chart 4 Storage
* *
* @author Giancarlo Panichi * @author Giancarlo Panichi
* *
* *
*/ */
@ -20,7 +21,8 @@ public class AccountingChart4Storage extends AccountingChartBuilder {
private EventBus eventBus; private EventBus eventBus;
private AccountingClientStateData accountingStateData; private AccountingClientStateData accountingStateData;
public AccountingChart4Storage(EventBus eventBus, AccountingClientStateData accountingStateData) { public AccountingChart4Storage(EventBus eventBus,
AccountingClientStateData accountingStateData) {
this.eventBus = eventBus; this.eventBus = eventBus;
this.accountingStateData = accountingStateData; this.accountingStateData = accountingStateData;
} }
@ -29,8 +31,10 @@ public class AccountingChart4Storage extends AccountingChartBuilder {
public void buildChart() throws ChartDrawException { public void buildChart() throws ChartDrawException {
AccountingChartPanel accountingChartPanel = null; AccountingChartPanel accountingChartPanel = null;
if (accountingStateData == null || accountingStateData.getAccountingType() == null if (accountingStateData == null
|| accountingStateData.getSeriesRequest() == null || accountingStateData.getSeriesResponse() == null) { || accountingStateData.getAccountingType() == null
|| accountingStateData.getSeriesRequest() == null
|| accountingStateData.getSeriesResponse() == null) {
accountingChartSpec.setChart(accountingChartPanel); accountingChartSpec.setChart(accountingChartPanel);
return; return;
} }
@ -50,18 +54,25 @@ public class AccountingChart4Storage extends AccountingChartBuilder {
private SimpleContainer createStorageChartPanel() throws ChartDrawException { private SimpleContainer createStorageChartPanel() throws ChartDrawException {
if (accountingStateData == null || accountingStateData.getSeriesRequest() == null if (accountingStateData == null
|| accountingStateData.getSeriesRequest().getAccountingFilterDefinition() == null || accountingStateData.getSeriesRequest() == null
|| accountingStateData.getSeriesRequest().getAccountingFilterDefinition().getChartType() == null) { || accountingStateData.getSeriesRequest()
.getAccountingFilterDefinition() == null
|| accountingStateData.getSeriesRequest()
.getAccountingFilterDefinition().getChartType() == null) {
return null; return null;
} }
switch (accountingStateData.getSeriesRequest().getAccountingFilterDefinition().getChartType()) { switch (accountingStateData.getSeriesRequest()
.getAccountingFilterDefinition().getChartType()) {
case Top: case Top:
return new StorageChartTopPanel(eventBus, accountingStateData); return new StorageChartTopPanel(eventBus, accountingStateData);
case Basic: case Basic:
return new StorageChartBasicPanel(eventBus, accountingStateData); return new StorageChartBasicPanel(eventBus, accountingStateData);
case Context:
return new StorageChartContextPanel(eventBus, accountingStateData);
default: default:
return null; return null;

View File

@ -6,7 +6,6 @@ import java.util.Date;
import org.gcube.portlets.admin.accountingmanager.client.event.ExportRequestEvent; import org.gcube.portlets.admin.accountingmanager.client.event.ExportRequestEvent;
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.ChartDateTimeData; import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.ChartDateTimeData;
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.ChartTimeMeasure; import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.ChartTimeMeasure;
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.ColorsPalette;
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.DownloadConstants; import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.DownloadConstants;
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.JobChartMeasure; import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.JobChartMeasure;
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.TimeUnitMeasure; import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.TimeUnitMeasure;
@ -58,7 +57,8 @@ public class JobChartTopPanel extends SimpleContainer {
private static final String TIME_UNIT = "Time Unit"; private static final String TIME_UNIT = "Time Unit";
// private static final String MEASURE_TYPE = "Measure"; // 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 EventBus eventBus;
private AccountingClientStateData accountingStateData; private AccountingClientStateData accountingStateData;
@ -96,7 +96,8 @@ public class JobChartTopPanel extends SimpleContainer {
private VerticalLayoutContainer vert; private VerticalLayoutContainer vert;
public JobChartTopPanel(EventBus eventBus, AccountingClientStateData accountingStateData) { public JobChartTopPanel(EventBus eventBus,
AccountingClientStateData accountingStateData) {
this.eventBus = eventBus; this.eventBus = eventBus;
this.accountingStateData = accountingStateData; this.accountingStateData = accountingStateData;
forceLayoutOnResize = true; forceLayoutOnResize = true;
@ -108,7 +109,8 @@ public class JobChartTopPanel extends SimpleContainer {
ToolBar toolBar = new ToolBar(); ToolBar toolBar = new ToolBar();
toolBar.setSpacing(2); toolBar.setSpacing(2);
// Download // Download
final TextButton downloadButton = new TextButton(DownloadConstants.DOWNLOAD, final TextButton downloadButton = new TextButton(
DownloadConstants.DOWNLOAD,
AccountingManagerResources.INSTANCE.accountingDownload24()); AccountingManagerResources.INSTANCE.accountingDownload24());
// downloadButton.setScale(ButtonScale.MEDIUM); // downloadButton.setScale(ButtonScale.MEDIUM);
downloadButton.setIconAlign(IconAlign.RIGHT); downloadButton.setIconAlign(IconAlign.RIGHT);
@ -123,7 +125,8 @@ public class JobChartTopPanel extends SimpleContainer {
measureButton.setMenu(createMeasureMenu()); measureButton.setMenu(createMeasureMenu());
// Unit // Unit
unitButton = new TextButton(TIME_UNIT, AccountingManagerResources.INSTANCE.accountingUnitms24()); unitButton = new TextButton(TIME_UNIT,
AccountingManagerResources.INSTANCE.accountingUnitms24());
unitButton.setIconAlign(IconAlign.RIGHT); unitButton.setIconAlign(IconAlign.RIGHT);
unitButton.setArrowAlign(ButtonArrowAlign.RIGHT); unitButton.setArrowAlign(ButtonArrowAlign.RIGHT);
unitButton.setMenu(createUnitMenu()); unitButton.setMenu(createUnitMenu());
@ -142,7 +145,8 @@ public class JobChartTopPanel extends SimpleContainer {
// //
vert = new VerticalLayoutContainer(); vert = new VerticalLayoutContainer();
vert.add(toolBar, new VerticalLayoutData(1, -1, new Margins(0))); 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)); add(vert, new MarginData(0));
@ -261,11 +265,14 @@ public class JobChartTopPanel extends SimpleContainer {
// TODO // TODO
durationItem = new MenuItem(JobChartMeasure.Duration.getLabel()); durationItem = new MenuItem(JobChartMeasure.Duration.getLabel());
durationItem.setHeight(30); durationItem.setHeight(30);
operationCountItem = new MenuItem(JobChartMeasure.OperationCount.getLabel()); operationCountItem = new MenuItem(
JobChartMeasure.OperationCount.getLabel());
operationCountItem.setHeight(30); operationCountItem.setHeight(30);
maxInvocationTimeItem = new MenuItem(JobChartMeasure.MaxInvocationTime.getLabel()); maxInvocationTimeItem = new MenuItem(
JobChartMeasure.MaxInvocationTime.getLabel());
maxInvocationTimeItem.setHeight(30); maxInvocationTimeItem.setHeight(30);
minInvocationTimeItem = new MenuItem(JobChartMeasure.MinInvocationTime.getLabel()); minInvocationTimeItem = new MenuItem(
JobChartMeasure.MinInvocationTime.getLabel());
minInvocationTimeItem.setHeight(30); minInvocationTimeItem.setHeight(30);
durationItem.addSelectionHandler(new SelectionHandler<Item>() { durationItem.addSelectionHandler(new SelectionHandler<Item>() {
@ -294,7 +301,8 @@ public class JobChartTopPanel extends SimpleContainer {
@Override @Override
public void onSelection(SelectionEvent<Item> event) { public void onSelection(SelectionEvent<Item> event) {
measureButton.setText(JobChartMeasure.MaxInvocationTime.getLabel()); measureButton.setText(JobChartMeasure.MaxInvocationTime
.getLabel());
measure = JobChartMeasure.MaxInvocationTime; measure = JobChartMeasure.MaxInvocationTime;
unitButton.setVisible(true); unitButton.setVisible(true);
updateChart(); updateChart();
@ -305,7 +313,8 @@ public class JobChartTopPanel extends SimpleContainer {
@Override @Override
public void onSelection(SelectionEvent<Item> event) { public void onSelection(SelectionEvent<Item> event) {
measureButton.setText(JobChartMeasure.MinInvocationTime.getLabel()); measureButton.setText(JobChartMeasure.MinInvocationTime
.getLabel());
measure = JobChartMeasure.MinInvocationTime; measure = JobChartMeasure.MinInvocationTime;
unitButton.setVisible(true); unitButton.setVisible(true);
updateChart(); updateChart();
@ -323,13 +332,17 @@ public class JobChartTopPanel extends SimpleContainer {
private Menu createUnitMenu() { private Menu createUnitMenu() {
Menu menuUnit = new Menu(); Menu menuUnit = new Menu();
msItem = new MenuItem(TimeUnitMeasure.MILLISECONDS, AccountingManagerResources.INSTANCE.accountingUnitms24()); msItem = new MenuItem(TimeUnitMeasure.MILLISECONDS,
AccountingManagerResources.INSTANCE.accountingUnitms24());
msItem.setHeight(30); msItem.setHeight(30);
sItem = new MenuItem(TimeUnitMeasure.SECONDS, AccountingManagerResources.INSTANCE.accountingUnits24()); sItem = new MenuItem(TimeUnitMeasure.SECONDS,
AccountingManagerResources.INSTANCE.accountingUnits24());
sItem.setHeight(30); sItem.setHeight(30);
mItem = new MenuItem(TimeUnitMeasure.MINUTES, AccountingManagerResources.INSTANCE.accountingUnitm24()); mItem = new MenuItem(TimeUnitMeasure.MINUTES,
AccountingManagerResources.INSTANCE.accountingUnitm24());
mItem.setHeight(30); mItem.setHeight(30);
hItem = new MenuItem(TimeUnitMeasure.HOURS, AccountingManagerResources.INSTANCE.accountingUnith24()); hItem = new MenuItem(TimeUnitMeasure.HOURS,
AccountingManagerResources.INSTANCE.accountingUnith24());
hItem.setHeight(30); hItem.setHeight(30);
msItem.addSelectionHandler(new SelectionHandler<Item>() { msItem.addSelectionHandler(new SelectionHandler<Item>() {
@ -338,7 +351,8 @@ public class JobChartTopPanel extends SimpleContainer {
public void onSelection(SelectionEvent<Item> event) { public void onSelection(SelectionEvent<Item> event) {
unitMeasure = TimeUnitMeasure.getMilliseconds(); unitMeasure = TimeUnitMeasure.getMilliseconds();
unitMeasureLabel = TimeUnitMeasure.MS; unitMeasureLabel = TimeUnitMeasure.MS;
unitButton.setIcon(AccountingManagerResources.INSTANCE.accountingUnitms24()); unitButton.setIcon(AccountingManagerResources.INSTANCE
.accountingUnitms24());
updateChart(); updateChart();
} }
}); });
@ -349,7 +363,8 @@ public class JobChartTopPanel extends SimpleContainer {
public void onSelection(SelectionEvent<Item> event) { public void onSelection(SelectionEvent<Item> event) {
unitMeasure = TimeUnitMeasure.getSeconds(); unitMeasure = TimeUnitMeasure.getSeconds();
unitMeasureLabel = TimeUnitMeasure.S; unitMeasureLabel = TimeUnitMeasure.S;
unitButton.setIcon(AccountingManagerResources.INSTANCE.accountingUnits24()); unitButton.setIcon(AccountingManagerResources.INSTANCE
.accountingUnits24());
updateChart(); updateChart();
} }
}); });
@ -360,7 +375,8 @@ public class JobChartTopPanel extends SimpleContainer {
public void onSelection(SelectionEvent<Item> event) { public void onSelection(SelectionEvent<Item> event) {
unitMeasure = TimeUnitMeasure.getMinutes(); unitMeasure = TimeUnitMeasure.getMinutes();
unitMeasureLabel = TimeUnitMeasure.M; unitMeasureLabel = TimeUnitMeasure.M;
unitButton.setIcon(AccountingManagerResources.INSTANCE.accountingUnitm24()); unitButton.setIcon(AccountingManagerResources.INSTANCE
.accountingUnitm24());
updateChart(); updateChart();
} }
}); });
@ -371,7 +387,8 @@ public class JobChartTopPanel extends SimpleContainer {
public void onSelection(SelectionEvent<Item> event) { public void onSelection(SelectionEvent<Item> event) {
unitMeasure = TimeUnitMeasure.getHours(); unitMeasure = TimeUnitMeasure.getHours();
unitMeasureLabel = TimeUnitMeasure.H; unitMeasureLabel = TimeUnitMeasure.H;
unitButton.setIcon(AccountingManagerResources.INSTANCE.accountingUnith24()); unitButton.setIcon(AccountingManagerResources.INSTANCE
.accountingUnith24());
updateChart(); updateChart();
} }
}); });
@ -385,17 +402,20 @@ public class JobChartTopPanel extends SimpleContainer {
} }
private void onDownloadCSV() { private void onDownloadCSV() {
ExportRequestEvent event = new ExportRequestEvent(ExportType.CSV, accountingStateData.getAccountingType()); ExportRequestEvent event = new ExportRequestEvent(ExportType.CSV,
accountingStateData.getAccountingType());
eventBus.fireEvent(event); eventBus.fireEvent(event);
} }
private void onDownloadXML() { private void onDownloadXML() {
ExportRequestEvent event = new ExportRequestEvent(ExportType.XML, accountingStateData.getAccountingType()); ExportRequestEvent event = new ExportRequestEvent(ExportType.XML,
accountingStateData.getAccountingType());
eventBus.fireEvent(event); eventBus.fireEvent(event);
} }
private void onDownloadJSON() { private void onDownloadJSON() {
ExportRequestEvent event = new ExportRequestEvent(ExportType.JSON, accountingStateData.getAccountingType()); ExportRequestEvent event = new ExportRequestEvent(ExportType.JSON,
accountingStateData.getAccountingType());
eventBus.fireEvent(event); eventBus.fireEvent(event);
} }
@ -452,13 +472,15 @@ public class JobChartTopPanel extends SimpleContainer {
}-*/; }-*/;
private void createChart() { private void createChart() {
SeriesJob seriesJob = (SeriesJob) accountingStateData.getSeriesResponse(); SeriesJob seriesJob = (SeriesJob) accountingStateData
.getSeriesResponse();
if (!(seriesJob.getSeriesJobDefinition() instanceof SeriesJobTop)) { if (!(seriesJob.getSeriesJobDefinition() instanceof SeriesJobTop)) {
Log.debug("Invalid SeriesJobTop!"); Log.debug("Invalid SeriesJobTop!");
return; return;
} }
SeriesJobTop seriesJobTop = (SeriesJobTop) seriesJob.getSeriesJobDefinition(); SeriesJobTop seriesJobTop = (SeriesJobTop) seriesJob
.getSeriesJobDefinition();
HighchartsOptionFactory highchartsFactory = new JsoHighchartsOptionFactory(); HighchartsOptionFactory highchartsFactory = new JsoHighchartsOptionFactory();
@ -469,28 +491,32 @@ public class JobChartTopPanel extends SimpleContainer {
options.title().text("Accounting Job Top"); 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");
* );
*/ */
ColorsPalette colorsPalette=new ColorsPalette();
ArrayString colors = options.colors(); ArrayString colors = options.colors();
colors=colorsPalette.getColorsPalette(colors);
options.colors(colors);
// colors.setValue(0, "#cc0038"); // colors.setValue(0, "#cc0038");
// colors.setValue(1, "#32cd32"); // colors.setValue(1, "#32cd32");
// yAxis // yAxis
options.setFieldAsJsonObject("yAxis", retrieveYAxis(colors)); options.setFieldAsJsonObject("yAxis", retrieveYAxis(colors));
options.plotOptions().setFieldAsJsonObject("column", options.plotOptions().setFieldAsJsonObject(
"{ " + "\"stacking\": \"normal\"," + "\"dataLabels\": { " + " \"enabled\": \"true\"," "column",
"{ " + "\"stacking\": \"normal\"," + "\"dataLabels\": { "
+ " \"enabled\": \"true\","
+ " \"color\": \"white\", " + " \"style\": {" + " \"color\": \"white\", " + " \"style\": {"
+ " \"textShadow\": \"0 0 3px black\"" + " }" + " }" + " }"); + " \"textShadow\": \"0 0 3px black\"" + " }"
+ " }" + " }");
ArrayList<SeriesColumn> seriesColumn = new ArrayList<>(); ArrayList<SeriesColumn> seriesColumn = new ArrayList<>();
createSeriesColumnSimple(seriesJobTop, highchartsFactory, colors, seriesColumn); if (seriesJobTop.getShowOthers()) {
createSeriesColumnShowOthers(seriesJobTop, highchartsFactory,
colors, seriesColumn);
} else {
createSeriesColumnSimple(seriesJobTop, highchartsFactory, colors,
seriesColumn);
}
for (SeriesColumn serie : seriesColumn) { for (SeriesColumn serie : seriesColumn) {
options.series().addToEnd(serie); options.series().addToEnd(serie);
@ -502,28 +528,35 @@ public class JobChartTopPanel extends SimpleContainer {
return; return;
} }
private void createSeriesColumnShowOthers(SeriesJobTop seriesJobTop, HighchartsOptionFactory highchartsFactory, private void createSeriesColumnShowOthers(SeriesJobTop seriesJobTop,
ArrayString colors, ArrayList<SeriesColumn> seriesColumn) { HighchartsOptionFactory highchartsFactory, ArrayString colors,
ArrayList<SeriesColumn> seriesColumn) {
Log.debug("Series ShowOthers"); Log.debug("Series ShowOthers");
if (accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod() if (accountingStateData.getSeriesRequest().getAccountingPeriod()
.compareTo(AccountingPeriodMode.DAILY) == 0 .getPeriod().compareTo(AccountingPeriodMode.DAILY) == 0
|| accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod() || accountingStateData.getSeriesRequest().getAccountingPeriod()
.compareTo(AccountingPeriodMode.HOURLY) == 0 .getPeriod().compareTo(AccountingPeriodMode.HOURLY) == 0
|| accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod() || accountingStateData.getSeriesRequest().getAccountingPeriod()
.compareTo(AccountingPeriodMode.MINUTELY) == 0) { .getPeriod().compareTo(AccountingPeriodMode.MINUTELY) == 0) {
double minRange = ChartTimeMeasure double minRange = ChartTimeMeasure
.calculateMinRange(accountingStateData.getSeriesRequest().getAccountingPeriod()); .calculateMinRange(accountingStateData.getSeriesRequest()
.getAccountingPeriod());
double interval = ChartTimeMeasure 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: " Log.debug("BuildChart DateStart: "
+ DateTimeFormat.getFormat(PredefinedFormat.DATE_TIME_FULL).format(dateStart)); + DateTimeFormat.getFormat(PredefinedFormat.DATE_TIME_FULL)
.format(dateStart));
// xAxis // xAxis
options.xAxis().type("datetime"); options.xAxis().type("datetime");
@ -531,25 +564,31 @@ public class JobChartTopPanel extends SimpleContainer {
options.tooltip().xDateFormat("Selected Data"); options.tooltip().xDateFormat("Selected Data");
int i = 0; int i = 0;
for (; i < seriesJobTop.getSeriesJobDataTopList().size() && i < seriesJobTop.getTopNumber(); i++) { for (; i < seriesJobTop.getSeriesJobDataTopList().size()
SeriesColumn seriesColumnData = highchartsFactory.createSeriesColumn(); && 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.color(colors.get(i));
seriesColumnData.type("column"); seriesColumnData.type("column");
ArrayNumber data = seriesColumnData.dataAsArrayNumber(); ArrayNumber data = seriesColumnData.dataAsArrayNumber();
for (SeriesJobData seriesJobData : seriesJobTop.getSeriesJobDataTopList().get(i).getSeries()) { for (SeriesJobData seriesJobData : seriesJobTop
.getSeriesJobDataTopList().get(i).getSeries()) {
switch (measure) { switch (measure) {
case Duration: case Duration:
data.push(seriesJobData.getDuration() / unitMeasure); data.push(seriesJobData.getDuration() / unitMeasure);
break; break;
case MaxInvocationTime: case MaxInvocationTime:
data.push(seriesJobData.getMaxInvocationTime() / unitMeasure); data.push(seriesJobData.getMaxInvocationTime()
/ unitMeasure);
break; break;
case MinInvocationTime: case MinInvocationTime:
data.push(seriesJobData.getMinInvocationTime() / unitMeasure); data.push(seriesJobData.getMinInvocationTime()
/ unitMeasure);
break; break;
case OperationCount: case OperationCount:
data.push(seriesJobData.getOperationCount()); data.push(seriesJobData.getOperationCount());
@ -562,61 +601,77 @@ public class JobChartTopPanel extends SimpleContainer {
} }
seriesColumnData.pointInterval(interval).pointStart(dateStart.getTime()); seriesColumnData.pointInterval(interval).pointStart(
dateStart.getTime());
seriesColumn.add(seriesColumnData); seriesColumn.add(seriesColumnData);
} }
if (i < seriesJobTop.getSeriesJobDataTopList().size()) { if (i < seriesJobTop.getSeriesJobDataTopList().size()) {
SeriesColumn seriesColumnData = highchartsFactory.createSeriesColumn(); SeriesColumn seriesColumnData = highchartsFactory
.createSeriesColumn();
seriesColumnData.name("Others"); seriesColumnData.name("Others");
seriesColumnData.color(colors.get(i)); seriesColumnData.color(colors.get(i));
seriesColumnData.type("column"); seriesColumnData.type("column");
ArrayList<Long> othersData = new ArrayList<>(); 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; Long value;
for (int k = 0; k < seriesJobTop.getSeriesJobDataTopList().get(j).getSeries().size(); k++) { for (int k = 0; k < seriesJobTop.getSeriesJobDataTopList()
SeriesJobData seriesJobData = seriesJobTop.getSeriesJobDataTopList().get(j).getSeries().get(k); .get(j).getSeries().size(); k++) {
SeriesJobData seriesJobData = seriesJobTop
.getSeriesJobDataTopList().get(j).getSeries()
.get(k);
if (j == i) { if (j == i) {
switch (measure) { switch (measure) {
case Duration: case Duration:
othersData.add(seriesJobData.getDuration() / unitMeasure); othersData.add(seriesJobData.getDuration()
/ unitMeasure);
break; break;
case MaxInvocationTime: case MaxInvocationTime:
othersData.add(seriesJobData.getMaxInvocationTime() / unitMeasure); othersData.add(seriesJobData
.getMaxInvocationTime() / unitMeasure);
break; break;
case MinInvocationTime: case MinInvocationTime:
othersData.add(seriesJobData.getMinInvocationTime() / unitMeasure); othersData.add(seriesJobData
.getMinInvocationTime() / unitMeasure);
break; break;
case OperationCount: case OperationCount:
othersData.add(seriesJobData.getOperationCount()); othersData.add(seriesJobData
.getOperationCount());
break; break;
default: default:
othersData.add(seriesJobData.getDuration() / unitMeasure); othersData.add(seriesJobData.getDuration()
/ unitMeasure);
break; break;
} }
} else { } else {
switch (measure) { switch (measure) {
case Duration: case Duration:
value = (seriesJobData.getDuration() / unitMeasure) + othersData.get(k); value = (seriesJobData.getDuration() / unitMeasure)
+ othersData.get(k);
othersData.set(k, value); othersData.set(k, value);
break; break;
case MaxInvocationTime: case MaxInvocationTime:
value = (seriesJobData.getMaxInvocationTime() / unitMeasure) + othersData.get(k); value = (seriesJobData.getMaxInvocationTime() / unitMeasure)
+ othersData.get(k);
othersData.set(k, value); othersData.set(k, value);
break; break;
case MinInvocationTime: case MinInvocationTime:
value = (seriesJobData.getMinInvocationTime() / unitMeasure) + othersData.get(k); value = (seriesJobData.getMinInvocationTime() / unitMeasure)
+ othersData.get(k);
othersData.set(k, value); othersData.set(k, value);
break; break;
case OperationCount: case OperationCount:
value = seriesJobData.getOperationCount() + othersData.get(k); value = seriesJobData.getOperationCount()
+ othersData.get(k);
othersData.set(k, value); othersData.set(k, value);
break; break;
default: default:
value = (seriesJobData.getDuration() / unitMeasure) + othersData.get(k); value = (seriesJobData.getDuration() / unitMeasure)
+ othersData.get(k);
othersData.set(k, value); othersData.set(k, value);
break; break;
@ -633,7 +688,8 @@ public class JobChartTopPanel extends SimpleContainer {
data.push(value); data.push(value);
} }
seriesColumnData.pointInterval(interval).pointStart(dateStart.getTime()); seriesColumnData.pointInterval(interval).pointStart(
dateStart.getTime());
seriesColumn.add(seriesColumnData); seriesColumn.add(seriesColumnData);
} }
@ -641,15 +697,16 @@ public class JobChartTopPanel extends SimpleContainer {
// xAxis // xAxis
options.xAxis().type("datetime"); options.xAxis().type("datetime");
if (accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod() if (accountingStateData.getSeriesRequest().getAccountingPeriod()
.compareTo(AccountingPeriodMode.MONTHLY) == 0) { .getPeriod().compareTo(AccountingPeriodMode.MONTHLY) == 0) {
// options.tooltip().xDateFormat("%b, %Y"); //options.tooltip().xDateFormat("%b, %Y");
options.tooltip().xDateFormat("Selected Data"); options.tooltip().xDateFormat("Selected Data");
} else { } else {
if (accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod() if (accountingStateData.getSeriesRequest()
.getAccountingPeriod().getPeriod()
.compareTo(AccountingPeriodMode.YEARLY) == 0) { .compareTo(AccountingPeriodMode.YEARLY) == 0) {
// options.tooltip().xDateFormat("%Y"); //options.tooltip().xDateFormat("%Y");
options.tooltip().xDateFormat("Selected Data"); options.tooltip().xDateFormat("Selected Data");
} else { } else {
@ -659,16 +716,20 @@ public class JobChartTopPanel extends SimpleContainer {
} }
int i = 0; int i = 0;
for (; i < seriesJobTop.getSeriesJobDataTopList().size() && i < seriesJobTop.getTopNumber(); i++) { for (; i < seriesJobTop.getSeriesJobDataTopList().size()
SeriesColumn seriesColumnData = highchartsFactory.createSeriesColumn(); && 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.color(colors.get(i));
seriesColumnData.type("column"); seriesColumnData.type("column");
Array<Data> arrayData = seriesColumnData.dataAsArrayObject(); 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(); long dateFrom1970 = seriesJobData.getDate().getTime();
Log.debug("SeriersJobData: " + seriesJobData.getDate()); Log.debug("SeriersJobData: " + seriesJobData.getDate());
@ -684,12 +745,14 @@ public class JobChartTopPanel extends SimpleContainer {
break; break;
case MaxInvocationTime: case MaxInvocationTime:
data.x(dateFrom1970); data.x(dateFrom1970);
data.y(seriesJobData.getMaxInvocationTime() / unitMeasure); data.y(seriesJobData.getMaxInvocationTime()
/ unitMeasure);
arrayData.addToEnd(data); arrayData.addToEnd(data);
break; break;
case MinInvocationTime: case MinInvocationTime:
data.x(dateFrom1970); data.x(dateFrom1970);
data.y(seriesJobData.getMinInvocationTime() / unitMeasure); data.y(seriesJobData.getMinInvocationTime()
/ unitMeasure);
arrayData.addToEnd(data); arrayData.addToEnd(data);
break; break;
case OperationCount: case OperationCount:
@ -712,72 +775,94 @@ public class JobChartTopPanel extends SimpleContainer {
} }
if (i < seriesJobTop.getSeriesJobDataTopList().size()) { if (i < seriesJobTop.getSeriesJobDataTopList().size()) {
SeriesColumn seriesColumnData = highchartsFactory.createSeriesColumn(); SeriesColumn seriesColumnData = highchartsFactory
.createSeriesColumn();
seriesColumnData.name("Others"); seriesColumnData.name("Others");
seriesColumnData.color(colors.get(i)); seriesColumnData.color(colors.get(i));
seriesColumnData.type("column"); seriesColumnData.type("column");
ArrayList<ChartDateTimeData> othersData = new ArrayList<>(); 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; ChartDateTimeData chartDateTimeData;
for (int k = 0; k < seriesJobTop.getSeriesJobDataTopList().get(j).getSeries().size(); k++) { for (int k = 0; k < seriesJobTop.getSeriesJobDataTopList()
SeriesJobData seriesJobData = seriesJobTop.getSeriesJobDataTopList().get(j).getSeries().get(k); .get(j).getSeries().size(); k++) {
SeriesJobData seriesJobData = seriesJobTop
.getSeriesJobDataTopList().get(j).getSeries()
.get(k);
if (j == i) { if (j == i) {
switch (measure) { switch (measure) {
case Duration: case Duration:
chartDateTimeData = new ChartDateTimeData(seriesJobData.getDate(), chartDateTimeData = new ChartDateTimeData(
seriesJobData.getDuration() / unitMeasure); seriesJobData.getDate(),
seriesJobData.getDuration()
/ unitMeasure);
othersData.add(chartDateTimeData); othersData.add(chartDateTimeData);
break; break;
case MaxInvocationTime: case MaxInvocationTime:
chartDateTimeData = new ChartDateTimeData(seriesJobData.getDate(), chartDateTimeData = new ChartDateTimeData(
seriesJobData.getMaxInvocationTime() / unitMeasure); seriesJobData.getDate(),
seriesJobData.getMaxInvocationTime()
/ unitMeasure);
othersData.add(chartDateTimeData); othersData.add(chartDateTimeData);
break; break;
case MinInvocationTime: case MinInvocationTime:
chartDateTimeData = new ChartDateTimeData(seriesJobData.getDate(), chartDateTimeData = new ChartDateTimeData(
seriesJobData.getMinInvocationTime() / unitMeasure); seriesJobData.getDate(),
seriesJobData.getMinInvocationTime()
/ unitMeasure);
othersData.add(chartDateTimeData); othersData.add(chartDateTimeData);
break; break;
case OperationCount: case OperationCount:
chartDateTimeData = new ChartDateTimeData(seriesJobData.getDate(), chartDateTimeData = new ChartDateTimeData(
seriesJobData.getDate(),
seriesJobData.getOperationCount()); seriesJobData.getOperationCount());
othersData.add(chartDateTimeData); othersData.add(chartDateTimeData);
break; break;
default: default:
chartDateTimeData = new ChartDateTimeData(seriesJobData.getDate(), chartDateTimeData = new ChartDateTimeData(
seriesJobData.getDuration() / unitMeasure); seriesJobData.getDate(),
seriesJobData.getDuration()
/ unitMeasure);
othersData.add(chartDateTimeData); othersData.add(chartDateTimeData);
break; break;
} }
} else { } else {
switch (measure) { switch (measure) {
case Duration: case Duration:
chartDateTimeData = new ChartDateTimeData(seriesJobData.getDate(), chartDateTimeData = new ChartDateTimeData(
(seriesJobData.getDuration() / unitMeasure) + othersData.get(k).getValue()); seriesJobData.getDate(),
(seriesJobData.getDuration() / unitMeasure)
+ othersData.get(k).getValue());
othersData.set(k, chartDateTimeData); othersData.set(k, chartDateTimeData);
break; break;
case MaxInvocationTime: case MaxInvocationTime:
chartDateTimeData = new ChartDateTimeData(seriesJobData.getDate(), chartDateTimeData = new ChartDateTimeData(
seriesJobData.getDate(),
(seriesJobData.getMaxInvocationTime() / unitMeasure) (seriesJobData.getMaxInvocationTime() / unitMeasure)
+ othersData.get(k).getValue()); + othersData.get(k).getValue());
othersData.set(k, chartDateTimeData); othersData.set(k, chartDateTimeData);
break; break;
case MinInvocationTime: case MinInvocationTime:
chartDateTimeData = new ChartDateTimeData(seriesJobData.getDate(), chartDateTimeData = new ChartDateTimeData(
seriesJobData.getDate(),
(seriesJobData.getMinInvocationTime() / unitMeasure) (seriesJobData.getMinInvocationTime() / unitMeasure)
+ othersData.get(k).getValue()); + othersData.get(k).getValue());
othersData.set(k, chartDateTimeData); othersData.set(k, chartDateTimeData);
break; break;
case OperationCount: case OperationCount:
chartDateTimeData = new ChartDateTimeData(seriesJobData.getDate(), chartDateTimeData = new ChartDateTimeData(
seriesJobData.getOperationCount() + othersData.get(k).getValue()); seriesJobData.getDate(),
seriesJobData.getOperationCount()
+ othersData.get(k).getValue());
othersData.set(k, chartDateTimeData); othersData.set(k, chartDateTimeData);
break; break;
default: default:
chartDateTimeData = new ChartDateTimeData(seriesJobData.getDate(), chartDateTimeData = new ChartDateTimeData(
(seriesJobData.getDuration() / unitMeasure) + othersData.get(k).getValue()); seriesJobData.getDate(),
(seriesJobData.getDuration() / unitMeasure)
+ othersData.get(k).getValue());
othersData.set(k, chartDateTimeData); othersData.set(k, chartDateTimeData);
break; break;
@ -793,7 +878,8 @@ public class JobChartTopPanel extends SimpleContainer {
for (ChartDateTimeData chartDateTimeData : othersData) { for (ChartDateTimeData chartDateTimeData : othersData) {
long dateFrom1970 = chartDateTimeData.getDate().getTime(); long dateFrom1970 = chartDateTimeData.getDate().getTime();
Log.debug("SeriersOthersData: " + chartDateTimeData.getDate()); Log.debug("SeriersOthersData: "
+ chartDateTimeData.getDate());
Log.debug("SeriersOthersData: " + dateFrom1970); Log.debug("SeriersOthersData: " + dateFrom1970);
Data data = highchartsFactory.createSeriesColumnData(); Data data = highchartsFactory.createSeriesColumnData();
@ -810,53 +896,65 @@ public class JobChartTopPanel extends SimpleContainer {
} }
} }
private void createSeriesColumnSimple(SeriesJobTop seriesJobTop, HighchartsOptionFactory highchartsFactory, private void createSeriesColumnSimple(SeriesJobTop seriesJobTop,
ArrayString colors, ArrayList<SeriesColumn> seriesColumn) { HighchartsOptionFactory highchartsFactory, ArrayString colors,
ArrayList<SeriesColumn> seriesColumn) {
Log.debug("Series Simple"); Log.debug("Series Simple");
if (accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod() if (accountingStateData.getSeriesRequest().getAccountingPeriod()
.compareTo(AccountingPeriodMode.DAILY) == 0 .getPeriod().compareTo(AccountingPeriodMode.DAILY) == 0
|| accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod() || accountingStateData.getSeriesRequest().getAccountingPeriod()
.compareTo(AccountingPeriodMode.HOURLY) == 0 .getPeriod().compareTo(AccountingPeriodMode.HOURLY) == 0
|| accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod() || accountingStateData.getSeriesRequest().getAccountingPeriod()
.compareTo(AccountingPeriodMode.MINUTELY) == 0) { .getPeriod().compareTo(AccountingPeriodMode.MINUTELY) == 0) {
double minRange = ChartTimeMeasure double minRange = ChartTimeMeasure
.calculateMinRange(accountingStateData.getSeriesRequest().getAccountingPeriod()); .calculateMinRange(accountingStateData.getSeriesRequest()
.getAccountingPeriod());
double interval = ChartTimeMeasure 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: " Log.debug("BuildChart DateStart: "
+ DateTimeFormat.getFormat(PredefinedFormat.DATE_TIME_FULL).format(dateStart)); + DateTimeFormat.getFormat(PredefinedFormat.DATE_TIME_FULL)
.format(dateStart));
// xAxis // xAxis
options.xAxis().type("datetime"); options.xAxis().type("datetime");
options.xAxis().minRange(minRange); options.xAxis().minRange(minRange);
options.tooltip().xDateFormat("Selected Data"); options.tooltip().xDateFormat("Selected Data");
for (int i = 0; i < seriesJobTop.getSeriesJobDataTopList().size(); i++) { 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.color(colors.get(i));
seriesColumnData.type("column"); seriesColumnData.type("column");
ArrayNumber data = seriesColumnData.dataAsArrayNumber(); ArrayNumber data = seriesColumnData.dataAsArrayNumber();
for (SeriesJobData seriesJobData : seriesJobTop.getSeriesJobDataTopList().get(i).getSeries()) { for (SeriesJobData seriesJobData : seriesJobTop
.getSeriesJobDataTopList().get(i).getSeries()) {
switch (measure) { switch (measure) {
case Duration: case Duration:
data.push(seriesJobData.getDuration() / unitMeasure); data.push(seriesJobData.getDuration() / unitMeasure);
break; break;
case MaxInvocationTime: case MaxInvocationTime:
data.push(seriesJobData.getMaxInvocationTime() / unitMeasure); data.push(seriesJobData.getMaxInvocationTime()
/ unitMeasure);
break; break;
case MinInvocationTime: case MinInvocationTime:
data.push(seriesJobData.getMinInvocationTime() / unitMeasure); data.push(seriesJobData.getMinInvocationTime()
/ unitMeasure);
break; break;
case OperationCount: case OperationCount:
data.push(seriesJobData.getOperationCount()); data.push(seriesJobData.getOperationCount());
@ -869,7 +967,8 @@ public class JobChartTopPanel extends SimpleContainer {
} }
seriesColumnData.pointInterval(interval).pointStart(dateStart.getTime()); seriesColumnData.pointInterval(interval).pointStart(
dateStart.getTime());
seriesColumn.add(seriesColumnData); seriesColumn.add(seriesColumnData);
} }
@ -877,15 +976,16 @@ public class JobChartTopPanel extends SimpleContainer {
// xAxis // xAxis
options.xAxis().type("datetime"); options.xAxis().type("datetime");
if (accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod() if (accountingStateData.getSeriesRequest().getAccountingPeriod()
.compareTo(AccountingPeriodMode.MONTHLY) == 0) { .getPeriod().compareTo(AccountingPeriodMode.MONTHLY) == 0) {
// options.tooltip().xDateFormat("%b, %Y"); //options.tooltip().xDateFormat("%b, %Y");
options.tooltip().xDateFormat("Selected Data"); options.tooltip().xDateFormat("Selected Data");
} else { } else {
if (accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod() if (accountingStateData.getSeriesRequest()
.getAccountingPeriod().getPeriod()
.compareTo(AccountingPeriodMode.YEARLY) == 0) { .compareTo(AccountingPeriodMode.YEARLY) == 0) {
// options.tooltip().xDateFormat("%Y"); //options.tooltip().xDateFormat("%Y");
options.tooltip().xDateFormat("Selected Data"); options.tooltip().xDateFormat("Selected Data");
} else { } else {
@ -895,15 +995,18 @@ public class JobChartTopPanel extends SimpleContainer {
} }
for (int i = 0; i < seriesJobTop.getSeriesJobDataTopList().size(); i++) { 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.color(colors.get(i));
seriesColumnData.type("column"); seriesColumnData.type("column");
Array<Data> arrayData = seriesColumnData.dataAsArrayObject(); 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(); long dateFrom1970 = seriesJobData.getDate().getTime();
Log.debug("SeriersJobData: " + seriesJobData.getDate()); Log.debug("SeriersJobData: " + seriesJobData.getDate());
@ -919,12 +1022,14 @@ public class JobChartTopPanel extends SimpleContainer {
break; break;
case MaxInvocationTime: case MaxInvocationTime:
data.x(dateFrom1970); data.x(dateFrom1970);
data.y(seriesJobData.getMaxInvocationTime() / unitMeasure); data.y(seriesJobData.getMaxInvocationTime()
/ unitMeasure);
arrayData.addToEnd(data); arrayData.addToEnd(data);
break; break;
case MinInvocationTime: case MinInvocationTime:
data.x(dateFrom1970); data.x(dateFrom1970);
data.y(seriesJobData.getMinInvocationTime() / unitMeasure); data.y(seriesJobData.getMinInvocationTime()
/ unitMeasure);
arrayData.addToEnd(data); arrayData.addToEnd(data);
break; break;
case OperationCount: case OperationCount:
@ -952,45 +1057,68 @@ public class JobChartTopPanel extends SimpleContainer {
private String retrieveYAxis(ArrayString colors) { private String retrieveYAxis(ArrayString colors) {
switch (measure) { switch (measure) {
case Duration: case Duration:
return "[{" + " \"id\": \"" + JobChartMeasure.Duration.name() + "\"," + " \"labels\": {" return "[{" + " \"id\": \"" + JobChartMeasure.Duration.name()
+ " \"format\": \"{value} " + unitMeasureLabel + "\"," + " \"style\": {" + "\"," + " \"labels\": {" + " \"format\": \"{value} "
+ " \"color\": \"#434348\"" + " }" + " }," + " \"stackLabels\": {" + unitMeasureLabel + "\"," + " \"style\": {"
+ " \"enabled\": \"true\"," + " \"style\": {" + " \"fontWeight\": \"bold\"," + " \"color\": \"" + colors.get(1) + "\"" + " }"
+ " \"color\": \"gray\"" + " } " + " }," + " \"title\": { " + " \"text\": \"" + " }," + " \"stackLabels\": {" + " \"enabled\": \"true\","
+ JobChartMeasure.Duration.getLabel() + "\"," + " \"style\": {" + " \"color\": \"#434348\"" + " \"style\": {" + " \"fontWeight\": \"bold\","
+ " }" + " }" + "}]"; + " \"color\": \"gray\"" + " } " + " },"
+ " \"title\": { " + " \"text\": \""
+ JobChartMeasure.Duration.getLabel() + "\","
+ " \"style\": {" + " \"color\": \""
+ colors.get(1) + "\"" + " }" + " }" + "}]";
case MaxInvocationTime: case MaxInvocationTime:
return "[{" + " \"id\": \"" + JobChartMeasure.MaxInvocationTime.name() + "\"," + " \"labels\": {" return "[{" + " \"id\": \""
+ " \"format\": \"{value} " + unitMeasureLabel + "\"," + " \"style\": {" + JobChartMeasure.MaxInvocationTime.name() + "\","
+ " \"color\": \"#434348\"" + " }" + " }," + " \"stackLabels\": {" + " \"labels\": {" + " \"format\": \"{value} "
+ " \"enabled\": \"true\"," + " \"style\": {" + " \"fontWeight\": \"bold\"," + unitMeasureLabel + "\"," + " \"style\": {"
+ " \"color\": \"gray\"" + " } " + " }," + " \"title\": { " + " \"text\": \"" + " \"color\": \"" + colors.get(1) + "\"" + " }"
+ JobChartMeasure.MaxInvocationTime.getLabel() + "\"," + " \"style\": {" + " \"color\": \"#434348\"" + " }," + " \"stackLabels\": {" + " \"enabled\": \"true\","
+ " }" + " }" + "}]"; + " \"style\": {" + " \"fontWeight\": \"bold\","
+ " \"color\": \"gray\"" + " } " + " },"
+ " \"title\": { " + " \"text\": \""
+ JobChartMeasure.MaxInvocationTime.getLabel() + "\","
+ " \"style\": {" + " \"color\": \""
+ colors.get(1) + "\"" + " }" + " }" + "}]";
case MinInvocationTime: case MinInvocationTime:
return "[{" + " \"id\": \"" + JobChartMeasure.MinInvocationTime.name() + "\"," + " \"labels\": {" return "[{" + " \"id\": \""
+ " \"format\": \"{value} " + unitMeasureLabel + "\"," + " \"style\": {" + JobChartMeasure.MinInvocationTime.name() + "\","
+ " \"color\": \"#434348\"" + " }" + " }," + " \"stackLabels\": {" + " \"labels\": {" + " \"format\": \"{value} "
+ " \"enabled\": \"true\"," + " \"style\": {" + " \"fontWeight\": \"bold\"," + unitMeasureLabel + "\"," + " \"style\": {"
+ " \"color\": \"gray\"" + " } " + " }," + " \"title\": { " + " \"text\": \"" + " \"color\": \"" + colors.get(1) + "\"" + " }"
+ JobChartMeasure.MinInvocationTime.getLabel() + "\"," + " \"style\": {" + " \"color\": \"#434348\"" + " }," + " \"stackLabels\": {" + " \"enabled\": \"true\","
+ " }" + " }" + "}]"; + " \"style\": {" + " \"fontWeight\": \"bold\","
+ " \"color\": \"gray\"" + " } " + " },"
+ " \"title\": { " + " \"text\": \""
+ JobChartMeasure.MinInvocationTime.getLabel() + "\","
+ " \"style\": {" + " \"color\": \""
+ colors.get(1) + "\"" + " }" + " }" + "}]";
case OperationCount: case OperationCount:
return "[{" + " \"id\": \"" + JobChartMeasure.OperationCount.name() + "\"," + " \"labels\": { " return "[{" + " \"id\": \"" + JobChartMeasure.OperationCount.name()
+ " \"format\": \"{value}\"," + " \"style\": { " + " \"color\": \"#434348\"" + "\"," + " \"labels\": { "
+ " }" + " }," + " \"stackLabels\": {" + " \"enabled\": \"true\"," + " \"style\": {" + " \"format\": \"{value}\"," + " \"style\": { "
+ " \"fontWeight\": \"bold\"," + " \"color\": \"gray\"" + " } " + " }," + " \"color\": \"" + colors.get(1) + "\"" + " }"
+ " \"title\": { " + " \"text\": \"" + JobChartMeasure.OperationCount.getLabel() + "\"," + " }," + " \"stackLabels\": {" + " \"enabled\": \"true\","
+ " \"style\": {" + " \"color\": \"#434348\"" + " }" + " }" + "}]"; + " \"style\": {" + " \"fontWeight\": \"bold\","
+ " \"color\": \"gray\"" + " } " + " },"
+ " \"title\": { " + " \"text\": \""
+ JobChartMeasure.OperationCount.getLabel() + "\","
+ " \"style\": {" + " \"color\": \""
+ colors.get(1) + "\"" + " }" + " }" + "}]";
default: default:
return "[{" + " \"id\": \"" + JobChartMeasure.Duration.name() + "\"," + " \"labels\": {" return "[{" + " \"id\": \"" + JobChartMeasure.Duration.name()
+ " \"format\": \"{value} " + unitMeasureLabel + "\"," + " \"style\": {" + "\"," + " \"labels\": {" + " \"format\": \"{value} "
+ " \"color\": \"#434348\"" + " }" + " }," + " \"stackLabels\": {" + unitMeasureLabel + "\"," + " \"style\": {"
+ " \"enabled\": \"true\"," + " \"style\": {" + " \"fontWeight\": \"bold\"," + " \"color\": \"" + colors.get(1) + "\"" + " }"
+ " \"color\": \"gray\"" + " } " + " }," + " \"title\": { " + " \"text\": \"" + " }," + " \"stackLabels\": {" + " \"enabled\": \"true\","
+ JobChartMeasure.Duration.getLabel() + "\"," + " \"style\": {" + " \"color\": \"#434348\"" + " \"style\": {" + " \"fontWeight\": \"bold\","
+ " }" + " }" + "}]"; + " \"color\": \"gray\"" + " } " + " },"
+ " \"title\": { " + " \"text\": \""
+ JobChartMeasure.Duration.getLabel() + "\","
+ " \"style\": {" + " \"color\": \""
+ colors.get(1) + "\"" + " }" + " }" + "}]";
} }

View File

@ -7,7 +7,6 @@ import org.gcube.portlets.admin.accountingmanager.client.event.ExportRequestEven
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.ByteUnitMeasure; import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.ByteUnitMeasure;
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.ChartDateTimeData; import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.ChartDateTimeData;
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.ChartTimeMeasure; import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.ChartTimeMeasure;
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.ColorsPalette;
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.DownloadConstants; import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.DownloadConstants;
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.StorageChartMeasure; import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.StorageChartMeasure;
import org.gcube.portlets.admin.accountingmanager.client.resource.AccountingManagerResources; import org.gcube.portlets.admin.accountingmanager.client.resource.AccountingManagerResources;
@ -58,7 +57,8 @@ public class StorageChartTopPanel extends SimpleContainer {
private static final String DATA_VOLUME_UNIT = "Data Volume Unit"; private static final String DATA_VOLUME_UNIT = "Data Volume Unit";
// private static final String MEASURE_TYPE = "Measure"; // 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 EventBus eventBus;
private AccountingClientStateData accountingStateData; private AccountingClientStateData accountingStateData;
@ -94,7 +94,8 @@ public class StorageChartTopPanel extends SimpleContainer {
private VerticalLayoutContainer vert; private VerticalLayoutContainer vert;
public StorageChartTopPanel(EventBus eventBus, AccountingClientStateData accountingStateData) { public StorageChartTopPanel(EventBus eventBus,
AccountingClientStateData accountingStateData) {
this.eventBus = eventBus; this.eventBus = eventBus;
this.accountingStateData = accountingStateData; this.accountingStateData = accountingStateData;
forceLayoutOnResize = true; forceLayoutOnResize = true;
@ -106,7 +107,8 @@ public class StorageChartTopPanel extends SimpleContainer {
ToolBar toolBar = new ToolBar(); ToolBar toolBar = new ToolBar();
toolBar.setSpacing(2); toolBar.setSpacing(2);
// Download // Download
final TextButton downloadButton = new TextButton(DownloadConstants.DOWNLOAD, final TextButton downloadButton = new TextButton(
DownloadConstants.DOWNLOAD,
AccountingManagerResources.INSTANCE.accountingDownload24()); AccountingManagerResources.INSTANCE.accountingDownload24());
// downloadButton.setScale(ButtonScale.MEDIUM); // downloadButton.setScale(ButtonScale.MEDIUM);
downloadButton.setIconAlign(IconAlign.RIGHT); downloadButton.setIconAlign(IconAlign.RIGHT);
@ -114,14 +116,16 @@ public class StorageChartTopPanel extends SimpleContainer {
downloadButton.setMenu(createDownloadMenu()); downloadButton.setMenu(createDownloadMenu());
// Measure // Measure
measureButton = new TextButton(StorageChartMeasure.DataVolume.getLabel(), measureButton = new TextButton(
StorageChartMeasure.DataVolume.getLabel(),
AccountingManagerResources.INSTANCE.accountingByte24()); AccountingManagerResources.INSTANCE.accountingByte24());
measureButton.setIconAlign(IconAlign.RIGHT); measureButton.setIconAlign(IconAlign.RIGHT);
measureButton.setArrowAlign(ButtonArrowAlign.RIGHT); measureButton.setArrowAlign(ButtonArrowAlign.RIGHT);
measureButton.setMenu(createMeasureMenu()); measureButton.setMenu(createMeasureMenu());
// Unit // Unit
unitButton = new TextButton(DATA_VOLUME_UNIT, AccountingManagerResources.INSTANCE.accountingUnitMB24()); unitButton = new TextButton(DATA_VOLUME_UNIT,
AccountingManagerResources.INSTANCE.accountingUnitMB24());
unitButton.setIconAlign(IconAlign.RIGHT); unitButton.setIconAlign(IconAlign.RIGHT);
unitButton.setArrowAlign(ButtonArrowAlign.RIGHT); unitButton.setArrowAlign(ButtonArrowAlign.RIGHT);
unitButton.setMenu(createUnitMenu()); unitButton.setMenu(createUnitMenu());
@ -139,7 +143,8 @@ public class StorageChartTopPanel extends SimpleContainer {
// //
vert = new VerticalLayoutContainer(); vert = new VerticalLayoutContainer();
vert.add(toolBar, new VerticalLayoutData(1, -1, new Margins(0))); 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)); add(vert, new MarginData(0));
@ -268,7 +273,8 @@ public class StorageChartTopPanel extends SimpleContainer {
Menu menuMeasure = new Menu(); Menu menuMeasure = new Menu();
dataVolumeItem = new MenuItem(StorageChartMeasure.DataVolume.getLabel()); dataVolumeItem = new MenuItem(StorageChartMeasure.DataVolume.getLabel());
dataVolumeItem.setHeight(30); dataVolumeItem.setHeight(30);
operationCountItem = new MenuItem(StorageChartMeasure.OperationCount.getLabel()); operationCountItem = new MenuItem(
StorageChartMeasure.OperationCount.getLabel());
operationCountItem.setHeight(30); operationCountItem.setHeight(30);
dataVolumeItem.addSelectionHandler(new SelectionHandler<Item>() { dataVolumeItem.addSelectionHandler(new SelectionHandler<Item>() {
@ -286,7 +292,8 @@ public class StorageChartTopPanel extends SimpleContainer {
@Override @Override
public void onSelection(SelectionEvent<Item> event) { public void onSelection(SelectionEvent<Item> event) {
measureButton.setText(StorageChartMeasure.OperationCount.getLabel()); measureButton.setText(StorageChartMeasure.OperationCount
.getLabel());
measure = StorageChartMeasure.OperationCount; measure = StorageChartMeasure.OperationCount;
unitButton.setVisible(false); unitButton.setVisible(false);
updateChart(); updateChart();
@ -302,13 +309,17 @@ public class StorageChartTopPanel extends SimpleContainer {
private Menu createUnitMenu() { private Menu createUnitMenu() {
Menu menuUnit = new Menu(); Menu menuUnit = new Menu();
kBItem = new MenuItem(ByteUnitMeasure.KILOBYTE, AccountingManagerResources.INSTANCE.accountingUnitkB24()); kBItem = new MenuItem(ByteUnitMeasure.KILOBYTE,
AccountingManagerResources.INSTANCE.accountingUnitkB24());
kBItem.setHeight(30); kBItem.setHeight(30);
MBItem = new MenuItem(ByteUnitMeasure.MEGABYTE, AccountingManagerResources.INSTANCE.accountingUnitMB24()); MBItem = new MenuItem(ByteUnitMeasure.MEGABYTE,
AccountingManagerResources.INSTANCE.accountingUnitMB24());
MBItem.setHeight(30); MBItem.setHeight(30);
GBItem = new MenuItem(ByteUnitMeasure.GIGABYTE, AccountingManagerResources.INSTANCE.accountingUnitGB24()); GBItem = new MenuItem(ByteUnitMeasure.GIGABYTE,
AccountingManagerResources.INSTANCE.accountingUnitGB24());
GBItem.setHeight(30); GBItem.setHeight(30);
TBItem = new MenuItem(ByteUnitMeasure.TERABYTE, AccountingManagerResources.INSTANCE.accountingUnitTB24()); TBItem = new MenuItem(ByteUnitMeasure.TERABYTE,
AccountingManagerResources.INSTANCE.accountingUnitTB24());
TBItem.setHeight(30); TBItem.setHeight(30);
kBItem.addSelectionHandler(new SelectionHandler<Item>() { kBItem.addSelectionHandler(new SelectionHandler<Item>() {
@ -317,7 +328,8 @@ public class StorageChartTopPanel extends SimpleContainer {
public void onSelection(SelectionEvent<Item> event) { public void onSelection(SelectionEvent<Item> event) {
unitMeasure = ByteUnitMeasure.getKiloByteDimForStorage(); unitMeasure = ByteUnitMeasure.getKiloByteDimForStorage();
unitMeasureLabel = ByteUnitMeasure.kB; unitMeasureLabel = ByteUnitMeasure.kB;
unitButton.setIcon(AccountingManagerResources.INSTANCE.accountingUnitkB24()); unitButton.setIcon(AccountingManagerResources.INSTANCE
.accountingUnitkB24());
updateChart(); updateChart();
} }
}); });
@ -328,7 +340,8 @@ public class StorageChartTopPanel extends SimpleContainer {
public void onSelection(SelectionEvent<Item> event) { public void onSelection(SelectionEvent<Item> event) {
unitMeasure = ByteUnitMeasure.getMegaByteDimForStorage(); unitMeasure = ByteUnitMeasure.getMegaByteDimForStorage();
unitMeasureLabel = ByteUnitMeasure.MB; unitMeasureLabel = ByteUnitMeasure.MB;
unitButton.setIcon(AccountingManagerResources.INSTANCE.accountingUnitMB24()); unitButton.setIcon(AccountingManagerResources.INSTANCE
.accountingUnitMB24());
updateChart(); updateChart();
} }
}); });
@ -339,7 +352,8 @@ public class StorageChartTopPanel extends SimpleContainer {
public void onSelection(SelectionEvent<Item> event) { public void onSelection(SelectionEvent<Item> event) {
unitMeasure = ByteUnitMeasure.getGigaByteDimForStorage(); unitMeasure = ByteUnitMeasure.getGigaByteDimForStorage();
unitMeasureLabel = ByteUnitMeasure.GB; unitMeasureLabel = ByteUnitMeasure.GB;
unitButton.setIcon(AccountingManagerResources.INSTANCE.accountingUnitGB24()); unitButton.setIcon(AccountingManagerResources.INSTANCE
.accountingUnitGB24());
updateChart(); updateChart();
} }
}); });
@ -350,7 +364,8 @@ public class StorageChartTopPanel extends SimpleContainer {
public void onSelection(SelectionEvent<Item> event) { public void onSelection(SelectionEvent<Item> event) {
unitMeasure = ByteUnitMeasure.getTeraByteDimForStorage(); unitMeasure = ByteUnitMeasure.getTeraByteDimForStorage();
unitMeasureLabel = ByteUnitMeasure.TB; unitMeasureLabel = ByteUnitMeasure.TB;
unitButton.setIcon(AccountingManagerResources.INSTANCE.accountingUnitTB24()); unitButton.setIcon(AccountingManagerResources.INSTANCE
.accountingUnitTB24());
updateChart(); updateChart();
} }
}); });
@ -364,17 +379,20 @@ public class StorageChartTopPanel extends SimpleContainer {
} }
private void onDownloadCSV() { private void onDownloadCSV() {
ExportRequestEvent event = new ExportRequestEvent(ExportType.CSV, accountingStateData.getAccountingType()); ExportRequestEvent event = new ExportRequestEvent(ExportType.CSV,
accountingStateData.getAccountingType());
eventBus.fireEvent(event); eventBus.fireEvent(event);
} }
private void onDownloadXML() { private void onDownloadXML() {
ExportRequestEvent event = new ExportRequestEvent(ExportType.XML, accountingStateData.getAccountingType()); ExportRequestEvent event = new ExportRequestEvent(ExportType.XML,
accountingStateData.getAccountingType());
eventBus.fireEvent(event); eventBus.fireEvent(event);
} }
private void onDownloadJSON() { private void onDownloadJSON() {
ExportRequestEvent event = new ExportRequestEvent(ExportType.JSON, accountingStateData.getAccountingType()); ExportRequestEvent event = new ExportRequestEvent(ExportType.JSON,
accountingStateData.getAccountingType());
eventBus.fireEvent(event); eventBus.fireEvent(event);
} }
@ -431,13 +449,15 @@ public class StorageChartTopPanel extends SimpleContainer {
}-*/; }-*/;
private void createChart() { private void createChart() {
SeriesStorage seriesStorage = (SeriesStorage) accountingStateData.getSeriesResponse(); SeriesStorage seriesStorage = (SeriesStorage) accountingStateData
.getSeriesResponse();
if (!(seriesStorage.getSeriesStorageDefinition() instanceof SeriesStorageTop)) { if (!(seriesStorage.getSeriesStorageDefinition() instanceof SeriesStorageTop)) {
Log.debug("Invalid SeriesStorageTop!"); Log.debug("Invalid SeriesStorageTop!");
return; return;
} }
SeriesStorageTop seriesStorageTop = (SeriesStorageTop) seriesStorage.getSeriesStorageDefinition(); SeriesStorageTop seriesStorageTop = (SeriesStorageTop) seriesStorage
.getSeriesStorageDefinition();
HighchartsOptionFactory highchartsFactory = new JsoHighchartsOptionFactory(); HighchartsOptionFactory highchartsFactory = new JsoHighchartsOptionFactory();
@ -448,29 +468,32 @@ public class StorageChartTopPanel extends SimpleContainer {
options.title().text("Accounting Storage Top"); 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");
* );
*/ */
ColorsPalette colorsPalette = new ColorsPalette();
ArrayString colors = options.colors(); ArrayString colors = options.colors();
colors = colorsPalette.getColorsPalette(colors);
options.colors(colors);
// colors.setValue(0, "#cc0038"); // colors.setValue(0, "#cc0038");
// colors.setValue(1, "#32cd32"); // colors.setValue(1, "#32cd32");
// yAxis // yAxis
options.setFieldAsJsonObject("yAxis", retrieveYAxis(colors)); options.setFieldAsJsonObject("yAxis", retrieveYAxis(colors));
options.plotOptions().setFieldAsJsonObject("column", options.plotOptions().setFieldAsJsonObject(
"{ " + "\"stacking\": \"normal\"," + "\"dataLabels\": { " + " \"enabled\": \"true\"," "column",
"{ " + "\"stacking\": \"normal\"," + "\"dataLabels\": { "
+ " \"enabled\": \"true\","
+ " \"color\": \"white\", " + " \"style\": {" + " \"color\": \"white\", " + " \"style\": {"
+ " \"textShadow\": \"0 0 3px black\"" + " }" + " }" + " }"); + " \"textShadow\": \"0 0 3px black\"" + " }"
+ " }" + " }");
ArrayList<SeriesColumn> seriesColumn = new ArrayList<>(); ArrayList<SeriesColumn> seriesColumn = new ArrayList<>();
if (seriesStorageTop.getShowOthers()) {
createSeriesColumnSimple(seriesStorageTop, highchartsFactory, colors, seriesColumn); createSeriesColumnShowOthers(seriesStorageTop, highchartsFactory,
colors, seriesColumn);
} else {
createSeriesColumnSimple(seriesStorageTop, highchartsFactory,
colors, seriesColumn);
}
for (SeriesColumn serie : seriesColumn) { for (SeriesColumn serie : seriesColumn) {
options.series().addToEnd(serie); options.series().addToEnd(serie);
@ -482,51 +505,62 @@ public class StorageChartTopPanel extends SimpleContainer {
return; return;
} }
private void createSeriesColumnShowOthers(SeriesStorageTop seriesStorageTop, private void createSeriesColumnShowOthers(
HighchartsOptionFactory highchartsFactory, ArrayString colors, ArrayList<SeriesColumn> seriesColumn) { SeriesStorageTop seriesStorageTop,
HighchartsOptionFactory highchartsFactory, ArrayString colors,
ArrayList<SeriesColumn> seriesColumn) {
Log.debug("Series ShowOthers"); Log.debug("Series ShowOthers");
if (accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod() if (accountingStateData.getSeriesRequest().getAccountingPeriod()
.compareTo(AccountingPeriodMode.DAILY) == 0 .getPeriod().compareTo(AccountingPeriodMode.DAILY) == 0
|| accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod() || accountingStateData.getSeriesRequest().getAccountingPeriod()
.compareTo(AccountingPeriodMode.HOURLY) == 0 .getPeriod().compareTo(AccountingPeriodMode.HOURLY) == 0
|| accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod() || accountingStateData.getSeriesRequest().getAccountingPeriod()
.compareTo(AccountingPeriodMode.MINUTELY) == 0) { .getPeriod().compareTo(AccountingPeriodMode.MINUTELY) == 0) {
double minRange = ChartTimeMeasure double minRange = ChartTimeMeasure
.calculateMinRange(accountingStateData.getSeriesRequest().getAccountingPeriod()); .calculateMinRange(accountingStateData.getSeriesRequest()
.getAccountingPeriod());
double interval = ChartTimeMeasure 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: " Log.debug("BuildChart DateStart: "
+ DateTimeFormat.getFormat(PredefinedFormat.DATE_TIME_FULL).format(dateStart)); + DateTimeFormat.getFormat(PredefinedFormat.DATE_TIME_FULL)
.format(dateStart));
// xAxis // xAxis
options.xAxis().type("datetime"); options.xAxis().type("datetime");
options.xAxis().minRange(minRange); options.xAxis().minRange(minRange);
options.tooltip().xDateFormat("Selected Data"); options.tooltip().xDateFormat("Selected Data");
int i = 0; int i = 0;
for (; i < seriesStorageTop.getSeriesStorageDataTopList().size() for (; i < seriesStorageTop.getSeriesStorageDataTopList().size()
&& i < seriesStorageTop.getTopNumber(); i++) { && i < seriesStorageTop.getTopNumber(); i++) {
SeriesColumn seriesColumnData = highchartsFactory.createSeriesColumn(); SeriesColumn seriesColumnData = highchartsFactory
.createSeriesColumn();
seriesColumnData seriesColumnData.name(seriesStorageTop
.name(seriesStorageTop.getSeriesStorageDataTopList().get(i).getFilterValue().getValue()); .getSeriesStorageDataTopList().get(i).getFilterValue()
.getValue());
seriesColumnData.color(colors.get(i)); seriesColumnData.color(colors.get(i));
seriesColumnData.type("column"); seriesColumnData.type("column");
ArrayNumber data = seriesColumnData.dataAsArrayNumber(); ArrayNumber data = seriesColumnData.dataAsArrayNumber();
for (SeriesStorageData seriesStorageData : seriesStorageTop.getSeriesStorageDataTopList().get(i) for (SeriesStorageData seriesStorageData : seriesStorageTop
.getSeries()) { .getSeriesStorageDataTopList().get(i).getSeries()) {
switch (measure) { switch (measure) {
case DataVolume: case DataVolume:
data.push(seriesStorageData.getDataVolume() / unitMeasure); data.push(seriesStorageData.getDataVolume()
/ unitMeasure);
break; break;
case OperationCount: case OperationCount:
data.push(seriesStorageData.getOperationCount()); data.push(seriesStorageData.getOperationCount());
@ -539,34 +573,43 @@ public class StorageChartTopPanel extends SimpleContainer {
} }
seriesColumnData.pointInterval(interval).pointStart(dateStart.getTime()); seriesColumnData.pointInterval(interval).pointStart(
dateStart.getTime());
seriesColumn.add(seriesColumnData); seriesColumn.add(seriesColumnData);
} }
if (i < seriesStorageTop.getSeriesStorageDataTopList().size()) { if (i < seriesStorageTop.getSeriesStorageDataTopList().size()) {
SeriesColumn seriesColumnData = highchartsFactory.createSeriesColumn(); SeriesColumn seriesColumnData = highchartsFactory
.createSeriesColumn();
seriesColumnData.name("Others"); seriesColumnData.name("Others");
seriesColumnData.color(colors.get(i)); seriesColumnData.color(colors.get(i));
seriesColumnData.type("column"); seriesColumnData.type("column");
ArrayList<Long> othersData = new ArrayList<>(); 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; Long value;
for (int k = 0; k < seriesStorageTop.getSeriesStorageDataTopList().get(j).getSeries().size(); k++) { for (int k = 0; k < seriesStorageTop
SeriesStorageData seriesStorageData = seriesStorageTop.getSeriesStorageDataTopList().get(j) .getSeriesStorageDataTopList().get(j).getSeries()
.size(); k++) {
SeriesStorageData seriesStorageData = seriesStorageTop
.getSeriesStorageDataTopList().get(j)
.getSeries().get(k); .getSeries().get(k);
if (j == i) { if (j == i) {
switch (measure) { switch (measure) {
case DataVolume: case DataVolume:
othersData.add(seriesStorageData.getDataVolume() / unitMeasure); othersData.add(seriesStorageData
.getDataVolume() / unitMeasure);
break; break;
case OperationCount: case OperationCount:
othersData.add(seriesStorageData.getOperationCount()); othersData.add(seriesStorageData
.getOperationCount());
break; break;
default: default:
othersData.add(seriesStorageData.getDataVolume() / unitMeasure); othersData.add(seriesStorageData
.getDataVolume() / unitMeasure);
break; break;
} }
@ -574,15 +617,18 @@ public class StorageChartTopPanel extends SimpleContainer {
switch (measure) { switch (measure) {
case DataVolume: case DataVolume:
value = seriesStorageData.getDataVolume() / unitMeasure + othersData.get(k); value = seriesStorageData.getDataVolume()
/ unitMeasure + othersData.get(k);
othersData.set(k, value); othersData.set(k, value);
break; break;
case OperationCount: case OperationCount:
value = seriesStorageData.getOperationCount() + othersData.get(k); value = seriesStorageData.getOperationCount()
+ othersData.get(k);
othersData.set(k, value); othersData.set(k, value);
break; break;
default: default:
value = seriesStorageData.getDataVolume() / unitMeasure + othersData.get(k); value = seriesStorageData.getDataVolume()
/ unitMeasure + othersData.get(k);
othersData.set(k, value); othersData.set(k, value);
break; break;
@ -598,7 +644,8 @@ public class StorageChartTopPanel extends SimpleContainer {
data.push(value); data.push(value);
} }
seriesColumnData.pointInterval(interval).pointStart(dateStart.getTime()); seriesColumnData.pointInterval(interval).pointStart(
dateStart.getTime());
seriesColumn.add(seriesColumnData); seriesColumn.add(seriesColumnData);
} }
@ -606,15 +653,16 @@ public class StorageChartTopPanel extends SimpleContainer {
// xAxis // xAxis
options.xAxis().type("datetime"); options.xAxis().type("datetime");
if (accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod() if (accountingStateData.getSeriesRequest().getAccountingPeriod()
.compareTo(AccountingPeriodMode.MONTHLY) == 0) { .getPeriod().compareTo(AccountingPeriodMode.MONTHLY) == 0) {
// options.tooltip().xDateFormat("%b, %Y"); //options.tooltip().xDateFormat("%b, %Y");
options.tooltip().xDateFormat("Selected Data"); options.tooltip().xDateFormat("Selected Data");
} else { } else {
if (accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod() if (accountingStateData.getSeriesRequest()
.getAccountingPeriod().getPeriod()
.compareTo(AccountingPeriodMode.YEARLY) == 0) { .compareTo(AccountingPeriodMode.YEARLY) == 0) {
// options.tooltip().xDateFormat("%Y"); //options.tooltip().xDateFormat("%Y");
options.tooltip().xDateFormat("Selected Data"); options.tooltip().xDateFormat("Selected Data");
} else { } else {
@ -626,20 +674,23 @@ public class StorageChartTopPanel extends SimpleContainer {
int i = 0; int i = 0;
for (; i < seriesStorageTop.getSeriesStorageDataTopList().size() for (; i < seriesStorageTop.getSeriesStorageDataTopList().size()
&& i < seriesStorageTop.getTopNumber(); i++) { && i < seriesStorageTop.getTopNumber(); i++) {
SeriesColumn seriesColumnData = highchartsFactory.createSeriesColumn(); SeriesColumn seriesColumnData = highchartsFactory
.createSeriesColumn();
seriesColumnData seriesColumnData.name(seriesStorageTop
.name(seriesStorageTop.getSeriesStorageDataTopList().get(i).getFilterValue().getValue()); .getSeriesStorageDataTopList().get(i).getFilterValue()
.getValue());
seriesColumnData.color(colors.get(i)); seriesColumnData.color(colors.get(i));
seriesColumnData.type("column"); seriesColumnData.type("column");
Array<Data> arrayData = seriesColumnData.dataAsArrayObject(); Array<Data> arrayData = seriesColumnData.dataAsArrayObject();
for (SeriesStorageData seriesStorageData : seriesStorageTop.getSeriesStorageDataTopList().get(i) for (SeriesStorageData seriesStorageData : seriesStorageTop
.getSeries()) { .getSeriesStorageDataTopList().get(i).getSeries()) {
long dateFrom1970 = seriesStorageData.getDate().getTime(); long dateFrom1970 = seriesStorageData.getDate().getTime();
Log.debug("SeriersStorageData: " + seriesStorageData.getDate()); Log.debug("SeriersStorageData: "
+ seriesStorageData.getDate());
Log.debug("SeriersStorageData: " + dateFrom1970); Log.debug("SeriersStorageData: " + dateFrom1970);
Data data = highchartsFactory.createSeriesColumnData(); Data data = highchartsFactory.createSeriesColumnData();
@ -670,51 +721,65 @@ public class StorageChartTopPanel extends SimpleContainer {
} }
if (i < seriesStorageTop.getSeriesStorageDataTopList().size()) { if (i < seriesStorageTop.getSeriesStorageDataTopList().size()) {
SeriesColumn seriesColumnData = highchartsFactory.createSeriesColumn(); SeriesColumn seriesColumnData = highchartsFactory
.createSeriesColumn();
seriesColumnData.name("Others"); seriesColumnData.name("Others");
seriesColumnData.color(colors.get(i)); seriesColumnData.color(colors.get(i));
seriesColumnData.type("column"); seriesColumnData.type("column");
ArrayList<ChartDateTimeData> othersData = new ArrayList<>(); 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; ChartDateTimeData chartDateTimeData;
for (int k = 0; k < seriesStorageTop.getSeriesStorageDataTopList().get(j).getSeries().size(); k++) { for (int k = 0; k < seriesStorageTop
SeriesStorageData seriesStorageData = seriesStorageTop.getSeriesStorageDataTopList().get(j) .getSeriesStorageDataTopList().get(j).getSeries()
.size(); k++) {
SeriesStorageData seriesStorageData = seriesStorageTop
.getSeriesStorageDataTopList().get(j)
.getSeries().get(k); .getSeries().get(k);
if (j == i) { if (j == i) {
switch (measure) { switch (measure) {
case DataVolume: case DataVolume:
chartDateTimeData = new ChartDateTimeData(seriesStorageData.getDate(), chartDateTimeData = new ChartDateTimeData(
seriesStorageData.getDataVolume() / unitMeasure); seriesStorageData.getDate(),
seriesStorageData.getDataVolume()
/ unitMeasure);
othersData.add(chartDateTimeData); othersData.add(chartDateTimeData);
break; break;
case OperationCount: case OperationCount:
chartDateTimeData = new ChartDateTimeData(seriesStorageData.getDate(), chartDateTimeData = new ChartDateTimeData(
seriesStorageData.getDate(),
seriesStorageData.getOperationCount()); seriesStorageData.getOperationCount());
othersData.add(chartDateTimeData); othersData.add(chartDateTimeData);
break; break;
default: default:
chartDateTimeData = new ChartDateTimeData(seriesStorageData.getDate(), chartDateTimeData = new ChartDateTimeData(
seriesStorageData.getDataVolume() / unitMeasure); seriesStorageData.getDate(),
seriesStorageData.getDataVolume()
/ unitMeasure);
othersData.add(chartDateTimeData); othersData.add(chartDateTimeData);
break; break;
} }
} else { } else {
switch (measure) { switch (measure) {
case DataVolume: case DataVolume:
chartDateTimeData = new ChartDateTimeData(seriesStorageData.getDate(), chartDateTimeData = new ChartDateTimeData(
seriesStorageData.getDate(),
(seriesStorageData.getDataVolume() / unitMeasure) (seriesStorageData.getDataVolume() / unitMeasure)
+ othersData.get(k).getValue()); + othersData.get(k).getValue());
othersData.set(k, chartDateTimeData); othersData.set(k, chartDateTimeData);
break; break;
case OperationCount: case OperationCount:
chartDateTimeData = new ChartDateTimeData(seriesStorageData.getDate(), chartDateTimeData = new ChartDateTimeData(
seriesStorageData.getOperationCount() + othersData.get(k).getValue()); seriesStorageData.getDate(),
seriesStorageData.getOperationCount()
+ othersData.get(k).getValue());
othersData.set(k, chartDateTimeData); othersData.set(k, chartDateTimeData);
break; break;
default: default:
chartDateTimeData = new ChartDateTimeData(seriesStorageData.getDate(), chartDateTimeData = new ChartDateTimeData(
seriesStorageData.getDate(),
(seriesStorageData.getDataVolume() / unitMeasure) (seriesStorageData.getDataVolume() / unitMeasure)
+ othersData.get(k).getValue()); + othersData.get(k).getValue());
othersData.set(k, chartDateTimeData); othersData.set(k, chartDateTimeData);
@ -731,7 +796,8 @@ public class StorageChartTopPanel extends SimpleContainer {
for (ChartDateTimeData chartDateTimeData : othersData) { for (ChartDateTimeData chartDateTimeData : othersData) {
long dateFrom1970 = chartDateTimeData.getDate().getTime(); long dateFrom1970 = chartDateTimeData.getDate().getTime();
Log.debug("SeriersOthersData: " + chartDateTimeData.getDate()); Log.debug("SeriersOthersData: "
+ chartDateTimeData.getDate());
Log.debug("SeriersOthersData: " + dateFrom1970); Log.debug("SeriersOthersData: " + dateFrom1970);
Data data = highchartsFactory.createSeriesColumnData(); Data data = highchartsFactory.createSeriesColumnData();
@ -749,50 +815,61 @@ public class StorageChartTopPanel extends SimpleContainer {
} }
private void createSeriesColumnSimple(SeriesStorageTop seriesStorageTop, HighchartsOptionFactory highchartsFactory, private void createSeriesColumnSimple(SeriesStorageTop seriesStorageTop,
ArrayString colors, ArrayList<SeriesColumn> seriesColumn) { HighchartsOptionFactory highchartsFactory, ArrayString colors,
ArrayList<SeriesColumn> seriesColumn) {
Log.debug("Series Simple"); Log.debug("Series Simple");
if (accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod() if (accountingStateData.getSeriesRequest().getAccountingPeriod()
.compareTo(AccountingPeriodMode.DAILY) == 0 .getPeriod().compareTo(AccountingPeriodMode.DAILY) == 0
|| accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod() || accountingStateData.getSeriesRequest().getAccountingPeriod()
.compareTo(AccountingPeriodMode.HOURLY) == 0 .getPeriod().compareTo(AccountingPeriodMode.HOURLY) == 0
|| accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod() || accountingStateData.getSeriesRequest().getAccountingPeriod()
.compareTo(AccountingPeriodMode.MINUTELY) == 0) { .getPeriod().compareTo(AccountingPeriodMode.MINUTELY) == 0) {
double minRange = ChartTimeMeasure double minRange = ChartTimeMeasure
.calculateMinRange(accountingStateData.getSeriesRequest().getAccountingPeriod()); .calculateMinRange(accountingStateData.getSeriesRequest()
.getAccountingPeriod());
double interval = ChartTimeMeasure 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: " Log.debug("BuildChart DateStart: "
+ DateTimeFormat.getFormat(PredefinedFormat.DATE_TIME_FULL).format(dateStart)); + DateTimeFormat.getFormat(PredefinedFormat.DATE_TIME_FULL)
.format(dateStart));
// xAxis // xAxis
options.xAxis().type("datetime"); options.xAxis().type("datetime");
options.xAxis().minRange(minRange); options.xAxis().minRange(minRange);
options.tooltip().xDateFormat("Selected Data"); options.tooltip().xDateFormat("Selected Data");
for (int i = 0; i < seriesStorageTop.getSeriesStorageDataTopList()
.size(); i++) {
SeriesColumn seriesColumnData = highchartsFactory
.createSeriesColumn();
for (int i = 0; i < seriesStorageTop.getSeriesStorageDataTopList().size(); i++) { seriesColumnData.name(seriesStorageTop
SeriesColumn seriesColumnData = highchartsFactory.createSeriesColumn(); .getSeriesStorageDataTopList().get(i).getFilterValue()
.getValue());
seriesColumnData
.name(seriesStorageTop.getSeriesStorageDataTopList().get(i).getFilterValue().getValue());
seriesColumnData.color(colors.get(i)); seriesColumnData.color(colors.get(i));
seriesColumnData.type("column"); seriesColumnData.type("column");
ArrayNumber data = seriesColumnData.dataAsArrayNumber(); ArrayNumber data = seriesColumnData.dataAsArrayNumber();
for (SeriesStorageData seriesStorageData : seriesStorageTop.getSeriesStorageDataTopList().get(i) for (SeriesStorageData seriesStorageData : seriesStorageTop
.getSeries()) { .getSeriesStorageDataTopList().get(i).getSeries()) {
switch (measure) { switch (measure) {
case DataVolume: case DataVolume:
data.push(seriesStorageData.getDataVolume() / unitMeasure); data.push(seriesStorageData.getDataVolume()
/ unitMeasure);
break; break;
case OperationCount: case OperationCount:
data.push(seriesStorageData.getOperationCount()); data.push(seriesStorageData.getOperationCount());
@ -805,7 +882,8 @@ public class StorageChartTopPanel extends SimpleContainer {
} }
seriesColumnData.pointInterval(interval).pointStart(dateStart.getTime()); seriesColumnData.pointInterval(interval).pointStart(
dateStart.getTime());
seriesColumn.add(seriesColumnData); seriesColumn.add(seriesColumnData);
} }
@ -814,15 +892,16 @@ public class StorageChartTopPanel extends SimpleContainer {
// xAxis // xAxis
options.xAxis().type("datetime"); options.xAxis().type("datetime");
if (accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod() if (accountingStateData.getSeriesRequest().getAccountingPeriod()
.compareTo(AccountingPeriodMode.MONTHLY) == 0) { .getPeriod().compareTo(AccountingPeriodMode.MONTHLY) == 0) {
// options.tooltip().xDateFormat("%b, %Y"); //options.tooltip().xDateFormat("%b, %Y");
options.tooltip().xDateFormat("Selected Data"); options.tooltip().xDateFormat("Selected Data");
} else { } else {
if (accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod() if (accountingStateData.getSeriesRequest()
.getAccountingPeriod().getPeriod()
.compareTo(AccountingPeriodMode.YEARLY) == 0) { .compareTo(AccountingPeriodMode.YEARLY) == 0) {
// options.tooltip().xDateFormat("%Y"); //options.tooltip().xDateFormat("%Y");
options.tooltip().xDateFormat("Selected Data"); options.tooltip().xDateFormat("Selected Data");
} else { } else {
@ -831,21 +910,25 @@ public class StorageChartTopPanel extends SimpleContainer {
} }
for (int i = 0; i < seriesStorageTop.getSeriesStorageDataTopList().size(); i++) { for (int i = 0; i < seriesStorageTop.getSeriesStorageDataTopList()
SeriesColumn seriesColumnData = highchartsFactory.createSeriesColumn(); .size(); i++) {
SeriesColumn seriesColumnData = highchartsFactory
.createSeriesColumn();
seriesColumnData seriesColumnData.name(seriesStorageTop
.name(seriesStorageTop.getSeriesStorageDataTopList().get(i).getFilterValue().getValue()); .getSeriesStorageDataTopList().get(i).getFilterValue()
.getValue());
seriesColumnData.color(colors.get(i)); seriesColumnData.color(colors.get(i));
seriesColumnData.type("column"); seriesColumnData.type("column");
Array<Data> arrayData = seriesColumnData.dataAsArrayObject(); Array<Data> arrayData = seriesColumnData.dataAsArrayObject();
for (SeriesStorageData seriesStorageData : seriesStorageTop.getSeriesStorageDataTopList().get(i) for (SeriesStorageData seriesStorageData : seriesStorageTop
.getSeries()) { .getSeriesStorageDataTopList().get(i).getSeries()) {
long dateFrom1970 = seriesStorageData.getDate().getTime(); long dateFrom1970 = seriesStorageData.getDate().getTime();
Log.debug("SeriersStorageData: " + seriesStorageData.getDate()); Log.debug("SeriersStorageData: "
+ seriesStorageData.getDate());
Log.debug("SeriersStorageData: " + dateFrom1970); Log.debug("SeriersStorageData: " + dateFrom1970);
Data data = highchartsFactory.createSeriesColumnData(); Data data = highchartsFactory.createSeriesColumnData();
@ -881,30 +964,44 @@ public class StorageChartTopPanel extends SimpleContainer {
private String retrieveYAxis(ArrayString colors) { private String retrieveYAxis(ArrayString colors) {
switch (measure) { switch (measure) {
case DataVolume: case DataVolume:
return "[{" + " \"id\": \"" + StorageChartMeasure.DataVolume.name() + "\"," + " \"labels\": {" return "[{" + " \"id\": \"" + StorageChartMeasure.DataVolume.name()
+ " \"format\": \"{value} " + unitMeasureLabel + "\"," + " \"style\": {" + "\"," + " \"labels\": {" + " \"format\": \"{value} "
+ " \"color\": \"#434348\"" + " }" + " }," + " \"stackLabels\": {" + unitMeasureLabel + "\"," + " \"style\": {"
+ " \"enabled\": \"true\"," + " \"style\": {" + " \"fontWeight\": \"bold\"," + " \"color\": \"" + colors.get(1) + "\"" + " }"
+ " \"color\": \"gray\"" + " } " + " }," + " \"title\": { " + " \"text\": \"" + " }," + " \"stackLabels\": {" + " \"enabled\": \"true\","
+ StorageChartMeasure.DataVolume.getLabel() + "\"," + " \"style\": {" + " \"style\": {" + " \"fontWeight\": \"bold\","
+ " \"color\": \"#434348\"" + " }" + " }" + "}]"; + " \"color\": \"gray\"" + " } " + " },"
+ " \"title\": { " + " \"text\": \""
+ StorageChartMeasure.DataVolume.getLabel() + "\","
+ " \"style\": {" + " \"color\": \""
+ colors.get(1) + "\"" + " }" + " }" + "}]";
case OperationCount: case OperationCount:
return "[{" + " \"id\": \"" + StorageChartMeasure.OperationCount.name() + "\"," + " \"labels\": { " return "[{" + " \"id\": \""
+ " \"format\": \"{value}\"," + " \"style\": { " + " \"color\": \"#434348\"" + " }" + StorageChartMeasure.OperationCount.name() + "\","
+ " }," + " \"stackLabels\": {" + " \"enabled\": \"true\"," + " \"style\": {" + " \"labels\": { " + " \"format\": \"{value}\","
+ " \"fontWeight\": \"bold\"," + " \"color\": \"gray\"" + " } " + " }," + " \"style\": { " + " \"color\": \""
+ " \"title\": { " + " \"text\": \"" + StorageChartMeasure.OperationCount.getLabel() + "\"," + colors.get(1) + "\"" + " }" + " },"
+ " \"style\": {" + " \"color\": \"#434348\"" + " }" + " }" + "}]"; + " \"stackLabels\": {" + " \"enabled\": \"true\","
+ " \"style\": {" + " \"fontWeight\": \"bold\","
+ " \"color\": \"gray\"" + " } " + " },"
+ " \"title\": { " + " \"text\": \""
+ StorageChartMeasure.OperationCount.getLabel() + "\","
+ " \"style\": {" + " \"color\": \""
+ colors.get(1) + "\"" + " }" + " }" + "}]";
default: default:
return "[{" + " \"id\": \"" + StorageChartMeasure.DataVolume.name() + "\"," + " \"labels\": {" return "[{" + " \"id\": \"" + StorageChartMeasure.DataVolume.name()
+ " \"format\": \"{value} " + unitMeasureLabel + "\"," + " \"style\": {" + "\"," + " \"labels\": {" + " \"format\": \"{value} "
+ " \"color\": \"#434348\"" + " }" + " }," + " \"stackLabels\": {" + unitMeasureLabel + "\"," + " \"style\": {"
+ " \"enabled\": \"true\"," + " \"style\": {" + " \"fontWeight\": \"bold\"," + " \"color\": \"" + colors.get(1) + "\"" + " }"
+ " \"color\": \"gray\"" + " } " + " }," + " \"title\": { " + " \"text\": \"" + " }," + " \"stackLabels\": {" + " \"enabled\": \"true\","
+ StorageChartMeasure.DataVolume.getLabel() + "\"," + " \"style\": {" + " \"style\": {" + " \"fontWeight\": \"bold\","
+ " \"color\": \"#434348\"" + " }" + " }" + "}]"; + " \"color\": \"gray\"" + " } " + " },"
+ " \"title\": { " + " \"text\": \""
+ StorageChartMeasure.DataVolume.getLabel() + "\","
+ " \"style\": {" + " \"color\": \""
+ colors.get(1) + "\"" + " }" + " }" + "}]";
} }

View File

@ -1,35 +0,0 @@
package org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils;
import com.github.highcharts4gwt.model.array.api.ArrayString;
/**
*
* @author Giancarlo Panichi
*
*/
public class ColorsPalette {
private String[] palette = { "#87CEEB", "#DAA520", "#3CB371", "#FF4500", "#8FBC8F", "#FF00FF", "#BDB76B", "#5F9EA0",
"#A0522D", "#6B8E23", "#FFA07A", "#696969", "#DDA0DD", "#C71585", "#1E90FF", "#D2B48C", "#90EE90",
"#B22222", "#00CED1", "#9400D3", "#FFDAB9", "#663399", "#FFE4C4", "#ADFF2F", "#FF0000", "#00FFFF",
"#483D8B", "#FFFF00", "#00008B", "#FFDEAD", "#7CFC00", "#FF6347", "#AFEEEE", "#6A5ACD", "#FFFACD",
"#0000CD", "#F5DEB3", "#00FF00", "#FF7F50", "#7FFFD4", "#7B68EE", "#FFEFD5", "#0000FF", "#DEB887",
"#32CD32", "#FFA500", "#40E0D0", "#9370DB", "#FFE4B5", "#4169E1", "#BC8F8F", "#98FB98", "#8B0000",
"#48D1CC", "#800080", "#EEE8AA", "#00BFFF", "#F4A460", "#00FA9A", "#800000", "#556B2F", "#8A2BE2",
"#F0E68C", "#6495ED", "#B8860B", "#2E8B57", "#FFD700", "#66CDAA", "#9932CC", "#FFC0CB", "#87CEFA",
"#CD853F", "#228B22", "#DC143C", "#20B2AA", "#BA55D3", "#FFB6C1", "#B0E0E6", "#D2691E", "#008000",
"#CD5C5C", "#008B8B", "#FF00FF", "#FF69B4", "#B0C4DE", "#808000", "#006400", "#F08080", "#008080",
"#EE82EE", "#FF1493", "#4682B4", "#8B4513", "#9ACD32", "#FA8072", "#778899", "#DA70D6", "#DB7093" };
public ColorsPalette() {
}
public ArrayString getColorsPalette(ArrayString colors) {
for (int i = 0; i < palette.length; i++) {
colors.setValue(i, palette[i]);
}
colors.setLength(palette.length);
return colors;
}
}

View File

@ -9,7 +9,8 @@ import com.sencha.gxt.data.shared.PropertyAccess;
/** /**
* *
* @author Giancarlo Panichi * @author giancarlo
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
* *
*/ */
public interface AccountingFilterProperties extends public interface AccountingFilterProperties extends

View File

@ -9,10 +9,12 @@ import com.sencha.gxt.data.shared.PropertyAccess;
/** /**
* *
* @author Giancarlo Panichi * @author giancarlo
* * email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/ */
public interface AccountingPeriodModePropertiesCombo extends PropertyAccess<AccountingPeriodMode> { public interface AccountingPeriodModePropertiesCombo extends
PropertyAccess<AccountingPeriodMode> {
@Path("id") @Path("id")
ModelKeyProvider<AccountingPeriodMode> id(); ModelKeyProvider<AccountingPeriodMode> id();

View File

@ -1,6 +1,6 @@
package org.gcube.portlets.admin.accountingmanager.client.properties; package org.gcube.portlets.admin.accountingmanager.client.properties;
import org.gcube.portlets.admin.accountingmanager.shared.data.ContextData; import org.gcube.portlets.admin.accountingmanager.shared.data.GenresData;
import com.google.gwt.editor.client.Editor.Path; import com.google.gwt.editor.client.Editor.Path;
import com.sencha.gxt.core.client.ValueProvider; import com.sencha.gxt.core.client.ValueProvider;
@ -9,14 +9,13 @@ import com.sencha.gxt.data.shared.PropertyAccess;
/** /**
* *
* @author Giancarlo Panichi * @author Giancarlo Panichi
* *
* *
*/ */
public interface ContextDataProperties extends PropertyAccess<ContextData> { public interface GenresDataProperties extends PropertyAccess<GenresData> {
@Path("genre")
ModelKeyProvider<GenresData> id();
@Path("contextData") ValueProvider<GenresData, String> label();
ModelKeyProvider<ContextData> id();
ValueProvider<ContextData, String> label();
} }

View File

@ -0,0 +1,24 @@
package org.gcube.portlets.admin.accountingmanager.client.properties;
import org.gcube.portlets.admin.accountingmanager.shared.data.GenresData;
import com.google.gwt.editor.client.Editor.Path;
import com.sencha.gxt.data.shared.LabelProvider;
import com.sencha.gxt.data.shared.ModelKeyProvider;
import com.sencha.gxt.data.shared.PropertyAccess;
/**
*
* @author giancarlo
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public interface GenresDataPropertiesCombo extends
PropertyAccess<GenresData> {
@Path("genre")
ModelKeyProvider<GenresData> id();
LabelProvider<GenresData> label();
}

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

Before

Width:  |  Height:  |  Size: 952 B

After

Width:  |  Height:  |  Size: 952 B

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 869 B

After

Width:  |  Height:  |  Size: 869 B

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 924 B

After

Width:  |  Height:  |  Size: 924 B

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 847 B

After

Width:  |  Height:  |  Size: 847 B

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 900 B

After

Width:  |  Height:  |  Size: 900 B

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 866 B

After

Width:  |  Height:  |  Size: 866 B

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 943 B

After

Width:  |  Height:  |  Size: 943 B

Some files were not shown because too many files have changed in this diff Show More