Compare commits

..

14 Commits

Author SHA1 Message Date
Giancarlo Panichi c4c4313e31 Update pom.xml
Updated for gCubeRelease 6.0.0
2024-10-16 14:20:24 +02:00
Giancarlo Panichi a727f479c0 Update CHANGELOG.md
Updated for gCubeRelease 6.0.0
2024-10-16 14:19:32 +02:00
Giancarlo Panichi e27701bcff Updated pom 2024-09-24 15:44:32 +02:00
Giancarlo Panichi b45f65d2e3 Updated to maven-portal-bom-4.0.0-SNAPSHOT 2024-09-24 15:42:07 +02:00
Giancarlo Panichi 6cef907cf4 Updated pom for StorageHub 2 2022-05-20 16:35:26 +02:00
Giancarlo Panichi df73990175 Updated pom for StorageHub 2 2022-05-20 16:33:54 +02:00
Giancarlo Panichi 0650a1ed5e Updated Version for Next Release 2021-11-30 14:43:43 +01:00
Giancarlo Panichi 109e04f8e8 Merge pull request 'feature/21354' (!3) from feature/21354 into master
Reviewed-on: #3
2021-11-30 14:36:40 +01:00
Giancarlo Panichi 4ab9e3ea97 Refs #21354: Improve accounting manager portlet by new persistence
Upddated context column name
2021-11-26 17:42:47 +01:00
Giancarlo Panichi 8e68cdcf4b Refs #21354: Improve accounting manager portlet by new persistence
Upddated colors palette for Top chart
2021-11-26 12:32:54 +01:00
Giancarlo Panichi ec06f615d7 Refs #21354: Improve accounting manager portlet by new persistence
Updated Top
2021-11-25 16:53:23 +01:00
Giancarlo Panichi ac4c236019 Refs #21354: Improve accounting manager portlet by new persistence
Updated portlet behavior
2021-11-23 19:21:22 +01:00
Giancarlo Panichi 3ffb9f8523 Refs #21354: Improve accounting manager portlet by new persistence
Updated portlet behavior
2021-11-22 18:09:50 +01:00
Giancarlo Panichi a36fef1aa9 Refs #21354: Improve accounting manager portlet by new persistence
Updated portlet behavior
2021-11-22 18:09:02 +01:00
417 changed files with 1722 additions and 7254 deletions

6
.classpath Normal file → Executable 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.13.0/WEB-INF/classes" path="src/main/java"> <classpathentry kind="src" output="target/accounting-manager-1.16.0-SNAPSHOT/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.13.0/WEB-INF/classes" path="src/main/resources"> <classpathentry excluding="**" kind="src" output="target/accounting-manager-1.16.0-SNAPSHOT/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.13.0/WEB-INF/classes"/> <classpathentry kind="output" path="target/accounting-manager-1.16.0-SNAPSHOT/WEB-INF/classes"/>
</classpath> </classpath>

0
.gitignore vendored Normal file → Executable file
View File

0
.project Normal file → Executable file
View File

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

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

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

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

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

2
.settings/org.eclipse.wst.common.component Normal file → Executable 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.13.0"> <wb-module deploy-name="accounting-manager-1.16.0-SNAPSHOT">
<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 Normal file → Executable file
View File

58
CHANGELOG.md Normal file → Executable file
View File

@ -3,139 +3,101 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
# Changelog for "accounting-manager" # Changelog for "accounting-manager"
## [v1.14.0] - 2021-06-28 ## [v1.16.0]
### Fixes - Updated to maven-portal-bom 4.0.0
## [v1.15.0] - 2021-11-30
- Improve query support of the new persistence [#21354]
## [v1.14.0] - 2021-06-28
- Fixed display errors generated in Root scope [#21729] - Fixed display errors generated in Root scope [#21729]
## [v1.13.0] - 2021-03-23 ## [v1.13.0] - 2021-03-23
### Features
- Migrate accounting-manager to postgresql persistence [#21013] - Migrate accounting-manager to postgresql persistence [#21013]
## [v1.12.0] - 2019-05-02 ## [v1.12.0] - 2019-05-02
### Features
- Added autocomplete combo scope and fixed scope list view width - Added autocomplete combo scope and fixed scope list view width
## [v1.11.0] - 2018-12-28 ## [v1.11.0] - 2018-12-28
### Features
- Added scope selection [#10188] - Added scope selection [#10188]
## [v1.10.0] - 2018-10-01 ## [v1.10.0] - 2018-10-01
### Features
- Updated to StorageHub [#12474] - Updated to StorageHub [#12474]
## [v1.9.1] - 2018-04-11 ## [v1.9.1] - 2018-04-11
### Features
- Updated log level to debug [#11259] - Updated log level to debug [#11259]
## [v1.9.0] - 2017-11-20 ## [v1.9.0] - 2017-11-20
### Features
- Updated to support Operation Count as default in all charts - Updated to support Operation Count as default in all charts
## [v1.8.0] - 2017-10-01 ## [v1.8.0] - 2017-10-01
### Features
- Updated to new version of accounting client library - Updated to new version of accounting client library
## [v1.7.0] - 2017-06-12 ## [v1.7.0] - 2017-06-12
### Features
- Added Spaces chart [#8397] - Added Spaces chart [#8397]
## [v1.6.0] - 2017-02-28 ## [v1.6.0] - 2017-02-28
### Features
- Fixed download in case of multitab on different scopes - Fixed download in case of multitab on different scopes
## [v1.5.0] - 2016-12-01 ## [v1.5.0] - 2016-12-01
### Features
- Added Context Chart - Added Context Chart
- Added Cache - Added Cache
- Updated to PortalContext - Updated to PortalContext
## [v1.4.0] - 2016-10-01 ## [v1.4.0] - 2016-10-01
### Features
- Updated to AUTH2.0 - Updated to AUTH2.0
- Added Job - Added Job
- Added configuration by generic resource - Added configuration by generic resource
## [v1.3.0] - 2016-07-15 ## [v1.3.0] - 2016-07-15
### Features
- Added CSV download [Ticket #4041] - Added CSV download [Ticket #4041]
- Added Show Others option - Added Show Others option
- Updated to Liferay 6.2 - Updated to Liferay 6.2
## [v1.2.0] - 2016-05-01 ## [v1.2.0] - 2016-05-01
### Features
- Added Top N Chart[#2251] - Added Top N Chart[#2251]
- Fixed back button behavior[#3251] - Fixed back button behavior[#3251]
## [v1.1.0] - 2016-01-31 ## [v1.1.0] - 2016-01-31
### Features
- Added to Storage Accounting more formats for DataVolume axis [#1831] - Added to Storage Accounting more formats for DataVolume axis [#1831]
- Fixed on Storage Accounting the popup validation on filters [#1832] - Fixed on Storage Accounting the popup validation on filters [#1832]
- Fixed library dependencies - Fixed library dependencies
## [v1.0.0] - 2015-10-15 ## [v1.0.0] - 2015-10-15
### Features
- First Release - First Release

0
FUNDING.md Normal file → Executable file
View File

0
LICENSE.md Normal file → Executable file
View File

0
README.md Normal file → Executable file
View File

0
accountingman.launch Normal file → Executable file
View File

8
changelog.xml Normal file → Executable file
View File

@ -1,4 +1,12 @@
<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 Normal file → Executable file
View File

30
pom.xml Normal file → Executable file
View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>org.gcube.tools</groupId> <groupId>org.gcube.tools</groupId>
<artifactId>maven-parent</artifactId> <artifactId>maven-parent</artifactId>
<version>1.1.0</version> <version>1.2.0</version>
<relativePath /> <relativePath />
</parent> </parent>
@ -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.14.0</version> <version>1.16.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>
<version>[4.0.0,5.0.0-SNAPSHOT)</version> <scope>provided</scope>
</dependency> </dependency>
</dependencies> </dependencies>
@ -214,12 +214,12 @@
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<!-- Social --> <!-- Social
<dependency> <dependency>
<groupId>org.gcube.portal</groupId> <groupId>org.gcube.portal</groupId>
<artifactId>social-networking-library</artifactId> <artifactId>social-networking-library</artifactId>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency> -->
<!-- Common Encryption --> <!-- Common Encryption -->
<dependency> <dependency>
@ -235,6 +235,13 @@
<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>
@ -246,14 +253,7 @@
<dependency> <dependency>
<groupId>org.gcube.accounting</groupId> <groupId>org.gcube.accounting</groupId>
<artifactId>accounting-analytics</artifactId> <artifactId>accounting-analytics</artifactId>
<version>[3.0.0,4.0.0-SNAPSHOT)</version> <version>[4.0.0-SNAPSHOT,5.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>[1.0.0,2.0.0-SNAPSHOT)</version> <version>[2.0.0-SNAPSHOT,3.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.6.3</version> <version>4.0.0</version>
<type>pom</type> <type>pom</type>
<scope>import</scope> <scope>import</scope>
</dependency> </dependency>

0
profile.xml Normal file → Executable file
View File

View File

@ -46,7 +46,8 @@
<!-- <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"
/> --> /> -->
@ -58,7 +59,6 @@
<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' />
<source path='shared' /> <source path='shared' />

View File

@ -430,6 +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:
@ -439,9 +440,8 @@ 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()); new AccountingFilterBasic(defaultContext));
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) { if (accountingPeriod != null && accountingFilterDefinition!=null) {
SeriesRequest seriesRequest = new SeriesRequest(accountingPeriod, SeriesRequest seriesRequest = new SeriesRequest(accountingPeriod,
accountingFilterDefinition); accountingFilterDefinition);
Log.debug("UpdateChart: " + seriesRequest); Log.debug("UpdateChart: " + seriesRequest);

View File

@ -1,7 +1,6 @@
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;
@ -13,7 +12,7 @@ import com.sencha.gxt.widget.core.client.container.SimpleContainer;
/** /**
* Accounting Chart 4 Job * Accounting Chart 4 Job
* *
* @author Giancarlo Panichi * @author Giancarlo Panichi
* *
* *
*/ */
@ -22,8 +21,7 @@ public class AccountingChart4Job extends AccountingChartBuilder {
private AccountingClientStateData accountingStateData; private AccountingClientStateData accountingStateData;
private EventBus eventBus; private EventBus eventBus;
public AccountingChart4Job(EventBus eventBus, public AccountingChart4Job(EventBus eventBus, AccountingClientStateData accountingStateData) {
AccountingClientStateData accountingStateData) {
this.eventBus = eventBus; this.eventBus = eventBus;
this.accountingStateData = accountingStateData; this.accountingStateData = accountingStateData;
} }
@ -32,10 +30,8 @@ public class AccountingChart4Job extends AccountingChartBuilder {
public void buildChart() throws ChartDrawException { public void buildChart() throws ChartDrawException {
AccountingChartPanel accountingChartPanel = null; AccountingChartPanel accountingChartPanel = null;
if (accountingStateData == null if (accountingStateData == null || accountingStateData.getAccountingType() == null
|| accountingStateData.getAccountingType() == null || accountingStateData.getSeriesRequest() == null || accountingStateData.getSeriesResponse() == null) {
|| accountingStateData.getSeriesRequest() == null
|| accountingStateData.getSeriesResponse() == null) {
accountingChartSpec.setChart(accountingChartPanel); accountingChartSpec.setChart(accountingChartPanel);
return; return;
} }
@ -55,25 +51,18 @@ public class AccountingChart4Job extends AccountingChartBuilder {
private SimpleContainer createJobChartPanel() throws ChartDrawException { private SimpleContainer createJobChartPanel() throws ChartDrawException {
if (accountingStateData == null if (accountingStateData == null || accountingStateData.getSeriesRequest() == null
|| accountingStateData.getSeriesRequest() == null || accountingStateData.getSeriesRequest().getAccountingFilterDefinition() == null
|| accountingStateData.getSeriesRequest() || accountingStateData.getSeriesRequest().getAccountingFilterDefinition().getChartType() == null) {
.getAccountingFilterDefinition() == null
|| accountingStateData.getSeriesRequest()
.getAccountingFilterDefinition().getChartType() == null) {
return null; return null;
} }
switch (accountingStateData.getSeriesRequest() switch (accountingStateData.getSeriesRequest().getAccountingFilterDefinition().getChartType()) {
.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,7 +1,6 @@
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;
@ -13,7 +12,7 @@ import com.sencha.gxt.widget.core.client.container.SimpleContainer;
/** /**
* Accounting Chart 4 Service * Accounting Chart 4 Service
* *
* @author Giancarlo Panichi * @author Giancarlo Panichi
* *
* *
*/ */
@ -21,9 +20,8 @@ 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;
} }
@ -31,10 +29,8 @@ public class AccountingChart4Service extends AccountingChartBuilder {
public void buildChart() throws ChartDrawException { public void buildChart() throws ChartDrawException {
AccountingChartPanel accountingChartPanel = null; AccountingChartPanel accountingChartPanel = null;
if (accountingStateData == null if (accountingStateData == null || accountingStateData.getAccountingType() == null
|| accountingStateData.getAccountingType() == null || accountingStateData.getSeriesRequest() == null || accountingStateData.getSeriesResponse() == null) {
|| accountingStateData.getSeriesRequest() == null
|| accountingStateData.getSeriesResponse() == null) {
accountingChartSpec.setChart(accountingChartPanel); accountingChartSpec.setChart(accountingChartPanel);
return; return;
} }
@ -52,28 +48,20 @@ public class AccountingChart4Service extends AccountingChartBuilder {
} }
private SimpleContainer createServiceChartPanel() private SimpleContainer createServiceChartPanel() throws ChartDrawException {
throws ChartDrawException {
if (accountingStateData == null if (accountingStateData == null || accountingStateData.getSeriesRequest() == null
|| accountingStateData.getSeriesRequest() == null || accountingStateData.getSeriesRequest().getAccountingFilterDefinition() == null
|| accountingStateData.getSeriesRequest() || accountingStateData.getSeriesRequest().getAccountingFilterDefinition().getChartType() == null) {
.getAccountingFilterDefinition() == null
|| accountingStateData.getSeriesRequest()
.getAccountingFilterDefinition().getChartType() == null) {
return null; return null;
} }
switch (accountingStateData.getSeriesRequest() switch (accountingStateData.getSeriesRequest().getAccountingFilterDefinition().getChartType()) {
.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,7 +1,6 @@
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;
@ -13,7 +12,7 @@ import com.sencha.gxt.widget.core.client.container.SimpleContainer;
/** /**
* Accounting Chart 4 Storage * Accounting Chart 4 Storage
* *
* @author Giancarlo Panichi * @author Giancarlo Panichi
* *
* *
*/ */
@ -21,8 +20,7 @@ public class AccountingChart4Storage extends AccountingChartBuilder {
private EventBus eventBus; private EventBus eventBus;
private AccountingClientStateData accountingStateData; private AccountingClientStateData accountingStateData;
public AccountingChart4Storage(EventBus eventBus, public AccountingChart4Storage(EventBus eventBus, AccountingClientStateData accountingStateData) {
AccountingClientStateData accountingStateData) {
this.eventBus = eventBus; this.eventBus = eventBus;
this.accountingStateData = accountingStateData; this.accountingStateData = accountingStateData;
} }
@ -31,10 +29,8 @@ public class AccountingChart4Storage extends AccountingChartBuilder {
public void buildChart() throws ChartDrawException { public void buildChart() throws ChartDrawException {
AccountingChartPanel accountingChartPanel = null; AccountingChartPanel accountingChartPanel = null;
if (accountingStateData == null if (accountingStateData == null || accountingStateData.getAccountingType() == null
|| accountingStateData.getAccountingType() == null || accountingStateData.getSeriesRequest() == null || accountingStateData.getSeriesResponse() == null) {
|| accountingStateData.getSeriesRequest() == null
|| accountingStateData.getSeriesResponse() == null) {
accountingChartSpec.setChart(accountingChartPanel); accountingChartSpec.setChart(accountingChartPanel);
return; return;
} }
@ -54,25 +50,18 @@ public class AccountingChart4Storage extends AccountingChartBuilder {
private SimpleContainer createStorageChartPanel() throws ChartDrawException { private SimpleContainer createStorageChartPanel() throws ChartDrawException {
if (accountingStateData == null if (accountingStateData == null || accountingStateData.getSeriesRequest() == null
|| accountingStateData.getSeriesRequest() == null || accountingStateData.getSeriesRequest().getAccountingFilterDefinition() == null
|| accountingStateData.getSeriesRequest() || accountingStateData.getSeriesRequest().getAccountingFilterDefinition().getChartType() == null) {
.getAccountingFilterDefinition() == null
|| accountingStateData.getSeriesRequest()
.getAccountingFilterDefinition().getChartType() == null) {
return null; return null;
} }
switch (accountingStateData.getSeriesRequest() switch (accountingStateData.getSeriesRequest().getAccountingFilterDefinition().getChartType()) {
.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,6 +6,7 @@ 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;
@ -57,8 +58,7 @@ 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 private DateTimeFormat dtf = DateTimeFormat.getFormat(PredefinedFormat.YEAR_MONTH_DAY);
.getFormat(PredefinedFormat.YEAR_MONTH_DAY);
private EventBus eventBus; private EventBus eventBus;
private AccountingClientStateData accountingStateData; private AccountingClientStateData accountingStateData;
@ -96,8 +96,7 @@ public class JobChartTopPanel extends SimpleContainer {
private VerticalLayoutContainer vert; private VerticalLayoutContainer vert;
public JobChartTopPanel(EventBus eventBus, public JobChartTopPanel(EventBus eventBus, AccountingClientStateData accountingStateData) {
AccountingClientStateData accountingStateData) {
this.eventBus = eventBus; this.eventBus = eventBus;
this.accountingStateData = accountingStateData; this.accountingStateData = accountingStateData;
forceLayoutOnResize = true; forceLayoutOnResize = true;
@ -109,8 +108,7 @@ 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( final TextButton downloadButton = new TextButton(DownloadConstants.DOWNLOAD,
DownloadConstants.DOWNLOAD,
AccountingManagerResources.INSTANCE.accountingDownload24()); AccountingManagerResources.INSTANCE.accountingDownload24());
// downloadButton.setScale(ButtonScale.MEDIUM); // downloadButton.setScale(ButtonScale.MEDIUM);
downloadButton.setIconAlign(IconAlign.RIGHT); downloadButton.setIconAlign(IconAlign.RIGHT);
@ -125,8 +123,7 @@ public class JobChartTopPanel extends SimpleContainer {
measureButton.setMenu(createMeasureMenu()); measureButton.setMenu(createMeasureMenu());
// Unit // Unit
unitButton = new TextButton(TIME_UNIT, unitButton = new TextButton(TIME_UNIT, AccountingManagerResources.INSTANCE.accountingUnitms24());
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());
@ -145,8 +142,7 @@ 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, vert.add(highchartsLayoutPanel, new VerticalLayoutData(1, 1, new Margins(0)));
new Margins(0)));
add(vert, new MarginData(0)); add(vert, new MarginData(0));
@ -265,14 +261,11 @@ 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( operationCountItem = new MenuItem(JobChartMeasure.OperationCount.getLabel());
JobChartMeasure.OperationCount.getLabel());
operationCountItem.setHeight(30); operationCountItem.setHeight(30);
maxInvocationTimeItem = new MenuItem( maxInvocationTimeItem = new MenuItem(JobChartMeasure.MaxInvocationTime.getLabel());
JobChartMeasure.MaxInvocationTime.getLabel());
maxInvocationTimeItem.setHeight(30); maxInvocationTimeItem.setHeight(30);
minInvocationTimeItem = new MenuItem( minInvocationTimeItem = new MenuItem(JobChartMeasure.MinInvocationTime.getLabel());
JobChartMeasure.MinInvocationTime.getLabel());
minInvocationTimeItem.setHeight(30); minInvocationTimeItem.setHeight(30);
durationItem.addSelectionHandler(new SelectionHandler<Item>() { durationItem.addSelectionHandler(new SelectionHandler<Item>() {
@ -301,8 +294,7 @@ public class JobChartTopPanel extends SimpleContainer {
@Override @Override
public void onSelection(SelectionEvent<Item> event) { public void onSelection(SelectionEvent<Item> event) {
measureButton.setText(JobChartMeasure.MaxInvocationTime measureButton.setText(JobChartMeasure.MaxInvocationTime.getLabel());
.getLabel());
measure = JobChartMeasure.MaxInvocationTime; measure = JobChartMeasure.MaxInvocationTime;
unitButton.setVisible(true); unitButton.setVisible(true);
updateChart(); updateChart();
@ -313,8 +305,7 @@ public class JobChartTopPanel extends SimpleContainer {
@Override @Override
public void onSelection(SelectionEvent<Item> event) { public void onSelection(SelectionEvent<Item> event) {
measureButton.setText(JobChartMeasure.MinInvocationTime measureButton.setText(JobChartMeasure.MinInvocationTime.getLabel());
.getLabel());
measure = JobChartMeasure.MinInvocationTime; measure = JobChartMeasure.MinInvocationTime;
unitButton.setVisible(true); unitButton.setVisible(true);
updateChart(); updateChart();
@ -332,17 +323,13 @@ public class JobChartTopPanel extends SimpleContainer {
private Menu createUnitMenu() { private Menu createUnitMenu() {
Menu menuUnit = new Menu(); Menu menuUnit = new Menu();
msItem = new MenuItem(TimeUnitMeasure.MILLISECONDS, msItem = new MenuItem(TimeUnitMeasure.MILLISECONDS, AccountingManagerResources.INSTANCE.accountingUnitms24());
AccountingManagerResources.INSTANCE.accountingUnitms24());
msItem.setHeight(30); msItem.setHeight(30);
sItem = new MenuItem(TimeUnitMeasure.SECONDS, sItem = new MenuItem(TimeUnitMeasure.SECONDS, AccountingManagerResources.INSTANCE.accountingUnits24());
AccountingManagerResources.INSTANCE.accountingUnits24());
sItem.setHeight(30); sItem.setHeight(30);
mItem = new MenuItem(TimeUnitMeasure.MINUTES, mItem = new MenuItem(TimeUnitMeasure.MINUTES, AccountingManagerResources.INSTANCE.accountingUnitm24());
AccountingManagerResources.INSTANCE.accountingUnitm24());
mItem.setHeight(30); mItem.setHeight(30);
hItem = new MenuItem(TimeUnitMeasure.HOURS, hItem = new MenuItem(TimeUnitMeasure.HOURS, AccountingManagerResources.INSTANCE.accountingUnith24());
AccountingManagerResources.INSTANCE.accountingUnith24());
hItem.setHeight(30); hItem.setHeight(30);
msItem.addSelectionHandler(new SelectionHandler<Item>() { msItem.addSelectionHandler(new SelectionHandler<Item>() {
@ -351,8 +338,7 @@ 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 unitButton.setIcon(AccountingManagerResources.INSTANCE.accountingUnitms24());
.accountingUnitms24());
updateChart(); updateChart();
} }
}); });
@ -363,8 +349,7 @@ 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 unitButton.setIcon(AccountingManagerResources.INSTANCE.accountingUnits24());
.accountingUnits24());
updateChart(); updateChart();
} }
}); });
@ -375,8 +360,7 @@ 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 unitButton.setIcon(AccountingManagerResources.INSTANCE.accountingUnitm24());
.accountingUnitm24());
updateChart(); updateChart();
} }
}); });
@ -387,8 +371,7 @@ 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 unitButton.setIcon(AccountingManagerResources.INSTANCE.accountingUnith24());
.accountingUnith24());
updateChart(); updateChart();
} }
}); });
@ -402,20 +385,17 @@ public class JobChartTopPanel extends SimpleContainer {
} }
private void onDownloadCSV() { private void onDownloadCSV() {
ExportRequestEvent event = new ExportRequestEvent(ExportType.CSV, ExportRequestEvent event = new ExportRequestEvent(ExportType.CSV, accountingStateData.getAccountingType());
accountingStateData.getAccountingType());
eventBus.fireEvent(event); eventBus.fireEvent(event);
} }
private void onDownloadXML() { private void onDownloadXML() {
ExportRequestEvent event = new ExportRequestEvent(ExportType.XML, ExportRequestEvent event = new ExportRequestEvent(ExportType.XML, accountingStateData.getAccountingType());
accountingStateData.getAccountingType());
eventBus.fireEvent(event); eventBus.fireEvent(event);
} }
private void onDownloadJSON() { private void onDownloadJSON() {
ExportRequestEvent event = new ExportRequestEvent(ExportType.JSON, ExportRequestEvent event = new ExportRequestEvent(ExportType.JSON, accountingStateData.getAccountingType());
accountingStateData.getAccountingType());
eventBus.fireEvent(event); eventBus.fireEvent(event);
} }
@ -472,15 +452,13 @@ public class JobChartTopPanel extends SimpleContainer {
}-*/; }-*/;
private void createChart() { private void createChart() {
SeriesJob seriesJob = (SeriesJob) accountingStateData SeriesJob seriesJob = (SeriesJob) accountingStateData.getSeriesResponse();
.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 SeriesJobTop seriesJobTop = (SeriesJobTop) seriesJob.getSeriesJobDefinition();
.getSeriesJobDefinition();
HighchartsOptionFactory highchartsFactory = new JsoHighchartsOptionFactory(); HighchartsOptionFactory highchartsFactory = new JsoHighchartsOptionFactory();
@ -491,32 +469,28 @@ 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( options.plotOptions().setFieldAsJsonObject("column",
"column", "{ " + "\"stacking\": \"normal\"," + "\"dataLabels\": { " + " \"enabled\": \"true\","
"{ " + "\"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 (seriesJobTop.getShowOthers()) { createSeriesColumnSimple(seriesJobTop, highchartsFactory, colors, seriesColumn);
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);
@ -528,35 +502,28 @@ public class JobChartTopPanel extends SimpleContainer {
return; return;
} }
private void createSeriesColumnShowOthers(SeriesJobTop seriesJobTop, private void createSeriesColumnShowOthers(SeriesJobTop seriesJobTop, HighchartsOptionFactory highchartsFactory,
HighchartsOptionFactory highchartsFactory, ArrayString colors, ArrayString colors, ArrayList<SeriesColumn> seriesColumn) {
ArrayList<SeriesColumn> seriesColumn) {
Log.debug("Series ShowOthers"); Log.debug("Series ShowOthers");
if (accountingStateData.getSeriesRequest().getAccountingPeriod() if (accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
.getPeriod().compareTo(AccountingPeriodMode.DAILY) == 0 .compareTo(AccountingPeriodMode.DAILY) == 0
|| accountingStateData.getSeriesRequest().getAccountingPeriod() || accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
.getPeriod().compareTo(AccountingPeriodMode.HOURLY) == 0 .compareTo(AccountingPeriodMode.HOURLY) == 0
|| accountingStateData.getSeriesRequest().getAccountingPeriod() || accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
.getPeriod().compareTo(AccountingPeriodMode.MINUTELY) == 0) { .compareTo(AccountingPeriodMode.MINUTELY) == 0) {
double minRange = ChartTimeMeasure double minRange = ChartTimeMeasure
.calculateMinRange(accountingStateData.getSeriesRequest() .calculateMinRange(accountingStateData.getSeriesRequest().getAccountingPeriod());
.getAccountingPeriod());
double interval = ChartTimeMeasure double interval = ChartTimeMeasure
.calculateInterval(accountingStateData.getSeriesRequest() .calculateInterval(accountingStateData.getSeriesRequest().getAccountingPeriod());
.getAccountingPeriod());
Date dateStart = dtf.parse(accountingStateData.getSeriesRequest() Date dateStart = dtf.parse(accountingStateData.getSeriesRequest().getAccountingPeriod().getStartDate());
.getAccountingPeriod().getStartDate());
dateStart.setTime(dateStart.getTime() dateStart.setTime(dateStart.getTime() + ChartTimeMeasure.timeZoneOffset() * ChartTimeMeasure.MINUTE);
+ ChartTimeMeasure.timeZoneOffset()
* ChartTimeMeasure.MINUTE);
Log.debug("BuildChart DateStart: " Log.debug("BuildChart DateStart: "
+ DateTimeFormat.getFormat(PredefinedFormat.DATE_TIME_FULL) + DateTimeFormat.getFormat(PredefinedFormat.DATE_TIME_FULL).format(dateStart));
.format(dateStart));
// xAxis // xAxis
options.xAxis().type("datetime"); options.xAxis().type("datetime");
@ -564,31 +531,25 @@ 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() for (; i < seriesJobTop.getSeriesJobDataTopList().size() && i < seriesJobTop.getTopNumber(); i++) {
&& i < seriesJobTop.getTopNumber(); i++) { SeriesColumn seriesColumnData = highchartsFactory.createSeriesColumn();
SeriesColumn seriesColumnData = highchartsFactory
.createSeriesColumn();
seriesColumnData.name(seriesJobTop.getSeriesJobDataTopList() seriesColumnData.name(seriesJobTop.getSeriesJobDataTopList().get(i).getFilterValue().getValue());
.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 for (SeriesJobData seriesJobData : seriesJobTop.getSeriesJobDataTopList().get(i).getSeries()) {
.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() data.push(seriesJobData.getMaxInvocationTime() / unitMeasure);
/ unitMeasure);
break; break;
case MinInvocationTime: case MinInvocationTime:
data.push(seriesJobData.getMinInvocationTime() data.push(seriesJobData.getMinInvocationTime() / unitMeasure);
/ unitMeasure);
break; break;
case OperationCount: case OperationCount:
data.push(seriesJobData.getOperationCount()); data.push(seriesJobData.getOperationCount());
@ -601,77 +562,61 @@ public class JobChartTopPanel extends SimpleContainer {
} }
seriesColumnData.pointInterval(interval).pointStart( seriesColumnData.pointInterval(interval).pointStart(dateStart.getTime());
dateStart.getTime());
seriesColumn.add(seriesColumnData); seriesColumn.add(seriesColumnData);
} }
if (i < seriesJobTop.getSeriesJobDataTopList().size()) { if (i < seriesJobTop.getSeriesJobDataTopList().size()) {
SeriesColumn seriesColumnData = highchartsFactory SeriesColumn seriesColumnData = highchartsFactory.createSeriesColumn();
.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() for (int j = i; j < seriesJobTop.getSeriesJobDataTopList().size(); j++) {
.size(); j++) {
Long value; Long value;
for (int k = 0; k < seriesJobTop.getSeriesJobDataTopList() for (int k = 0; k < seriesJobTop.getSeriesJobDataTopList().get(j).getSeries().size(); k++) {
.get(j).getSeries().size(); k++) { SeriesJobData seriesJobData = seriesJobTop.getSeriesJobDataTopList().get(j).getSeries().get(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() othersData.add(seriesJobData.getDuration() / unitMeasure);
/ unitMeasure);
break; break;
case MaxInvocationTime: case MaxInvocationTime:
othersData.add(seriesJobData othersData.add(seriesJobData.getMaxInvocationTime() / unitMeasure);
.getMaxInvocationTime() / unitMeasure);
break; break;
case MinInvocationTime: case MinInvocationTime:
othersData.add(seriesJobData othersData.add(seriesJobData.getMinInvocationTime() / unitMeasure);
.getMinInvocationTime() / unitMeasure);
break; break;
case OperationCount: case OperationCount:
othersData.add(seriesJobData othersData.add(seriesJobData.getOperationCount());
.getOperationCount());
break; break;
default: default:
othersData.add(seriesJobData.getDuration() othersData.add(seriesJobData.getDuration() / unitMeasure);
/ unitMeasure);
break; break;
} }
} else { } else {
switch (measure) { switch (measure) {
case Duration: case Duration:
value = (seriesJobData.getDuration() / unitMeasure) value = (seriesJobData.getDuration() / unitMeasure) + othersData.get(k);
+ othersData.get(k);
othersData.set(k, value); othersData.set(k, value);
break; break;
case MaxInvocationTime: case MaxInvocationTime:
value = (seriesJobData.getMaxInvocationTime() / unitMeasure) value = (seriesJobData.getMaxInvocationTime() / unitMeasure) + othersData.get(k);
+ othersData.get(k);
othersData.set(k, value); othersData.set(k, value);
break; break;
case MinInvocationTime: case MinInvocationTime:
value = (seriesJobData.getMinInvocationTime() / unitMeasure) value = (seriesJobData.getMinInvocationTime() / unitMeasure) + othersData.get(k);
+ othersData.get(k);
othersData.set(k, value); othersData.set(k, value);
break; break;
case OperationCount: case OperationCount:
value = seriesJobData.getOperationCount() value = seriesJobData.getOperationCount() + othersData.get(k);
+ othersData.get(k);
othersData.set(k, value); othersData.set(k, value);
break; break;
default: default:
value = (seriesJobData.getDuration() / unitMeasure) value = (seriesJobData.getDuration() / unitMeasure) + othersData.get(k);
+ othersData.get(k);
othersData.set(k, value); othersData.set(k, value);
break; break;
@ -688,8 +633,7 @@ public class JobChartTopPanel extends SimpleContainer {
data.push(value); data.push(value);
} }
seriesColumnData.pointInterval(interval).pointStart( seriesColumnData.pointInterval(interval).pointStart(dateStart.getTime());
dateStart.getTime());
seriesColumn.add(seriesColumnData); seriesColumn.add(seriesColumnData);
} }
@ -697,16 +641,15 @@ public class JobChartTopPanel extends SimpleContainer {
// xAxis // xAxis
options.xAxis().type("datetime"); options.xAxis().type("datetime");
if (accountingStateData.getSeriesRequest().getAccountingPeriod() if (accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
.getPeriod().compareTo(AccountingPeriodMode.MONTHLY) == 0) { .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() if (accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
.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 {
@ -716,20 +659,16 @@ public class JobChartTopPanel extends SimpleContainer {
} }
int i = 0; int i = 0;
for (; i < seriesJobTop.getSeriesJobDataTopList().size() for (; i < seriesJobTop.getSeriesJobDataTopList().size() && i < seriesJobTop.getTopNumber(); i++) {
&& i < seriesJobTop.getTopNumber(); i++) { SeriesColumn seriesColumnData = highchartsFactory.createSeriesColumn();
SeriesColumn seriesColumnData = highchartsFactory
.createSeriesColumn();
seriesColumnData.name(seriesJobTop.getSeriesJobDataTopList() seriesColumnData.name(seriesJobTop.getSeriesJobDataTopList().get(i).getFilterValue().getValue());
.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 for (SeriesJobData seriesJobData : seriesJobTop.getSeriesJobDataTopList().get(i).getSeries()) {
.getSeriesJobDataTopList().get(i).getSeries()) {
long dateFrom1970 = seriesJobData.getDate().getTime(); long dateFrom1970 = seriesJobData.getDate().getTime();
Log.debug("SeriersJobData: " + seriesJobData.getDate()); Log.debug("SeriersJobData: " + seriesJobData.getDate());
@ -745,14 +684,12 @@ public class JobChartTopPanel extends SimpleContainer {
break; break;
case MaxInvocationTime: case MaxInvocationTime:
data.x(dateFrom1970); data.x(dateFrom1970);
data.y(seriesJobData.getMaxInvocationTime() data.y(seriesJobData.getMaxInvocationTime() / unitMeasure);
/ unitMeasure);
arrayData.addToEnd(data); arrayData.addToEnd(data);
break; break;
case MinInvocationTime: case MinInvocationTime:
data.x(dateFrom1970); data.x(dateFrom1970);
data.y(seriesJobData.getMinInvocationTime() data.y(seriesJobData.getMinInvocationTime() / unitMeasure);
/ unitMeasure);
arrayData.addToEnd(data); arrayData.addToEnd(data);
break; break;
case OperationCount: case OperationCount:
@ -775,94 +712,72 @@ public class JobChartTopPanel extends SimpleContainer {
} }
if (i < seriesJobTop.getSeriesJobDataTopList().size()) { if (i < seriesJobTop.getSeriesJobDataTopList().size()) {
SeriesColumn seriesColumnData = highchartsFactory SeriesColumn seriesColumnData = highchartsFactory.createSeriesColumn();
.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() for (int j = i; j < seriesJobTop.getSeriesJobDataTopList().size(); j++) {
.size(); j++) {
ChartDateTimeData chartDateTimeData; ChartDateTimeData chartDateTimeData;
for (int k = 0; k < seriesJobTop.getSeriesJobDataTopList() for (int k = 0; k < seriesJobTop.getSeriesJobDataTopList().get(j).getSeries().size(); k++) {
.get(j).getSeries().size(); k++) { SeriesJobData seriesJobData = seriesJobTop.getSeriesJobDataTopList().get(j).getSeries().get(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( chartDateTimeData = new ChartDateTimeData(seriesJobData.getDate(),
seriesJobData.getDate(), seriesJobData.getDuration() / unitMeasure);
seriesJobData.getDuration()
/ unitMeasure);
othersData.add(chartDateTimeData); othersData.add(chartDateTimeData);
break; break;
case MaxInvocationTime: case MaxInvocationTime:
chartDateTimeData = new ChartDateTimeData( chartDateTimeData = new ChartDateTimeData(seriesJobData.getDate(),
seriesJobData.getDate(), seriesJobData.getMaxInvocationTime() / unitMeasure);
seriesJobData.getMaxInvocationTime()
/ unitMeasure);
othersData.add(chartDateTimeData); othersData.add(chartDateTimeData);
break; break;
case MinInvocationTime: case MinInvocationTime:
chartDateTimeData = new ChartDateTimeData( chartDateTimeData = new ChartDateTimeData(seriesJobData.getDate(),
seriesJobData.getDate(), seriesJobData.getMinInvocationTime() / unitMeasure);
seriesJobData.getMinInvocationTime()
/ unitMeasure);
othersData.add(chartDateTimeData); othersData.add(chartDateTimeData);
break; break;
case OperationCount: case OperationCount:
chartDateTimeData = new ChartDateTimeData( chartDateTimeData = new ChartDateTimeData(seriesJobData.getDate(),
seriesJobData.getDate(),
seriesJobData.getOperationCount()); seriesJobData.getOperationCount());
othersData.add(chartDateTimeData); othersData.add(chartDateTimeData);
break; break;
default: default:
chartDateTimeData = new ChartDateTimeData( chartDateTimeData = new ChartDateTimeData(seriesJobData.getDate(),
seriesJobData.getDate(), seriesJobData.getDuration() / unitMeasure);
seriesJobData.getDuration()
/ unitMeasure);
othersData.add(chartDateTimeData); othersData.add(chartDateTimeData);
break; break;
} }
} else { } else {
switch (measure) { switch (measure) {
case Duration: case Duration:
chartDateTimeData = new ChartDateTimeData( chartDateTimeData = new ChartDateTimeData(seriesJobData.getDate(),
seriesJobData.getDate(), (seriesJobData.getDuration() / unitMeasure) + othersData.get(k).getValue());
(seriesJobData.getDuration() / unitMeasure)
+ othersData.get(k).getValue());
othersData.set(k, chartDateTimeData); othersData.set(k, chartDateTimeData);
break; break;
case MaxInvocationTime: case MaxInvocationTime:
chartDateTimeData = new ChartDateTimeData( chartDateTimeData = new ChartDateTimeData(seriesJobData.getDate(),
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( chartDateTimeData = new ChartDateTimeData(seriesJobData.getDate(),
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( chartDateTimeData = new ChartDateTimeData(seriesJobData.getDate(),
seriesJobData.getDate(), seriesJobData.getOperationCount() + othersData.get(k).getValue());
seriesJobData.getOperationCount()
+ othersData.get(k).getValue());
othersData.set(k, chartDateTimeData); othersData.set(k, chartDateTimeData);
break; break;
default: default:
chartDateTimeData = new ChartDateTimeData( chartDateTimeData = new ChartDateTimeData(seriesJobData.getDate(),
seriesJobData.getDate(), (seriesJobData.getDuration() / unitMeasure) + othersData.get(k).getValue());
(seriesJobData.getDuration() / unitMeasure)
+ othersData.get(k).getValue());
othersData.set(k, chartDateTimeData); othersData.set(k, chartDateTimeData);
break; break;
@ -878,8 +793,7 @@ 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: " Log.debug("SeriersOthersData: " + chartDateTimeData.getDate());
+ chartDateTimeData.getDate());
Log.debug("SeriersOthersData: " + dateFrom1970); Log.debug("SeriersOthersData: " + dateFrom1970);
Data data = highchartsFactory.createSeriesColumnData(); Data data = highchartsFactory.createSeriesColumnData();
@ -896,35 +810,28 @@ public class JobChartTopPanel extends SimpleContainer {
} }
} }
private void createSeriesColumnSimple(SeriesJobTop seriesJobTop, private void createSeriesColumnSimple(SeriesJobTop seriesJobTop, HighchartsOptionFactory highchartsFactory,
HighchartsOptionFactory highchartsFactory, ArrayString colors, ArrayString colors, ArrayList<SeriesColumn> seriesColumn) {
ArrayList<SeriesColumn> seriesColumn) {
Log.debug("Series Simple"); Log.debug("Series Simple");
if (accountingStateData.getSeriesRequest().getAccountingPeriod() if (accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
.getPeriod().compareTo(AccountingPeriodMode.DAILY) == 0 .compareTo(AccountingPeriodMode.DAILY) == 0
|| accountingStateData.getSeriesRequest().getAccountingPeriod() || accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
.getPeriod().compareTo(AccountingPeriodMode.HOURLY) == 0 .compareTo(AccountingPeriodMode.HOURLY) == 0
|| accountingStateData.getSeriesRequest().getAccountingPeriod() || accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
.getPeriod().compareTo(AccountingPeriodMode.MINUTELY) == 0) { .compareTo(AccountingPeriodMode.MINUTELY) == 0) {
double minRange = ChartTimeMeasure double minRange = ChartTimeMeasure
.calculateMinRange(accountingStateData.getSeriesRequest() .calculateMinRange(accountingStateData.getSeriesRequest().getAccountingPeriod());
.getAccountingPeriod());
double interval = ChartTimeMeasure double interval = ChartTimeMeasure
.calculateInterval(accountingStateData.getSeriesRequest() .calculateInterval(accountingStateData.getSeriesRequest().getAccountingPeriod());
.getAccountingPeriod());
Date dateStart = dtf.parse(accountingStateData.getSeriesRequest() Date dateStart = dtf.parse(accountingStateData.getSeriesRequest().getAccountingPeriod().getStartDate());
.getAccountingPeriod().getStartDate());
dateStart.setTime(dateStart.getTime() dateStart.setTime(dateStart.getTime() + ChartTimeMeasure.timeZoneOffset() * ChartTimeMeasure.MINUTE);
+ ChartTimeMeasure.timeZoneOffset()
* ChartTimeMeasure.MINUTE);
Log.debug("BuildChart DateStart: " Log.debug("BuildChart DateStart: "
+ DateTimeFormat.getFormat(PredefinedFormat.DATE_TIME_FULL) + DateTimeFormat.getFormat(PredefinedFormat.DATE_TIME_FULL).format(dateStart));
.format(dateStart));
// xAxis // xAxis
options.xAxis().type("datetime"); options.xAxis().type("datetime");
@ -932,29 +839,24 @@ public class JobChartTopPanel extends SimpleContainer {
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 SeriesColumn seriesColumnData = highchartsFactory.createSeriesColumn();
.createSeriesColumn();
seriesColumnData.name(seriesJobTop.getSeriesJobDataTopList() seriesColumnData.name(seriesJobTop.getSeriesJobDataTopList().get(i).getFilterValue().getValue());
.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 for (SeriesJobData seriesJobData : seriesJobTop.getSeriesJobDataTopList().get(i).getSeries()) {
.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() data.push(seriesJobData.getMaxInvocationTime() / unitMeasure);
/ unitMeasure);
break; break;
case MinInvocationTime: case MinInvocationTime:
data.push(seriesJobData.getMinInvocationTime() data.push(seriesJobData.getMinInvocationTime() / unitMeasure);
/ unitMeasure);
break; break;
case OperationCount: case OperationCount:
data.push(seriesJobData.getOperationCount()); data.push(seriesJobData.getOperationCount());
@ -967,8 +869,7 @@ public class JobChartTopPanel extends SimpleContainer {
} }
seriesColumnData.pointInterval(interval).pointStart( seriesColumnData.pointInterval(interval).pointStart(dateStart.getTime());
dateStart.getTime());
seriesColumn.add(seriesColumnData); seriesColumn.add(seriesColumnData);
} }
@ -976,16 +877,15 @@ public class JobChartTopPanel extends SimpleContainer {
// xAxis // xAxis
options.xAxis().type("datetime"); options.xAxis().type("datetime");
if (accountingStateData.getSeriesRequest().getAccountingPeriod() if (accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
.getPeriod().compareTo(AccountingPeriodMode.MONTHLY) == 0) { .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() if (accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
.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 {
@ -995,18 +895,15 @@ 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 SeriesColumn seriesColumnData = highchartsFactory.createSeriesColumn();
.createSeriesColumn();
seriesColumnData.name(seriesJobTop.getSeriesJobDataTopList() seriesColumnData.name(seriesJobTop.getSeriesJobDataTopList().get(i).getFilterValue().getValue());
.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 for (SeriesJobData seriesJobData : seriesJobTop.getSeriesJobDataTopList().get(i).getSeries()) {
.getSeriesJobDataTopList().get(i).getSeries()) {
long dateFrom1970 = seriesJobData.getDate().getTime(); long dateFrom1970 = seriesJobData.getDate().getTime();
Log.debug("SeriersJobData: " + seriesJobData.getDate()); Log.debug("SeriersJobData: " + seriesJobData.getDate());
@ -1022,14 +919,12 @@ public class JobChartTopPanel extends SimpleContainer {
break; break;
case MaxInvocationTime: case MaxInvocationTime:
data.x(dateFrom1970); data.x(dateFrom1970);
data.y(seriesJobData.getMaxInvocationTime() data.y(seriesJobData.getMaxInvocationTime() / unitMeasure);
/ unitMeasure);
arrayData.addToEnd(data); arrayData.addToEnd(data);
break; break;
case MinInvocationTime: case MinInvocationTime:
data.x(dateFrom1970); data.x(dateFrom1970);
data.y(seriesJobData.getMinInvocationTime() data.y(seriesJobData.getMinInvocationTime() / unitMeasure);
/ unitMeasure);
arrayData.addToEnd(data); arrayData.addToEnd(data);
break; break;
case OperationCount: case OperationCount:
@ -1057,68 +952,45 @@ 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() return "[{" + " \"id\": \"" + JobChartMeasure.Duration.name() + "\"," + " \"labels\": {"
+ "\"," + " \"labels\": {" + " \"format\": \"{value} " + " \"format\": \"{value} " + unitMeasureLabel + "\"," + " \"style\": {"
+ unitMeasureLabel + "\"," + " \"style\": {" + " \"color\": \"#434348\"" + " }" + " }," + " \"stackLabels\": {"
+ " \"color\": \"" + colors.get(1) + "\"" + " }" + " \"enabled\": \"true\"," + " \"style\": {" + " \"fontWeight\": \"bold\","
+ " }," + " \"stackLabels\": {" + " \"enabled\": \"true\"," + " \"color\": \"gray\"" + " } " + " }," + " \"title\": { " + " \"text\": \""
+ " \"style\": {" + " \"fontWeight\": \"bold\"," + JobChartMeasure.Duration.getLabel() + "\"," + " \"style\": {" + " \"color\": \"#434348\""
+ " \"color\": \"gray\"" + " } " + " }," + " }" + " }" + "}]";
+ " \"title\": { " + " \"text\": \""
+ JobChartMeasure.Duration.getLabel() + "\","
+ " \"style\": {" + " \"color\": \""
+ colors.get(1) + "\"" + " }" + " }" + "}]";
case MaxInvocationTime: case MaxInvocationTime:
return "[{" + " \"id\": \"" return "[{" + " \"id\": \"" + JobChartMeasure.MaxInvocationTime.name() + "\"," + " \"labels\": {"
+ JobChartMeasure.MaxInvocationTime.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.MaxInvocationTime.getLabel() + "\"," + " \"style\": {" + " \"color\": \"#434348\""
+ " \"style\": {" + " \"fontWeight\": \"bold\"," + " }" + " }" + "}]";
+ " \"color\": \"gray\"" + " } " + " },"
+ " \"title\": { " + " \"text\": \""
+ JobChartMeasure.MaxInvocationTime.getLabel() + "\","
+ " \"style\": {" + " \"color\": \""
+ colors.get(1) + "\"" + " }" + " }" + "}]";
case MinInvocationTime: case MinInvocationTime:
return "[{" + " \"id\": \"" return "[{" + " \"id\": \"" + JobChartMeasure.MinInvocationTime.name() + "\"," + " \"labels\": {"
+ JobChartMeasure.MinInvocationTime.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.MinInvocationTime.getLabel() + "\"," + " \"style\": {" + " \"color\": \"#434348\""
+ " \"style\": {" + " \"fontWeight\": \"bold\"," + " }" + " }" + "}]";
+ " \"color\": \"gray\"" + " } " + " },"
+ " \"title\": { " + " \"text\": \""
+ JobChartMeasure.MinInvocationTime.getLabel() + "\","
+ " \"style\": {" + " \"color\": \""
+ colors.get(1) + "\"" + " }" + " }" + "}]";
case OperationCount: case OperationCount:
return "[{" + " \"id\": \"" + JobChartMeasure.OperationCount.name() return "[{" + " \"id\": \"" + JobChartMeasure.OperationCount.name() + "\"," + " \"labels\": { "
+ "\"," + " \"labels\": { " + " \"format\": \"{value}\"," + " \"style\": { " + " \"color\": \"#434348\""
+ " \"format\": \"{value}\"," + " \"style\": { " + " }" + " }," + " \"stackLabels\": {" + " \"enabled\": \"true\"," + " \"style\": {"
+ " \"color\": \"" + colors.get(1) + "\"" + " }" + " \"fontWeight\": \"bold\"," + " \"color\": \"gray\"" + " } " + " },"
+ " }," + " \"stackLabels\": {" + " \"enabled\": \"true\"," + " \"title\": { " + " \"text\": \"" + JobChartMeasure.OperationCount.getLabel() + "\","
+ " \"style\": {" + " \"fontWeight\": \"bold\"," + " \"style\": {" + " \"color\": \"#434348\"" + " }" + " }" + "}]";
+ " \"color\": \"gray\"" + " } " + " },"
+ " \"title\": { " + " \"text\": \""
+ JobChartMeasure.OperationCount.getLabel() + "\","
+ " \"style\": {" + " \"color\": \""
+ colors.get(1) + "\"" + " }" + " }" + "}]";
default: default:
return "[{" + " \"id\": \"" + JobChartMeasure.Duration.name() return "[{" + " \"id\": \"" + JobChartMeasure.Duration.name() + "\"," + " \"labels\": {"
+ "\"," + " \"labels\": {" + " \"format\": \"{value} " + " \"format\": \"{value} " + unitMeasureLabel + "\"," + " \"style\": {"
+ unitMeasureLabel + "\"," + " \"style\": {" + " \"color\": \"#434348\"" + " }" + " }," + " \"stackLabels\": {"
+ " \"color\": \"" + colors.get(1) + "\"" + " }" + " \"enabled\": \"true\"," + " \"style\": {" + " \"fontWeight\": \"bold\","
+ " }," + " \"stackLabels\": {" + " \"enabled\": \"true\"," + " \"color\": \"gray\"" + " } " + " }," + " \"title\": { " + " \"text\": \""
+ " \"style\": {" + " \"fontWeight\": \"bold\"," + JobChartMeasure.Duration.getLabel() + "\"," + " \"style\": {" + " \"color\": \"#434348\""
+ " \"color\": \"gray\"" + " } " + " }," + " }" + " }" + "}]";
+ " \"title\": { " + " \"text\": \""
+ JobChartMeasure.Duration.getLabel() + "\","
+ " \"style\": {" + " \"color\": \""
+ colors.get(1) + "\"" + " }" + " }" + "}]";
} }

View File

@ -7,6 +7,7 @@ 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;
@ -57,8 +58,7 @@ 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 private DateTimeFormat dtf = DateTimeFormat.getFormat(PredefinedFormat.YEAR_MONTH_DAY);
.getFormat(PredefinedFormat.YEAR_MONTH_DAY);
private EventBus eventBus; private EventBus eventBus;
private AccountingClientStateData accountingStateData; private AccountingClientStateData accountingStateData;
@ -94,8 +94,7 @@ public class StorageChartTopPanel extends SimpleContainer {
private VerticalLayoutContainer vert; private VerticalLayoutContainer vert;
public StorageChartTopPanel(EventBus eventBus, public StorageChartTopPanel(EventBus eventBus, AccountingClientStateData accountingStateData) {
AccountingClientStateData accountingStateData) {
this.eventBus = eventBus; this.eventBus = eventBus;
this.accountingStateData = accountingStateData; this.accountingStateData = accountingStateData;
forceLayoutOnResize = true; forceLayoutOnResize = true;
@ -107,8 +106,7 @@ 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( final TextButton downloadButton = new TextButton(DownloadConstants.DOWNLOAD,
DownloadConstants.DOWNLOAD,
AccountingManagerResources.INSTANCE.accountingDownload24()); AccountingManagerResources.INSTANCE.accountingDownload24());
// downloadButton.setScale(ButtonScale.MEDIUM); // downloadButton.setScale(ButtonScale.MEDIUM);
downloadButton.setIconAlign(IconAlign.RIGHT); downloadButton.setIconAlign(IconAlign.RIGHT);
@ -116,16 +114,14 @@ public class StorageChartTopPanel extends SimpleContainer {
downloadButton.setMenu(createDownloadMenu()); downloadButton.setMenu(createDownloadMenu());
// Measure // Measure
measureButton = new TextButton( measureButton = new TextButton(StorageChartMeasure.DataVolume.getLabel(),
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, unitButton = new TextButton(DATA_VOLUME_UNIT, AccountingManagerResources.INSTANCE.accountingUnitMB24());
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());
@ -143,8 +139,7 @@ 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, vert.add(highchartsLayoutPanel, new VerticalLayoutData(1, 1, new Margins(0)));
new Margins(0)));
add(vert, new MarginData(0)); add(vert, new MarginData(0));
@ -273,8 +268,7 @@ 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( operationCountItem = new MenuItem(StorageChartMeasure.OperationCount.getLabel());
StorageChartMeasure.OperationCount.getLabel());
operationCountItem.setHeight(30); operationCountItem.setHeight(30);
dataVolumeItem.addSelectionHandler(new SelectionHandler<Item>() { dataVolumeItem.addSelectionHandler(new SelectionHandler<Item>() {
@ -292,8 +286,7 @@ public class StorageChartTopPanel extends SimpleContainer {
@Override @Override
public void onSelection(SelectionEvent<Item> event) { public void onSelection(SelectionEvent<Item> event) {
measureButton.setText(StorageChartMeasure.OperationCount measureButton.setText(StorageChartMeasure.OperationCount.getLabel());
.getLabel());
measure = StorageChartMeasure.OperationCount; measure = StorageChartMeasure.OperationCount;
unitButton.setVisible(false); unitButton.setVisible(false);
updateChart(); updateChart();
@ -309,17 +302,13 @@ public class StorageChartTopPanel extends SimpleContainer {
private Menu createUnitMenu() { private Menu createUnitMenu() {
Menu menuUnit = new Menu(); Menu menuUnit = new Menu();
kBItem = new MenuItem(ByteUnitMeasure.KILOBYTE, kBItem = new MenuItem(ByteUnitMeasure.KILOBYTE, AccountingManagerResources.INSTANCE.accountingUnitkB24());
AccountingManagerResources.INSTANCE.accountingUnitkB24());
kBItem.setHeight(30); kBItem.setHeight(30);
MBItem = new MenuItem(ByteUnitMeasure.MEGABYTE, MBItem = new MenuItem(ByteUnitMeasure.MEGABYTE, AccountingManagerResources.INSTANCE.accountingUnitMB24());
AccountingManagerResources.INSTANCE.accountingUnitMB24());
MBItem.setHeight(30); MBItem.setHeight(30);
GBItem = new MenuItem(ByteUnitMeasure.GIGABYTE, GBItem = new MenuItem(ByteUnitMeasure.GIGABYTE, AccountingManagerResources.INSTANCE.accountingUnitGB24());
AccountingManagerResources.INSTANCE.accountingUnitGB24());
GBItem.setHeight(30); GBItem.setHeight(30);
TBItem = new MenuItem(ByteUnitMeasure.TERABYTE, TBItem = new MenuItem(ByteUnitMeasure.TERABYTE, AccountingManagerResources.INSTANCE.accountingUnitTB24());
AccountingManagerResources.INSTANCE.accountingUnitTB24());
TBItem.setHeight(30); TBItem.setHeight(30);
kBItem.addSelectionHandler(new SelectionHandler<Item>() { kBItem.addSelectionHandler(new SelectionHandler<Item>() {
@ -328,8 +317,7 @@ 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 unitButton.setIcon(AccountingManagerResources.INSTANCE.accountingUnitkB24());
.accountingUnitkB24());
updateChart(); updateChart();
} }
}); });
@ -340,8 +328,7 @@ 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 unitButton.setIcon(AccountingManagerResources.INSTANCE.accountingUnitMB24());
.accountingUnitMB24());
updateChart(); updateChart();
} }
}); });
@ -352,8 +339,7 @@ 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 unitButton.setIcon(AccountingManagerResources.INSTANCE.accountingUnitGB24());
.accountingUnitGB24());
updateChart(); updateChart();
} }
}); });
@ -364,8 +350,7 @@ 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 unitButton.setIcon(AccountingManagerResources.INSTANCE.accountingUnitTB24());
.accountingUnitTB24());
updateChart(); updateChart();
} }
}); });
@ -379,20 +364,17 @@ public class StorageChartTopPanel extends SimpleContainer {
} }
private void onDownloadCSV() { private void onDownloadCSV() {
ExportRequestEvent event = new ExportRequestEvent(ExportType.CSV, ExportRequestEvent event = new ExportRequestEvent(ExportType.CSV, accountingStateData.getAccountingType());
accountingStateData.getAccountingType());
eventBus.fireEvent(event); eventBus.fireEvent(event);
} }
private void onDownloadXML() { private void onDownloadXML() {
ExportRequestEvent event = new ExportRequestEvent(ExportType.XML, ExportRequestEvent event = new ExportRequestEvent(ExportType.XML, accountingStateData.getAccountingType());
accountingStateData.getAccountingType());
eventBus.fireEvent(event); eventBus.fireEvent(event);
} }
private void onDownloadJSON() { private void onDownloadJSON() {
ExportRequestEvent event = new ExportRequestEvent(ExportType.JSON, ExportRequestEvent event = new ExportRequestEvent(ExportType.JSON, accountingStateData.getAccountingType());
accountingStateData.getAccountingType());
eventBus.fireEvent(event); eventBus.fireEvent(event);
} }
@ -449,15 +431,13 @@ public class StorageChartTopPanel extends SimpleContainer {
}-*/; }-*/;
private void createChart() { private void createChart() {
SeriesStorage seriesStorage = (SeriesStorage) accountingStateData SeriesStorage seriesStorage = (SeriesStorage) accountingStateData.getSeriesResponse();
.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 SeriesStorageTop seriesStorageTop = (SeriesStorageTop) seriesStorage.getSeriesStorageDefinition();
.getSeriesStorageDefinition();
HighchartsOptionFactory highchartsFactory = new JsoHighchartsOptionFactory(); HighchartsOptionFactory highchartsFactory = new JsoHighchartsOptionFactory();
@ -468,32 +448,29 @@ 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( options.plotOptions().setFieldAsJsonObject("column",
"column", "{ " + "\"stacking\": \"normal\"," + "\"dataLabels\": { " + " \"enabled\": \"true\","
"{ " + "\"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()) {
createSeriesColumnShowOthers(seriesStorageTop, highchartsFactory, createSeriesColumnSimple(seriesStorageTop, highchartsFactory, colors, seriesColumn);
colors, seriesColumn);
} else {
createSeriesColumnSimple(seriesStorageTop, highchartsFactory,
colors, seriesColumn);
}
for (SeriesColumn serie : seriesColumn) { for (SeriesColumn serie : seriesColumn) {
options.series().addToEnd(serie); options.series().addToEnd(serie);
@ -505,36 +482,28 @@ public class StorageChartTopPanel extends SimpleContainer {
return; return;
} }
private void createSeriesColumnShowOthers( private void createSeriesColumnShowOthers(SeriesStorageTop seriesStorageTop,
SeriesStorageTop seriesStorageTop, HighchartsOptionFactory highchartsFactory, ArrayString colors, ArrayList<SeriesColumn> seriesColumn) {
HighchartsOptionFactory highchartsFactory, ArrayString colors,
ArrayList<SeriesColumn> seriesColumn) {
Log.debug("Series ShowOthers"); Log.debug("Series ShowOthers");
if (accountingStateData.getSeriesRequest().getAccountingPeriod() if (accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
.getPeriod().compareTo(AccountingPeriodMode.DAILY) == 0 .compareTo(AccountingPeriodMode.DAILY) == 0
|| accountingStateData.getSeriesRequest().getAccountingPeriod() || accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
.getPeriod().compareTo(AccountingPeriodMode.HOURLY) == 0 .compareTo(AccountingPeriodMode.HOURLY) == 0
|| accountingStateData.getSeriesRequest().getAccountingPeriod() || accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
.getPeriod().compareTo(AccountingPeriodMode.MINUTELY) == 0) { .compareTo(AccountingPeriodMode.MINUTELY) == 0) {
double minRange = ChartTimeMeasure double minRange = ChartTimeMeasure
.calculateMinRange(accountingStateData.getSeriesRequest() .calculateMinRange(accountingStateData.getSeriesRequest().getAccountingPeriod());
.getAccountingPeriod());
double interval = ChartTimeMeasure double interval = ChartTimeMeasure
.calculateInterval(accountingStateData.getSeriesRequest() .calculateInterval(accountingStateData.getSeriesRequest().getAccountingPeriod());
.getAccountingPeriod());
Date dateStart = dtf.parse(accountingStateData.getSeriesRequest() Date dateStart = dtf.parse(accountingStateData.getSeriesRequest().getAccountingPeriod().getStartDate());
.getAccountingPeriod().getStartDate());
dateStart.setTime(dateStart.getTime() dateStart.setTime(dateStart.getTime() + ChartTimeMeasure.timeZoneOffset() * ChartTimeMeasure.MINUTE);
+ ChartTimeMeasure.timeZoneOffset()
* ChartTimeMeasure.MINUTE);
Log.debug("BuildChart DateStart: " Log.debug("BuildChart DateStart: "
+ DateTimeFormat.getFormat(PredefinedFormat.DATE_TIME_FULL) + DateTimeFormat.getFormat(PredefinedFormat.DATE_TIME_FULL).format(dateStart));
.format(dateStart));
// xAxis // xAxis
options.xAxis().type("datetime"); options.xAxis().type("datetime");
@ -544,23 +513,20 @@ 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 SeriesColumn seriesColumnData = highchartsFactory.createSeriesColumn();
.createSeriesColumn();
seriesColumnData.name(seriesStorageTop seriesColumnData
.getSeriesStorageDataTopList().get(i).getFilterValue() .name(seriesStorageTop.getSeriesStorageDataTopList().get(i).getFilterValue().getValue());
.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 for (SeriesStorageData seriesStorageData : seriesStorageTop.getSeriesStorageDataTopList().get(i)
.getSeriesStorageDataTopList().get(i).getSeries()) { .getSeries()) {
switch (measure) { switch (measure) {
case DataVolume: case DataVolume:
data.push(seriesStorageData.getDataVolume() data.push(seriesStorageData.getDataVolume() / unitMeasure);
/ unitMeasure);
break; break;
case OperationCount: case OperationCount:
data.push(seriesStorageData.getOperationCount()); data.push(seriesStorageData.getOperationCount());
@ -573,43 +539,34 @@ public class StorageChartTopPanel extends SimpleContainer {
} }
seriesColumnData.pointInterval(interval).pointStart( seriesColumnData.pointInterval(interval).pointStart(dateStart.getTime());
dateStart.getTime());
seriesColumn.add(seriesColumnData); seriesColumn.add(seriesColumnData);
} }
if (i < seriesStorageTop.getSeriesStorageDataTopList().size()) { if (i < seriesStorageTop.getSeriesStorageDataTopList().size()) {
SeriesColumn seriesColumnData = highchartsFactory SeriesColumn seriesColumnData = highchartsFactory.createSeriesColumn();
.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 for (int j = i; j < seriesStorageTop.getSeriesStorageDataTopList().size(); j++) {
.getSeriesStorageDataTopList().size(); j++) {
Long value; Long value;
for (int k = 0; k < seriesStorageTop for (int k = 0; k < seriesStorageTop.getSeriesStorageDataTopList().get(j).getSeries().size(); k++) {
.getSeriesStorageDataTopList().get(j).getSeries() SeriesStorageData seriesStorageData = seriesStorageTop.getSeriesStorageDataTopList().get(j)
.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 othersData.add(seriesStorageData.getDataVolume() / unitMeasure);
.getDataVolume() / unitMeasure);
break; break;
case OperationCount: case OperationCount:
othersData.add(seriesStorageData othersData.add(seriesStorageData.getOperationCount());
.getOperationCount());
break; break;
default: default:
othersData.add(seriesStorageData othersData.add(seriesStorageData.getDataVolume() / unitMeasure);
.getDataVolume() / unitMeasure);
break; break;
} }
@ -617,18 +574,15 @@ public class StorageChartTopPanel extends SimpleContainer {
switch (measure) { switch (measure) {
case DataVolume: case DataVolume:
value = seriesStorageData.getDataVolume() value = seriesStorageData.getDataVolume() / unitMeasure + othersData.get(k);
/ unitMeasure + othersData.get(k);
othersData.set(k, value); othersData.set(k, value);
break; break;
case OperationCount: case OperationCount:
value = seriesStorageData.getOperationCount() value = seriesStorageData.getOperationCount() + othersData.get(k);
+ othersData.get(k);
othersData.set(k, value); othersData.set(k, value);
break; break;
default: default:
value = seriesStorageData.getDataVolume() value = seriesStorageData.getDataVolume() / unitMeasure + othersData.get(k);
/ unitMeasure + othersData.get(k);
othersData.set(k, value); othersData.set(k, value);
break; break;
@ -644,8 +598,7 @@ public class StorageChartTopPanel extends SimpleContainer {
data.push(value); data.push(value);
} }
seriesColumnData.pointInterval(interval).pointStart( seriesColumnData.pointInterval(interval).pointStart(dateStart.getTime());
dateStart.getTime());
seriesColumn.add(seriesColumnData); seriesColumn.add(seriesColumnData);
} }
@ -653,16 +606,15 @@ public class StorageChartTopPanel extends SimpleContainer {
// xAxis // xAxis
options.xAxis().type("datetime"); options.xAxis().type("datetime");
if (accountingStateData.getSeriesRequest().getAccountingPeriod() if (accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
.getPeriod().compareTo(AccountingPeriodMode.MONTHLY) == 0) { .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() if (accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
.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 {
@ -674,23 +626,20 @@ 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 SeriesColumn seriesColumnData = highchartsFactory.createSeriesColumn();
.createSeriesColumn();
seriesColumnData.name(seriesStorageTop seriesColumnData
.getSeriesStorageDataTopList().get(i).getFilterValue() .name(seriesStorageTop.getSeriesStorageDataTopList().get(i).getFilterValue().getValue());
.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 for (SeriesStorageData seriesStorageData : seriesStorageTop.getSeriesStorageDataTopList().get(i)
.getSeriesStorageDataTopList().get(i).getSeries()) { .getSeries()) {
long dateFrom1970 = seriesStorageData.getDate().getTime(); long dateFrom1970 = seriesStorageData.getDate().getTime();
Log.debug("SeriersStorageData: " Log.debug("SeriersStorageData: " + seriesStorageData.getDate());
+ seriesStorageData.getDate());
Log.debug("SeriersStorageData: " + dateFrom1970); Log.debug("SeriersStorageData: " + dateFrom1970);
Data data = highchartsFactory.createSeriesColumnData(); Data data = highchartsFactory.createSeriesColumnData();
@ -721,65 +670,51 @@ public class StorageChartTopPanel extends SimpleContainer {
} }
if (i < seriesStorageTop.getSeriesStorageDataTopList().size()) { if (i < seriesStorageTop.getSeriesStorageDataTopList().size()) {
SeriesColumn seriesColumnData = highchartsFactory SeriesColumn seriesColumnData = highchartsFactory.createSeriesColumn();
.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 for (int j = i; j < seriesStorageTop.getSeriesStorageDataTopList().size(); j++) {
.getSeriesStorageDataTopList().size(); j++) {
ChartDateTimeData chartDateTimeData; ChartDateTimeData chartDateTimeData;
for (int k = 0; k < seriesStorageTop for (int k = 0; k < seriesStorageTop.getSeriesStorageDataTopList().get(j).getSeries().size(); k++) {
.getSeriesStorageDataTopList().get(j).getSeries() SeriesStorageData seriesStorageData = seriesStorageTop.getSeriesStorageDataTopList().get(j)
.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( chartDateTimeData = new ChartDateTimeData(seriesStorageData.getDate(),
seriesStorageData.getDate(), seriesStorageData.getDataVolume() / unitMeasure);
seriesStorageData.getDataVolume()
/ unitMeasure);
othersData.add(chartDateTimeData); othersData.add(chartDateTimeData);
break; break;
case OperationCount: case OperationCount:
chartDateTimeData = new ChartDateTimeData( chartDateTimeData = new ChartDateTimeData(seriesStorageData.getDate(),
seriesStorageData.getDate(),
seriesStorageData.getOperationCount()); seriesStorageData.getOperationCount());
othersData.add(chartDateTimeData); othersData.add(chartDateTimeData);
break; break;
default: default:
chartDateTimeData = new ChartDateTimeData( chartDateTimeData = new ChartDateTimeData(seriesStorageData.getDate(),
seriesStorageData.getDate(), seriesStorageData.getDataVolume() / unitMeasure);
seriesStorageData.getDataVolume()
/ unitMeasure);
othersData.add(chartDateTimeData); othersData.add(chartDateTimeData);
break; break;
} }
} else { } else {
switch (measure) { switch (measure) {
case DataVolume: case DataVolume:
chartDateTimeData = new ChartDateTimeData( chartDateTimeData = new ChartDateTimeData(seriesStorageData.getDate(),
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( chartDateTimeData = new ChartDateTimeData(seriesStorageData.getDate(),
seriesStorageData.getDate(), seriesStorageData.getOperationCount() + othersData.get(k).getValue());
seriesStorageData.getOperationCount()
+ othersData.get(k).getValue());
othersData.set(k, chartDateTimeData); othersData.set(k, chartDateTimeData);
break; break;
default: default:
chartDateTimeData = new ChartDateTimeData( chartDateTimeData = new ChartDateTimeData(seriesStorageData.getDate(),
seriesStorageData.getDate(),
(seriesStorageData.getDataVolume() / unitMeasure) (seriesStorageData.getDataVolume() / unitMeasure)
+ othersData.get(k).getValue()); + othersData.get(k).getValue());
othersData.set(k, chartDateTimeData); othersData.set(k, chartDateTimeData);
@ -796,8 +731,7 @@ 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: " Log.debug("SeriersOthersData: " + chartDateTimeData.getDate());
+ chartDateTimeData.getDate());
Log.debug("SeriersOthersData: " + dateFrom1970); Log.debug("SeriersOthersData: " + dateFrom1970);
Data data = highchartsFactory.createSeriesColumnData(); Data data = highchartsFactory.createSeriesColumnData();
@ -815,61 +749,50 @@ public class StorageChartTopPanel extends SimpleContainer {
} }
private void createSeriesColumnSimple(SeriesStorageTop seriesStorageTop, private void createSeriesColumnSimple(SeriesStorageTop seriesStorageTop, HighchartsOptionFactory highchartsFactory,
HighchartsOptionFactory highchartsFactory, ArrayString colors, ArrayString colors, ArrayList<SeriesColumn> seriesColumn) {
ArrayList<SeriesColumn> seriesColumn) {
Log.debug("Series Simple"); Log.debug("Series Simple");
if (accountingStateData.getSeriesRequest().getAccountingPeriod() if (accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
.getPeriod().compareTo(AccountingPeriodMode.DAILY) == 0 .compareTo(AccountingPeriodMode.DAILY) == 0
|| accountingStateData.getSeriesRequest().getAccountingPeriod() || accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
.getPeriod().compareTo(AccountingPeriodMode.HOURLY) == 0 .compareTo(AccountingPeriodMode.HOURLY) == 0
|| accountingStateData.getSeriesRequest().getAccountingPeriod() || accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
.getPeriod().compareTo(AccountingPeriodMode.MINUTELY) == 0) { .compareTo(AccountingPeriodMode.MINUTELY) == 0) {
double minRange = ChartTimeMeasure double minRange = ChartTimeMeasure
.calculateMinRange(accountingStateData.getSeriesRequest() .calculateMinRange(accountingStateData.getSeriesRequest().getAccountingPeriod());
.getAccountingPeriod());
double interval = ChartTimeMeasure double interval = ChartTimeMeasure
.calculateInterval(accountingStateData.getSeriesRequest() .calculateInterval(accountingStateData.getSeriesRequest().getAccountingPeriod());
.getAccountingPeriod());
Date dateStart = dtf.parse(accountingStateData.getSeriesRequest() Date dateStart = dtf.parse(accountingStateData.getSeriesRequest().getAccountingPeriod().getStartDate());
.getAccountingPeriod().getStartDate());
dateStart.setTime(dateStart.getTime() dateStart.setTime(dateStart.getTime() + ChartTimeMeasure.timeZoneOffset() * ChartTimeMeasure.MINUTE);
+ ChartTimeMeasure.timeZoneOffset()
* ChartTimeMeasure.MINUTE);
Log.debug("BuildChart DateStart: " Log.debug("BuildChart DateStart: "
+ DateTimeFormat.getFormat(PredefinedFormat.DATE_TIME_FULL) + DateTimeFormat.getFormat(PredefinedFormat.DATE_TIME_FULL).format(dateStart));
.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() for (int i = 0; i < seriesStorageTop.getSeriesStorageDataTopList().size(); i++) {
.size(); i++) { SeriesColumn seriesColumnData = highchartsFactory.createSeriesColumn();
SeriesColumn seriesColumnData = highchartsFactory
.createSeriesColumn();
seriesColumnData.name(seriesStorageTop seriesColumnData
.getSeriesStorageDataTopList().get(i).getFilterValue() .name(seriesStorageTop.getSeriesStorageDataTopList().get(i).getFilterValue().getValue());
.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 for (SeriesStorageData seriesStorageData : seriesStorageTop.getSeriesStorageDataTopList().get(i)
.getSeriesStorageDataTopList().get(i).getSeries()) { .getSeries()) {
switch (measure) { switch (measure) {
case DataVolume: case DataVolume:
data.push(seriesStorageData.getDataVolume() data.push(seriesStorageData.getDataVolume() / unitMeasure);
/ unitMeasure);
break; break;
case OperationCount: case OperationCount:
data.push(seriesStorageData.getOperationCount()); data.push(seriesStorageData.getOperationCount());
@ -882,8 +805,7 @@ public class StorageChartTopPanel extends SimpleContainer {
} }
seriesColumnData.pointInterval(interval).pointStart( seriesColumnData.pointInterval(interval).pointStart(dateStart.getTime());
dateStart.getTime());
seriesColumn.add(seriesColumnData); seriesColumn.add(seriesColumnData);
} }
@ -892,16 +814,15 @@ public class StorageChartTopPanel extends SimpleContainer {
// xAxis // xAxis
options.xAxis().type("datetime"); options.xAxis().type("datetime");
if (accountingStateData.getSeriesRequest().getAccountingPeriod() if (accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
.getPeriod().compareTo(AccountingPeriodMode.MONTHLY) == 0) { .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() if (accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
.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 {
@ -910,25 +831,21 @@ public class StorageChartTopPanel extends SimpleContainer {
} }
for (int i = 0; i < seriesStorageTop.getSeriesStorageDataTopList() for (int i = 0; i < seriesStorageTop.getSeriesStorageDataTopList().size(); i++) {
.size(); i++) { SeriesColumn seriesColumnData = highchartsFactory.createSeriesColumn();
SeriesColumn seriesColumnData = highchartsFactory
.createSeriesColumn();
seriesColumnData.name(seriesStorageTop seriesColumnData
.getSeriesStorageDataTopList().get(i).getFilterValue() .name(seriesStorageTop.getSeriesStorageDataTopList().get(i).getFilterValue().getValue());
.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 for (SeriesStorageData seriesStorageData : seriesStorageTop.getSeriesStorageDataTopList().get(i)
.getSeriesStorageDataTopList().get(i).getSeries()) { .getSeries()) {
long dateFrom1970 = seriesStorageData.getDate().getTime(); long dateFrom1970 = seriesStorageData.getDate().getTime();
Log.debug("SeriersStorageData: " Log.debug("SeriersStorageData: " + seriesStorageData.getDate());
+ seriesStorageData.getDate());
Log.debug("SeriersStorageData: " + dateFrom1970); Log.debug("SeriersStorageData: " + dateFrom1970);
Data data = highchartsFactory.createSeriesColumnData(); Data data = highchartsFactory.createSeriesColumnData();
@ -964,44 +881,30 @@ 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() return "[{" + " \"id\": \"" + StorageChartMeasure.DataVolume.name() + "\"," + " \"labels\": {"
+ "\"," + " \"labels\": {" + " \"format\": \"{value} " + " \"format\": \"{value} " + unitMeasureLabel + "\"," + " \"style\": {"
+ unitMeasureLabel + "\"," + " \"style\": {" + " \"color\": \"#434348\"" + " }" + " }," + " \"stackLabels\": {"
+ " \"color\": \"" + colors.get(1) + "\"" + " }" + " \"enabled\": \"true\"," + " \"style\": {" + " \"fontWeight\": \"bold\","
+ " }," + " \"stackLabels\": {" + " \"enabled\": \"true\"," + " \"color\": \"gray\"" + " } " + " }," + " \"title\": { " + " \"text\": \""
+ " \"style\": {" + " \"fontWeight\": \"bold\"," + StorageChartMeasure.DataVolume.getLabel() + "\"," + " \"style\": {"
+ " \"color\": \"gray\"" + " } " + " }," + " \"color\": \"#434348\"" + " }" + " }" + "}]";
+ " \"title\": { " + " \"text\": \""
+ StorageChartMeasure.DataVolume.getLabel() + "\","
+ " \"style\": {" + " \"color\": \""
+ colors.get(1) + "\"" + " }" + " }" + "}]";
case OperationCount: case OperationCount:
return "[{" + " \"id\": \"" return "[{" + " \"id\": \"" + StorageChartMeasure.OperationCount.name() + "\"," + " \"labels\": { "
+ StorageChartMeasure.OperationCount.name() + "\"," + " \"format\": \"{value}\"," + " \"style\": { " + " \"color\": \"#434348\"" + " }"
+ " \"labels\": { " + " \"format\": \"{value}\"," + " }," + " \"stackLabels\": {" + " \"enabled\": \"true\"," + " \"style\": {"
+ " \"style\": { " + " \"color\": \"" + " \"fontWeight\": \"bold\"," + " \"color\": \"gray\"" + " } " + " },"
+ colors.get(1) + "\"" + " }" + " }," + " \"title\": { " + " \"text\": \"" + StorageChartMeasure.OperationCount.getLabel() + "\","
+ " \"stackLabels\": {" + " \"enabled\": \"true\"," + " \"style\": {" + " \"color\": \"#434348\"" + " }" + " }" + "}]";
+ " \"style\": {" + " \"fontWeight\": \"bold\","
+ " \"color\": \"gray\"" + " } " + " },"
+ " \"title\": { " + " \"text\": \""
+ StorageChartMeasure.OperationCount.getLabel() + "\","
+ " \"style\": {" + " \"color\": \""
+ colors.get(1) + "\"" + " }" + " }" + "}]";
default: default:
return "[{" + " \"id\": \"" + StorageChartMeasure.DataVolume.name() return "[{" + " \"id\": \"" + StorageChartMeasure.DataVolume.name() + "\"," + " \"labels\": {"
+ "\"," + " \"labels\": {" + " \"format\": \"{value} " + " \"format\": \"{value} " + unitMeasureLabel + "\"," + " \"style\": {"
+ unitMeasureLabel + "\"," + " \"style\": {" + " \"color\": \"#434348\"" + " }" + " }," + " \"stackLabels\": {"
+ " \"color\": \"" + colors.get(1) + "\"" + " }" + " \"enabled\": \"true\"," + " \"style\": {" + " \"fontWeight\": \"bold\","
+ " }," + " \"stackLabels\": {" + " \"enabled\": \"true\"," + " \"color\": \"gray\"" + " } " + " }," + " \"title\": { " + " \"text\": \""
+ " \"style\": {" + " \"fontWeight\": \"bold\"," + StorageChartMeasure.DataVolume.getLabel() + "\"," + " \"style\": {"
+ " \"color\": \"gray\"" + " } " + " }," + " \"color\": \"#434348\"" + " }" + " }" + "}]";
+ " \"title\": { " + " \"text\": \""
+ StorageChartMeasure.DataVolume.getLabel() + "\","
+ " \"style\": {" + " \"color\": \""
+ colors.get(1) + "\"" + " }" + " }" + "}]";
} }

View File

@ -0,0 +1,35 @@
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,8 +9,7 @@ import com.sencha.gxt.data.shared.PropertyAccess;
/** /**
* *
* @author giancarlo * @author Giancarlo Panichi
* 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,12 +9,10 @@ import com.sencha.gxt.data.shared.PropertyAccess;
/** /**
* *
* @author giancarlo * @author Giancarlo Panichi
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
* *
*/ */
public interface AccountingPeriodModePropertiesCombo extends public interface AccountingPeriodModePropertiesCombo extends PropertyAccess<AccountingPeriodMode> {
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.GenresData; import org.gcube.portlets.admin.accountingmanager.shared.data.ContextData;
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,13 +9,14 @@ import com.sencha.gxt.data.shared.PropertyAccess;
/** /**
* *
* @author Giancarlo Panichi * @author Giancarlo Panichi
* *
* *
*/ */
public interface GenresDataProperties extends PropertyAccess<GenresData> { public interface ContextDataProperties extends PropertyAccess<ContextData> {
@Path("genre")
ModelKeyProvider<GenresData> id();
ValueProvider<GenresData, String> label(); @Path("contextData")
ModelKeyProvider<ContextData> id();
ValueProvider<ContextData, String> label();
} }

View File

@ -1,24 +0,0 @@
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