Compare commits
No commits in common. "master" and "feature/21013" have entirely different histories.
master
...
feature/21
|
@ -1,12 +1,12 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<classpath>
|
<classpath>
|
||||||
<classpathentry kind="src" output="target/accounting-manager-1.16.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
|
<classpathentry kind="src" output="target/accounting-manager-1.13.0-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.16.0-SNAPSHOT/WEB-INF/classes" path="src/main/resources">
|
<classpathentry excluding="**" kind="src" output="target/accounting-manager-1.13.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.16.0-SNAPSHOT/WEB-INF/classes"/>
|
<classpathentry kind="output" path="target/accounting-manager-1.13.0-SNAPSHOT/WEB-INF/classes"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
|
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
|
||||||
<wb-module deploy-name="accounting-manager-1.16.0-SNAPSHOT">
|
<wb-module deploy-name="accounting-manager-1.13.0-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"/>
|
||||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
|
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
|
||||||
|
<dependent-module archiveName="accounting-manager-theme-1.3.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/accounting-manager-theme/accounting-manager-theme">
|
||||||
|
<dependency-type>uses</dependency-type>
|
||||||
|
</dependent-module>
|
||||||
<property name="java-output-path" value="/accounting-manager/target/accounting-manager-1.3.0-SNAPSHOT/WEB-INF/classes"/>
|
<property name="java-output-path" value="/accounting-manager/target/accounting-manager-1.3.0-SNAPSHOT/WEB-INF/classes"/>
|
||||||
<property name="context-root" value="accounting-manager"/>
|
<property name="context-root" value="accounting-manager"/>
|
||||||
</wb-module>
|
</wb-module>
|
||||||
|
|
|
@ -1,103 +1,133 @@
|
||||||
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
# Changelog for "accounting-manager"
|
# Changelog for "dataminer-manager"
|
||||||
|
|
||||||
|
|
||||||
## [v1.16.0]
|
## [v1-13-0-SNAPSHOT] - 2021-03-23
|
||||||
|
|
||||||
- Updated to maven-portal-bom 4.0.0
|
### Features
|
||||||
|
|
||||||
|
|
||||||
## [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]
|
|
||||||
|
|
||||||
|
|
||||||
## [v1.13.0] - 2021-03-23
|
|
||||||
|
|
||||||
- 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
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,16 +1,4 @@
|
||||||
<ReleaseNotes>
|
<ReleaseNotes>
|
||||||
<Changeset component="org.gcube.portlets.admin.accounting-manager.1-16-0"
|
|
||||||
date="2022-05-20">
|
|
||||||
<Change>Updated pom for Storage Hub 2</Change>
|
|
||||||
</Changeset>
|
|
||||||
<Changeset component="org.gcube.portlets.admin.accounting-manager.1-15-0"
|
|
||||||
date="2021-11-30">
|
|
||||||
<Change>Improve query support of the new persistence [#21354]</Change>
|
|
||||||
</Changeset>
|
|
||||||
<Changeset component="org.gcube.portlets.admin.accounting-manager.1-14-0"
|
|
||||||
date="2021-06-28">
|
|
||||||
<Change>Fixed display errors generated in Root scope [#21729]</Change>
|
|
||||||
</Changeset>
|
|
||||||
<Changeset component="org.gcube.portlets.admin.accounting-manager.1-13-0"
|
<Changeset component="org.gcube.portlets.admin.accounting-manager.1-13-0"
|
||||||
date="2021-03-23">
|
date="2021-03-23">
|
||||||
<Change>Migrate accounting-manager to postgresql persistence [#21013]</Change>
|
<Change>Migrate accounting-manager to postgresql persistence [#21013]</Change>
|
||||||
|
|
|
@ -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.2.0</version>
|
<version>1.1.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.16.0</version>
|
<version>1.13.0-SNAPSHOT</version>
|
||||||
<packaging>war</packaging>
|
<packaging>war</packaging>
|
||||||
|
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.accounting</groupId>
|
<groupId>org.gcube.accounting</groupId>
|
||||||
<artifactId>accounting-lib</artifactId>
|
<artifactId>accounting-lib</artifactId>
|
||||||
<scope>provided</scope>
|
<version>[4.0.0,5.0.0-SNAPSHOT)</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
@ -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,13 +235,6 @@
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Document Store Lib -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.gcube.data.publishing</groupId>
|
|
||||||
<artifactId>document-store-lib</artifactId>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- Accounting Lib -->
|
<!-- Accounting Lib -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.accounting</groupId>
|
<groupId>org.gcube.accounting</groupId>
|
||||||
|
@ -253,7 +246,14 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.accounting</groupId>
|
<groupId>org.gcube.accounting</groupId>
|
||||||
<artifactId>accounting-analytics</artifactId>
|
<artifactId>accounting-analytics</artifactId>
|
||||||
<version>[4.0.0-SNAPSHOT,5.0.0-SNAPSHOT)</version>
|
<version>[3.0.0-SNAPSHOT,4.0.0-SNAPSHOT)</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Document Store Lib -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.gcube.data.publishing</groupId>
|
||||||
|
<artifactId>document-store-lib</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
@ -261,7 +261,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.accounting</groupId>
|
<groupId>org.gcube.accounting</groupId>
|
||||||
<artifactId>accounting-analytics-persistence-postgresql</artifactId>
|
<artifactId>accounting-analytics-persistence-postgresql</artifactId>
|
||||||
<version>[2.0.0-SNAPSHOT,3.0.0-SNAPSHOT)</version>
|
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
|
||||||
<scope>runtime</scope>
|
<scope>runtime</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
@ -310,7 +310,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>slf4j-log4j12</artifactId>
|
<artifactId>slf4j-log4j12</artifactId>
|
||||||
<scope>test</scope>
|
<scope>provided</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>4.0.0</version>
|
<version>3.6.0</version>
|
||||||
<type>pom</type>
|
<type>pom</type>
|
||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
4
src/main/java/org/gcube/portlets/admin/accountingmanager/accountingman.gwt.xml
Executable file → Normal file
|
@ -46,8 +46,7 @@
|
||||||
|
|
||||||
<!-- <set-configuration-property name="CssResource.style" value="pretty"/> -->
|
<!-- <set-configuration-property name="CssResource.style" value="pretty"/> -->
|
||||||
|
|
||||||
<!--
|
<!-- <set-property name="log_DivLogger" value="ENABLED" /> <set-property
|
||||||
<set-property name="log_DivLogger" value="ENABLED" /> <set-property
|
|
||||||
name="log_ConsoleLogger" value="ENABLED" /> <set-property name="log_GWTLogger"
|
name="log_ConsoleLogger" value="ENABLED" /> <set-property name="log_GWTLogger"
|
||||||
value="ENABLED" /> <set-property name="log_SystemLogger" value="ENABLED"
|
value="ENABLED" /> <set-property name="log_SystemLogger" value="ENABLED"
|
||||||
/> -->
|
/> -->
|
||||||
|
@ -59,6 +58,7 @@
|
||||||
<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' />
|
||||||
|
|
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/AccountingManager.java
Executable file → Normal file
91
src/main/java/org/gcube/portlets/admin/accountingmanager/client/AccountingManagerController.java
Executable file → Normal file
|
@ -68,7 +68,6 @@ public class AccountingManagerController {
|
||||||
private BorderLayoutContainer mainPanel;
|
private BorderLayoutContainer mainPanel;
|
||||||
private AccountingMonitor accountingMonitor;
|
private AccountingMonitor accountingMonitor;
|
||||||
private EnableTabs enableTabs;
|
private EnableTabs enableTabs;
|
||||||
private Context availableContext;
|
|
||||||
|
|
||||||
public AccountingManagerController() {
|
public AccountingManagerController() {
|
||||||
eventBus = new SimpleEventBus();
|
eventBus = new SimpleEventBus();
|
||||||
|
@ -107,7 +106,7 @@ public class AccountingManagerController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
Log.error("No valid user found: " + caught.getLocalizedMessage(), caught);
|
Log.info("No valid user found: " + caught.getMessage());
|
||||||
if (caught instanceof SessionExpiredException) {
|
if (caught instanceof SessionExpiredException) {
|
||||||
UtilsGXT3.alert("Error", "Expired Session");
|
UtilsGXT3.alert("Error", "Expired Session");
|
||||||
sessionExpiredShowDelayed();
|
sessionExpiredShowDelayed();
|
||||||
|
@ -132,7 +131,7 @@ public class AccountingManagerController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
Log.error("Error in check root scope: " + caught.getLocalizedMessage(), caught);
|
Log.info("No valid user found: " + caught.getMessage());
|
||||||
if (caught instanceof SessionExpiredException) {
|
if (caught instanceof SessionExpiredException) {
|
||||||
UtilsGXT3.alert("Error", "Expired Session");
|
UtilsGXT3.alert("Error", "Expired Session");
|
||||||
sessionExpiredShowDelayed();
|
sessionExpiredShowDelayed();
|
||||||
|
@ -157,7 +156,7 @@ public class AccountingManagerController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
Log.error("Error retrieving enable tabs: " + caught.getLocalizedMessage(), caught);
|
Log.error("Error retrieving enable tabs: " + caught.getLocalizedMessage());
|
||||||
if (caught instanceof SessionExpiredException) {
|
if (caught instanceof SessionExpiredException) {
|
||||||
UtilsGXT3.alert("Error", "Expired Session");
|
UtilsGXT3.alert("Error", "Expired Session");
|
||||||
sessionExpiredShowDelayed();
|
sessionExpiredShowDelayed();
|
||||||
|
@ -294,7 +293,7 @@ public class AccountingManagerController {
|
||||||
Log.debug("AccountingType: " + event.getAccountingType());
|
Log.debug("AccountingType: " + event.getAccountingType());
|
||||||
accountingStateData = accountingState.getState(event.getAccountingType());
|
accountingStateData = accountingState.getState(event.getAccountingType());
|
||||||
if (accountingStateData == null) {
|
if (accountingStateData == null) {
|
||||||
configureDefaultChart(event.getAccountingType());
|
createDefaultChart(event.getAccountingType());
|
||||||
} else {
|
} else {
|
||||||
accountingType = event.getAccountingType();
|
accountingType = event.getAccountingType();
|
||||||
StateChangeEvent stateChangeEvent = new StateChangeEvent(StateChangeType.Restore, accountingStateData);
|
StateChangeEvent stateChangeEvent = new StateChangeEvent(StateChangeType.Restore, accountingStateData);
|
||||||
|
@ -311,51 +310,18 @@ public class AccountingManagerController {
|
||||||
if (enableTabs != null && enableTabs.getTabs() != null && enableTabs.getTabs().size() > 0
|
if (enableTabs != null && enableTabs.getTabs() != null && enableTabs.getTabs().size() > 0
|
||||||
&& enableTabs.getTabs().get(0) != null) {
|
&& enableTabs.getTabs().get(0) != null) {
|
||||||
Log.debug("Create DefaultChart");
|
Log.debug("Create DefaultChart");
|
||||||
configureDefaultChart(enableTabs.getTabs().get(0).getAccountingType());
|
createDefaultChart(enableTabs.getTabs().get(0).getAccountingType());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void configureDefaultChart(AccountingType accountingType) {
|
private void createDefaultChart(AccountingType accountingType) {
|
||||||
accountingMonitor = new AccountingMonitor();
|
accountingMonitor = new AccountingMonitor();
|
||||||
this.accountingType = accountingType;
|
this.accountingType = accountingType;
|
||||||
if (availableContext == null) {
|
|
||||||
retrieveContext();
|
|
||||||
} else {
|
|
||||||
createDefaultChart();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void createDefaultChart() {
|
|
||||||
AccountingClientStateData accountingStateData = new AccountingClientStateData(accountingType, rootScope);
|
AccountingClientStateData accountingStateData = new AccountingClientStateData(accountingType, rootScope);
|
||||||
accountingStateData.setAvailableContext(availableContext);
|
|
||||||
accountingState.setState(accountingType, accountingStateData);
|
accountingState.setState(accountingType, accountingStateData);
|
||||||
|
|
||||||
retrieveFilterKey();
|
retrieveFilterKey();
|
||||||
}
|
|
||||||
|
|
||||||
private void retrieveContext() {
|
|
||||||
|
|
||||||
AccountingManagerServiceAsync.INSTANCE.getContext(new AsyncCallback<Context>() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailure(Throwable caught) {
|
|
||||||
accountingMonitor.hide();
|
|
||||||
Log.error("Error retrieving contexts: " + caught.getLocalizedMessage(), caught);
|
|
||||||
if (caught instanceof SessionExpiredException) {
|
|
||||||
eventBus.fireEvent(new SessionExpiredEvent(SessionExpiredType.EXPIREDONSERVER));
|
|
||||||
} else {
|
|
||||||
UtilsGXT3.alert("Error retrieving contexts ", caught.getLocalizedMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSuccess(Context result) {
|
|
||||||
Log.debug("Available Context: " + result);
|
|
||||||
availableContext = result;
|
|
||||||
createDefaultChart();
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -366,7 +332,6 @@ public class AccountingManagerController {
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
accountingMonitor.hide();
|
accountingMonitor.hide();
|
||||||
Log.error("Error retrieving filter keys: " + caught.getLocalizedMessage(), caught);
|
|
||||||
if (caught instanceof SessionExpiredException) {
|
if (caught instanceof SessionExpiredException) {
|
||||||
eventBus.fireEvent(new SessionExpiredEvent(SessionExpiredType.EXPIREDONSERVER));
|
eventBus.fireEvent(new SessionExpiredEvent(SessionExpiredType.EXPIREDONSERVER));
|
||||||
} else {
|
} else {
|
||||||
|
@ -383,6 +348,34 @@ public class AccountingManagerController {
|
||||||
AccountingClientStateData accountingStateData = accountingState.getState(accountingType);
|
AccountingClientStateData accountingStateData = accountingState.getState(accountingType);
|
||||||
accountingStateData.setAvailableFilterKeys(result);
|
accountingStateData.setAvailableFilterKeys(result);
|
||||||
accountingState.setState(accountingType, accountingStateData);
|
accountingState.setState(accountingType, accountingStateData);
|
||||||
|
retrieveContext();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void retrieveContext() {
|
||||||
|
|
||||||
|
AccountingManagerServiceAsync.INSTANCE.getContext(new AsyncCallback<Context>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Throwable caught) {
|
||||||
|
accountingMonitor.hide();
|
||||||
|
if (caught instanceof SessionExpiredException) {
|
||||||
|
eventBus.fireEvent(new SessionExpiredEvent(SessionExpiredType.EXPIREDONSERVER));
|
||||||
|
} else {
|
||||||
|
Log.error("Error retrieving contexts for " + accountingType + ":" + caught.getLocalizedMessage());
|
||||||
|
UtilsGXT3.alert("Error retrieving contexts ", caught.getLocalizedMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Context result) {
|
||||||
|
Log.debug("Available Context: " + result);
|
||||||
|
AccountingClientStateData accountingStateData = accountingState.getState(accountingType);
|
||||||
|
accountingStateData.setAvailableContext(result);
|
||||||
|
accountingState.setState(accountingType, accountingStateData);
|
||||||
retrieveSpace();
|
retrieveSpace();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -390,7 +383,7 @@ public class AccountingManagerController {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void retrieveSpace() {
|
private void retrieveSpace() {
|
||||||
/* if (rootScope) {
|
if (rootScope) {
|
||||||
|
|
||||||
AccountingManagerServiceAsync.INSTANCE.getSpaces(new AsyncCallback<Spaces>() {
|
AccountingManagerServiceAsync.INSTANCE.getSpaces(new AsyncCallback<Spaces>() {
|
||||||
|
|
||||||
|
@ -400,7 +393,7 @@ public class AccountingManagerController {
|
||||||
if (caught instanceof SessionExpiredException) {
|
if (caught instanceof SessionExpiredException) {
|
||||||
eventBus.fireEvent(new SessionExpiredEvent(SessionExpiredType.EXPIREDONSERVER));
|
eventBus.fireEvent(new SessionExpiredEvent(SessionExpiredType.EXPIREDONSERVER));
|
||||||
} else {
|
} else {
|
||||||
Log.error("Error retrieving spaces for " + accountingType + ":" + caught.getLocalizedMessage());
|
Log.error("Error retrieving sapces for " + accountingType + ":" + caught.getLocalizedMessage());
|
||||||
UtilsGXT3.alert("Error retrieving spaces ", caught.getLocalizedMessage());
|
UtilsGXT3.alert("Error retrieving spaces ", caught.getLocalizedMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -414,9 +407,7 @@ public class AccountingManagerController {
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
createDefaultSeriesRequest(null);
|
createDefaultSeriesRequest(null);
|
||||||
} */
|
}
|
||||||
createDefaultSeriesRequest(null);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createDefaultSeriesRequest(Spaces spaces) {
|
private void createDefaultSeriesRequest(Spaces spaces) {
|
||||||
|
@ -430,7 +421,6 @@ 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:
|
||||||
|
@ -440,8 +430,9 @@ public class AccountingManagerController {
|
||||||
case TASK:
|
case TASK:
|
||||||
seriesRequest = new SeriesRequest(
|
seriesRequest = new SeriesRequest(
|
||||||
new AccountingPeriod(dtf.format(lastMonth), dtf.format(date), AccountingPeriodMode.DAILY),
|
new AccountingPeriod(dtf.format(lastMonth), dtf.format(date), AccountingPeriodMode.DAILY),
|
||||||
new AccountingFilterBasic(defaultContext));
|
new AccountingFilterBasic());
|
||||||
Log.debug("DefaultSeriesRequest: " + seriesRequest);
|
Log.debug("DefaultSeriesRequest: " + seriesRequest);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case SPACE:
|
case SPACE:
|
||||||
accountingStateData.setAvailableSpaces(spaces);
|
accountingStateData.setAvailableSpaces(spaces);
|
||||||
|
@ -847,6 +838,8 @@ public class AccountingManagerController {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void doExportRequest(ExportRequestEvent event) {
|
private void doExportRequest(ExportRequestEvent event) {
|
||||||
StringBuilder actionUrl = new StringBuilder();
|
StringBuilder actionUrl = new StringBuilder();
|
||||||
actionUrl.append(GWT.getModuleBaseURL());
|
actionUrl.append(GWT.getModuleBaseURL());
|
||||||
|
|
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/PortalViewport.java
Executable file → Normal file
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/carousel/CarouselPanel.java
Executable file → Normal file
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/custom/FormatedTimeAxis.java
Executable file → Normal file
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/event/AccountingMenuEvent.java
Executable file → Normal file
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/event/AccountingPeriodEvent.java
Executable file → Normal file
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/event/AccountingPeriodRequestEvent.java
Executable file → Normal file
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/event/EnableTabsEvent.java
Executable file → Normal file
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/event/ExportRequestEvent.java
Executable file → Normal file
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/event/FiltersChangeEvent.java
Executable file → Normal file
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/event/SessionExpiredEvent.java
Executable file → Normal file
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/event/StateChangeEvent.java
Executable file → Normal file
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/event/UIStateEvent.java
Executable file → Normal file
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/filters/AccountingPeriodPanel.java
Executable file → Normal file
1201
src/main/java/org/gcube/portlets/admin/accountingmanager/client/filters/ActiveFiltersPanel.java
Executable file → Normal file
2
src/main/java/org/gcube/portlets/admin/accountingmanager/client/filters/FiltersPanel.java
Executable file → Normal file
|
@ -92,7 +92,7 @@ public class FiltersPanel extends FramedPanel {
|
||||||
AccountingFilterDefinition accountingFilterDefinition = activeFiltersPanel
|
AccountingFilterDefinition accountingFilterDefinition = activeFiltersPanel
|
||||||
.getActiveFilters();
|
.getActiveFilters();
|
||||||
|
|
||||||
if (accountingPeriod != null && accountingFilterDefinition!=null) {
|
if (accountingPeriod != null) {
|
||||||
SeriesRequest seriesRequest = new SeriesRequest(accountingPeriod,
|
SeriesRequest seriesRequest = new SeriesRequest(accountingPeriod,
|
||||||
accountingFilterDefinition);
|
accountingFilterDefinition);
|
||||||
Log.debug("UpdateChart: " + seriesRequest);
|
Log.debug("UpdateChart: " + seriesRequest);
|
||||||
|
|
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/graphics/Vector2D.java
Executable file → Normal file
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/maindata/ChartViewerPanel.java
Executable file → Normal file
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/maindata/MainDataPanel.java
Executable file → Normal file
25
src/main/java/org/gcube/portlets/admin/accountingmanager/client/maindata/charts/AccountingChart4Job.java
Executable file → Normal file
|
@ -1,6 +1,7 @@
|
||||||
package org.gcube.portlets.admin.accountingmanager.client.maindata.charts;
|
package org.gcube.portlets.admin.accountingmanager.client.maindata.charts;
|
||||||
|
|
||||||
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.job.JobChartBasicPanel;
|
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.job.JobChartBasicPanel;
|
||||||
|
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.job.JobChartContextPanel;
|
||||||
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.job.JobChartTopPanel;
|
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.job.JobChartTopPanel;
|
||||||
import org.gcube.portlets.admin.accountingmanager.client.state.AccountingClientStateData;
|
import org.gcube.portlets.admin.accountingmanager.client.state.AccountingClientStateData;
|
||||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesJob;
|
import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesJob;
|
||||||
|
@ -21,7 +22,8 @@ public class AccountingChart4Job extends AccountingChartBuilder {
|
||||||
private AccountingClientStateData accountingStateData;
|
private AccountingClientStateData accountingStateData;
|
||||||
private EventBus eventBus;
|
private EventBus eventBus;
|
||||||
|
|
||||||
public AccountingChart4Job(EventBus eventBus, AccountingClientStateData accountingStateData) {
|
public AccountingChart4Job(EventBus eventBus,
|
||||||
|
AccountingClientStateData accountingStateData) {
|
||||||
this.eventBus = eventBus;
|
this.eventBus = eventBus;
|
||||||
this.accountingStateData = accountingStateData;
|
this.accountingStateData = accountingStateData;
|
||||||
}
|
}
|
||||||
|
@ -30,8 +32,10 @@ public class AccountingChart4Job extends AccountingChartBuilder {
|
||||||
public void buildChart() throws ChartDrawException {
|
public void buildChart() throws ChartDrawException {
|
||||||
AccountingChartPanel accountingChartPanel = null;
|
AccountingChartPanel accountingChartPanel = null;
|
||||||
|
|
||||||
if (accountingStateData == null || accountingStateData.getAccountingType() == null
|
if (accountingStateData == null
|
||||||
|| accountingStateData.getSeriesRequest() == null || accountingStateData.getSeriesResponse() == null) {
|
|| accountingStateData.getAccountingType() == null
|
||||||
|
|| accountingStateData.getSeriesRequest() == null
|
||||||
|
|| accountingStateData.getSeriesResponse() == null) {
|
||||||
accountingChartSpec.setChart(accountingChartPanel);
|
accountingChartSpec.setChart(accountingChartPanel);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -51,18 +55,25 @@ public class AccountingChart4Job extends AccountingChartBuilder {
|
||||||
|
|
||||||
private SimpleContainer createJobChartPanel() throws ChartDrawException {
|
private SimpleContainer createJobChartPanel() throws ChartDrawException {
|
||||||
|
|
||||||
if (accountingStateData == null || accountingStateData.getSeriesRequest() == null
|
if (accountingStateData == null
|
||||||
|| accountingStateData.getSeriesRequest().getAccountingFilterDefinition() == null
|
|| accountingStateData.getSeriesRequest() == null
|
||||||
|| accountingStateData.getSeriesRequest().getAccountingFilterDefinition().getChartType() == null) {
|
|| accountingStateData.getSeriesRequest()
|
||||||
|
.getAccountingFilterDefinition() == null
|
||||||
|
|| accountingStateData.getSeriesRequest()
|
||||||
|
.getAccountingFilterDefinition().getChartType() == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (accountingStateData.getSeriesRequest().getAccountingFilterDefinition().getChartType()) {
|
switch (accountingStateData.getSeriesRequest()
|
||||||
|
.getAccountingFilterDefinition().getChartType()) {
|
||||||
|
|
||||||
case Top:
|
case Top:
|
||||||
return new JobChartTopPanel(eventBus, accountingStateData);
|
return new JobChartTopPanel(eventBus, accountingStateData);
|
||||||
case Basic:
|
case Basic:
|
||||||
return new JobChartBasicPanel(eventBus, accountingStateData);
|
return new JobChartBasicPanel(eventBus, accountingStateData);
|
||||||
|
case Context:
|
||||||
|
return new JobChartContextPanel(eventBus, accountingStateData);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/maindata/charts/AccountingChart4Portlet.java
Executable file → Normal file
30
src/main/java/org/gcube/portlets/admin/accountingmanager/client/maindata/charts/AccountingChart4Service.java
Executable file → Normal file
|
@ -1,6 +1,7 @@
|
||||||
package org.gcube.portlets.admin.accountingmanager.client.maindata.charts;
|
package org.gcube.portlets.admin.accountingmanager.client.maindata.charts;
|
||||||
|
|
||||||
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.service.ServiceChartBasicPanel;
|
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.service.ServiceChartBasicPanel;
|
||||||
|
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.service.ServiceChartContextPanel;
|
||||||
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.service.ServiceChartTopPanel;
|
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.service.ServiceChartTopPanel;
|
||||||
import org.gcube.portlets.admin.accountingmanager.client.state.AccountingClientStateData;
|
import org.gcube.portlets.admin.accountingmanager.client.state.AccountingClientStateData;
|
||||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesService;
|
import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesService;
|
||||||
|
@ -20,8 +21,9 @@ public class AccountingChart4Service extends AccountingChartBuilder {
|
||||||
private EventBus eventBus;
|
private EventBus eventBus;
|
||||||
private AccountingClientStateData accountingStateData;
|
private AccountingClientStateData accountingStateData;
|
||||||
|
|
||||||
|
|
||||||
public AccountingChart4Service(EventBus eventBus, AccountingClientStateData accountingStateData) {
|
public AccountingChart4Service(EventBus eventBus, AccountingClientStateData accountingStateData) {
|
||||||
this.eventBus = eventBus;
|
this.eventBus=eventBus;
|
||||||
this.accountingStateData = accountingStateData;
|
this.accountingStateData = accountingStateData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,8 +31,10 @@ public class AccountingChart4Service extends AccountingChartBuilder {
|
||||||
public void buildChart() throws ChartDrawException {
|
public void buildChart() throws ChartDrawException {
|
||||||
AccountingChartPanel accountingChartPanel = null;
|
AccountingChartPanel accountingChartPanel = null;
|
||||||
|
|
||||||
if (accountingStateData == null || accountingStateData.getAccountingType() == null
|
if (accountingStateData == null
|
||||||
|| accountingStateData.getSeriesRequest() == null || accountingStateData.getSeriesResponse() == null) {
|
|| accountingStateData.getAccountingType() == null
|
||||||
|
|| accountingStateData.getSeriesRequest() == null
|
||||||
|
|| accountingStateData.getSeriesResponse() == null) {
|
||||||
accountingChartSpec.setChart(accountingChartPanel);
|
accountingChartSpec.setChart(accountingChartPanel);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -48,20 +52,28 @@ public class AccountingChart4Service extends AccountingChartBuilder {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private SimpleContainer createServiceChartPanel() throws ChartDrawException {
|
private SimpleContainer createServiceChartPanel()
|
||||||
|
throws ChartDrawException {
|
||||||
|
|
||||||
if (accountingStateData == null || accountingStateData.getSeriesRequest() == null
|
if (accountingStateData == null
|
||||||
|| accountingStateData.getSeriesRequest().getAccountingFilterDefinition() == null
|
|| accountingStateData.getSeriesRequest() == null
|
||||||
|| accountingStateData.getSeriesRequest().getAccountingFilterDefinition().getChartType() == null) {
|
|| accountingStateData.getSeriesRequest()
|
||||||
|
.getAccountingFilterDefinition() == null
|
||||||
|
|| accountingStateData.getSeriesRequest()
|
||||||
|
.getAccountingFilterDefinition().getChartType() == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (accountingStateData.getSeriesRequest().getAccountingFilterDefinition().getChartType()) {
|
switch (accountingStateData.getSeriesRequest()
|
||||||
|
.getAccountingFilterDefinition().getChartType()) {
|
||||||
|
|
||||||
case Top:
|
case Top:
|
||||||
return new ServiceChartTopPanel(eventBus, accountingStateData);
|
return new ServiceChartTopPanel(eventBus,accountingStateData);
|
||||||
case Basic:
|
case Basic:
|
||||||
return new ServiceChartBasicPanel(eventBus, accountingStateData);
|
return new ServiceChartBasicPanel(eventBus, accountingStateData);
|
||||||
|
case Context:
|
||||||
|
return new ServiceChartContextPanel(eventBus, accountingStateData);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/maindata/charts/AccountingChart4Space.java
Executable file → Normal file
25
src/main/java/org/gcube/portlets/admin/accountingmanager/client/maindata/charts/AccountingChart4Storage.java
Executable file → Normal file
|
@ -1,6 +1,7 @@
|
||||||
package org.gcube.portlets.admin.accountingmanager.client.maindata.charts;
|
package org.gcube.portlets.admin.accountingmanager.client.maindata.charts;
|
||||||
|
|
||||||
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.storage.StorageChartBasicPanel;
|
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.storage.StorageChartBasicPanel;
|
||||||
|
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.storage.StorageChartContextPanel;
|
||||||
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.storage.StorageChartTopPanel;
|
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.storage.StorageChartTopPanel;
|
||||||
import org.gcube.portlets.admin.accountingmanager.client.state.AccountingClientStateData;
|
import org.gcube.portlets.admin.accountingmanager.client.state.AccountingClientStateData;
|
||||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesStorage;
|
import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesStorage;
|
||||||
|
@ -20,7 +21,8 @@ public class AccountingChart4Storage extends AccountingChartBuilder {
|
||||||
private EventBus eventBus;
|
private EventBus eventBus;
|
||||||
private AccountingClientStateData accountingStateData;
|
private AccountingClientStateData accountingStateData;
|
||||||
|
|
||||||
public AccountingChart4Storage(EventBus eventBus, AccountingClientStateData accountingStateData) {
|
public AccountingChart4Storage(EventBus eventBus,
|
||||||
|
AccountingClientStateData accountingStateData) {
|
||||||
this.eventBus = eventBus;
|
this.eventBus = eventBus;
|
||||||
this.accountingStateData = accountingStateData;
|
this.accountingStateData = accountingStateData;
|
||||||
}
|
}
|
||||||
|
@ -29,8 +31,10 @@ public class AccountingChart4Storage extends AccountingChartBuilder {
|
||||||
public void buildChart() throws ChartDrawException {
|
public void buildChart() throws ChartDrawException {
|
||||||
AccountingChartPanel accountingChartPanel = null;
|
AccountingChartPanel accountingChartPanel = null;
|
||||||
|
|
||||||
if (accountingStateData == null || accountingStateData.getAccountingType() == null
|
if (accountingStateData == null
|
||||||
|| accountingStateData.getSeriesRequest() == null || accountingStateData.getSeriesResponse() == null) {
|
|| accountingStateData.getAccountingType() == null
|
||||||
|
|| accountingStateData.getSeriesRequest() == null
|
||||||
|
|| accountingStateData.getSeriesResponse() == null) {
|
||||||
accountingChartSpec.setChart(accountingChartPanel);
|
accountingChartSpec.setChart(accountingChartPanel);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -50,18 +54,25 @@ public class AccountingChart4Storage extends AccountingChartBuilder {
|
||||||
|
|
||||||
private SimpleContainer createStorageChartPanel() throws ChartDrawException {
|
private SimpleContainer createStorageChartPanel() throws ChartDrawException {
|
||||||
|
|
||||||
if (accountingStateData == null || accountingStateData.getSeriesRequest() == null
|
if (accountingStateData == null
|
||||||
|| accountingStateData.getSeriesRequest().getAccountingFilterDefinition() == null
|
|| accountingStateData.getSeriesRequest() == null
|
||||||
|| accountingStateData.getSeriesRequest().getAccountingFilterDefinition().getChartType() == null) {
|
|| accountingStateData.getSeriesRequest()
|
||||||
|
.getAccountingFilterDefinition() == null
|
||||||
|
|| accountingStateData.getSeriesRequest()
|
||||||
|
.getAccountingFilterDefinition().getChartType() == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (accountingStateData.getSeriesRequest().getAccountingFilterDefinition().getChartType()) {
|
switch (accountingStateData.getSeriesRequest()
|
||||||
|
.getAccountingFilterDefinition().getChartType()) {
|
||||||
|
|
||||||
case Top:
|
case Top:
|
||||||
return new StorageChartTopPanel(eventBus, accountingStateData);
|
return new StorageChartTopPanel(eventBus, accountingStateData);
|
||||||
case Basic:
|
case Basic:
|
||||||
return new StorageChartBasicPanel(eventBus, accountingStateData);
|
return new StorageChartBasicPanel(eventBus, accountingStateData);
|
||||||
|
case Context:
|
||||||
|
return new StorageChartContextPanel(eventBus, accountingStateData);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/maindata/charts/AccountingChart4Task.java
Executable file → Normal file
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/maindata/charts/AccountingChartBuilder.java
Executable file → Normal file
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/maindata/charts/AccountingChartDirector.java
Executable file → Normal file
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/maindata/charts/AccountingChartPanel.java
Executable file → Normal file
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/maindata/charts/AccountingChartSpec.java
Executable file → Normal file
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/maindata/charts/job/JobChartBasicPanel.java
Executable file → Normal file
458
src/main/java/org/gcube/portlets/admin/accountingmanager/client/maindata/charts/job/JobChartTopPanel.java
Executable file → Normal file
|
@ -6,7 +6,6 @@ import java.util.Date;
|
||||||
import org.gcube.portlets.admin.accountingmanager.client.event.ExportRequestEvent;
|
import org.gcube.portlets.admin.accountingmanager.client.event.ExportRequestEvent;
|
||||||
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.ChartDateTimeData;
|
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.ChartDateTimeData;
|
||||||
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.ChartTimeMeasure;
|
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.ChartTimeMeasure;
|
||||||
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.ColorsPalette;
|
|
||||||
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.DownloadConstants;
|
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.DownloadConstants;
|
||||||
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.JobChartMeasure;
|
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.JobChartMeasure;
|
||||||
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.TimeUnitMeasure;
|
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.TimeUnitMeasure;
|
||||||
|
@ -58,7 +57,8 @@ public class JobChartTopPanel extends SimpleContainer {
|
||||||
private static final String TIME_UNIT = "Time Unit";
|
private static final String TIME_UNIT = "Time Unit";
|
||||||
// private static final String MEASURE_TYPE = "Measure";
|
// private static final String MEASURE_TYPE = "Measure";
|
||||||
|
|
||||||
private DateTimeFormat dtf = DateTimeFormat.getFormat(PredefinedFormat.YEAR_MONTH_DAY);
|
private DateTimeFormat dtf = DateTimeFormat
|
||||||
|
.getFormat(PredefinedFormat.YEAR_MONTH_DAY);
|
||||||
|
|
||||||
private EventBus eventBus;
|
private EventBus eventBus;
|
||||||
private AccountingClientStateData accountingStateData;
|
private AccountingClientStateData accountingStateData;
|
||||||
|
@ -96,7 +96,8 @@ public class JobChartTopPanel extends SimpleContainer {
|
||||||
|
|
||||||
private VerticalLayoutContainer vert;
|
private VerticalLayoutContainer vert;
|
||||||
|
|
||||||
public JobChartTopPanel(EventBus eventBus, AccountingClientStateData accountingStateData) {
|
public JobChartTopPanel(EventBus eventBus,
|
||||||
|
AccountingClientStateData accountingStateData) {
|
||||||
this.eventBus = eventBus;
|
this.eventBus = eventBus;
|
||||||
this.accountingStateData = accountingStateData;
|
this.accountingStateData = accountingStateData;
|
||||||
forceLayoutOnResize = true;
|
forceLayoutOnResize = true;
|
||||||
|
@ -108,7 +109,8 @@ public class JobChartTopPanel extends SimpleContainer {
|
||||||
ToolBar toolBar = new ToolBar();
|
ToolBar toolBar = new ToolBar();
|
||||||
toolBar.setSpacing(2);
|
toolBar.setSpacing(2);
|
||||||
// Download
|
// Download
|
||||||
final TextButton downloadButton = new TextButton(DownloadConstants.DOWNLOAD,
|
final TextButton downloadButton = new TextButton(
|
||||||
|
DownloadConstants.DOWNLOAD,
|
||||||
AccountingManagerResources.INSTANCE.accountingDownload24());
|
AccountingManagerResources.INSTANCE.accountingDownload24());
|
||||||
// downloadButton.setScale(ButtonScale.MEDIUM);
|
// downloadButton.setScale(ButtonScale.MEDIUM);
|
||||||
downloadButton.setIconAlign(IconAlign.RIGHT);
|
downloadButton.setIconAlign(IconAlign.RIGHT);
|
||||||
|
@ -123,7 +125,8 @@ public class JobChartTopPanel extends SimpleContainer {
|
||||||
measureButton.setMenu(createMeasureMenu());
|
measureButton.setMenu(createMeasureMenu());
|
||||||
|
|
||||||
// Unit
|
// Unit
|
||||||
unitButton = new TextButton(TIME_UNIT, AccountingManagerResources.INSTANCE.accountingUnitms24());
|
unitButton = new TextButton(TIME_UNIT,
|
||||||
|
AccountingManagerResources.INSTANCE.accountingUnitms24());
|
||||||
unitButton.setIconAlign(IconAlign.RIGHT);
|
unitButton.setIconAlign(IconAlign.RIGHT);
|
||||||
unitButton.setArrowAlign(ButtonArrowAlign.RIGHT);
|
unitButton.setArrowAlign(ButtonArrowAlign.RIGHT);
|
||||||
unitButton.setMenu(createUnitMenu());
|
unitButton.setMenu(createUnitMenu());
|
||||||
|
@ -142,7 +145,8 @@ public class JobChartTopPanel extends SimpleContainer {
|
||||||
//
|
//
|
||||||
vert = new VerticalLayoutContainer();
|
vert = new VerticalLayoutContainer();
|
||||||
vert.add(toolBar, new VerticalLayoutData(1, -1, new Margins(0)));
|
vert.add(toolBar, new VerticalLayoutData(1, -1, new Margins(0)));
|
||||||
vert.add(highchartsLayoutPanel, new VerticalLayoutData(1, 1, new Margins(0)));
|
vert.add(highchartsLayoutPanel, new VerticalLayoutData(1, 1,
|
||||||
|
new Margins(0)));
|
||||||
|
|
||||||
add(vert, new MarginData(0));
|
add(vert, new MarginData(0));
|
||||||
|
|
||||||
|
@ -261,11 +265,14 @@ public class JobChartTopPanel extends SimpleContainer {
|
||||||
// TODO
|
// TODO
|
||||||
durationItem = new MenuItem(JobChartMeasure.Duration.getLabel());
|
durationItem = new MenuItem(JobChartMeasure.Duration.getLabel());
|
||||||
durationItem.setHeight(30);
|
durationItem.setHeight(30);
|
||||||
operationCountItem = new MenuItem(JobChartMeasure.OperationCount.getLabel());
|
operationCountItem = new MenuItem(
|
||||||
|
JobChartMeasure.OperationCount.getLabel());
|
||||||
operationCountItem.setHeight(30);
|
operationCountItem.setHeight(30);
|
||||||
maxInvocationTimeItem = new MenuItem(JobChartMeasure.MaxInvocationTime.getLabel());
|
maxInvocationTimeItem = new MenuItem(
|
||||||
|
JobChartMeasure.MaxInvocationTime.getLabel());
|
||||||
maxInvocationTimeItem.setHeight(30);
|
maxInvocationTimeItem.setHeight(30);
|
||||||
minInvocationTimeItem = new MenuItem(JobChartMeasure.MinInvocationTime.getLabel());
|
minInvocationTimeItem = new MenuItem(
|
||||||
|
JobChartMeasure.MinInvocationTime.getLabel());
|
||||||
minInvocationTimeItem.setHeight(30);
|
minInvocationTimeItem.setHeight(30);
|
||||||
|
|
||||||
durationItem.addSelectionHandler(new SelectionHandler<Item>() {
|
durationItem.addSelectionHandler(new SelectionHandler<Item>() {
|
||||||
|
@ -294,7 +301,8 @@ public class JobChartTopPanel extends SimpleContainer {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSelection(SelectionEvent<Item> event) {
|
public void onSelection(SelectionEvent<Item> event) {
|
||||||
measureButton.setText(JobChartMeasure.MaxInvocationTime.getLabel());
|
measureButton.setText(JobChartMeasure.MaxInvocationTime
|
||||||
|
.getLabel());
|
||||||
measure = JobChartMeasure.MaxInvocationTime;
|
measure = JobChartMeasure.MaxInvocationTime;
|
||||||
unitButton.setVisible(true);
|
unitButton.setVisible(true);
|
||||||
updateChart();
|
updateChart();
|
||||||
|
@ -305,7 +313,8 @@ public class JobChartTopPanel extends SimpleContainer {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSelection(SelectionEvent<Item> event) {
|
public void onSelection(SelectionEvent<Item> event) {
|
||||||
measureButton.setText(JobChartMeasure.MinInvocationTime.getLabel());
|
measureButton.setText(JobChartMeasure.MinInvocationTime
|
||||||
|
.getLabel());
|
||||||
measure = JobChartMeasure.MinInvocationTime;
|
measure = JobChartMeasure.MinInvocationTime;
|
||||||
unitButton.setVisible(true);
|
unitButton.setVisible(true);
|
||||||
updateChart();
|
updateChart();
|
||||||
|
@ -323,13 +332,17 @@ public class JobChartTopPanel extends SimpleContainer {
|
||||||
|
|
||||||
private Menu createUnitMenu() {
|
private Menu createUnitMenu() {
|
||||||
Menu menuUnit = new Menu();
|
Menu menuUnit = new Menu();
|
||||||
msItem = new MenuItem(TimeUnitMeasure.MILLISECONDS, AccountingManagerResources.INSTANCE.accountingUnitms24());
|
msItem = new MenuItem(TimeUnitMeasure.MILLISECONDS,
|
||||||
|
AccountingManagerResources.INSTANCE.accountingUnitms24());
|
||||||
msItem.setHeight(30);
|
msItem.setHeight(30);
|
||||||
sItem = new MenuItem(TimeUnitMeasure.SECONDS, AccountingManagerResources.INSTANCE.accountingUnits24());
|
sItem = new MenuItem(TimeUnitMeasure.SECONDS,
|
||||||
|
AccountingManagerResources.INSTANCE.accountingUnits24());
|
||||||
sItem.setHeight(30);
|
sItem.setHeight(30);
|
||||||
mItem = new MenuItem(TimeUnitMeasure.MINUTES, AccountingManagerResources.INSTANCE.accountingUnitm24());
|
mItem = new MenuItem(TimeUnitMeasure.MINUTES,
|
||||||
|
AccountingManagerResources.INSTANCE.accountingUnitm24());
|
||||||
mItem.setHeight(30);
|
mItem.setHeight(30);
|
||||||
hItem = new MenuItem(TimeUnitMeasure.HOURS, AccountingManagerResources.INSTANCE.accountingUnith24());
|
hItem = new MenuItem(TimeUnitMeasure.HOURS,
|
||||||
|
AccountingManagerResources.INSTANCE.accountingUnith24());
|
||||||
hItem.setHeight(30);
|
hItem.setHeight(30);
|
||||||
|
|
||||||
msItem.addSelectionHandler(new SelectionHandler<Item>() {
|
msItem.addSelectionHandler(new SelectionHandler<Item>() {
|
||||||
|
@ -338,7 +351,8 @@ public class JobChartTopPanel extends SimpleContainer {
|
||||||
public void onSelection(SelectionEvent<Item> event) {
|
public void onSelection(SelectionEvent<Item> event) {
|
||||||
unitMeasure = TimeUnitMeasure.getMilliseconds();
|
unitMeasure = TimeUnitMeasure.getMilliseconds();
|
||||||
unitMeasureLabel = TimeUnitMeasure.MS;
|
unitMeasureLabel = TimeUnitMeasure.MS;
|
||||||
unitButton.setIcon(AccountingManagerResources.INSTANCE.accountingUnitms24());
|
unitButton.setIcon(AccountingManagerResources.INSTANCE
|
||||||
|
.accountingUnitms24());
|
||||||
updateChart();
|
updateChart();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -349,7 +363,8 @@ public class JobChartTopPanel extends SimpleContainer {
|
||||||
public void onSelection(SelectionEvent<Item> event) {
|
public void onSelection(SelectionEvent<Item> event) {
|
||||||
unitMeasure = TimeUnitMeasure.getSeconds();
|
unitMeasure = TimeUnitMeasure.getSeconds();
|
||||||
unitMeasureLabel = TimeUnitMeasure.S;
|
unitMeasureLabel = TimeUnitMeasure.S;
|
||||||
unitButton.setIcon(AccountingManagerResources.INSTANCE.accountingUnits24());
|
unitButton.setIcon(AccountingManagerResources.INSTANCE
|
||||||
|
.accountingUnits24());
|
||||||
updateChart();
|
updateChart();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -360,7 +375,8 @@ public class JobChartTopPanel extends SimpleContainer {
|
||||||
public void onSelection(SelectionEvent<Item> event) {
|
public void onSelection(SelectionEvent<Item> event) {
|
||||||
unitMeasure = TimeUnitMeasure.getMinutes();
|
unitMeasure = TimeUnitMeasure.getMinutes();
|
||||||
unitMeasureLabel = TimeUnitMeasure.M;
|
unitMeasureLabel = TimeUnitMeasure.M;
|
||||||
unitButton.setIcon(AccountingManagerResources.INSTANCE.accountingUnitm24());
|
unitButton.setIcon(AccountingManagerResources.INSTANCE
|
||||||
|
.accountingUnitm24());
|
||||||
updateChart();
|
updateChart();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -371,7 +387,8 @@ public class JobChartTopPanel extends SimpleContainer {
|
||||||
public void onSelection(SelectionEvent<Item> event) {
|
public void onSelection(SelectionEvent<Item> event) {
|
||||||
unitMeasure = TimeUnitMeasure.getHours();
|
unitMeasure = TimeUnitMeasure.getHours();
|
||||||
unitMeasureLabel = TimeUnitMeasure.H;
|
unitMeasureLabel = TimeUnitMeasure.H;
|
||||||
unitButton.setIcon(AccountingManagerResources.INSTANCE.accountingUnith24());
|
unitButton.setIcon(AccountingManagerResources.INSTANCE
|
||||||
|
.accountingUnith24());
|
||||||
updateChart();
|
updateChart();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -385,17 +402,20 @@ public class JobChartTopPanel extends SimpleContainer {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onDownloadCSV() {
|
private void onDownloadCSV() {
|
||||||
ExportRequestEvent event = new ExportRequestEvent(ExportType.CSV, accountingStateData.getAccountingType());
|
ExportRequestEvent event = new ExportRequestEvent(ExportType.CSV,
|
||||||
|
accountingStateData.getAccountingType());
|
||||||
eventBus.fireEvent(event);
|
eventBus.fireEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onDownloadXML() {
|
private void onDownloadXML() {
|
||||||
ExportRequestEvent event = new ExportRequestEvent(ExportType.XML, accountingStateData.getAccountingType());
|
ExportRequestEvent event = new ExportRequestEvent(ExportType.XML,
|
||||||
|
accountingStateData.getAccountingType());
|
||||||
eventBus.fireEvent(event);
|
eventBus.fireEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onDownloadJSON() {
|
private void onDownloadJSON() {
|
||||||
ExportRequestEvent event = new ExportRequestEvent(ExportType.JSON, accountingStateData.getAccountingType());
|
ExportRequestEvent event = new ExportRequestEvent(ExportType.JSON,
|
||||||
|
accountingStateData.getAccountingType());
|
||||||
eventBus.fireEvent(event);
|
eventBus.fireEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -452,13 +472,15 @@ public class JobChartTopPanel extends SimpleContainer {
|
||||||
}-*/;
|
}-*/;
|
||||||
|
|
||||||
private void createChart() {
|
private void createChart() {
|
||||||
SeriesJob seriesJob = (SeriesJob) accountingStateData.getSeriesResponse();
|
SeriesJob seriesJob = (SeriesJob) accountingStateData
|
||||||
|
.getSeriesResponse();
|
||||||
|
|
||||||
if (!(seriesJob.getSeriesJobDefinition() instanceof SeriesJobTop)) {
|
if (!(seriesJob.getSeriesJobDefinition() instanceof SeriesJobTop)) {
|
||||||
Log.debug("Invalid SeriesJobTop!");
|
Log.debug("Invalid SeriesJobTop!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
SeriesJobTop seriesJobTop = (SeriesJobTop) seriesJob.getSeriesJobDefinition();
|
SeriesJobTop seriesJobTop = (SeriesJobTop) seriesJob
|
||||||
|
.getSeriesJobDefinition();
|
||||||
|
|
||||||
HighchartsOptionFactory highchartsFactory = new JsoHighchartsOptionFactory();
|
HighchartsOptionFactory highchartsFactory = new JsoHighchartsOptionFactory();
|
||||||
|
|
||||||
|
@ -469,28 +491,32 @@ public class JobChartTopPanel extends SimpleContainer {
|
||||||
options.title().text("Accounting Job Top");
|
options.title().text("Accounting Job Top");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* options.subtitle().text("Click and drag in the plot area to zoom in"
|
* options.subtitle().text("Click and drag in the plot area to zoom in");
|
||||||
* );
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ColorsPalette colorsPalette=new ColorsPalette();
|
|
||||||
ArrayString colors = options.colors();
|
ArrayString colors = options.colors();
|
||||||
colors=colorsPalette.getColorsPalette(colors);
|
|
||||||
options.colors(colors);
|
|
||||||
|
|
||||||
// colors.setValue(0, "#cc0038");
|
// colors.setValue(0, "#cc0038");
|
||||||
// colors.setValue(1, "#32cd32");
|
// colors.setValue(1, "#32cd32");
|
||||||
|
|
||||||
// yAxis
|
// yAxis
|
||||||
options.setFieldAsJsonObject("yAxis", retrieveYAxis(colors));
|
options.setFieldAsJsonObject("yAxis", retrieveYAxis(colors));
|
||||||
|
|
||||||
options.plotOptions().setFieldAsJsonObject("column",
|
options.plotOptions().setFieldAsJsonObject(
|
||||||
"{ " + "\"stacking\": \"normal\"," + "\"dataLabels\": { " + " \"enabled\": \"true\","
|
"column",
|
||||||
|
"{ " + "\"stacking\": \"normal\"," + "\"dataLabels\": { "
|
||||||
|
+ " \"enabled\": \"true\","
|
||||||
+ " \"color\": \"white\", " + " \"style\": {"
|
+ " \"color\": \"white\", " + " \"style\": {"
|
||||||
+ " \"textShadow\": \"0 0 3px black\"" + " }" + " }" + " }");
|
+ " \"textShadow\": \"0 0 3px black\"" + " }"
|
||||||
|
+ " }" + " }");
|
||||||
|
|
||||||
ArrayList<SeriesColumn> seriesColumn = new ArrayList<>();
|
ArrayList<SeriesColumn> seriesColumn = new ArrayList<>();
|
||||||
createSeriesColumnSimple(seriesJobTop, highchartsFactory, colors, seriesColumn);
|
if (seriesJobTop.getShowOthers()) {
|
||||||
|
createSeriesColumnShowOthers(seriesJobTop, highchartsFactory,
|
||||||
|
colors, seriesColumn);
|
||||||
|
} else {
|
||||||
|
createSeriesColumnSimple(seriesJobTop, highchartsFactory, colors,
|
||||||
|
seriesColumn);
|
||||||
|
}
|
||||||
|
|
||||||
for (SeriesColumn serie : seriesColumn) {
|
for (SeriesColumn serie : seriesColumn) {
|
||||||
options.series().addToEnd(serie);
|
options.series().addToEnd(serie);
|
||||||
|
@ -502,28 +528,35 @@ public class JobChartTopPanel extends SimpleContainer {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createSeriesColumnShowOthers(SeriesJobTop seriesJobTop, HighchartsOptionFactory highchartsFactory,
|
private void createSeriesColumnShowOthers(SeriesJobTop seriesJobTop,
|
||||||
ArrayString colors, ArrayList<SeriesColumn> seriesColumn) {
|
HighchartsOptionFactory highchartsFactory, ArrayString colors,
|
||||||
|
ArrayList<SeriesColumn> seriesColumn) {
|
||||||
Log.debug("Series ShowOthers");
|
Log.debug("Series ShowOthers");
|
||||||
if (accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
|
if (accountingStateData.getSeriesRequest().getAccountingPeriod()
|
||||||
.compareTo(AccountingPeriodMode.DAILY) == 0
|
.getPeriod().compareTo(AccountingPeriodMode.DAILY) == 0
|
||||||
|| accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
|
|| accountingStateData.getSeriesRequest().getAccountingPeriod()
|
||||||
.compareTo(AccountingPeriodMode.HOURLY) == 0
|
.getPeriod().compareTo(AccountingPeriodMode.HOURLY) == 0
|
||||||
|| accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
|
|| accountingStateData.getSeriesRequest().getAccountingPeriod()
|
||||||
.compareTo(AccountingPeriodMode.MINUTELY) == 0) {
|
.getPeriod().compareTo(AccountingPeriodMode.MINUTELY) == 0) {
|
||||||
|
|
||||||
double minRange = ChartTimeMeasure
|
double minRange = ChartTimeMeasure
|
||||||
.calculateMinRange(accountingStateData.getSeriesRequest().getAccountingPeriod());
|
.calculateMinRange(accountingStateData.getSeriesRequest()
|
||||||
|
.getAccountingPeriod());
|
||||||
|
|
||||||
double interval = ChartTimeMeasure
|
double interval = ChartTimeMeasure
|
||||||
.calculateInterval(accountingStateData.getSeriesRequest().getAccountingPeriod());
|
.calculateInterval(accountingStateData.getSeriesRequest()
|
||||||
|
.getAccountingPeriod());
|
||||||
|
|
||||||
Date dateStart = dtf.parse(accountingStateData.getSeriesRequest().getAccountingPeriod().getStartDate());
|
Date dateStart = dtf.parse(accountingStateData.getSeriesRequest()
|
||||||
|
.getAccountingPeriod().getStartDate());
|
||||||
|
|
||||||
dateStart.setTime(dateStart.getTime() + ChartTimeMeasure.timeZoneOffset() * ChartTimeMeasure.MINUTE);
|
dateStart.setTime(dateStart.getTime()
|
||||||
|
+ ChartTimeMeasure.timeZoneOffset()
|
||||||
|
* ChartTimeMeasure.MINUTE);
|
||||||
|
|
||||||
Log.debug("BuildChart DateStart: "
|
Log.debug("BuildChart DateStart: "
|
||||||
+ DateTimeFormat.getFormat(PredefinedFormat.DATE_TIME_FULL).format(dateStart));
|
+ DateTimeFormat.getFormat(PredefinedFormat.DATE_TIME_FULL)
|
||||||
|
.format(dateStart));
|
||||||
|
|
||||||
// xAxis
|
// xAxis
|
||||||
options.xAxis().type("datetime");
|
options.xAxis().type("datetime");
|
||||||
|
@ -531,25 +564,31 @@ public class JobChartTopPanel extends SimpleContainer {
|
||||||
options.tooltip().xDateFormat("Selected Data");
|
options.tooltip().xDateFormat("Selected Data");
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (; i < seriesJobTop.getSeriesJobDataTopList().size() && i < seriesJobTop.getTopNumber(); i++) {
|
for (; i < seriesJobTop.getSeriesJobDataTopList().size()
|
||||||
SeriesColumn seriesColumnData = highchartsFactory.createSeriesColumn();
|
&& i < seriesJobTop.getTopNumber(); i++) {
|
||||||
|
SeriesColumn seriesColumnData = highchartsFactory
|
||||||
|
.createSeriesColumn();
|
||||||
|
|
||||||
seriesColumnData.name(seriesJobTop.getSeriesJobDataTopList().get(i).getFilterValue().getValue());
|
seriesColumnData.name(seriesJobTop.getSeriesJobDataTopList()
|
||||||
|
.get(i).getFilterValue().getValue());
|
||||||
seriesColumnData.color(colors.get(i));
|
seriesColumnData.color(colors.get(i));
|
||||||
seriesColumnData.type("column");
|
seriesColumnData.type("column");
|
||||||
|
|
||||||
ArrayNumber data = seriesColumnData.dataAsArrayNumber();
|
ArrayNumber data = seriesColumnData.dataAsArrayNumber();
|
||||||
|
|
||||||
for (SeriesJobData seriesJobData : seriesJobTop.getSeriesJobDataTopList().get(i).getSeries()) {
|
for (SeriesJobData seriesJobData : seriesJobTop
|
||||||
|
.getSeriesJobDataTopList().get(i).getSeries()) {
|
||||||
switch (measure) {
|
switch (measure) {
|
||||||
case Duration:
|
case Duration:
|
||||||
data.push(seriesJobData.getDuration() / unitMeasure);
|
data.push(seriesJobData.getDuration() / unitMeasure);
|
||||||
break;
|
break;
|
||||||
case MaxInvocationTime:
|
case MaxInvocationTime:
|
||||||
data.push(seriesJobData.getMaxInvocationTime() / unitMeasure);
|
data.push(seriesJobData.getMaxInvocationTime()
|
||||||
|
/ unitMeasure);
|
||||||
break;
|
break;
|
||||||
case MinInvocationTime:
|
case MinInvocationTime:
|
||||||
data.push(seriesJobData.getMinInvocationTime() / unitMeasure);
|
data.push(seriesJobData.getMinInvocationTime()
|
||||||
|
/ unitMeasure);
|
||||||
break;
|
break;
|
||||||
case OperationCount:
|
case OperationCount:
|
||||||
data.push(seriesJobData.getOperationCount());
|
data.push(seriesJobData.getOperationCount());
|
||||||
|
@ -562,61 +601,77 @@ public class JobChartTopPanel extends SimpleContainer {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
seriesColumnData.pointInterval(interval).pointStart(dateStart.getTime());
|
seriesColumnData.pointInterval(interval).pointStart(
|
||||||
|
dateStart.getTime());
|
||||||
seriesColumn.add(seriesColumnData);
|
seriesColumn.add(seriesColumnData);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i < seriesJobTop.getSeriesJobDataTopList().size()) {
|
if (i < seriesJobTop.getSeriesJobDataTopList().size()) {
|
||||||
SeriesColumn seriesColumnData = highchartsFactory.createSeriesColumn();
|
SeriesColumn seriesColumnData = highchartsFactory
|
||||||
|
.createSeriesColumn();
|
||||||
|
|
||||||
seriesColumnData.name("Others");
|
seriesColumnData.name("Others");
|
||||||
seriesColumnData.color(colors.get(i));
|
seriesColumnData.color(colors.get(i));
|
||||||
seriesColumnData.type("column");
|
seriesColumnData.type("column");
|
||||||
|
|
||||||
ArrayList<Long> othersData = new ArrayList<>();
|
ArrayList<Long> othersData = new ArrayList<>();
|
||||||
for (int j = i; j < seriesJobTop.getSeriesJobDataTopList().size(); j++) {
|
for (int j = i; j < seriesJobTop.getSeriesJobDataTopList()
|
||||||
|
.size(); j++) {
|
||||||
Long value;
|
Long value;
|
||||||
for (int k = 0; k < seriesJobTop.getSeriesJobDataTopList().get(j).getSeries().size(); k++) {
|
for (int k = 0; k < seriesJobTop.getSeriesJobDataTopList()
|
||||||
SeriesJobData seriesJobData = seriesJobTop.getSeriesJobDataTopList().get(j).getSeries().get(k);
|
.get(j).getSeries().size(); k++) {
|
||||||
|
SeriesJobData seriesJobData = seriesJobTop
|
||||||
|
.getSeriesJobDataTopList().get(j).getSeries()
|
||||||
|
.get(k);
|
||||||
if (j == i) {
|
if (j == i) {
|
||||||
switch (measure) {
|
switch (measure) {
|
||||||
case Duration:
|
case Duration:
|
||||||
othersData.add(seriesJobData.getDuration() / unitMeasure);
|
othersData.add(seriesJobData.getDuration()
|
||||||
|
/ unitMeasure);
|
||||||
break;
|
break;
|
||||||
case MaxInvocationTime:
|
case MaxInvocationTime:
|
||||||
othersData.add(seriesJobData.getMaxInvocationTime() / unitMeasure);
|
othersData.add(seriesJobData
|
||||||
|
.getMaxInvocationTime() / unitMeasure);
|
||||||
break;
|
break;
|
||||||
case MinInvocationTime:
|
case MinInvocationTime:
|
||||||
othersData.add(seriesJobData.getMinInvocationTime() / unitMeasure);
|
othersData.add(seriesJobData
|
||||||
|
.getMinInvocationTime() / unitMeasure);
|
||||||
break;
|
break;
|
||||||
case OperationCount:
|
case OperationCount:
|
||||||
othersData.add(seriesJobData.getOperationCount());
|
othersData.add(seriesJobData
|
||||||
|
.getOperationCount());
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
othersData.add(seriesJobData.getDuration() / unitMeasure);
|
othersData.add(seriesJobData.getDuration()
|
||||||
|
/ unitMeasure);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
switch (measure) {
|
switch (measure) {
|
||||||
case Duration:
|
case Duration:
|
||||||
value = (seriesJobData.getDuration() / unitMeasure) + othersData.get(k);
|
value = (seriesJobData.getDuration() / unitMeasure)
|
||||||
|
+ othersData.get(k);
|
||||||
othersData.set(k, value);
|
othersData.set(k, value);
|
||||||
break;
|
break;
|
||||||
case MaxInvocationTime:
|
case MaxInvocationTime:
|
||||||
value = (seriesJobData.getMaxInvocationTime() / unitMeasure) + othersData.get(k);
|
value = (seriesJobData.getMaxInvocationTime() / unitMeasure)
|
||||||
|
+ othersData.get(k);
|
||||||
othersData.set(k, value);
|
othersData.set(k, value);
|
||||||
break;
|
break;
|
||||||
case MinInvocationTime:
|
case MinInvocationTime:
|
||||||
value = (seriesJobData.getMinInvocationTime() / unitMeasure) + othersData.get(k);
|
value = (seriesJobData.getMinInvocationTime() / unitMeasure)
|
||||||
|
+ othersData.get(k);
|
||||||
othersData.set(k, value);
|
othersData.set(k, value);
|
||||||
break;
|
break;
|
||||||
case OperationCount:
|
case OperationCount:
|
||||||
value = seriesJobData.getOperationCount() + othersData.get(k);
|
value = seriesJobData.getOperationCount()
|
||||||
|
+ othersData.get(k);
|
||||||
othersData.set(k, value);
|
othersData.set(k, value);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
value = (seriesJobData.getDuration() / unitMeasure) + othersData.get(k);
|
value = (seriesJobData.getDuration() / unitMeasure)
|
||||||
|
+ othersData.get(k);
|
||||||
othersData.set(k, value);
|
othersData.set(k, value);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -633,7 +688,8 @@ public class JobChartTopPanel extends SimpleContainer {
|
||||||
data.push(value);
|
data.push(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
seriesColumnData.pointInterval(interval).pointStart(dateStart.getTime());
|
seriesColumnData.pointInterval(interval).pointStart(
|
||||||
|
dateStart.getTime());
|
||||||
seriesColumn.add(seriesColumnData);
|
seriesColumn.add(seriesColumnData);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -641,15 +697,16 @@ public class JobChartTopPanel extends SimpleContainer {
|
||||||
// xAxis
|
// xAxis
|
||||||
options.xAxis().type("datetime");
|
options.xAxis().type("datetime");
|
||||||
|
|
||||||
if (accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
|
if (accountingStateData.getSeriesRequest().getAccountingPeriod()
|
||||||
.compareTo(AccountingPeriodMode.MONTHLY) == 0) {
|
.getPeriod().compareTo(AccountingPeriodMode.MONTHLY) == 0) {
|
||||||
// options.tooltip().xDateFormat("%b, %Y");
|
//options.tooltip().xDateFormat("%b, %Y");
|
||||||
options.tooltip().xDateFormat("Selected Data");
|
options.tooltip().xDateFormat("Selected Data");
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
|
if (accountingStateData.getSeriesRequest()
|
||||||
|
.getAccountingPeriod().getPeriod()
|
||||||
.compareTo(AccountingPeriodMode.YEARLY) == 0) {
|
.compareTo(AccountingPeriodMode.YEARLY) == 0) {
|
||||||
// options.tooltip().xDateFormat("%Y");
|
//options.tooltip().xDateFormat("%Y");
|
||||||
options.tooltip().xDateFormat("Selected Data");
|
options.tooltip().xDateFormat("Selected Data");
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -659,16 +716,20 @@ public class JobChartTopPanel extends SimpleContainer {
|
||||||
}
|
}
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (; i < seriesJobTop.getSeriesJobDataTopList().size() && i < seriesJobTop.getTopNumber(); i++) {
|
for (; i < seriesJobTop.getSeriesJobDataTopList().size()
|
||||||
SeriesColumn seriesColumnData = highchartsFactory.createSeriesColumn();
|
&& i < seriesJobTop.getTopNumber(); i++) {
|
||||||
|
SeriesColumn seriesColumnData = highchartsFactory
|
||||||
|
.createSeriesColumn();
|
||||||
|
|
||||||
seriesColumnData.name(seriesJobTop.getSeriesJobDataTopList().get(i).getFilterValue().getValue());
|
seriesColumnData.name(seriesJobTop.getSeriesJobDataTopList()
|
||||||
|
.get(i).getFilterValue().getValue());
|
||||||
seriesColumnData.color(colors.get(i));
|
seriesColumnData.color(colors.get(i));
|
||||||
seriesColumnData.type("column");
|
seriesColumnData.type("column");
|
||||||
|
|
||||||
Array<Data> arrayData = seriesColumnData.dataAsArrayObject();
|
Array<Data> arrayData = seriesColumnData.dataAsArrayObject();
|
||||||
|
|
||||||
for (SeriesJobData seriesJobData : seriesJobTop.getSeriesJobDataTopList().get(i).getSeries()) {
|
for (SeriesJobData seriesJobData : seriesJobTop
|
||||||
|
.getSeriesJobDataTopList().get(i).getSeries()) {
|
||||||
long dateFrom1970 = seriesJobData.getDate().getTime();
|
long dateFrom1970 = seriesJobData.getDate().getTime();
|
||||||
|
|
||||||
Log.debug("SeriersJobData: " + seriesJobData.getDate());
|
Log.debug("SeriersJobData: " + seriesJobData.getDate());
|
||||||
|
@ -684,12 +745,14 @@ public class JobChartTopPanel extends SimpleContainer {
|
||||||
break;
|
break;
|
||||||
case MaxInvocationTime:
|
case MaxInvocationTime:
|
||||||
data.x(dateFrom1970);
|
data.x(dateFrom1970);
|
||||||
data.y(seriesJobData.getMaxInvocationTime() / unitMeasure);
|
data.y(seriesJobData.getMaxInvocationTime()
|
||||||
|
/ unitMeasure);
|
||||||
arrayData.addToEnd(data);
|
arrayData.addToEnd(data);
|
||||||
break;
|
break;
|
||||||
case MinInvocationTime:
|
case MinInvocationTime:
|
||||||
data.x(dateFrom1970);
|
data.x(dateFrom1970);
|
||||||
data.y(seriesJobData.getMinInvocationTime() / unitMeasure);
|
data.y(seriesJobData.getMinInvocationTime()
|
||||||
|
/ unitMeasure);
|
||||||
arrayData.addToEnd(data);
|
arrayData.addToEnd(data);
|
||||||
break;
|
break;
|
||||||
case OperationCount:
|
case OperationCount:
|
||||||
|
@ -712,72 +775,94 @@ public class JobChartTopPanel extends SimpleContainer {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i < seriesJobTop.getSeriesJobDataTopList().size()) {
|
if (i < seriesJobTop.getSeriesJobDataTopList().size()) {
|
||||||
SeriesColumn seriesColumnData = highchartsFactory.createSeriesColumn();
|
SeriesColumn seriesColumnData = highchartsFactory
|
||||||
|
.createSeriesColumn();
|
||||||
|
|
||||||
seriesColumnData.name("Others");
|
seriesColumnData.name("Others");
|
||||||
seriesColumnData.color(colors.get(i));
|
seriesColumnData.color(colors.get(i));
|
||||||
seriesColumnData.type("column");
|
seriesColumnData.type("column");
|
||||||
|
|
||||||
ArrayList<ChartDateTimeData> othersData = new ArrayList<>();
|
ArrayList<ChartDateTimeData> othersData = new ArrayList<>();
|
||||||
for (int j = i; j < seriesJobTop.getSeriesJobDataTopList().size(); j++) {
|
for (int j = i; j < seriesJobTop.getSeriesJobDataTopList()
|
||||||
|
.size(); j++) {
|
||||||
ChartDateTimeData chartDateTimeData;
|
ChartDateTimeData chartDateTimeData;
|
||||||
for (int k = 0; k < seriesJobTop.getSeriesJobDataTopList().get(j).getSeries().size(); k++) {
|
for (int k = 0; k < seriesJobTop.getSeriesJobDataTopList()
|
||||||
SeriesJobData seriesJobData = seriesJobTop.getSeriesJobDataTopList().get(j).getSeries().get(k);
|
.get(j).getSeries().size(); k++) {
|
||||||
|
SeriesJobData seriesJobData = seriesJobTop
|
||||||
|
.getSeriesJobDataTopList().get(j).getSeries()
|
||||||
|
.get(k);
|
||||||
if (j == i) {
|
if (j == i) {
|
||||||
switch (measure) {
|
switch (measure) {
|
||||||
case Duration:
|
case Duration:
|
||||||
chartDateTimeData = new ChartDateTimeData(seriesJobData.getDate(),
|
chartDateTimeData = new ChartDateTimeData(
|
||||||
seriesJobData.getDuration() / unitMeasure);
|
seriesJobData.getDate(),
|
||||||
|
seriesJobData.getDuration()
|
||||||
|
/ unitMeasure);
|
||||||
othersData.add(chartDateTimeData);
|
othersData.add(chartDateTimeData);
|
||||||
break;
|
break;
|
||||||
case MaxInvocationTime:
|
case MaxInvocationTime:
|
||||||
chartDateTimeData = new ChartDateTimeData(seriesJobData.getDate(),
|
chartDateTimeData = new ChartDateTimeData(
|
||||||
seriesJobData.getMaxInvocationTime() / unitMeasure);
|
seriesJobData.getDate(),
|
||||||
|
seriesJobData.getMaxInvocationTime()
|
||||||
|
/ unitMeasure);
|
||||||
othersData.add(chartDateTimeData);
|
othersData.add(chartDateTimeData);
|
||||||
break;
|
break;
|
||||||
case MinInvocationTime:
|
case MinInvocationTime:
|
||||||
chartDateTimeData = new ChartDateTimeData(seriesJobData.getDate(),
|
chartDateTimeData = new ChartDateTimeData(
|
||||||
seriesJobData.getMinInvocationTime() / unitMeasure);
|
seriesJobData.getDate(),
|
||||||
|
seriesJobData.getMinInvocationTime()
|
||||||
|
/ unitMeasure);
|
||||||
othersData.add(chartDateTimeData);
|
othersData.add(chartDateTimeData);
|
||||||
break;
|
break;
|
||||||
case OperationCount:
|
case OperationCount:
|
||||||
chartDateTimeData = new ChartDateTimeData(seriesJobData.getDate(),
|
chartDateTimeData = new ChartDateTimeData(
|
||||||
|
seriesJobData.getDate(),
|
||||||
seriesJobData.getOperationCount());
|
seriesJobData.getOperationCount());
|
||||||
othersData.add(chartDateTimeData);
|
othersData.add(chartDateTimeData);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
chartDateTimeData = new ChartDateTimeData(seriesJobData.getDate(),
|
chartDateTimeData = new ChartDateTimeData(
|
||||||
seriesJobData.getDuration() / unitMeasure);
|
seriesJobData.getDate(),
|
||||||
|
seriesJobData.getDuration()
|
||||||
|
/ unitMeasure);
|
||||||
othersData.add(chartDateTimeData);
|
othersData.add(chartDateTimeData);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
switch (measure) {
|
switch (measure) {
|
||||||
case Duration:
|
case Duration:
|
||||||
chartDateTimeData = new ChartDateTimeData(seriesJobData.getDate(),
|
chartDateTimeData = new ChartDateTimeData(
|
||||||
(seriesJobData.getDuration() / unitMeasure) + othersData.get(k).getValue());
|
seriesJobData.getDate(),
|
||||||
|
(seriesJobData.getDuration() / unitMeasure)
|
||||||
|
+ othersData.get(k).getValue());
|
||||||
othersData.set(k, chartDateTimeData);
|
othersData.set(k, chartDateTimeData);
|
||||||
break;
|
break;
|
||||||
case MaxInvocationTime:
|
case MaxInvocationTime:
|
||||||
chartDateTimeData = new ChartDateTimeData(seriesJobData.getDate(),
|
chartDateTimeData = new ChartDateTimeData(
|
||||||
|
seriesJobData.getDate(),
|
||||||
(seriesJobData.getMaxInvocationTime() / unitMeasure)
|
(seriesJobData.getMaxInvocationTime() / unitMeasure)
|
||||||
+ othersData.get(k).getValue());
|
+ othersData.get(k).getValue());
|
||||||
othersData.set(k, chartDateTimeData);
|
othersData.set(k, chartDateTimeData);
|
||||||
break;
|
break;
|
||||||
case MinInvocationTime:
|
case MinInvocationTime:
|
||||||
chartDateTimeData = new ChartDateTimeData(seriesJobData.getDate(),
|
chartDateTimeData = new ChartDateTimeData(
|
||||||
|
seriesJobData.getDate(),
|
||||||
(seriesJobData.getMinInvocationTime() / unitMeasure)
|
(seriesJobData.getMinInvocationTime() / unitMeasure)
|
||||||
+ othersData.get(k).getValue());
|
+ othersData.get(k).getValue());
|
||||||
othersData.set(k, chartDateTimeData);
|
othersData.set(k, chartDateTimeData);
|
||||||
break;
|
break;
|
||||||
case OperationCount:
|
case OperationCount:
|
||||||
chartDateTimeData = new ChartDateTimeData(seriesJobData.getDate(),
|
chartDateTimeData = new ChartDateTimeData(
|
||||||
seriesJobData.getOperationCount() + othersData.get(k).getValue());
|
seriesJobData.getDate(),
|
||||||
|
seriesJobData.getOperationCount()
|
||||||
|
+ othersData.get(k).getValue());
|
||||||
othersData.set(k, chartDateTimeData);
|
othersData.set(k, chartDateTimeData);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
chartDateTimeData = new ChartDateTimeData(seriesJobData.getDate(),
|
chartDateTimeData = new ChartDateTimeData(
|
||||||
(seriesJobData.getDuration() / unitMeasure) + othersData.get(k).getValue());
|
seriesJobData.getDate(),
|
||||||
|
(seriesJobData.getDuration() / unitMeasure)
|
||||||
|
+ othersData.get(k).getValue());
|
||||||
othersData.set(k, chartDateTimeData);
|
othersData.set(k, chartDateTimeData);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -793,7 +878,8 @@ public class JobChartTopPanel extends SimpleContainer {
|
||||||
for (ChartDateTimeData chartDateTimeData : othersData) {
|
for (ChartDateTimeData chartDateTimeData : othersData) {
|
||||||
long dateFrom1970 = chartDateTimeData.getDate().getTime();
|
long dateFrom1970 = chartDateTimeData.getDate().getTime();
|
||||||
|
|
||||||
Log.debug("SeriersOthersData: " + chartDateTimeData.getDate());
|
Log.debug("SeriersOthersData: "
|
||||||
|
+ chartDateTimeData.getDate());
|
||||||
Log.debug("SeriersOthersData: " + dateFrom1970);
|
Log.debug("SeriersOthersData: " + dateFrom1970);
|
||||||
|
|
||||||
Data data = highchartsFactory.createSeriesColumnData();
|
Data data = highchartsFactory.createSeriesColumnData();
|
||||||
|
@ -810,28 +896,35 @@ public class JobChartTopPanel extends SimpleContainer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createSeriesColumnSimple(SeriesJobTop seriesJobTop, HighchartsOptionFactory highchartsFactory,
|
private void createSeriesColumnSimple(SeriesJobTop seriesJobTop,
|
||||||
ArrayString colors, ArrayList<SeriesColumn> seriesColumn) {
|
HighchartsOptionFactory highchartsFactory, ArrayString colors,
|
||||||
|
ArrayList<SeriesColumn> seriesColumn) {
|
||||||
Log.debug("Series Simple");
|
Log.debug("Series Simple");
|
||||||
if (accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
|
if (accountingStateData.getSeriesRequest().getAccountingPeriod()
|
||||||
.compareTo(AccountingPeriodMode.DAILY) == 0
|
.getPeriod().compareTo(AccountingPeriodMode.DAILY) == 0
|
||||||
|| accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
|
|| accountingStateData.getSeriesRequest().getAccountingPeriod()
|
||||||
.compareTo(AccountingPeriodMode.HOURLY) == 0
|
.getPeriod().compareTo(AccountingPeriodMode.HOURLY) == 0
|
||||||
|| accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
|
|| accountingStateData.getSeriesRequest().getAccountingPeriod()
|
||||||
.compareTo(AccountingPeriodMode.MINUTELY) == 0) {
|
.getPeriod().compareTo(AccountingPeriodMode.MINUTELY) == 0) {
|
||||||
|
|
||||||
double minRange = ChartTimeMeasure
|
double minRange = ChartTimeMeasure
|
||||||
.calculateMinRange(accountingStateData.getSeriesRequest().getAccountingPeriod());
|
.calculateMinRange(accountingStateData.getSeriesRequest()
|
||||||
|
.getAccountingPeriod());
|
||||||
|
|
||||||
double interval = ChartTimeMeasure
|
double interval = ChartTimeMeasure
|
||||||
.calculateInterval(accountingStateData.getSeriesRequest().getAccountingPeriod());
|
.calculateInterval(accountingStateData.getSeriesRequest()
|
||||||
|
.getAccountingPeriod());
|
||||||
|
|
||||||
Date dateStart = dtf.parse(accountingStateData.getSeriesRequest().getAccountingPeriod().getStartDate());
|
Date dateStart = dtf.parse(accountingStateData.getSeriesRequest()
|
||||||
|
.getAccountingPeriod().getStartDate());
|
||||||
|
|
||||||
dateStart.setTime(dateStart.getTime() + ChartTimeMeasure.timeZoneOffset() * ChartTimeMeasure.MINUTE);
|
dateStart.setTime(dateStart.getTime()
|
||||||
|
+ ChartTimeMeasure.timeZoneOffset()
|
||||||
|
* ChartTimeMeasure.MINUTE);
|
||||||
|
|
||||||
Log.debug("BuildChart DateStart: "
|
Log.debug("BuildChart DateStart: "
|
||||||
+ DateTimeFormat.getFormat(PredefinedFormat.DATE_TIME_FULL).format(dateStart));
|
+ DateTimeFormat.getFormat(PredefinedFormat.DATE_TIME_FULL)
|
||||||
|
.format(dateStart));
|
||||||
|
|
||||||
// xAxis
|
// xAxis
|
||||||
options.xAxis().type("datetime");
|
options.xAxis().type("datetime");
|
||||||
|
@ -839,24 +932,29 @@ 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.createSeriesColumn();
|
SeriesColumn seriesColumnData = highchartsFactory
|
||||||
|
.createSeriesColumn();
|
||||||
|
|
||||||
seriesColumnData.name(seriesJobTop.getSeriesJobDataTopList().get(i).getFilterValue().getValue());
|
seriesColumnData.name(seriesJobTop.getSeriesJobDataTopList()
|
||||||
|
.get(i).getFilterValue().getValue());
|
||||||
seriesColumnData.color(colors.get(i));
|
seriesColumnData.color(colors.get(i));
|
||||||
seriesColumnData.type("column");
|
seriesColumnData.type("column");
|
||||||
|
|
||||||
ArrayNumber data = seriesColumnData.dataAsArrayNumber();
|
ArrayNumber data = seriesColumnData.dataAsArrayNumber();
|
||||||
|
|
||||||
for (SeriesJobData seriesJobData : seriesJobTop.getSeriesJobDataTopList().get(i).getSeries()) {
|
for (SeriesJobData seriesJobData : seriesJobTop
|
||||||
|
.getSeriesJobDataTopList().get(i).getSeries()) {
|
||||||
switch (measure) {
|
switch (measure) {
|
||||||
case Duration:
|
case Duration:
|
||||||
data.push(seriesJobData.getDuration() / unitMeasure);
|
data.push(seriesJobData.getDuration() / unitMeasure);
|
||||||
break;
|
break;
|
||||||
case MaxInvocationTime:
|
case MaxInvocationTime:
|
||||||
data.push(seriesJobData.getMaxInvocationTime() / unitMeasure);
|
data.push(seriesJobData.getMaxInvocationTime()
|
||||||
|
/ unitMeasure);
|
||||||
break;
|
break;
|
||||||
case MinInvocationTime:
|
case MinInvocationTime:
|
||||||
data.push(seriesJobData.getMinInvocationTime() / unitMeasure);
|
data.push(seriesJobData.getMinInvocationTime()
|
||||||
|
/ unitMeasure);
|
||||||
break;
|
break;
|
||||||
case OperationCount:
|
case OperationCount:
|
||||||
data.push(seriesJobData.getOperationCount());
|
data.push(seriesJobData.getOperationCount());
|
||||||
|
@ -869,7 +967,8 @@ public class JobChartTopPanel extends SimpleContainer {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
seriesColumnData.pointInterval(interval).pointStart(dateStart.getTime());
|
seriesColumnData.pointInterval(interval).pointStart(
|
||||||
|
dateStart.getTime());
|
||||||
seriesColumn.add(seriesColumnData);
|
seriesColumn.add(seriesColumnData);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -877,15 +976,16 @@ public class JobChartTopPanel extends SimpleContainer {
|
||||||
// xAxis
|
// xAxis
|
||||||
options.xAxis().type("datetime");
|
options.xAxis().type("datetime");
|
||||||
|
|
||||||
if (accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
|
if (accountingStateData.getSeriesRequest().getAccountingPeriod()
|
||||||
.compareTo(AccountingPeriodMode.MONTHLY) == 0) {
|
.getPeriod().compareTo(AccountingPeriodMode.MONTHLY) == 0) {
|
||||||
// options.tooltip().xDateFormat("%b, %Y");
|
//options.tooltip().xDateFormat("%b, %Y");
|
||||||
options.tooltip().xDateFormat("Selected Data");
|
options.tooltip().xDateFormat("Selected Data");
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
|
if (accountingStateData.getSeriesRequest()
|
||||||
|
.getAccountingPeriod().getPeriod()
|
||||||
.compareTo(AccountingPeriodMode.YEARLY) == 0) {
|
.compareTo(AccountingPeriodMode.YEARLY) == 0) {
|
||||||
// options.tooltip().xDateFormat("%Y");
|
//options.tooltip().xDateFormat("%Y");
|
||||||
options.tooltip().xDateFormat("Selected Data");
|
options.tooltip().xDateFormat("Selected Data");
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -895,15 +995,18 @@ public class JobChartTopPanel extends SimpleContainer {
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < seriesJobTop.getSeriesJobDataTopList().size(); i++) {
|
for (int i = 0; i < seriesJobTop.getSeriesJobDataTopList().size(); i++) {
|
||||||
SeriesColumn seriesColumnData = highchartsFactory.createSeriesColumn();
|
SeriesColumn seriesColumnData = highchartsFactory
|
||||||
|
.createSeriesColumn();
|
||||||
|
|
||||||
seriesColumnData.name(seriesJobTop.getSeriesJobDataTopList().get(i).getFilterValue().getValue());
|
seriesColumnData.name(seriesJobTop.getSeriesJobDataTopList()
|
||||||
|
.get(i).getFilterValue().getValue());
|
||||||
seriesColumnData.color(colors.get(i));
|
seriesColumnData.color(colors.get(i));
|
||||||
seriesColumnData.type("column");
|
seriesColumnData.type("column");
|
||||||
|
|
||||||
Array<Data> arrayData = seriesColumnData.dataAsArrayObject();
|
Array<Data> arrayData = seriesColumnData.dataAsArrayObject();
|
||||||
|
|
||||||
for (SeriesJobData seriesJobData : seriesJobTop.getSeriesJobDataTopList().get(i).getSeries()) {
|
for (SeriesJobData seriesJobData : seriesJobTop
|
||||||
|
.getSeriesJobDataTopList().get(i).getSeries()) {
|
||||||
long dateFrom1970 = seriesJobData.getDate().getTime();
|
long dateFrom1970 = seriesJobData.getDate().getTime();
|
||||||
|
|
||||||
Log.debug("SeriersJobData: " + seriesJobData.getDate());
|
Log.debug("SeriersJobData: " + seriesJobData.getDate());
|
||||||
|
@ -919,12 +1022,14 @@ public class JobChartTopPanel extends SimpleContainer {
|
||||||
break;
|
break;
|
||||||
case MaxInvocationTime:
|
case MaxInvocationTime:
|
||||||
data.x(dateFrom1970);
|
data.x(dateFrom1970);
|
||||||
data.y(seriesJobData.getMaxInvocationTime() / unitMeasure);
|
data.y(seriesJobData.getMaxInvocationTime()
|
||||||
|
/ unitMeasure);
|
||||||
arrayData.addToEnd(data);
|
arrayData.addToEnd(data);
|
||||||
break;
|
break;
|
||||||
case MinInvocationTime:
|
case MinInvocationTime:
|
||||||
data.x(dateFrom1970);
|
data.x(dateFrom1970);
|
||||||
data.y(seriesJobData.getMinInvocationTime() / unitMeasure);
|
data.y(seriesJobData.getMinInvocationTime()
|
||||||
|
/ unitMeasure);
|
||||||
arrayData.addToEnd(data);
|
arrayData.addToEnd(data);
|
||||||
break;
|
break;
|
||||||
case OperationCount:
|
case OperationCount:
|
||||||
|
@ -952,45 +1057,68 @@ public class JobChartTopPanel extends SimpleContainer {
|
||||||
private String retrieveYAxis(ArrayString colors) {
|
private String retrieveYAxis(ArrayString colors) {
|
||||||
switch (measure) {
|
switch (measure) {
|
||||||
case Duration:
|
case Duration:
|
||||||
return "[{" + " \"id\": \"" + JobChartMeasure.Duration.name() + "\"," + " \"labels\": {"
|
return "[{" + " \"id\": \"" + JobChartMeasure.Duration.name()
|
||||||
+ " \"format\": \"{value} " + unitMeasureLabel + "\"," + " \"style\": {"
|
+ "\"," + " \"labels\": {" + " \"format\": \"{value} "
|
||||||
+ " \"color\": \"#434348\"" + " }" + " }," + " \"stackLabels\": {"
|
+ unitMeasureLabel + "\"," + " \"style\": {"
|
||||||
+ " \"enabled\": \"true\"," + " \"style\": {" + " \"fontWeight\": \"bold\","
|
+ " \"color\": \"" + colors.get(1) + "\"" + " }"
|
||||||
+ " \"color\": \"gray\"" + " } " + " }," + " \"title\": { " + " \"text\": \""
|
+ " }," + " \"stackLabels\": {" + " \"enabled\": \"true\","
|
||||||
+ JobChartMeasure.Duration.getLabel() + "\"," + " \"style\": {" + " \"color\": \"#434348\""
|
+ " \"style\": {" + " \"fontWeight\": \"bold\","
|
||||||
+ " }" + " }" + "}]";
|
+ " \"color\": \"gray\"" + " } " + " },"
|
||||||
|
+ " \"title\": { " + " \"text\": \""
|
||||||
|
+ JobChartMeasure.Duration.getLabel() + "\","
|
||||||
|
+ " \"style\": {" + " \"color\": \""
|
||||||
|
+ colors.get(1) + "\"" + " }" + " }" + "}]";
|
||||||
case MaxInvocationTime:
|
case MaxInvocationTime:
|
||||||
return "[{" + " \"id\": \"" + JobChartMeasure.MaxInvocationTime.name() + "\"," + " \"labels\": {"
|
return "[{" + " \"id\": \""
|
||||||
+ " \"format\": \"{value} " + unitMeasureLabel + "\"," + " \"style\": {"
|
+ JobChartMeasure.MaxInvocationTime.name() + "\","
|
||||||
+ " \"color\": \"#434348\"" + " }" + " }," + " \"stackLabels\": {"
|
+ " \"labels\": {" + " \"format\": \"{value} "
|
||||||
+ " \"enabled\": \"true\"," + " \"style\": {" + " \"fontWeight\": \"bold\","
|
+ unitMeasureLabel + "\"," + " \"style\": {"
|
||||||
+ " \"color\": \"gray\"" + " } " + " }," + " \"title\": { " + " \"text\": \""
|
+ " \"color\": \"" + colors.get(1) + "\"" + " }"
|
||||||
+ JobChartMeasure.MaxInvocationTime.getLabel() + "\"," + " \"style\": {" + " \"color\": \"#434348\""
|
+ " }," + " \"stackLabels\": {" + " \"enabled\": \"true\","
|
||||||
+ " }" + " }" + "}]";
|
+ " \"style\": {" + " \"fontWeight\": \"bold\","
|
||||||
|
+ " \"color\": \"gray\"" + " } " + " },"
|
||||||
|
+ " \"title\": { " + " \"text\": \""
|
||||||
|
+ JobChartMeasure.MaxInvocationTime.getLabel() + "\","
|
||||||
|
+ " \"style\": {" + " \"color\": \""
|
||||||
|
+ colors.get(1) + "\"" + " }" + " }" + "}]";
|
||||||
case MinInvocationTime:
|
case MinInvocationTime:
|
||||||
return "[{" + " \"id\": \"" + JobChartMeasure.MinInvocationTime.name() + "\"," + " \"labels\": {"
|
return "[{" + " \"id\": \""
|
||||||
+ " \"format\": \"{value} " + unitMeasureLabel + "\"," + " \"style\": {"
|
+ JobChartMeasure.MinInvocationTime.name() + "\","
|
||||||
+ " \"color\": \"#434348\"" + " }" + " }," + " \"stackLabels\": {"
|
+ " \"labels\": {" + " \"format\": \"{value} "
|
||||||
+ " \"enabled\": \"true\"," + " \"style\": {" + " \"fontWeight\": \"bold\","
|
+ unitMeasureLabel + "\"," + " \"style\": {"
|
||||||
+ " \"color\": \"gray\"" + " } " + " }," + " \"title\": { " + " \"text\": \""
|
+ " \"color\": \"" + colors.get(1) + "\"" + " }"
|
||||||
+ JobChartMeasure.MinInvocationTime.getLabel() + "\"," + " \"style\": {" + " \"color\": \"#434348\""
|
+ " }," + " \"stackLabels\": {" + " \"enabled\": \"true\","
|
||||||
+ " }" + " }" + "}]";
|
+ " \"style\": {" + " \"fontWeight\": \"bold\","
|
||||||
|
+ " \"color\": \"gray\"" + " } " + " },"
|
||||||
|
+ " \"title\": { " + " \"text\": \""
|
||||||
|
+ JobChartMeasure.MinInvocationTime.getLabel() + "\","
|
||||||
|
+ " \"style\": {" + " \"color\": \""
|
||||||
|
+ colors.get(1) + "\"" + " }" + " }" + "}]";
|
||||||
case OperationCount:
|
case OperationCount:
|
||||||
return "[{" + " \"id\": \"" + JobChartMeasure.OperationCount.name() + "\"," + " \"labels\": { "
|
return "[{" + " \"id\": \"" + JobChartMeasure.OperationCount.name()
|
||||||
+ " \"format\": \"{value}\"," + " \"style\": { " + " \"color\": \"#434348\""
|
+ "\"," + " \"labels\": { "
|
||||||
+ " }" + " }," + " \"stackLabels\": {" + " \"enabled\": \"true\"," + " \"style\": {"
|
+ " \"format\": \"{value}\"," + " \"style\": { "
|
||||||
+ " \"fontWeight\": \"bold\"," + " \"color\": \"gray\"" + " } " + " },"
|
+ " \"color\": \"" + colors.get(1) + "\"" + " }"
|
||||||
+ " \"title\": { " + " \"text\": \"" + JobChartMeasure.OperationCount.getLabel() + "\","
|
+ " }," + " \"stackLabels\": {" + " \"enabled\": \"true\","
|
||||||
+ " \"style\": {" + " \"color\": \"#434348\"" + " }" + " }" + "}]";
|
+ " \"style\": {" + " \"fontWeight\": \"bold\","
|
||||||
|
+ " \"color\": \"gray\"" + " } " + " },"
|
||||||
|
+ " \"title\": { " + " \"text\": \""
|
||||||
|
+ JobChartMeasure.OperationCount.getLabel() + "\","
|
||||||
|
+ " \"style\": {" + " \"color\": \""
|
||||||
|
+ colors.get(1) + "\"" + " }" + " }" + "}]";
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return "[{" + " \"id\": \"" + JobChartMeasure.Duration.name() + "\"," + " \"labels\": {"
|
return "[{" + " \"id\": \"" + JobChartMeasure.Duration.name()
|
||||||
+ " \"format\": \"{value} " + unitMeasureLabel + "\"," + " \"style\": {"
|
+ "\"," + " \"labels\": {" + " \"format\": \"{value} "
|
||||||
+ " \"color\": \"#434348\"" + " }" + " }," + " \"stackLabels\": {"
|
+ unitMeasureLabel + "\"," + " \"style\": {"
|
||||||
+ " \"enabled\": \"true\"," + " \"style\": {" + " \"fontWeight\": \"bold\","
|
+ " \"color\": \"" + colors.get(1) + "\"" + " }"
|
||||||
+ " \"color\": \"gray\"" + " } " + " }," + " \"title\": { " + " \"text\": \""
|
+ " }," + " \"stackLabels\": {" + " \"enabled\": \"true\","
|
||||||
+ JobChartMeasure.Duration.getLabel() + "\"," + " \"style\": {" + " \"color\": \"#434348\""
|
+ " \"style\": {" + " \"fontWeight\": \"bold\","
|
||||||
+ " }" + " }" + "}]";
|
+ " \"color\": \"gray\"" + " } " + " },"
|
||||||
|
+ " \"title\": { " + " \"text\": \""
|
||||||
|
+ JobChartMeasure.Duration.getLabel() + "\","
|
||||||
|
+ " \"style\": {" + " \"color\": \""
|
||||||
|
+ colors.get(1) + "\"" + " }" + " }" + "}]";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/maindata/charts/service/ServiceChartBasicPanel.java
Executable file → Normal file
576
src/main/java/org/gcube/portlets/admin/accountingmanager/client/maindata/charts/service/ServiceChartTopPanel.java
Executable file → Normal file
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/maindata/charts/space/SpaceChartSpacesPanel.java
Executable file → Normal file
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/maindata/charts/storage/StorageChartBasicPanel.java
Executable file → Normal file
381
src/main/java/org/gcube/portlets/admin/accountingmanager/client/maindata/charts/storage/StorageChartTopPanel.java
Executable file → Normal file
|
@ -7,7 +7,6 @@ import org.gcube.portlets.admin.accountingmanager.client.event.ExportRequestEven
|
||||||
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.ByteUnitMeasure;
|
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.ByteUnitMeasure;
|
||||||
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.ChartDateTimeData;
|
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.ChartDateTimeData;
|
||||||
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.ChartTimeMeasure;
|
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.ChartTimeMeasure;
|
||||||
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.ColorsPalette;
|
|
||||||
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.DownloadConstants;
|
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.DownloadConstants;
|
||||||
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.StorageChartMeasure;
|
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.StorageChartMeasure;
|
||||||
import org.gcube.portlets.admin.accountingmanager.client.resource.AccountingManagerResources;
|
import org.gcube.portlets.admin.accountingmanager.client.resource.AccountingManagerResources;
|
||||||
|
@ -58,7 +57,8 @@ public class StorageChartTopPanel extends SimpleContainer {
|
||||||
private static final String DATA_VOLUME_UNIT = "Data Volume Unit";
|
private static final String DATA_VOLUME_UNIT = "Data Volume Unit";
|
||||||
// private static final String MEASURE_TYPE = "Measure";
|
// private static final String MEASURE_TYPE = "Measure";
|
||||||
|
|
||||||
private DateTimeFormat dtf = DateTimeFormat.getFormat(PredefinedFormat.YEAR_MONTH_DAY);
|
private DateTimeFormat dtf = DateTimeFormat
|
||||||
|
.getFormat(PredefinedFormat.YEAR_MONTH_DAY);
|
||||||
|
|
||||||
private EventBus eventBus;
|
private EventBus eventBus;
|
||||||
private AccountingClientStateData accountingStateData;
|
private AccountingClientStateData accountingStateData;
|
||||||
|
@ -94,7 +94,8 @@ public class StorageChartTopPanel extends SimpleContainer {
|
||||||
|
|
||||||
private VerticalLayoutContainer vert;
|
private VerticalLayoutContainer vert;
|
||||||
|
|
||||||
public StorageChartTopPanel(EventBus eventBus, AccountingClientStateData accountingStateData) {
|
public StorageChartTopPanel(EventBus eventBus,
|
||||||
|
AccountingClientStateData accountingStateData) {
|
||||||
this.eventBus = eventBus;
|
this.eventBus = eventBus;
|
||||||
this.accountingStateData = accountingStateData;
|
this.accountingStateData = accountingStateData;
|
||||||
forceLayoutOnResize = true;
|
forceLayoutOnResize = true;
|
||||||
|
@ -106,7 +107,8 @@ public class StorageChartTopPanel extends SimpleContainer {
|
||||||
ToolBar toolBar = new ToolBar();
|
ToolBar toolBar = new ToolBar();
|
||||||
toolBar.setSpacing(2);
|
toolBar.setSpacing(2);
|
||||||
// Download
|
// Download
|
||||||
final TextButton downloadButton = new TextButton(DownloadConstants.DOWNLOAD,
|
final TextButton downloadButton = new TextButton(
|
||||||
|
DownloadConstants.DOWNLOAD,
|
||||||
AccountingManagerResources.INSTANCE.accountingDownload24());
|
AccountingManagerResources.INSTANCE.accountingDownload24());
|
||||||
// downloadButton.setScale(ButtonScale.MEDIUM);
|
// downloadButton.setScale(ButtonScale.MEDIUM);
|
||||||
downloadButton.setIconAlign(IconAlign.RIGHT);
|
downloadButton.setIconAlign(IconAlign.RIGHT);
|
||||||
|
@ -114,14 +116,16 @@ public class StorageChartTopPanel extends SimpleContainer {
|
||||||
downloadButton.setMenu(createDownloadMenu());
|
downloadButton.setMenu(createDownloadMenu());
|
||||||
|
|
||||||
// Measure
|
// Measure
|
||||||
measureButton = new TextButton(StorageChartMeasure.DataVolume.getLabel(),
|
measureButton = new TextButton(
|
||||||
|
StorageChartMeasure.DataVolume.getLabel(),
|
||||||
AccountingManagerResources.INSTANCE.accountingByte24());
|
AccountingManagerResources.INSTANCE.accountingByte24());
|
||||||
measureButton.setIconAlign(IconAlign.RIGHT);
|
measureButton.setIconAlign(IconAlign.RIGHT);
|
||||||
measureButton.setArrowAlign(ButtonArrowAlign.RIGHT);
|
measureButton.setArrowAlign(ButtonArrowAlign.RIGHT);
|
||||||
measureButton.setMenu(createMeasureMenu());
|
measureButton.setMenu(createMeasureMenu());
|
||||||
|
|
||||||
// Unit
|
// Unit
|
||||||
unitButton = new TextButton(DATA_VOLUME_UNIT, AccountingManagerResources.INSTANCE.accountingUnitMB24());
|
unitButton = new TextButton(DATA_VOLUME_UNIT,
|
||||||
|
AccountingManagerResources.INSTANCE.accountingUnitMB24());
|
||||||
unitButton.setIconAlign(IconAlign.RIGHT);
|
unitButton.setIconAlign(IconAlign.RIGHT);
|
||||||
unitButton.setArrowAlign(ButtonArrowAlign.RIGHT);
|
unitButton.setArrowAlign(ButtonArrowAlign.RIGHT);
|
||||||
unitButton.setMenu(createUnitMenu());
|
unitButton.setMenu(createUnitMenu());
|
||||||
|
@ -139,7 +143,8 @@ public class StorageChartTopPanel extends SimpleContainer {
|
||||||
//
|
//
|
||||||
vert = new VerticalLayoutContainer();
|
vert = new VerticalLayoutContainer();
|
||||||
vert.add(toolBar, new VerticalLayoutData(1, -1, new Margins(0)));
|
vert.add(toolBar, new VerticalLayoutData(1, -1, new Margins(0)));
|
||||||
vert.add(highchartsLayoutPanel, new VerticalLayoutData(1, 1, new Margins(0)));
|
vert.add(highchartsLayoutPanel, new VerticalLayoutData(1, 1,
|
||||||
|
new Margins(0)));
|
||||||
|
|
||||||
add(vert, new MarginData(0));
|
add(vert, new MarginData(0));
|
||||||
|
|
||||||
|
@ -268,7 +273,8 @@ public class StorageChartTopPanel extends SimpleContainer {
|
||||||
Menu menuMeasure = new Menu();
|
Menu menuMeasure = new Menu();
|
||||||
dataVolumeItem = new MenuItem(StorageChartMeasure.DataVolume.getLabel());
|
dataVolumeItem = new MenuItem(StorageChartMeasure.DataVolume.getLabel());
|
||||||
dataVolumeItem.setHeight(30);
|
dataVolumeItem.setHeight(30);
|
||||||
operationCountItem = new MenuItem(StorageChartMeasure.OperationCount.getLabel());
|
operationCountItem = new MenuItem(
|
||||||
|
StorageChartMeasure.OperationCount.getLabel());
|
||||||
operationCountItem.setHeight(30);
|
operationCountItem.setHeight(30);
|
||||||
|
|
||||||
dataVolumeItem.addSelectionHandler(new SelectionHandler<Item>() {
|
dataVolumeItem.addSelectionHandler(new SelectionHandler<Item>() {
|
||||||
|
@ -286,7 +292,8 @@ public class StorageChartTopPanel extends SimpleContainer {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSelection(SelectionEvent<Item> event) {
|
public void onSelection(SelectionEvent<Item> event) {
|
||||||
measureButton.setText(StorageChartMeasure.OperationCount.getLabel());
|
measureButton.setText(StorageChartMeasure.OperationCount
|
||||||
|
.getLabel());
|
||||||
measure = StorageChartMeasure.OperationCount;
|
measure = StorageChartMeasure.OperationCount;
|
||||||
unitButton.setVisible(false);
|
unitButton.setVisible(false);
|
||||||
updateChart();
|
updateChart();
|
||||||
|
@ -302,13 +309,17 @@ public class StorageChartTopPanel extends SimpleContainer {
|
||||||
|
|
||||||
private Menu createUnitMenu() {
|
private Menu createUnitMenu() {
|
||||||
Menu menuUnit = new Menu();
|
Menu menuUnit = new Menu();
|
||||||
kBItem = new MenuItem(ByteUnitMeasure.KILOBYTE, AccountingManagerResources.INSTANCE.accountingUnitkB24());
|
kBItem = new MenuItem(ByteUnitMeasure.KILOBYTE,
|
||||||
|
AccountingManagerResources.INSTANCE.accountingUnitkB24());
|
||||||
kBItem.setHeight(30);
|
kBItem.setHeight(30);
|
||||||
MBItem = new MenuItem(ByteUnitMeasure.MEGABYTE, AccountingManagerResources.INSTANCE.accountingUnitMB24());
|
MBItem = new MenuItem(ByteUnitMeasure.MEGABYTE,
|
||||||
|
AccountingManagerResources.INSTANCE.accountingUnitMB24());
|
||||||
MBItem.setHeight(30);
|
MBItem.setHeight(30);
|
||||||
GBItem = new MenuItem(ByteUnitMeasure.GIGABYTE, AccountingManagerResources.INSTANCE.accountingUnitGB24());
|
GBItem = new MenuItem(ByteUnitMeasure.GIGABYTE,
|
||||||
|
AccountingManagerResources.INSTANCE.accountingUnitGB24());
|
||||||
GBItem.setHeight(30);
|
GBItem.setHeight(30);
|
||||||
TBItem = new MenuItem(ByteUnitMeasure.TERABYTE, AccountingManagerResources.INSTANCE.accountingUnitTB24());
|
TBItem = new MenuItem(ByteUnitMeasure.TERABYTE,
|
||||||
|
AccountingManagerResources.INSTANCE.accountingUnitTB24());
|
||||||
TBItem.setHeight(30);
|
TBItem.setHeight(30);
|
||||||
|
|
||||||
kBItem.addSelectionHandler(new SelectionHandler<Item>() {
|
kBItem.addSelectionHandler(new SelectionHandler<Item>() {
|
||||||
|
@ -317,7 +328,8 @@ public class StorageChartTopPanel extends SimpleContainer {
|
||||||
public void onSelection(SelectionEvent<Item> event) {
|
public void onSelection(SelectionEvent<Item> event) {
|
||||||
unitMeasure = ByteUnitMeasure.getKiloByteDimForStorage();
|
unitMeasure = ByteUnitMeasure.getKiloByteDimForStorage();
|
||||||
unitMeasureLabel = ByteUnitMeasure.kB;
|
unitMeasureLabel = ByteUnitMeasure.kB;
|
||||||
unitButton.setIcon(AccountingManagerResources.INSTANCE.accountingUnitkB24());
|
unitButton.setIcon(AccountingManagerResources.INSTANCE
|
||||||
|
.accountingUnitkB24());
|
||||||
updateChart();
|
updateChart();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -328,7 +340,8 @@ public class StorageChartTopPanel extends SimpleContainer {
|
||||||
public void onSelection(SelectionEvent<Item> event) {
|
public void onSelection(SelectionEvent<Item> event) {
|
||||||
unitMeasure = ByteUnitMeasure.getMegaByteDimForStorage();
|
unitMeasure = ByteUnitMeasure.getMegaByteDimForStorage();
|
||||||
unitMeasureLabel = ByteUnitMeasure.MB;
|
unitMeasureLabel = ByteUnitMeasure.MB;
|
||||||
unitButton.setIcon(AccountingManagerResources.INSTANCE.accountingUnitMB24());
|
unitButton.setIcon(AccountingManagerResources.INSTANCE
|
||||||
|
.accountingUnitMB24());
|
||||||
updateChart();
|
updateChart();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -339,7 +352,8 @@ public class StorageChartTopPanel extends SimpleContainer {
|
||||||
public void onSelection(SelectionEvent<Item> event) {
|
public void onSelection(SelectionEvent<Item> event) {
|
||||||
unitMeasure = ByteUnitMeasure.getGigaByteDimForStorage();
|
unitMeasure = ByteUnitMeasure.getGigaByteDimForStorage();
|
||||||
unitMeasureLabel = ByteUnitMeasure.GB;
|
unitMeasureLabel = ByteUnitMeasure.GB;
|
||||||
unitButton.setIcon(AccountingManagerResources.INSTANCE.accountingUnitGB24());
|
unitButton.setIcon(AccountingManagerResources.INSTANCE
|
||||||
|
.accountingUnitGB24());
|
||||||
updateChart();
|
updateChart();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -350,7 +364,8 @@ public class StorageChartTopPanel extends SimpleContainer {
|
||||||
public void onSelection(SelectionEvent<Item> event) {
|
public void onSelection(SelectionEvent<Item> event) {
|
||||||
unitMeasure = ByteUnitMeasure.getTeraByteDimForStorage();
|
unitMeasure = ByteUnitMeasure.getTeraByteDimForStorage();
|
||||||
unitMeasureLabel = ByteUnitMeasure.TB;
|
unitMeasureLabel = ByteUnitMeasure.TB;
|
||||||
unitButton.setIcon(AccountingManagerResources.INSTANCE.accountingUnitTB24());
|
unitButton.setIcon(AccountingManagerResources.INSTANCE
|
||||||
|
.accountingUnitTB24());
|
||||||
updateChart();
|
updateChart();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -364,17 +379,20 @@ public class StorageChartTopPanel extends SimpleContainer {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onDownloadCSV() {
|
private void onDownloadCSV() {
|
||||||
ExportRequestEvent event = new ExportRequestEvent(ExportType.CSV, accountingStateData.getAccountingType());
|
ExportRequestEvent event = new ExportRequestEvent(ExportType.CSV,
|
||||||
|
accountingStateData.getAccountingType());
|
||||||
eventBus.fireEvent(event);
|
eventBus.fireEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onDownloadXML() {
|
private void onDownloadXML() {
|
||||||
ExportRequestEvent event = new ExportRequestEvent(ExportType.XML, accountingStateData.getAccountingType());
|
ExportRequestEvent event = new ExportRequestEvent(ExportType.XML,
|
||||||
|
accountingStateData.getAccountingType());
|
||||||
eventBus.fireEvent(event);
|
eventBus.fireEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onDownloadJSON() {
|
private void onDownloadJSON() {
|
||||||
ExportRequestEvent event = new ExportRequestEvent(ExportType.JSON, accountingStateData.getAccountingType());
|
ExportRequestEvent event = new ExportRequestEvent(ExportType.JSON,
|
||||||
|
accountingStateData.getAccountingType());
|
||||||
eventBus.fireEvent(event);
|
eventBus.fireEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -431,13 +449,15 @@ public class StorageChartTopPanel extends SimpleContainer {
|
||||||
}-*/;
|
}-*/;
|
||||||
|
|
||||||
private void createChart() {
|
private void createChart() {
|
||||||
SeriesStorage seriesStorage = (SeriesStorage) accountingStateData.getSeriesResponse();
|
SeriesStorage seriesStorage = (SeriesStorage) accountingStateData
|
||||||
|
.getSeriesResponse();
|
||||||
|
|
||||||
if (!(seriesStorage.getSeriesStorageDefinition() instanceof SeriesStorageTop)) {
|
if (!(seriesStorage.getSeriesStorageDefinition() instanceof SeriesStorageTop)) {
|
||||||
Log.debug("Invalid SeriesStorageTop!");
|
Log.debug("Invalid SeriesStorageTop!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
SeriesStorageTop seriesStorageTop = (SeriesStorageTop) seriesStorage.getSeriesStorageDefinition();
|
SeriesStorageTop seriesStorageTop = (SeriesStorageTop) seriesStorage
|
||||||
|
.getSeriesStorageDefinition();
|
||||||
|
|
||||||
HighchartsOptionFactory highchartsFactory = new JsoHighchartsOptionFactory();
|
HighchartsOptionFactory highchartsFactory = new JsoHighchartsOptionFactory();
|
||||||
|
|
||||||
|
@ -448,29 +468,32 @@ public class StorageChartTopPanel extends SimpleContainer {
|
||||||
options.title().text("Accounting Storage Top");
|
options.title().text("Accounting Storage Top");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* options.subtitle().text("Click and drag in the plot area to zoom in"
|
* options.subtitle().text("Click and drag in the plot area to zoom in");
|
||||||
* );
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ColorsPalette colorsPalette = new ColorsPalette();
|
|
||||||
ArrayString colors = options.colors();
|
ArrayString colors = options.colors();
|
||||||
colors = colorsPalette.getColorsPalette(colors);
|
|
||||||
options.colors(colors);
|
|
||||||
|
|
||||||
// colors.setValue(0, "#cc0038");
|
// colors.setValue(0, "#cc0038");
|
||||||
// colors.setValue(1, "#32cd32");
|
// colors.setValue(1, "#32cd32");
|
||||||
|
|
||||||
// yAxis
|
// yAxis
|
||||||
options.setFieldAsJsonObject("yAxis", retrieveYAxis(colors));
|
options.setFieldAsJsonObject("yAxis", retrieveYAxis(colors));
|
||||||
|
|
||||||
options.plotOptions().setFieldAsJsonObject("column",
|
options.plotOptions().setFieldAsJsonObject(
|
||||||
"{ " + "\"stacking\": \"normal\"," + "\"dataLabels\": { " + " \"enabled\": \"true\","
|
"column",
|
||||||
|
"{ " + "\"stacking\": \"normal\"," + "\"dataLabels\": { "
|
||||||
|
+ " \"enabled\": \"true\","
|
||||||
+ " \"color\": \"white\", " + " \"style\": {"
|
+ " \"color\": \"white\", " + " \"style\": {"
|
||||||
+ " \"textShadow\": \"0 0 3px black\"" + " }" + " }" + " }");
|
+ " \"textShadow\": \"0 0 3px black\"" + " }"
|
||||||
|
+ " }" + " }");
|
||||||
|
|
||||||
ArrayList<SeriesColumn> seriesColumn = new ArrayList<>();
|
ArrayList<SeriesColumn> seriesColumn = new ArrayList<>();
|
||||||
|
if (seriesStorageTop.getShowOthers()) {
|
||||||
createSeriesColumnSimple(seriesStorageTop, highchartsFactory, colors, seriesColumn);
|
createSeriesColumnShowOthers(seriesStorageTop, highchartsFactory,
|
||||||
|
colors, seriesColumn);
|
||||||
|
} else {
|
||||||
|
createSeriesColumnSimple(seriesStorageTop, highchartsFactory,
|
||||||
|
colors, seriesColumn);
|
||||||
|
}
|
||||||
|
|
||||||
for (SeriesColumn serie : seriesColumn) {
|
for (SeriesColumn serie : seriesColumn) {
|
||||||
options.series().addToEnd(serie);
|
options.series().addToEnd(serie);
|
||||||
|
@ -482,28 +505,36 @@ public class StorageChartTopPanel extends SimpleContainer {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createSeriesColumnShowOthers(SeriesStorageTop seriesStorageTop,
|
private void createSeriesColumnShowOthers(
|
||||||
HighchartsOptionFactory highchartsFactory, ArrayString colors, ArrayList<SeriesColumn> seriesColumn) {
|
SeriesStorageTop seriesStorageTop,
|
||||||
|
HighchartsOptionFactory highchartsFactory, ArrayString colors,
|
||||||
|
ArrayList<SeriesColumn> seriesColumn) {
|
||||||
Log.debug("Series ShowOthers");
|
Log.debug("Series ShowOthers");
|
||||||
if (accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
|
if (accountingStateData.getSeriesRequest().getAccountingPeriod()
|
||||||
.compareTo(AccountingPeriodMode.DAILY) == 0
|
.getPeriod().compareTo(AccountingPeriodMode.DAILY) == 0
|
||||||
|| accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
|
|| accountingStateData.getSeriesRequest().getAccountingPeriod()
|
||||||
.compareTo(AccountingPeriodMode.HOURLY) == 0
|
.getPeriod().compareTo(AccountingPeriodMode.HOURLY) == 0
|
||||||
|| accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
|
|| accountingStateData.getSeriesRequest().getAccountingPeriod()
|
||||||
.compareTo(AccountingPeriodMode.MINUTELY) == 0) {
|
.getPeriod().compareTo(AccountingPeriodMode.MINUTELY) == 0) {
|
||||||
|
|
||||||
double minRange = ChartTimeMeasure
|
double minRange = ChartTimeMeasure
|
||||||
.calculateMinRange(accountingStateData.getSeriesRequest().getAccountingPeriod());
|
.calculateMinRange(accountingStateData.getSeriesRequest()
|
||||||
|
.getAccountingPeriod());
|
||||||
|
|
||||||
double interval = ChartTimeMeasure
|
double interval = ChartTimeMeasure
|
||||||
.calculateInterval(accountingStateData.getSeriesRequest().getAccountingPeriod());
|
.calculateInterval(accountingStateData.getSeriesRequest()
|
||||||
|
.getAccountingPeriod());
|
||||||
|
|
||||||
Date dateStart = dtf.parse(accountingStateData.getSeriesRequest().getAccountingPeriod().getStartDate());
|
Date dateStart = dtf.parse(accountingStateData.getSeriesRequest()
|
||||||
|
.getAccountingPeriod().getStartDate());
|
||||||
|
|
||||||
dateStart.setTime(dateStart.getTime() + ChartTimeMeasure.timeZoneOffset() * ChartTimeMeasure.MINUTE);
|
dateStart.setTime(dateStart.getTime()
|
||||||
|
+ ChartTimeMeasure.timeZoneOffset()
|
||||||
|
* ChartTimeMeasure.MINUTE);
|
||||||
|
|
||||||
Log.debug("BuildChart DateStart: "
|
Log.debug("BuildChart DateStart: "
|
||||||
+ DateTimeFormat.getFormat(PredefinedFormat.DATE_TIME_FULL).format(dateStart));
|
+ DateTimeFormat.getFormat(PredefinedFormat.DATE_TIME_FULL)
|
||||||
|
.format(dateStart));
|
||||||
|
|
||||||
// xAxis
|
// xAxis
|
||||||
options.xAxis().type("datetime");
|
options.xAxis().type("datetime");
|
||||||
|
@ -513,20 +544,23 @@ public class StorageChartTopPanel extends SimpleContainer {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (; i < seriesStorageTop.getSeriesStorageDataTopList().size()
|
for (; i < seriesStorageTop.getSeriesStorageDataTopList().size()
|
||||||
&& i < seriesStorageTop.getTopNumber(); i++) {
|
&& i < seriesStorageTop.getTopNumber(); i++) {
|
||||||
SeriesColumn seriesColumnData = highchartsFactory.createSeriesColumn();
|
SeriesColumn seriesColumnData = highchartsFactory
|
||||||
|
.createSeriesColumn();
|
||||||
|
|
||||||
seriesColumnData
|
seriesColumnData.name(seriesStorageTop
|
||||||
.name(seriesStorageTop.getSeriesStorageDataTopList().get(i).getFilterValue().getValue());
|
.getSeriesStorageDataTopList().get(i).getFilterValue()
|
||||||
|
.getValue());
|
||||||
seriesColumnData.color(colors.get(i));
|
seriesColumnData.color(colors.get(i));
|
||||||
seriesColumnData.type("column");
|
seriesColumnData.type("column");
|
||||||
|
|
||||||
ArrayNumber data = seriesColumnData.dataAsArrayNumber();
|
ArrayNumber data = seriesColumnData.dataAsArrayNumber();
|
||||||
|
|
||||||
for (SeriesStorageData seriesStorageData : seriesStorageTop.getSeriesStorageDataTopList().get(i)
|
for (SeriesStorageData seriesStorageData : seriesStorageTop
|
||||||
.getSeries()) {
|
.getSeriesStorageDataTopList().get(i).getSeries()) {
|
||||||
switch (measure) {
|
switch (measure) {
|
||||||
case DataVolume:
|
case DataVolume:
|
||||||
data.push(seriesStorageData.getDataVolume() / unitMeasure);
|
data.push(seriesStorageData.getDataVolume()
|
||||||
|
/ unitMeasure);
|
||||||
break;
|
break;
|
||||||
case OperationCount:
|
case OperationCount:
|
||||||
data.push(seriesStorageData.getOperationCount());
|
data.push(seriesStorageData.getOperationCount());
|
||||||
|
@ -539,34 +573,43 @@ public class StorageChartTopPanel extends SimpleContainer {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
seriesColumnData.pointInterval(interval).pointStart(dateStart.getTime());
|
seriesColumnData.pointInterval(interval).pointStart(
|
||||||
|
dateStart.getTime());
|
||||||
seriesColumn.add(seriesColumnData);
|
seriesColumn.add(seriesColumnData);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i < seriesStorageTop.getSeriesStorageDataTopList().size()) {
|
if (i < seriesStorageTop.getSeriesStorageDataTopList().size()) {
|
||||||
SeriesColumn seriesColumnData = highchartsFactory.createSeriesColumn();
|
SeriesColumn seriesColumnData = highchartsFactory
|
||||||
|
.createSeriesColumn();
|
||||||
|
|
||||||
seriesColumnData.name("Others");
|
seriesColumnData.name("Others");
|
||||||
seriesColumnData.color(colors.get(i));
|
seriesColumnData.color(colors.get(i));
|
||||||
seriesColumnData.type("column");
|
seriesColumnData.type("column");
|
||||||
|
|
||||||
ArrayList<Long> othersData = new ArrayList<>();
|
ArrayList<Long> othersData = new ArrayList<>();
|
||||||
for (int j = i; j < seriesStorageTop.getSeriesStorageDataTopList().size(); j++) {
|
for (int j = i; j < seriesStorageTop
|
||||||
|
.getSeriesStorageDataTopList().size(); j++) {
|
||||||
Long value;
|
Long value;
|
||||||
for (int k = 0; k < seriesStorageTop.getSeriesStorageDataTopList().get(j).getSeries().size(); k++) {
|
for (int k = 0; k < seriesStorageTop
|
||||||
SeriesStorageData seriesStorageData = seriesStorageTop.getSeriesStorageDataTopList().get(j)
|
.getSeriesStorageDataTopList().get(j).getSeries()
|
||||||
|
.size(); k++) {
|
||||||
|
SeriesStorageData seriesStorageData = seriesStorageTop
|
||||||
|
.getSeriesStorageDataTopList().get(j)
|
||||||
.getSeries().get(k);
|
.getSeries().get(k);
|
||||||
if (j == i) {
|
if (j == i) {
|
||||||
switch (measure) {
|
switch (measure) {
|
||||||
case DataVolume:
|
case DataVolume:
|
||||||
othersData.add(seriesStorageData.getDataVolume() / unitMeasure);
|
othersData.add(seriesStorageData
|
||||||
|
.getDataVolume() / unitMeasure);
|
||||||
break;
|
break;
|
||||||
case OperationCount:
|
case OperationCount:
|
||||||
othersData.add(seriesStorageData.getOperationCount());
|
othersData.add(seriesStorageData
|
||||||
|
.getOperationCount());
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
othersData.add(seriesStorageData.getDataVolume() / unitMeasure);
|
othersData.add(seriesStorageData
|
||||||
|
.getDataVolume() / unitMeasure);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -574,15 +617,18 @@ public class StorageChartTopPanel extends SimpleContainer {
|
||||||
switch (measure) {
|
switch (measure) {
|
||||||
case DataVolume:
|
case DataVolume:
|
||||||
|
|
||||||
value = seriesStorageData.getDataVolume() / unitMeasure + othersData.get(k);
|
value = seriesStorageData.getDataVolume()
|
||||||
|
/ unitMeasure + othersData.get(k);
|
||||||
othersData.set(k, value);
|
othersData.set(k, value);
|
||||||
break;
|
break;
|
||||||
case OperationCount:
|
case OperationCount:
|
||||||
value = seriesStorageData.getOperationCount() + othersData.get(k);
|
value = seriesStorageData.getOperationCount()
|
||||||
|
+ othersData.get(k);
|
||||||
othersData.set(k, value);
|
othersData.set(k, value);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
value = seriesStorageData.getDataVolume() / unitMeasure + othersData.get(k);
|
value = seriesStorageData.getDataVolume()
|
||||||
|
/ unitMeasure + othersData.get(k);
|
||||||
othersData.set(k, value);
|
othersData.set(k, value);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -598,7 +644,8 @@ public class StorageChartTopPanel extends SimpleContainer {
|
||||||
data.push(value);
|
data.push(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
seriesColumnData.pointInterval(interval).pointStart(dateStart.getTime());
|
seriesColumnData.pointInterval(interval).pointStart(
|
||||||
|
dateStart.getTime());
|
||||||
seriesColumn.add(seriesColumnData);
|
seriesColumn.add(seriesColumnData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -606,15 +653,16 @@ public class StorageChartTopPanel extends SimpleContainer {
|
||||||
// xAxis
|
// xAxis
|
||||||
options.xAxis().type("datetime");
|
options.xAxis().type("datetime");
|
||||||
|
|
||||||
if (accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
|
if (accountingStateData.getSeriesRequest().getAccountingPeriod()
|
||||||
.compareTo(AccountingPeriodMode.MONTHLY) == 0) {
|
.getPeriod().compareTo(AccountingPeriodMode.MONTHLY) == 0) {
|
||||||
// options.tooltip().xDateFormat("%b, %Y");
|
//options.tooltip().xDateFormat("%b, %Y");
|
||||||
options.tooltip().xDateFormat("Selected Data");
|
options.tooltip().xDateFormat("Selected Data");
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
|
if (accountingStateData.getSeriesRequest()
|
||||||
|
.getAccountingPeriod().getPeriod()
|
||||||
.compareTo(AccountingPeriodMode.YEARLY) == 0) {
|
.compareTo(AccountingPeriodMode.YEARLY) == 0) {
|
||||||
// options.tooltip().xDateFormat("%Y");
|
//options.tooltip().xDateFormat("%Y");
|
||||||
options.tooltip().xDateFormat("Selected Data");
|
options.tooltip().xDateFormat("Selected Data");
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -626,20 +674,23 @@ public class StorageChartTopPanel extends SimpleContainer {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (; i < seriesStorageTop.getSeriesStorageDataTopList().size()
|
for (; i < seriesStorageTop.getSeriesStorageDataTopList().size()
|
||||||
&& i < seriesStorageTop.getTopNumber(); i++) {
|
&& i < seriesStorageTop.getTopNumber(); i++) {
|
||||||
SeriesColumn seriesColumnData = highchartsFactory.createSeriesColumn();
|
SeriesColumn seriesColumnData = highchartsFactory
|
||||||
|
.createSeriesColumn();
|
||||||
|
|
||||||
seriesColumnData
|
seriesColumnData.name(seriesStorageTop
|
||||||
.name(seriesStorageTop.getSeriesStorageDataTopList().get(i).getFilterValue().getValue());
|
.getSeriesStorageDataTopList().get(i).getFilterValue()
|
||||||
|
.getValue());
|
||||||
seriesColumnData.color(colors.get(i));
|
seriesColumnData.color(colors.get(i));
|
||||||
seriesColumnData.type("column");
|
seriesColumnData.type("column");
|
||||||
|
|
||||||
Array<Data> arrayData = seriesColumnData.dataAsArrayObject();
|
Array<Data> arrayData = seriesColumnData.dataAsArrayObject();
|
||||||
|
|
||||||
for (SeriesStorageData seriesStorageData : seriesStorageTop.getSeriesStorageDataTopList().get(i)
|
for (SeriesStorageData seriesStorageData : seriesStorageTop
|
||||||
.getSeries()) {
|
.getSeriesStorageDataTopList().get(i).getSeries()) {
|
||||||
long dateFrom1970 = seriesStorageData.getDate().getTime();
|
long dateFrom1970 = seriesStorageData.getDate().getTime();
|
||||||
|
|
||||||
Log.debug("SeriersStorageData: " + seriesStorageData.getDate());
|
Log.debug("SeriersStorageData: "
|
||||||
|
+ seriesStorageData.getDate());
|
||||||
Log.debug("SeriersStorageData: " + dateFrom1970);
|
Log.debug("SeriersStorageData: " + dateFrom1970);
|
||||||
|
|
||||||
Data data = highchartsFactory.createSeriesColumnData();
|
Data data = highchartsFactory.createSeriesColumnData();
|
||||||
|
@ -670,51 +721,65 @@ public class StorageChartTopPanel extends SimpleContainer {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i < seriesStorageTop.getSeriesStorageDataTopList().size()) {
|
if (i < seriesStorageTop.getSeriesStorageDataTopList().size()) {
|
||||||
SeriesColumn seriesColumnData = highchartsFactory.createSeriesColumn();
|
SeriesColumn seriesColumnData = highchartsFactory
|
||||||
|
.createSeriesColumn();
|
||||||
|
|
||||||
seriesColumnData.name("Others");
|
seriesColumnData.name("Others");
|
||||||
seriesColumnData.color(colors.get(i));
|
seriesColumnData.color(colors.get(i));
|
||||||
seriesColumnData.type("column");
|
seriesColumnData.type("column");
|
||||||
|
|
||||||
ArrayList<ChartDateTimeData> othersData = new ArrayList<>();
|
ArrayList<ChartDateTimeData> othersData = new ArrayList<>();
|
||||||
for (int j = i; j < seriesStorageTop.getSeriesStorageDataTopList().size(); j++) {
|
for (int j = i; j < seriesStorageTop
|
||||||
|
.getSeriesStorageDataTopList().size(); j++) {
|
||||||
ChartDateTimeData chartDateTimeData;
|
ChartDateTimeData chartDateTimeData;
|
||||||
for (int k = 0; k < seriesStorageTop.getSeriesStorageDataTopList().get(j).getSeries().size(); k++) {
|
for (int k = 0; k < seriesStorageTop
|
||||||
SeriesStorageData seriesStorageData = seriesStorageTop.getSeriesStorageDataTopList().get(j)
|
.getSeriesStorageDataTopList().get(j).getSeries()
|
||||||
|
.size(); k++) {
|
||||||
|
SeriesStorageData seriesStorageData = seriesStorageTop
|
||||||
|
.getSeriesStorageDataTopList().get(j)
|
||||||
.getSeries().get(k);
|
.getSeries().get(k);
|
||||||
if (j == i) {
|
if (j == i) {
|
||||||
switch (measure) {
|
switch (measure) {
|
||||||
case DataVolume:
|
case DataVolume:
|
||||||
chartDateTimeData = new ChartDateTimeData(seriesStorageData.getDate(),
|
chartDateTimeData = new ChartDateTimeData(
|
||||||
seriesStorageData.getDataVolume() / unitMeasure);
|
seriesStorageData.getDate(),
|
||||||
|
seriesStorageData.getDataVolume()
|
||||||
|
/ unitMeasure);
|
||||||
othersData.add(chartDateTimeData);
|
othersData.add(chartDateTimeData);
|
||||||
break;
|
break;
|
||||||
case OperationCount:
|
case OperationCount:
|
||||||
chartDateTimeData = new ChartDateTimeData(seriesStorageData.getDate(),
|
chartDateTimeData = new ChartDateTimeData(
|
||||||
|
seriesStorageData.getDate(),
|
||||||
seriesStorageData.getOperationCount());
|
seriesStorageData.getOperationCount());
|
||||||
othersData.add(chartDateTimeData);
|
othersData.add(chartDateTimeData);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
chartDateTimeData = new ChartDateTimeData(seriesStorageData.getDate(),
|
chartDateTimeData = new ChartDateTimeData(
|
||||||
seriesStorageData.getDataVolume() / unitMeasure);
|
seriesStorageData.getDate(),
|
||||||
|
seriesStorageData.getDataVolume()
|
||||||
|
/ unitMeasure);
|
||||||
othersData.add(chartDateTimeData);
|
othersData.add(chartDateTimeData);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
switch (measure) {
|
switch (measure) {
|
||||||
case DataVolume:
|
case DataVolume:
|
||||||
chartDateTimeData = new ChartDateTimeData(seriesStorageData.getDate(),
|
chartDateTimeData = new ChartDateTimeData(
|
||||||
|
seriesStorageData.getDate(),
|
||||||
(seriesStorageData.getDataVolume() / unitMeasure)
|
(seriesStorageData.getDataVolume() / unitMeasure)
|
||||||
+ othersData.get(k).getValue());
|
+ othersData.get(k).getValue());
|
||||||
othersData.set(k, chartDateTimeData);
|
othersData.set(k, chartDateTimeData);
|
||||||
break;
|
break;
|
||||||
case OperationCount:
|
case OperationCount:
|
||||||
chartDateTimeData = new ChartDateTimeData(seriesStorageData.getDate(),
|
chartDateTimeData = new ChartDateTimeData(
|
||||||
seriesStorageData.getOperationCount() + othersData.get(k).getValue());
|
seriesStorageData.getDate(),
|
||||||
|
seriesStorageData.getOperationCount()
|
||||||
|
+ othersData.get(k).getValue());
|
||||||
othersData.set(k, chartDateTimeData);
|
othersData.set(k, chartDateTimeData);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
chartDateTimeData = new ChartDateTimeData(seriesStorageData.getDate(),
|
chartDateTimeData = new ChartDateTimeData(
|
||||||
|
seriesStorageData.getDate(),
|
||||||
(seriesStorageData.getDataVolume() / unitMeasure)
|
(seriesStorageData.getDataVolume() / unitMeasure)
|
||||||
+ othersData.get(k).getValue());
|
+ othersData.get(k).getValue());
|
||||||
othersData.set(k, chartDateTimeData);
|
othersData.set(k, chartDateTimeData);
|
||||||
|
@ -731,7 +796,8 @@ public class StorageChartTopPanel extends SimpleContainer {
|
||||||
for (ChartDateTimeData chartDateTimeData : othersData) {
|
for (ChartDateTimeData chartDateTimeData : othersData) {
|
||||||
long dateFrom1970 = chartDateTimeData.getDate().getTime();
|
long dateFrom1970 = chartDateTimeData.getDate().getTime();
|
||||||
|
|
||||||
Log.debug("SeriersOthersData: " + chartDateTimeData.getDate());
|
Log.debug("SeriersOthersData: "
|
||||||
|
+ chartDateTimeData.getDate());
|
||||||
Log.debug("SeriersOthersData: " + dateFrom1970);
|
Log.debug("SeriersOthersData: " + dateFrom1970);
|
||||||
|
|
||||||
Data data = highchartsFactory.createSeriesColumnData();
|
Data data = highchartsFactory.createSeriesColumnData();
|
||||||
|
@ -749,50 +815,61 @@ public class StorageChartTopPanel extends SimpleContainer {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createSeriesColumnSimple(SeriesStorageTop seriesStorageTop, HighchartsOptionFactory highchartsFactory,
|
private void createSeriesColumnSimple(SeriesStorageTop seriesStorageTop,
|
||||||
ArrayString colors, ArrayList<SeriesColumn> seriesColumn) {
|
HighchartsOptionFactory highchartsFactory, ArrayString colors,
|
||||||
|
ArrayList<SeriesColumn> seriesColumn) {
|
||||||
|
|
||||||
Log.debug("Series Simple");
|
Log.debug("Series Simple");
|
||||||
if (accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
|
if (accountingStateData.getSeriesRequest().getAccountingPeriod()
|
||||||
.compareTo(AccountingPeriodMode.DAILY) == 0
|
.getPeriod().compareTo(AccountingPeriodMode.DAILY) == 0
|
||||||
|| accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
|
|| accountingStateData.getSeriesRequest().getAccountingPeriod()
|
||||||
.compareTo(AccountingPeriodMode.HOURLY) == 0
|
.getPeriod().compareTo(AccountingPeriodMode.HOURLY) == 0
|
||||||
|| accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
|
|| accountingStateData.getSeriesRequest().getAccountingPeriod()
|
||||||
.compareTo(AccountingPeriodMode.MINUTELY) == 0) {
|
.getPeriod().compareTo(AccountingPeriodMode.MINUTELY) == 0) {
|
||||||
|
|
||||||
double minRange = ChartTimeMeasure
|
double minRange = ChartTimeMeasure
|
||||||
.calculateMinRange(accountingStateData.getSeriesRequest().getAccountingPeriod());
|
.calculateMinRange(accountingStateData.getSeriesRequest()
|
||||||
|
.getAccountingPeriod());
|
||||||
|
|
||||||
double interval = ChartTimeMeasure
|
double interval = ChartTimeMeasure
|
||||||
.calculateInterval(accountingStateData.getSeriesRequest().getAccountingPeriod());
|
.calculateInterval(accountingStateData.getSeriesRequest()
|
||||||
|
.getAccountingPeriod());
|
||||||
|
|
||||||
Date dateStart = dtf.parse(accountingStateData.getSeriesRequest().getAccountingPeriod().getStartDate());
|
Date dateStart = dtf.parse(accountingStateData.getSeriesRequest()
|
||||||
|
.getAccountingPeriod().getStartDate());
|
||||||
|
|
||||||
dateStart.setTime(dateStart.getTime() + ChartTimeMeasure.timeZoneOffset() * ChartTimeMeasure.MINUTE);
|
dateStart.setTime(dateStart.getTime()
|
||||||
|
+ ChartTimeMeasure.timeZoneOffset()
|
||||||
|
* ChartTimeMeasure.MINUTE);
|
||||||
|
|
||||||
Log.debug("BuildChart DateStart: "
|
Log.debug("BuildChart DateStart: "
|
||||||
+ DateTimeFormat.getFormat(PredefinedFormat.DATE_TIME_FULL).format(dateStart));
|
+ DateTimeFormat.getFormat(PredefinedFormat.DATE_TIME_FULL)
|
||||||
|
.format(dateStart));
|
||||||
|
|
||||||
// xAxis
|
// xAxis
|
||||||
options.xAxis().type("datetime");
|
options.xAxis().type("datetime");
|
||||||
options.xAxis().minRange(minRange);
|
options.xAxis().minRange(minRange);
|
||||||
options.tooltip().xDateFormat("Selected Data");
|
options.tooltip().xDateFormat("Selected Data");
|
||||||
|
|
||||||
for (int i = 0; i < seriesStorageTop.getSeriesStorageDataTopList().size(); i++) {
|
for (int i = 0; i < seriesStorageTop.getSeriesStorageDataTopList()
|
||||||
SeriesColumn seriesColumnData = highchartsFactory.createSeriesColumn();
|
.size(); i++) {
|
||||||
|
SeriesColumn seriesColumnData = highchartsFactory
|
||||||
|
.createSeriesColumn();
|
||||||
|
|
||||||
seriesColumnData
|
seriesColumnData.name(seriesStorageTop
|
||||||
.name(seriesStorageTop.getSeriesStorageDataTopList().get(i).getFilterValue().getValue());
|
.getSeriesStorageDataTopList().get(i).getFilterValue()
|
||||||
|
.getValue());
|
||||||
seriesColumnData.color(colors.get(i));
|
seriesColumnData.color(colors.get(i));
|
||||||
seriesColumnData.type("column");
|
seriesColumnData.type("column");
|
||||||
|
|
||||||
ArrayNumber data = seriesColumnData.dataAsArrayNumber();
|
ArrayNumber data = seriesColumnData.dataAsArrayNumber();
|
||||||
|
|
||||||
for (SeriesStorageData seriesStorageData : seriesStorageTop.getSeriesStorageDataTopList().get(i)
|
for (SeriesStorageData seriesStorageData : seriesStorageTop
|
||||||
.getSeries()) {
|
.getSeriesStorageDataTopList().get(i).getSeries()) {
|
||||||
switch (measure) {
|
switch (measure) {
|
||||||
case DataVolume:
|
case DataVolume:
|
||||||
data.push(seriesStorageData.getDataVolume() / unitMeasure);
|
data.push(seriesStorageData.getDataVolume()
|
||||||
|
/ unitMeasure);
|
||||||
break;
|
break;
|
||||||
case OperationCount:
|
case OperationCount:
|
||||||
data.push(seriesStorageData.getOperationCount());
|
data.push(seriesStorageData.getOperationCount());
|
||||||
|
@ -805,7 +882,8 @@ public class StorageChartTopPanel extends SimpleContainer {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
seriesColumnData.pointInterval(interval).pointStart(dateStart.getTime());
|
seriesColumnData.pointInterval(interval).pointStart(
|
||||||
|
dateStart.getTime());
|
||||||
seriesColumn.add(seriesColumnData);
|
seriesColumn.add(seriesColumnData);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -814,15 +892,16 @@ public class StorageChartTopPanel extends SimpleContainer {
|
||||||
// xAxis
|
// xAxis
|
||||||
options.xAxis().type("datetime");
|
options.xAxis().type("datetime");
|
||||||
|
|
||||||
if (accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
|
if (accountingStateData.getSeriesRequest().getAccountingPeriod()
|
||||||
.compareTo(AccountingPeriodMode.MONTHLY) == 0) {
|
.getPeriod().compareTo(AccountingPeriodMode.MONTHLY) == 0) {
|
||||||
// options.tooltip().xDateFormat("%b, %Y");
|
//options.tooltip().xDateFormat("%b, %Y");
|
||||||
options.tooltip().xDateFormat("Selected Data");
|
options.tooltip().xDateFormat("Selected Data");
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (accountingStateData.getSeriesRequest().getAccountingPeriod().getPeriod()
|
if (accountingStateData.getSeriesRequest()
|
||||||
|
.getAccountingPeriod().getPeriod()
|
||||||
.compareTo(AccountingPeriodMode.YEARLY) == 0) {
|
.compareTo(AccountingPeriodMode.YEARLY) == 0) {
|
||||||
// options.tooltip().xDateFormat("%Y");
|
//options.tooltip().xDateFormat("%Y");
|
||||||
options.tooltip().xDateFormat("Selected Data");
|
options.tooltip().xDateFormat("Selected Data");
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -831,21 +910,25 @@ public class StorageChartTopPanel extends SimpleContainer {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < seriesStorageTop.getSeriesStorageDataTopList().size(); i++) {
|
for (int i = 0; i < seriesStorageTop.getSeriesStorageDataTopList()
|
||||||
SeriesColumn seriesColumnData = highchartsFactory.createSeriesColumn();
|
.size(); i++) {
|
||||||
|
SeriesColumn seriesColumnData = highchartsFactory
|
||||||
|
.createSeriesColumn();
|
||||||
|
|
||||||
seriesColumnData
|
seriesColumnData.name(seriesStorageTop
|
||||||
.name(seriesStorageTop.getSeriesStorageDataTopList().get(i).getFilterValue().getValue());
|
.getSeriesStorageDataTopList().get(i).getFilterValue()
|
||||||
|
.getValue());
|
||||||
seriesColumnData.color(colors.get(i));
|
seriesColumnData.color(colors.get(i));
|
||||||
seriesColumnData.type("column");
|
seriesColumnData.type("column");
|
||||||
|
|
||||||
Array<Data> arrayData = seriesColumnData.dataAsArrayObject();
|
Array<Data> arrayData = seriesColumnData.dataAsArrayObject();
|
||||||
|
|
||||||
for (SeriesStorageData seriesStorageData : seriesStorageTop.getSeriesStorageDataTopList().get(i)
|
for (SeriesStorageData seriesStorageData : seriesStorageTop
|
||||||
.getSeries()) {
|
.getSeriesStorageDataTopList().get(i).getSeries()) {
|
||||||
long dateFrom1970 = seriesStorageData.getDate().getTime();
|
long dateFrom1970 = seriesStorageData.getDate().getTime();
|
||||||
|
|
||||||
Log.debug("SeriersStorageData: " + seriesStorageData.getDate());
|
Log.debug("SeriersStorageData: "
|
||||||
|
+ seriesStorageData.getDate());
|
||||||
Log.debug("SeriersStorageData: " + dateFrom1970);
|
Log.debug("SeriersStorageData: " + dateFrom1970);
|
||||||
|
|
||||||
Data data = highchartsFactory.createSeriesColumnData();
|
Data data = highchartsFactory.createSeriesColumnData();
|
||||||
|
@ -881,30 +964,44 @@ public class StorageChartTopPanel extends SimpleContainer {
|
||||||
private String retrieveYAxis(ArrayString colors) {
|
private String retrieveYAxis(ArrayString colors) {
|
||||||
switch (measure) {
|
switch (measure) {
|
||||||
case DataVolume:
|
case DataVolume:
|
||||||
return "[{" + " \"id\": \"" + StorageChartMeasure.DataVolume.name() + "\"," + " \"labels\": {"
|
return "[{" + " \"id\": \"" + StorageChartMeasure.DataVolume.name()
|
||||||
+ " \"format\": \"{value} " + unitMeasureLabel + "\"," + " \"style\": {"
|
+ "\"," + " \"labels\": {" + " \"format\": \"{value} "
|
||||||
+ " \"color\": \"#434348\"" + " }" + " }," + " \"stackLabels\": {"
|
+ unitMeasureLabel + "\"," + " \"style\": {"
|
||||||
+ " \"enabled\": \"true\"," + " \"style\": {" + " \"fontWeight\": \"bold\","
|
+ " \"color\": \"" + colors.get(1) + "\"" + " }"
|
||||||
+ " \"color\": \"gray\"" + " } " + " }," + " \"title\": { " + " \"text\": \""
|
+ " }," + " \"stackLabels\": {" + " \"enabled\": \"true\","
|
||||||
+ StorageChartMeasure.DataVolume.getLabel() + "\"," + " \"style\": {"
|
+ " \"style\": {" + " \"fontWeight\": \"bold\","
|
||||||
+ " \"color\": \"#434348\"" + " }" + " }" + "}]";
|
+ " \"color\": \"gray\"" + " } " + " },"
|
||||||
|
+ " \"title\": { " + " \"text\": \""
|
||||||
|
+ StorageChartMeasure.DataVolume.getLabel() + "\","
|
||||||
|
+ " \"style\": {" + " \"color\": \""
|
||||||
|
+ colors.get(1) + "\"" + " }" + " }" + "}]";
|
||||||
|
|
||||||
case OperationCount:
|
case OperationCount:
|
||||||
return "[{" + " \"id\": \"" + StorageChartMeasure.OperationCount.name() + "\"," + " \"labels\": { "
|
return "[{" + " \"id\": \""
|
||||||
+ " \"format\": \"{value}\"," + " \"style\": { " + " \"color\": \"#434348\"" + " }"
|
+ StorageChartMeasure.OperationCount.name() + "\","
|
||||||
+ " }," + " \"stackLabels\": {" + " \"enabled\": \"true\"," + " \"style\": {"
|
+ " \"labels\": { " + " \"format\": \"{value}\","
|
||||||
+ " \"fontWeight\": \"bold\"," + " \"color\": \"gray\"" + " } " + " },"
|
+ " \"style\": { " + " \"color\": \""
|
||||||
+ " \"title\": { " + " \"text\": \"" + StorageChartMeasure.OperationCount.getLabel() + "\","
|
+ colors.get(1) + "\"" + " }" + " },"
|
||||||
+ " \"style\": {" + " \"color\": \"#434348\"" + " }" + " }" + "}]";
|
+ " \"stackLabels\": {" + " \"enabled\": \"true\","
|
||||||
|
+ " \"style\": {" + " \"fontWeight\": \"bold\","
|
||||||
|
+ " \"color\": \"gray\"" + " } " + " },"
|
||||||
|
+ " \"title\": { " + " \"text\": \""
|
||||||
|
+ StorageChartMeasure.OperationCount.getLabel() + "\","
|
||||||
|
+ " \"style\": {" + " \"color\": \""
|
||||||
|
+ colors.get(1) + "\"" + " }" + " }" + "}]";
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return "[{" + " \"id\": \"" + StorageChartMeasure.DataVolume.name() + "\"," + " \"labels\": {"
|
return "[{" + " \"id\": \"" + StorageChartMeasure.DataVolume.name()
|
||||||
+ " \"format\": \"{value} " + unitMeasureLabel + "\"," + " \"style\": {"
|
+ "\"," + " \"labels\": {" + " \"format\": \"{value} "
|
||||||
+ " \"color\": \"#434348\"" + " }" + " }," + " \"stackLabels\": {"
|
+ unitMeasureLabel + "\"," + " \"style\": {"
|
||||||
+ " \"enabled\": \"true\"," + " \"style\": {" + " \"fontWeight\": \"bold\","
|
+ " \"color\": \"" + colors.get(1) + "\"" + " }"
|
||||||
+ " \"color\": \"gray\"" + " } " + " }," + " \"title\": { " + " \"text\": \""
|
+ " }," + " \"stackLabels\": {" + " \"enabled\": \"true\","
|
||||||
+ StorageChartMeasure.DataVolume.getLabel() + "\"," + " \"style\": {"
|
+ " \"style\": {" + " \"fontWeight\": \"bold\","
|
||||||
+ " \"color\": \"#434348\"" + " }" + " }" + "}]";
|
+ " \"color\": \"gray\"" + " } " + " },"
|
||||||
|
+ " \"title\": { " + " \"text\": \""
|
||||||
|
+ StorageChartMeasure.DataVolume.getLabel() + "\","
|
||||||
|
+ " \"style\": {" + " \"color\": \""
|
||||||
|
+ colors.get(1) + "\"" + " }" + " }" + "}]";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/maindata/charts/utils/ByteUnitMeasure.java
Executable file → Normal file
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/maindata/charts/utils/ChartDateTimeData.java
Executable file → Normal file
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/maindata/charts/utils/ChartTimeMeasure.java
Executable file → Normal file
|
@ -1,35 +0,0 @@
|
||||||
package org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils;
|
|
||||||
|
|
||||||
import com.github.highcharts4gwt.model.array.api.ArrayString;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author Giancarlo Panichi
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class ColorsPalette {
|
|
||||||
|
|
||||||
private String[] palette = { "#87CEEB", "#DAA520", "#3CB371", "#FF4500", "#8FBC8F", "#FF00FF", "#BDB76B", "#5F9EA0",
|
|
||||||
"#A0522D", "#6B8E23", "#FFA07A", "#696969", "#DDA0DD", "#C71585", "#1E90FF", "#D2B48C", "#90EE90",
|
|
||||||
"#B22222", "#00CED1", "#9400D3", "#FFDAB9", "#663399", "#FFE4C4", "#ADFF2F", "#FF0000", "#00FFFF",
|
|
||||||
"#483D8B", "#FFFF00", "#00008B", "#FFDEAD", "#7CFC00", "#FF6347", "#AFEEEE", "#6A5ACD", "#FFFACD",
|
|
||||||
"#0000CD", "#F5DEB3", "#00FF00", "#FF7F50", "#7FFFD4", "#7B68EE", "#FFEFD5", "#0000FF", "#DEB887",
|
|
||||||
"#32CD32", "#FFA500", "#40E0D0", "#9370DB", "#FFE4B5", "#4169E1", "#BC8F8F", "#98FB98", "#8B0000",
|
|
||||||
"#48D1CC", "#800080", "#EEE8AA", "#00BFFF", "#F4A460", "#00FA9A", "#800000", "#556B2F", "#8A2BE2",
|
|
||||||
"#F0E68C", "#6495ED", "#B8860B", "#2E8B57", "#FFD700", "#66CDAA", "#9932CC", "#FFC0CB", "#87CEFA",
|
|
||||||
"#CD853F", "#228B22", "#DC143C", "#20B2AA", "#BA55D3", "#FFB6C1", "#B0E0E6", "#D2691E", "#008000",
|
|
||||||
"#CD5C5C", "#008B8B", "#FF00FF", "#FF69B4", "#B0C4DE", "#808000", "#006400", "#F08080", "#008080",
|
|
||||||
"#EE82EE", "#FF1493", "#4682B4", "#8B4513", "#9ACD32", "#FA8072", "#778899", "#DA70D6", "#DB7093" };
|
|
||||||
|
|
||||||
public ColorsPalette() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public ArrayString getColorsPalette(ArrayString colors) {
|
|
||||||
for (int i = 0; i < palette.length; i++) {
|
|
||||||
colors.setValue(i, palette[i]);
|
|
||||||
}
|
|
||||||
colors.setLength(palette.length);
|
|
||||||
return colors;
|
|
||||||
}
|
|
||||||
}
|
|
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/maindata/charts/utils/DownloadConstants.java
Executable file → Normal file
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/maindata/charts/utils/JobChartMeasure.java
Executable file → Normal file
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/maindata/charts/utils/ServiceChartMeasure.java
Executable file → Normal file
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/maindata/charts/utils/SpaceChartMeasure.java
Executable file → Normal file
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/maindata/charts/utils/StorageChartMeasure.java
Executable file → Normal file
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/maindata/charts/utils/TimeUnitMeasure.java
Executable file → Normal file
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/menu/AccountingManagerMenu.java
Executable file → Normal file
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/menu/EmptyPanel.java
Executable file → Normal file
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/monitor/AccountingMonitor.java
Executable file → Normal file
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/monitor/MonitorRequest.java
Executable file → Normal file
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/monitor/MonitorRequestEvent.java
Executable file → Normal file
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/monitor/MonitorRequestType.java
Executable file → Normal file
3
src/main/java/org/gcube/portlets/admin/accountingmanager/client/properties/AccountingFilterProperties.java
Executable file → Normal file
|
@ -9,7 +9,8 @@ import com.sencha.gxt.data.shared.PropertyAccess;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Giancarlo Panichi
|
* @author giancarlo
|
||||||
|
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public interface AccountingFilterProperties extends
|
public interface AccountingFilterProperties extends
|
||||||
|
|
6
src/main/java/org/gcube/portlets/admin/accountingmanager/client/properties/AccountingPeriodModePropertiesCombo.java
Executable file → Normal file
|
@ -9,10 +9,12 @@ import com.sencha.gxt.data.shared.PropertyAccess;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Giancarlo Panichi
|
* @author giancarlo
|
||||||
|
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public interface AccountingPeriodModePropertiesCombo extends PropertyAccess<AccountingPeriodMode> {
|
public interface AccountingPeriodModePropertiesCombo extends
|
||||||
|
PropertyAccess<AccountingPeriodMode> {
|
||||||
|
|
||||||
@Path("id")
|
@Path("id")
|
||||||
ModelKeyProvider<AccountingPeriodMode> id();
|
ModelKeyProvider<AccountingPeriodMode> id();
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package org.gcube.portlets.admin.accountingmanager.client.properties;
|
package org.gcube.portlets.admin.accountingmanager.client.properties;
|
||||||
|
|
||||||
import org.gcube.portlets.admin.accountingmanager.shared.data.ContextData;
|
import org.gcube.portlets.admin.accountingmanager.shared.data.GenresData;
|
||||||
|
|
||||||
import com.google.gwt.editor.client.Editor.Path;
|
import com.google.gwt.editor.client.Editor.Path;
|
||||||
import com.sencha.gxt.core.client.ValueProvider;
|
import com.sencha.gxt.core.client.ValueProvider;
|
||||||
|
@ -13,10 +13,9 @@ import com.sencha.gxt.data.shared.PropertyAccess;
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public interface ContextDataProperties extends PropertyAccess<ContextData> {
|
public interface GenresDataProperties extends PropertyAccess<GenresData> {
|
||||||
|
@Path("genre")
|
||||||
|
ModelKeyProvider<GenresData> id();
|
||||||
|
|
||||||
@Path("contextData")
|
ValueProvider<GenresData, String> label();
|
||||||
ModelKeyProvider<ContextData> id();
|
|
||||||
|
|
||||||
ValueProvider<ContextData, String> label();
|
|
||||||
}
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
package org.gcube.portlets.admin.accountingmanager.client.properties;
|
||||||
|
|
||||||
|
import org.gcube.portlets.admin.accountingmanager.shared.data.GenresData;
|
||||||
|
|
||||||
|
import com.google.gwt.editor.client.Editor.Path;
|
||||||
|
import com.sencha.gxt.data.shared.LabelProvider;
|
||||||
|
import com.sencha.gxt.data.shared.ModelKeyProvider;
|
||||||
|
import com.sencha.gxt.data.shared.PropertyAccess;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author giancarlo
|
||||||
|
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public interface GenresDataPropertiesCombo extends
|
||||||
|
PropertyAccess<GenresData> {
|
||||||
|
|
||||||
|
@Path("genre")
|
||||||
|
ModelKeyProvider<GenresData> id();
|
||||||
|
|
||||||
|
LabelProvider<GenresData> label();
|
||||||
|
|
||||||
|
}
|
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/resource/AccountingManager.css
Executable file → Normal file
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/resource/AccountingManagerCSS.java
Executable file → Normal file
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/resource/AccountingManagerResources.java
Executable file → Normal file
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/resource/accounting-byte_24.png
Executable file → Normal file
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/resource/accounting-byte_32.png
Executable file → Normal file
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/resource/accounting-chart-variable-axis_24.png
Executable file → Normal file
Before Width: | Height: | Size: 952 B After Width: | Height: | Size: 952 B |
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/resource/accounting-chart-variable-axis_32.png
Executable file → Normal file
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/resource/accounting-download_24.png
Executable file → Normal file
Before Width: | Height: | Size: 869 B After Width: | Height: | Size: 869 B |
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/resource/accounting-download_32.png
Executable file → Normal file
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/resource/accounting-file-csv_24.png
Executable file → Normal file
Before Width: | Height: | Size: 924 B After Width: | Height: | Size: 924 B |
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/resource/accounting-file-csv_32.png
Executable file → Normal file
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/resource/accounting-file-jpg_24.png
Executable file → Normal file
Before Width: | Height: | Size: 847 B After Width: | Height: | Size: 847 B |
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/resource/accounting-file-jpg_32.png
Executable file → Normal file
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/resource/accounting-file-json_24.png
Executable file → Normal file
Before Width: | Height: | Size: 900 B After Width: | Height: | Size: 900 B |
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/resource/accounting-file-json_32.png
Executable file → Normal file
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/resource/accounting-file-pdf_24.png
Executable file → Normal file
Before Width: | Height: | Size: 866 B After Width: | Height: | Size: 866 B |
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/resource/accounting-file-pdf_32.png
Executable file → Normal file
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
0
src/main/java/org/gcube/portlets/admin/accountingmanager/client/resource/accounting-file-png_24.png
Executable file → Normal file
Before Width: | Height: | Size: 943 B After Width: | Height: | Size: 943 B |