Skip to content
This repository has been archived by the owner on Jul 24, 2019. It is now read-only.

fixed #226 Redundant property columns in parent-child level with show… #227

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@
/pom.xml.releaseBackup
/pom.xml.tag
/release.properties
.idea/
*.iml
31 changes: 30 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,33 @@ is independent of any particular GUI implementation.
Project Page
=======

Please visit Pivot4J home page at http://www.pivot4j.org
Please visit original Pivot4J home page at http://www.pivot4j.org
Original Pivot4J is not maintained. This is Argus fork of original Pivot4J.

Build
=======

* use java 8
* mvn clean install

Debug pivot4j-analytics
=======
pivot4j-analytics - оригинальное демо приложение для используемого Аргус pivot4j-core.

* IDEA. Открой как проект: pivot4j/pom.xml
* File/Project structure.
* В Project SDK задай JDK 11.
* Edit configuration "JBoss/WildFly pivot4j-analytics"
* Application server: укажи чистую инсталляцию Wilfdly 15.0.1. Чистую, значит не сконфигурированную под Аргус, не применялся configure_server.bat.
* Собери артефакт
* Меню Build\Build artifacts\pivot4j-analytics:war exploded
* Появится каталог pivot4j\pivot4j-analytics\target\pivot4j-analytics-<версия>
* В него надо руками положить демо-БД в "WEB-INF/foodmart"
* Из "A:\Разработка.java\lib and docs\pivot4j\pivot4j-analytics-0.9.war" взять каталог "WEB-INF/foodmart"
* Запуcкай конфигурацию "JBoss/WildFly pivot4j-analytics"






74 changes: 74 additions & 0 deletions pivot4j-analytics/.run/JBoss_WildFly pivot4j exploded.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="JBoss/WildFly pivot4j-analytics" type="JBossConfiguration" factoryName="Local" APPLICATION_SERVER_NAME="JBoss/WildFly 15.0.1.Final.Clean" ALTERNATIVE_JRE_ENABLED="true" ALTERNATIVE_JRE_PATH="11.0.11_9">
<option name="COMMON_VM_ARGUMENTS" value="-Dorg.jboss.logmanager.nocolor=false -Dfile.encoding=UTF-8" />
<option name="UPDATING_POLICY" value="restart-server" />
<deployment>
<artifact name="pivot4j-analytics:war exploded">
<settings />
</artifact>
</deployment>
<server-settings>
<option name="SERVER" />
<option name="BINDING_SET_NAME" value="" />
<option name="DOMAIN" value="false" />
<option name="SERVER_GROUP" value="main-server-group" />
<option name="USERNAME" value="" />
<option name="CREDENTIAL_ALIAS" />
</server-settings>
<predefined_log_file enabled="true" id="JBoss" />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="58907" />
</RunnerSettings>
<ConfigurationWrapper VM_VAR="JAVA_OPTS" RunnerId="Cover">
<option name="USE_ENV_VARIABLES" value="true" />
<STARTUP>
<option name="USE_DEFAULT" value="true" />
<option name="SCRIPT" value="" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
</STARTUP>
<SHUTDOWN>
<option name="USE_DEFAULT" value="true" />
<option name="SCRIPT" value="" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
</SHUTDOWN>
</ConfigurationWrapper>
<ConfigurationWrapper VM_VAR="JAVA_OPTS" RunnerId="Debug">
<option name="USE_ENV_VARIABLES" value="true" />
<STARTUP>
<option name="USE_DEFAULT" value="true" />
<option name="SCRIPT" value="" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
</STARTUP>
<SHUTDOWN>
<option name="USE_DEFAULT" value="true" />
<option name="SCRIPT" value="" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
</SHUTDOWN>
</ConfigurationWrapper>
<ConfigurationWrapper VM_VAR="JAVA_OPTS" RunnerId="Run">
<option name="USE_ENV_VARIABLES" value="true" />
<STARTUP>
<option name="USE_DEFAULT" value="true" />
<option name="SCRIPT" value="" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
</STARTUP>
<SHUTDOWN>
<option name="USE_DEFAULT" value="true" />
<option name="SCRIPT" value="" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
</SHUTDOWN>
</ConfigurationWrapper>
<method v="2">
<option name="Make" enabled="true" />
<option name="BuildArtifacts" enabled="true">
<artifact name="pivot4j-analytics:war exploded" />
</option>
</method>
</configuration>
</component>
2 changes: 1 addition & 1 deletion pivot4j-analytics/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>org.pivot4j</groupId>
<artifactId>pivot4j</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.0-TASK-123529</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
6 changes: 6 additions & 0 deletions pivot4j-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -297,5 +297,11 @@
<name>emuStudio Repository</name>
<url>http://emustudio.sf.net/repository/</url>
</pluginRepository>
<!-- Для cup-maven-plugin, т.к. в интернете больше его нет. Удача повернулась лицом и зависимость было найдена в локальном репозитории-->
<pluginRepository>
<id>central</id>
<name>argus-internal</name>
<url>http://git:8081/artifactory/repo</url>
</pluginRepository>
</pluginRepositories>
</project>
64 changes: 32 additions & 32 deletions pivot4j-core/src/main/java/org/pivot4j/ui/poi/ExcelExporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
*/
package org.pivot4j.ui.poi;

import static org.pivot4j.ui.CellTypes.VALUE;
import static org.pivot4j.ui.CellTypes.LABEL;
import static org.pivot4j.ui.CellTypes.VALUE;

import java.awt.Color;
import java.io.IOException;
Expand All @@ -20,11 +20,15 @@
import org.apache.commons.lang.StringUtils;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.hssf.util.HSSFColor;
import org.apache.poi.ss.usermodel.BorderStyle;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.FillPatternType;
import org.apache.poi.ss.usermodel.Font;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.VerticalAlignment;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.ss.util.RegionUtil;
Expand Down Expand Up @@ -396,11 +400,11 @@ protected CellStyle createHeaderCellStyle() {

font.setFontName(fontFamily);
font.setFontHeightInPoints((short) fontSize);
font.setBoldweight(Font.BOLDWEIGHT_BOLD);
font.setBold(true);

style.setFont(font);
style.setAlignment(CellStyle.ALIGN_LEFT);
style.setVerticalAlignment(CellStyle.VERTICAL_CENTER);
style.setAlignment(HorizontalAlignment.LEFT);
style.setVerticalAlignment(VerticalAlignment.CENTER);

switch (format) {
case XSSF:
Expand All @@ -415,11 +419,11 @@ protected CellStyle createHeaderCellStyle() {
assert false;
}

style.setFillPattern(CellStyle.SOLID_FOREGROUND);
style.setBorderTop(CellStyle.BORDER_THIN);
style.setBorderLeft(CellStyle.BORDER_THIN);
style.setBorderRight(CellStyle.BORDER_THIN);
style.setBorderBottom(CellStyle.BORDER_THIN);
style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
style.setBorderTop(BorderStyle.THIN);
style.setBorderLeft(BorderStyle.THIN);
style.setBorderRight(BorderStyle.THIN);
style.setBorderBottom(BorderStyle.THIN);

return style;
}
Expand All @@ -441,15 +445,15 @@ protected CellStyle createValueCellStyle() {

font.setFontName(fontFamily);
font.setFontHeightInPoints((short) fontSize);
font.setBoldweight(Font.BOLDWEIGHT_NORMAL);
font.setBold(true);

style.setFont(font);
style.setAlignment(CellStyle.ALIGN_RIGHT);
style.setVerticalAlignment(CellStyle.VERTICAL_CENTER);
style.setBorderTop(CellStyle.BORDER_THIN);
style.setBorderLeft(CellStyle.BORDER_THIN);
style.setBorderRight(CellStyle.BORDER_THIN);
style.setBorderBottom(CellStyle.BORDER_THIN);
style.setAlignment(HorizontalAlignment.RIGHT);
style.setVerticalAlignment(VerticalAlignment.CENTER);
style.setBorderTop(BorderStyle.THIN);
style.setBorderLeft(BorderStyle.THIN);
style.setBorderRight(BorderStyle.THIN);
style.setBorderBottom(BorderStyle.THIN);
style.setDataFormat((short) 4);

return style;
Expand All @@ -472,11 +476,11 @@ protected CellStyle createAggregationCellStyle() {

font.setFontName(fontFamily);
font.setFontHeightInPoints((short) fontSize);
font.setBoldweight(Font.BOLDWEIGHT_NORMAL);
font.setBold(true);

style.setFont(font);
style.setAlignment(CellStyle.ALIGN_RIGHT);
style.setVerticalAlignment(CellStyle.VERTICAL_CENTER);
style.setAlignment(HorizontalAlignment.RIGHT);
style.setVerticalAlignment(VerticalAlignment.CENTER);

switch (format) {
case XSSF:
Expand All @@ -491,11 +495,11 @@ protected CellStyle createAggregationCellStyle() {
assert false;
}

style.setFillPattern(CellStyle.SOLID_FOREGROUND);
style.setBorderTop(CellStyle.BORDER_THIN);
style.setBorderLeft(CellStyle.BORDER_THIN);
style.setBorderRight(CellStyle.BORDER_THIN);
style.setBorderBottom(CellStyle.BORDER_THIN);
style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
style.setBorderTop(BorderStyle.THIN);
style.setBorderLeft(BorderStyle.THIN);
style.setBorderRight(BorderStyle.THIN);
style.setBorderBottom(BorderStyle.THIN);
style.setDataFormat((short) 4);

return style;
Expand Down Expand Up @@ -558,14 +562,10 @@ protected void mergeCells(TableRenderContext context, Sheet sheet,
for (CellRangeAddress region : regions) {
sheet.addMergedRegion(region);

RegionUtil.setBorderTop(CellStyle.BORDER_THIN, region, sheet,
workbook);
RegionUtil.setBorderLeft(CellStyle.BORDER_THIN, region, sheet,
workbook);
RegionUtil.setBorderBottom(CellStyle.BORDER_THIN, region, sheet,
workbook);
RegionUtil.setBorderRight(CellStyle.BORDER_THIN, region, sheet,
workbook);
RegionUtil.setBorderTop(BorderStyle.THIN, region, sheet);
RegionUtil.setBorderLeft(BorderStyle.THIN, region, sheet);
RegionUtil.setBorderBottom(BorderStyle.THIN, region, sheet);
RegionUtil.setBorderRight(BorderStyle.THIN, region, sheet);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,9 @@ void addMemberProperties() {

List<TreeNode<TableAxisContext>> children = null;

if (getMember() != null) {
// Should render level properties only once behind the latest
if (getMember() != null && isLastInLevel()) {

List<Level> levels = getReference().getLevels(getHierarchy());

boolean showParent = getReference().getRenderer().getShowParentMembers();
Expand Down Expand Up @@ -319,6 +321,18 @@ void addMemberProperties() {
}
}

private boolean isLastInLevel() {
if (getChildCount() == 0) {
return true;
}

TableHeaderNode childNode = (TableHeaderNode) getChildren().get(0);
if (getMember().getLevel().getDepth() == childNode.getMember().getLevel().getDepth()) {
return !OlapUtils.equals(getHierarchy(), childNode.getHierarchy());
}
return true;
}

void mergeChildren() {
List<TreeNode<TableAxisContext>> children = new ArrayList<TreeNode<TableAxisContext>>(getChildren());

Expand Down
43 changes: 23 additions & 20 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<groupId>org.pivot4j</groupId>
<artifactId>pivot4j</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.0-TASK-123529</version>
<name>Pivot4J</name>
<description>Pivot4J provides a common API for OLAP servers which can be used to build an analytical service frontend with pivot style GUI.

Expand Down Expand Up @@ -108,7 +108,7 @@ It aims to leverage mature but now discontinued JPivot project's codebase to mak
<version.avalon>4.3</version.avalon>
<version.freemarker>2.3.20</version.freemarker>
<version.jflex>1.4.3</version.jflex>
<version.poi>3.10-FINAL</version.poi>
<version.poi>3.17</version.poi>
<version.shrinkwrap>2.0.0</version.shrinkwrap>
<version.tomcat6>6.0.41</version.tomcat6>
<version.xerces>2.11.0</version.xerces>
Expand All @@ -125,7 +125,8 @@ It aims to leverage mature but now discontinued JPivot project's codebase to mak
<modules>
<module>pivot4j-core</module>
<module>pivot4j-analytics</module>
<module>pivot4j-pentaho</module>
<!--Not supported
<module>pivot4j-pentaho</module>-->
</modules>

<developers>
Expand Down Expand Up @@ -531,30 +532,32 @@ It aims to leverage mature but now discontinued JPivot project's codebase to mak
</dependency>
</dependencies>


<repositories>
<repository>
<id>pentaho</id>
<name>Pentaho Repository</name>
<url>http://repository.pentaho.org/artifactory/repo/</url>
<id>central</id>
<name>argus-internal</name>
<url>http://git:8081/artifactory/repo</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>

<pluginRepositories>
<pluginRepository>
<id>central</id>
<name>argus-internal</name>
<url>http://git:8081/artifactory/repo</url>
</pluginRepository>
</pluginRepositories>


<distributionManagement>
<repository>
<id>sonatype-nexus-staging</id>
<name>Sonatype Staging</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
<id>artifactory</id>
<name>artifactory-releases</name>
<url>http://git:8081/artifactory/ext-release-local</url>
</repository>
<snapshotRepository>
<id>sonatype-nexus-snapshots</id>
<name>Sonatype Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</snapshotRepository>
<site>
<id>pivot4j</id>
<name>Pivot4J Home Page</name>
<url>${deploy.site.url}</url>
</site>
<downloadUrl>http://www.pivot4j.org/download.html</downloadUrl>
</distributionManagement>
</project>