You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ki...@apache.org on 2018/10/06 19:33:28 UTC
svn commit: r1843032 [1/3] - in /poi/branches/hemf: ./ jenkins/ maven/
sonar/ooxml/ src/examples/src/org/apache/poi/hssf/view/
src/examples/src/org/apache/poi/ss/examples/
src/examples/src/org/apache/poi/ss/examples/html/
src/examples/src/org/apache/po...
Author: kiwiwings
Date: Sat Oct 6 19:33:27 2018
New Revision: 1843032
URL: http://svn.apache.org/viewvc?rev=1843032&view=rev
Log:
merge trunk
Added:
poi/branches/hemf/src/examples/src/org/apache/poi/xssf/usermodel/examples/BarAndLineChart.java
- copied unchanged from r1843031, poi/trunk/src/examples/src/org/apache/poi/xssf/usermodel/examples/BarAndLineChart.java
poi/branches/hemf/src/examples/src/org/apache/poi/xwpf/usermodel/examples/BarChartExample.java
- copied unchanged from r1843031, poi/trunk/src/examples/src/org/apache/poi/xwpf/usermodel/examples/BarChartExample.java
poi/branches/hemf/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/DisplayBlanks.java
- copied unchanged from r1843031, poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/DisplayBlanks.java
poi/branches/hemf/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFTitle.java
- copied unchanged from r1843031, poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFTitle.java
poi/branches/hemf/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFBackground.java
- copied unchanged from r1843031, poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFBackground.java
poi/branches/hemf/test-data/slideshow/bug62736.pptx
- copied unchanged from r1843031, poi/trunk/test-data/slideshow/bug62736.pptx
poi/branches/hemf/test-data/spreadsheet/60509.xlsx
- copied unchanged from r1843031, poi/trunk/test-data/spreadsheet/60509.xlsx
Removed:
poi/branches/hemf/src/examples/src/org/apache/poi/xwpf/usermodel/examples/BarChartExampleDOCX.java
Modified:
poi/branches/hemf/ (props changed)
poi/branches/hemf/.classpath
poi/branches/hemf/build.gradle
poi/branches/hemf/build.xml
poi/branches/hemf/jenkins/create_jobs.groovy
poi/branches/hemf/maven/poi-ooxml.pom
poi/branches/hemf/maven/poi.pom
poi/branches/hemf/sonar/ooxml/pom.xml
poi/branches/hemf/src/examples/src/org/apache/poi/hssf/view/SVBorder.java
poi/branches/hemf/src/examples/src/org/apache/poi/ss/examples/ConditionalFormats.java
poi/branches/hemf/src/examples/src/org/apache/poi/ss/examples/html/ToHtml.java
poi/branches/hemf/src/examples/src/org/apache/poi/xslf/usermodel/BarChartDemo.java
poi/branches/hemf/src/examples/src/org/apache/poi/xslf/usermodel/PieChartDemo.java
poi/branches/hemf/src/examples/src/org/apache/poi/xslf/usermodel/bar-chart-data.txt
poi/branches/hemf/src/examples/src/org/apache/poi/xssf/usermodel/examples/BarChart.java
poi/branches/hemf/src/examples/src/org/apache/poi/xssf/usermodel/examples/BigGridDemo.java
poi/branches/hemf/src/examples/src/org/apache/poi/xssf/usermodel/examples/CreateTable.java
poi/branches/hemf/src/examples/src/org/apache/poi/xssf/usermodel/examples/IterateCells.java
poi/branches/hemf/src/examples/src/org/apache/poi/xssf/usermodel/examples/LineChart.java
poi/branches/hemf/src/examples/src/org/apache/poi/xssf/usermodel/examples/ScatterChart.java
poi/branches/hemf/src/examples/src/org/apache/poi/xwpf/usermodel/examples/SimpleDocument.java
poi/branches/hemf/src/examples/src/org/apache/poi/xwpf/usermodel/examples/SimpleImages.java
poi/branches/hemf/src/examples/src/org/apache/poi/xwpf/usermodel/examples/bar-chart-data.txt
poi/branches/hemf/src/java/org/apache/poi/ddf/EscherRecord.java
poi/branches/hemf/src/java/org/apache/poi/ss/formula/EvaluationConditionalFormatRule.java
poi/branches/hemf/src/java/org/apache/poi/ss/formula/FormulaParser.java
poi/branches/hemf/src/java/org/apache/poi/ss/formula/atp/RandBetween.java
poi/branches/hemf/src/java/org/apache/poi/util/StaxHelper.java
poi/branches/hemf/src/ooxml/java/org/apache/poi/ooxml/POIXMLProperties.java
poi/branches/hemf/src/ooxml/java/org/apache/poi/openxml4j/opc/OPCPackage.java
poi/branches/hemf/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/marshallers/PackagePropertiesMarshaller.java
poi/branches/hemf/src/ooxml/java/org/apache/poi/openxml4j/util/Nullable.java
poi/branches/hemf/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/SignatureInfo.java
poi/branches/hemf/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFBarChartData.java
poi/branches/hemf/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFCategoryAxis.java
poi/branches/hemf/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFCategoryDataSource.java
poi/branches/hemf/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFChart.java
poi/branches/hemf/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFChartAxis.java
poi/branches/hemf/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFChartData.java
poi/branches/hemf/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFDataSource.java
poi/branches/hemf/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFDataSourcesFactory.java
poi/branches/hemf/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFDateAxis.java
poi/branches/hemf/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFLineChartData.java
poi/branches/hemf/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFPieChartData.java
poi/branches/hemf/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFRadarChartData.java
poi/branches/hemf/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFScatterChartData.java
poi/branches/hemf/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFSeriesAxis.java
poi/branches/hemf/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFValueAxis.java
poi/branches/hemf/src/ooxml/java/org/apache/poi/xddf/usermodel/text/XDDFParagraphProperties.java
poi/branches/hemf/src/ooxml/java/org/apache/poi/xddf/usermodel/text/XDDFTextBody.java
poi/branches/hemf/src/ooxml/java/org/apache/poi/xddf/usermodel/text/XDDFTextParagraph.java
poi/branches/hemf/src/ooxml/java/org/apache/poi/xslf/usermodel/XMLSlideShow.java
poi/branches/hemf/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFBackground.java
poi/branches/hemf/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFChart.java
poi/branches/hemf/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFColor.java
poi/branches/hemf/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSheet.java
poi/branches/hemf/src/ooxml/java/org/apache/poi/xssf/model/StylesTable.java
poi/branches/hemf/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFBuiltinTableStyle.java
poi/branches/hemf/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java
poi/branches/hemf/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFChart.java
poi/branches/hemf/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFClientAnchor.java
poi/branches/hemf/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFComment.java
poi/branches/hemf/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java
poi/branches/hemf/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFTable.java
poi/branches/hemf/src/ooxml/java/org/apache/poi/xssf/usermodel/helpers/XSSFFormulaUtils.java
poi/branches/hemf/src/ooxml/testcases/org/apache/poi/ooxml/util/OOXMLLite.java
poi/branches/hemf/src/ooxml/testcases/org/apache/poi/ooxml/util/TestDocumentHelper.java
poi/branches/hemf/src/ooxml/testcases/org/apache/poi/ooxml/util/TestSAXHelper.java
poi/branches/hemf/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestPackage.java
poi/branches/hemf/src/ooxml/testcases/org/apache/poi/xslf/TestXSLFBugs.java
poi/branches/hemf/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFChart.java
poi/branches/hemf/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFTable.java
poi/branches/hemf/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java
poi/branches/hemf/src/resources/devtools/forbidden-signatures.txt
poi/branches/hemf/src/scratchpad/src/org/apache/poi/hslf/record/TextSpecInfoRun.java
poi/branches/hemf/src/testcases/org/apache/poi/ss/formula/atp/TestRandBetween.java
Propchange: poi/branches/hemf/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Sat Oct 6 19:33:27 2018
@@ -1,26 +1 @@
-classes
-workbook.xls
-bak
-*.iws
-build.number
-*.el
-TEST-org.apache.poi*.xml
-build
-.settings
-scripts
-*.ipr
-untitled1.jpx
-*.iml
-log*.*
-dist
-*.log
-bin
-.ant-targets-build.xml
-out
-.idea
-.gradle
-gradle
-gradlew
-gradlew.bat
-tmp
-
+ooxml-testlib
Propchange: poi/branches/hemf/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Oct 6 19:33:27 2018
@@ -5,4 +5,4 @@
/poi/branches/ss_border_property_template:1747847-1748074
/poi/branches/xml_signature:1617139-1628347
/poi/branches/xssf_structured_references:1747607-1747656
-/poi/trunk:693591-694881,695264-695420,695621,695649-711764,1839877-1840323
+/poi/trunk:693591-694881,695264-695420,695621,695649-711764,1839877-1840323,1840325-1843031
Modified: poi/branches/hemf/.classpath
URL: http://svn.apache.org/viewvc/poi/branches/hemf/.classpath?rev=1843032&r1=1843031&r2=1843032&view=diff
==============================================================================
--- poi/branches/hemf/.classpath (original)
+++ poi/branches/hemf/.classpath Sat Oct 6 19:33:27 2018
@@ -28,8 +28,8 @@
<classpathentry kind="lib" path="lib/jmh-generator-annprocess-1.19.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry exported="true" kind="lib" path="compile-lib/slf4j-api-1.7.25.jar"/>
- <classpathentry kind="lib" path="compile-lib/bcpkix-jdk15on-1.59.jar"/>
- <classpathentry kind="lib" path="compile-lib/bcprov-ext-jdk15on-1.59.jar"/>
+ <classpathentry kind="lib" path="compile-lib/bcpkix-jdk15on-1.60.jar"/>
+ <classpathentry kind="lib" path="compile-lib/bcprov-ext-jdk15on-1.60.jar"/>
<classpathentry exported="true" kind="lib" path="compile-lib/xmlsec-2.1.0.jar"/>
<classpathentry exported="true" kind="lib" path="lib/commons-codec-1.11.jar"/>
<classpathentry exported="true" kind="lib" path="lib/commons-logging-1.2.jar"/>
Modified: poi/branches/hemf/build.gradle
URL: http://svn.apache.org/viewvc/poi/branches/hemf/build.gradle?rev=1843032&r1=1843031&r2=1843032&view=diff
==============================================================================
--- poi/branches/hemf/build.gradle (original)
+++ poi/branches/hemf/build.gradle Sat Oct 6 19:33:27 2018
@@ -159,8 +159,6 @@ subprojects {
}
}
- // japicmp will fail with "Could not load" because we moved some classes out of the root-package
- // for Java 9 compatibility in 4.0.0
task(japicmp, type: me.champeau.gradle.ArtifactJapicmpTask, dependsOn: jar) {
to = jar.archivePath
onlyModified = true
@@ -187,6 +185,7 @@ project('main') {
compile 'javax.activation:activation:1.1.1'
testCompile 'junit:junit:4.12'
+ testCompile 'org.reflections:reflections:0.9.11'
}
jar {
@@ -231,7 +230,7 @@ project('ooxml') {
compile 'org.apache.commons:commons-math3:3.6.1'
compile 'org.apache.commons:commons-compress:1.18'
compile 'org.apache.santuario:xmlsec:2.1.0'
- compile 'org.bouncycastle:bcpkix-jdk15on:1.59'
+ compile 'org.bouncycastle:bcpkix-jdk15on:1.60'
compile 'com.github.virtuald:curvesapi:1.05'
// for ooxml-lite, should we move this somewhere else?
@@ -245,6 +244,7 @@ project('ooxml') {
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:2.21.0'
testCompile 'org.xmlunit:xmlunit-core:2.5.1'
+ testCompile 'org.reflections:reflections:0.9.11'
testCompile project(path: ':main', configuration: 'tests')
testCompile 'org.openjdk.jmh:jmh-core:1.19'
testCompile 'org.openjdk.jmh:jmh-generator-annprocess:1.19'
Modified: poi/branches/hemf/build.xml
URL: http://svn.apache.org/viewvc/poi/branches/hemf/build.xml?rev=1843032&r1=1843031&r2=1843032&view=diff
==============================================================================
--- poi/branches/hemf/build.xml (original)
+++ poi/branches/hemf/build.xml Sat Oct 6 19:33:27 2018
@@ -52,6 +52,7 @@ under the License.
<property name="main.lib" location="lib"/>
<property name="ooxml.lib" location="ooxml-lib"/>
+ <property name="ooxml.test.lib" location="ooxml-testlib"/>
<property name="compile.lib" location="compile-lib"/>
<!-- compiler options options -->
@@ -201,14 +202,14 @@ under the License.
<!-- xml signature libs -->
<property name="dsig.xmlsec.jar" location="${compile.lib}/xmlsec-2.1.0.jar"/>
<property name="dsig.xmlsec.url" value="${repository.m2}/maven2/org/apache/santuario/xmlsec/2.1.0/xmlsec-2.1.0.jar"/>
- <property name="dsig.bouncycastle-prov.jar" location="${compile.lib}/bcprov-ext-jdk15on-1.59.jar"/>
- <property name="dsig.bouncycastle-prov.url" value="${repository.m2}/maven2/org/bouncycastle/bcprov-ext-jdk15on/1.59/bcprov-ext-jdk15on-1.59.jar"/>
- <property name="dsig.bouncycastle-pkix.jar" location="${compile.lib}/bcpkix-jdk15on-1.59.jar"/>
- <property name="dsig.bouncycastle-pkix.url" value="${repository.m2}/maven2/org/bouncycastle/bcpkix-jdk15on/1.59/bcpkix-jdk15on-1.59.jar"/>
+ <property name="dsig.bouncycastle-prov.jar" location="${compile.lib}/bcprov-ext-jdk15on-1.60.jar"/>
+ <property name="dsig.bouncycastle-prov.url" value="${repository.m2}/maven2/org/bouncycastle/bcprov-ext-jdk15on/1.60/bcprov-ext-jdk15on-1.60.jar"/>
+ <property name="dsig.bouncycastle-pkix.jar" location="${compile.lib}/bcpkix-jdk15on-1.60.jar"/>
+ <property name="dsig.bouncycastle-pkix.url" value="${repository.m2}/maven2/org/bouncycastle/bcpkix-jdk15on/1.60/bcpkix-jdk15on-1.60.jar"/>
<property name="dsig.sl4j-api.jar" location="${compile.lib}/slf4j-api-1.7.25.jar"/>
<property name="dsig.sl4j-api.url" value="${repository.m2}/maven2/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar"/>
- <!-- jars in the lib-ooxml directory, see the fetch-ooxml-jars target-->
+ <!-- jars in the ooxml-lib directory, see the fetch-ooxml-jars target-->
<property name="ooxml.curvesapi.jar" location="${ooxml.lib}/curvesapi-1.05.jar"/>
<property name="ooxml.curvesapi.url"
value="${repository.m2}/maven2/com/github/virtuald/curvesapi/1.05/curvesapi-1.05.jar"/>
@@ -219,6 +220,17 @@ under the License.
<property name="ooxml.commons-compress.url"
value="${repository.m2}/maven2/org/apache/commons/commons-compress/1.18/commons-compress-1.18.jar"/>
+ <!-- jars in the ooxml-test-lib directory, see the fetch-ooxml-jars target-->
+ <property name="ooxml.test.reflections.jar" location="${ooxml.test.lib}/reflections.jar"/>
+ <property name="ooxml.test.reflections.url"
+ value="${repository.m2}/maven2/org/reflections/reflections/0.9.11/reflections-0.9.11.jar"/>
+ <property name="ooxml.test.guava.jar" location="${ooxml.test.lib}/guava.jar"/>
+ <property name="ooxml.test.guava.url"
+ value="${repository.m2}/maven2/com/google/guava/guava/20.0/guava-20.0.jar"/>
+ <property name="ooxml.test.javassist.jar" location="${ooxml.test.lib}/javassist.jar"/>
+ <property name="ooxml.test.javassist.url"
+ value="${repository.m2}/maven2/org/javassist/javassist/3.21.0-GA/javassist-3.21.0-GA.jar"/>
+
<!-- coverage libs -->
<property name="jacoco.zip" location="${main.lib}/jacoco-0.8.2.zip"/>
<property name="jacoco.url" value="${repository.m2}/maven2/org/jacoco/jacoco/0.8.2/jacoco-0.8.2.zip"/>
@@ -232,8 +244,8 @@ under the License.
<!-- license and api checks -->
<property name="rat.jar" location="${main.lib}/apache-rat-0.12.jar"/>
<property name="rat.url" value="${repository.m2}/maven2/org/apache/rat/apache-rat/0.12/apache-rat-0.12.jar"/>
- <property name="forbidden.jar" location="${main.lib}/forbiddenapis-2.5.jar"/>
- <property name="forbidden.url" value="${repository.m2}/maven2/de/thetaphi/forbiddenapis/2.5/forbiddenapis-2.5.jar"/>
+ <property name="forbidden.jar" location="${main.lib}/forbiddenapis-2.6.jar"/>
+ <property name="forbidden.url" value="${repository.m2}/maven2/de/thetaphi/forbiddenapis/2.6/forbiddenapis-2.6.jar"/>
<property name="maven.ooxml.xsds.version.id" value="1.4"/>
@@ -282,10 +294,10 @@ under the License.
<property name="halt.on.test.failure" value="true"/>
<!-- helper jars for pgp signing, building and nexus staging -->
- <property name="dist.bouncycastle-prov.jar" location="${compile.lib}/bcprov-ext-jdk15on-1.59.jar"/>
- <property name="dist.bouncycastle-prov.url" value="${repository.m2}/maven2/org/bouncycastle/bcprov-ext-jdk15on/1.59/bcprov-ext-jdk15on-1.59.jar"/>
- <property name="dist.bouncycastle-bcpg.jar" location="${compile.lib}/bcpg-jdk15on-1.59.jar"/>
- <property name="dist.bouncycastle-bcpg.url" value="${repository.m2}/maven2/org/bouncycastle/bcpg-jdk15on/1.59/bcpg-jdk15on-1.59.jar"/>
+ <property name="dist.bouncycastle-prov.jar" location="${compile.lib}/bcprov-ext-jdk15on-1.60.jar"/>
+ <property name="dist.bouncycastle-prov.url" value="${repository.m2}/maven2/org/bouncycastle/bcprov-ext-jdk15on/1.60/bcprov-ext-jdk15on-1.60.jar"/>
+ <property name="dist.bouncycastle-bcpg.jar" location="${compile.lib}/bcpg-jdk15on-1.60.jar"/>
+ <property name="dist.bouncycastle-bcpg.url" value="${repository.m2}/maven2/org/bouncycastle/bcpg-jdk15on/1.60/bcpg-jdk15on-1.60.jar"/>
<property name="dist.commons-openpgp.jar" location="${compile.lib}/commons-openpgp-1.0-SNAPSHOT.jar"/>
<property name="dist.commons-openpgp.url" value="https://repository.apache.org/snapshots/org/apache/commons/commons-openpgp/1.0-SNAPSHOT/commons-openpgp-1.0-20140717.171036-11.jar"/>
<property name="dist.nexus-staging.jar" location="${compile.lib}/nexus-staging-ant-tasks-1.6.3-uber.jar"/>
@@ -416,10 +428,17 @@ under the License.
<pathelement location="${additionaljar}"/>
</path>
+ <path id="test.ooxml.reflections.classpath">
+ <pathelement location="${ooxml.test.reflections.jar}"/>
+ <pathelement location="${ooxml.test.guava.jar}"/>
+ <pathelement location="${ooxml.test.javassist.jar}"/>
+ </path>
+
<path id="test.ooxml.classpath">
<path refid="ooxml.classpath"/>
<path refid="ooxml.xmlsec.classpath"/>
<path refid="test.jar.classpath"/>
+ <path refid="test.ooxml.reflections.classpath"/>
<pathelement location="${ooxml.output.dir}"/>
<pathelement location="${ooxml.output.test.dir}"/>
<pathelement location="${main.output.test.dir}"/>
@@ -484,6 +503,7 @@ under the License.
<path refid="scratchpad.classpath"/>
<path refid="ooxml.classpath"/>
<path refid="ooxml.xmlsec.classpath"/>
+ <path refid="test.ooxml.reflections.classpath"/>
<path refid="excelant.classpath"/>
<path refid="examples.classpath"/>
<pathelement location="${examples.output.dir}"/>
@@ -582,6 +602,7 @@ under the License.
<mkdir dir="${main.lib}"/>
<mkdir dir="${compile.lib}"/>
<mkdir dir="${ooxml.lib}"/>
+ <mkdir dir="${ooxml.test.lib}"/>
<delete verbose="true">
<fileset dir="${main.lib}">
<include name="ant-1.8*"/>
@@ -631,6 +652,7 @@ under the License.
<include name="forbiddenapis-2.0.jar"/>
<include name="forbiddenapis-2.1.jar"/>
<include name="forbiddenapis-2.3.jar"/>
+ <include name="forbiddenapis-2.5.jar"/>
<include name="apache-rat-0.11.jar"/>
<include name="mockito-core-2.13.0.jar"/>
</fileset>
@@ -655,10 +677,7 @@ under the License.
<include name="xmlsec-2.0.1.jar"/>
<include name="xmlsec-2.0.5.jar"/>
<include name="xmlsec-2.0.6.jar"/>
- <include name="bc*jdk15on-1.51.jar"/>
- <include name="bc*jdk15on-1.53.jar"/>
- <include name="bc*jdk15on-1.54.jar"/>
- <include name="bc*jdk15on-1.58.jar"/>
+ <include name="bc*jdk15on-1.5*.jar"/>
<include name="slf4j-api-1.7.7.jar"/>
<include name="slf4j-api-1.7.12.jar"/>
</fileset>
@@ -753,6 +772,9 @@ under the License.
<available file="${ooxml.curvesapi.jar}"/>
<available file="${ooxml.xmlbeans.jar}"/>
<available file="${ooxml.commons-compress.jar}"/>
+ <available file="${ooxml.test.reflections.jar}"/>
+ <available file="${ooxml.test.guava.jar}"/>
+ <available file="${ooxml.test.javassist.jar}"/>
</and>
<isset property="disconnected"/>
</or>
@@ -760,9 +782,13 @@ under the License.
</target>
<target name="fetch-ooxml-jars" depends="check-ooxml-jars" unless="ooxml.jars.present">
<mkdir dir="${ooxml.lib}"/>
+ <mkdir dir="${ooxml.test.lib}"/>
<downloadfile src="${ooxml.curvesapi.url}" dest="${ooxml.curvesapi.jar}"/>
<downloadfile src="${ooxml.xmlbeans.url}" dest="${ooxml.xmlbeans.jar}"/>
<downloadfile src="${ooxml.commons-compress.url}" dest="${ooxml.commons-compress.jar}"/>
+ <downloadfile src="${ooxml.test.reflections.url}" dest="${ooxml.test.reflections.jar}"/>
+ <downloadfile src="${ooxml.test.guava.url}" dest="${ooxml.test.guava.jar}"/>
+ <downloadfile src="${ooxml.test.javassist.url}" dest="${ooxml.test.javassist.jar}"/>
</target>
<target name="check-svn-jars">
<condition property="svn.jars.present">
@@ -2045,6 +2071,7 @@ under the License.
<include name="commons-codec-*.jar"/>
<include name="commons-logging-*.jar"/>
<include name="commons-collections4-*.jar"/>
+ <include name="commons-compress*.jar"/>
<include name="commons-math3-*.jar"/>
<include name="jaxb-api-*.jar"/>
<include name="jaxb-impl-*.jar"/>
@@ -2753,13 +2780,20 @@ under the License.
project.setProperty(attributes.get("property"), mega);
</scriptdef>
- <macrodef name="loadFilesize">
- <attribute name="url"/>
- <attribute name="property"/>
+ <macrodef name="download-line">
+ <attribute name="prop"/>
+ <attribute name="dist"/>
+ <attribute name="pack"/>
<sequential>
+ <local name="baseurl"/>
+ <property name="baseurl" value="https://www.apache.org/dist/poi/release"/>
+
+ <local name="basedyn"/>
+ <property name="basedyn" value="https://www.apache.org/dyn/closer.lua/poi/release"/>
+
<delete file="build/loadFilesize.txt"/>
<record name="build/loadFilesize.txt" action="start" loglevel="verbose" append="false"/>
- <http url="@{url}" method="HEAD" expected="200" printrequestheaders="false" printresponseheaders="false"/>
+ <http url="${baseurl}/@{dist}/poi-@{dist}-${version.id}-${file_date}.@{pack}" method="HEAD" expected="200" printrequestheaders="false" printresponseheaders="false"/>
<record name="build/loadFilesize.txt" action="stop"/>
<local name="fileSize"/>
<loadfile property="fileSize" srcFile="build/loadFilesize.txt">
@@ -2770,7 +2804,16 @@ under the License.
</tokenfilter>
</filterchain>
</loadfile>
- <bytes2mega property="@{property}" bytes="${fileSize}"/>
+
+ <local name="fileSizeMb"/>
+ <bytes2mega property="fileSizeMb" bytes="${fileSize}"/>
+
+ <property name="@{prop}"><![CDATA[<li>
+ <a href="${basedyn}/@{dist}/poi-@{dist}-${version.id}-${file_date}.@{pack}">poi-@{dist}-${version.id}-${file_date}.@{pack}</a>
+ (${fileSizeMb} MB, <a href="${baseurl}/@{dist}/poi-@{dist}-${version.id}-${file_date}.@{pack}.asc">signature (.asc)</a>,
+ checksum: <a href="${baseurl}/@{dist}/poi-@{dist}-${version.id}-${file_date}.@{pack}.sha256">SHA-256</a>,
+ <a href="${baseurl}/@{dist}/poi-@{dist}-${version.id}-${file_date}.@{pack}.sha512">SHA-512</a>)
+ </li>]]></property>
</sequential>
</macrodef>
@@ -2795,23 +2838,17 @@ under the License.
<format property="rel_date" pattern="dd MMMM yyyy" locale="US"/>
<format property="file_date" pattern="yyyyMMdd" locale="US"/>
</tstamp>
- <property name="baseurl" value="https://www.apache.org/dist/poi/release"/>
- <loadChecksum property="bin-tar-sha256" url="${baseurl}/bin/poi-bin-${version.id}-${file_date}.tar.gz.sha256"/>
- <loadChecksum property="bin-tar-sha512" url="${baseurl}/bin/poi-bin-${version.id}-${file_date}.tar.gz.sha512"/>
- <loadChecksum property="bin-zip-sha256" url="${baseurl}/bin/poi-bin-${version.id}-${file_date}.zip.sha256"/>
- <loadChecksum property="bin-zip-sha512" url="${baseurl}/bin/poi-bin-${version.id}-${file_date}.zip.sha512"/>
- <loadChecksum property="src-tar-sha256" url="${baseurl}/src/poi-src-${version.id}-${file_date}.tar.gz.sha256"/>
- <loadChecksum property="src-tar-sha512" url="${baseurl}/src/poi-src-${version.id}-${file_date}.tar.gz.sha512"/>
- <loadChecksum property="src-zip-sha256" url="${baseurl}/src/poi-src-${version.id}-${file_date}.zip.sha256"/>
- <loadChecksum property="src-zip-sha512" url="${baseurl}/src/poi-src-${version.id}-${file_date}.zip.sha512"/>
-
- <loadFilesize property="bin-tar-size" url="${baseurl}/bin/poi-bin-${version.id}-${file_date}.tar.gz"/>
- <loadFilesize property="bin-zip-size" url="${baseurl}/bin/poi-bin-${version.id}-${file_date}.zip"/>
- <loadFilesize property="src-tar-size" url="${baseurl}/src/poi-src-${version.id}-${file_date}.tar.gz"/>
- <loadFilesize property="src-zip-size" url="${baseurl}/src/poi-src-${version.id}-${file_date}.zip"/>
+ <local name="li1"/>
+ <local name="li2"/>
+ <local name="li3"/>
+ <local name="li4"/>
+ <download-line prop="li1" dist="bin" pack="tar.gz"/>
+ <download-line prop="li2" dist="bin" pack="zip"/>
+ <download-line prop="li3" dist="src" pack="tar.gz"/>
+ <download-line prop="li4" dist="src" pack="zip"/>
- <echo file="download-snipplet.xml"><![CDATA[
+<echo file="download-snipplet.xml"><![CDATA[
<section id="POI-${version.id}"><title>${rel_date} - POI ${version.id} available</title>
<p>The Apache POI team is pleased to announce the release of ${version.id}.
Featured are a handful of new areas of functionality and numerous bug fixes.</p>
@@ -2828,46 +2865,14 @@ under the License.
</p>
<section id="POI-${version.id}-bin"><title>Binary Distribution</title>
<ul>
- <li><a href="https://www.apache.org/dyn/closer.lua/poi/release/bin/poi-bin-${version.id}-${file_date}.tar.gz">poi-bin-${version.id}-${file_date}.tar.gz</a>
- (${bin-tar-size} MB, <a href="https://www.apache.org/dist/poi/release/bin/poi-bin-${version.id}-${file_date}.tar.gz.asc">signature (.asc)</a>)
- <br/>
- SHA256 checksum: <a href="https://www.apache.org/dist/poi/release/bin/poi-bin-${version.id}-${file_date}.tar.gz.sha256">
- ${bin-tar-sha256}</a>
- <br/>
- SHA512 checksum: <a href="https://www.apache.org/dist/poi/release/bin/poi-bin-${version.id}-${file_date}.tar.gz.sha512">
- ${bin-tar-sha512}</a>
- </li>
- <li><a href="https://www.apache.org/dyn/closer.lua/poi/release/bin/poi-bin-${version.id}-${file_date}.zip">poi-bin-${version.id}-${file_date}.zip</a>
- (${bin-zip-size} MB, <a href="https://www.apache.org/dist/poi/release/bin/poi-bin-${version.id}-${file_date}.zip.asc">signature (.asc)</a>)
- <br/>
- SHA256 checksum: <a href="https://www.apache.org/dist/poi/release/bin/poi-bin-${version.id}-${file_date}.zip.sha256">
- ${bin-zip-sha256}</a>
- <br/>
- SHA512 checksum: <a href="https://www.apache.org/dist/poi/release/bin/poi-bin-${version.id}-${file_date}.zip.sha512">
- ${bin-zip-sha512}</a>
- </li>
+ ${li1}
+ ${li2}
</ul>
</section>
<section id="POI-${version.id}-src"><title>Source Distribution</title>
<ul>
- <li><a href="https://www.apache.org/dyn/closer.lua/poi/release/src/poi-src-${version.id}-${file_date}.tar.gz">poi-src-${version.id}-${file_date}.tar.gz</a>
- (${src-tar-size} MB, <a href="https://www.apache.org/dist/poi/release/src/poi-src-${version.id}-${file_date}.tar.gz.asc">signature (.asc)</a>)
- <br/>
- SHA256 checksum: <a href="https://www.apache.org/dist/poi/release/src/poi-src-${version.id}-${file_date}.tar.gz.sha256">
- ${src-tar-sha256}</a>
- <br/>
- SHA512 checksum: <a href="https://www.apache.org/dist/poi/release/src/poi-src-${version.id}-${file_date}.tar.gz.sha512">
- ${src-tar-sha512}</a>
- </li>
- <li><a href="https://www.apache.org/dyn/closer.lua/poi/release/src/poi-src-${version.id}-${file_date}.zip">poi-src-${version.id}-${file_date}.zip</a>
- (${src-zip-size} MB, <a href="https://www.apache.org/dist/poi/release/src/poi-src-${version.id}-${file_date}.zip.asc">signature (.asc)</a>)
- <br/>
- SHA256 checksum: <a href="https://www.apache.org/dist/poi/release/src/poi-src-${version.id}-${file_date}.zip.sha256">
- ${src-zip-sha256}</a>
- <br/>
- SHA512 checksum: <a href="https://www.apache.org/dist/poi/release/src/poi-src-${version.id}-${file_date}.zip.sha512">
- ${src-zip-sha512}</a>
- </li>
+ ${li3}
+ ${li4}
</ul>
</section>
</section>
Modified: poi/branches/hemf/jenkins/create_jobs.groovy
URL: http://svn.apache.org/viewvc/poi/branches/hemf/jenkins/create_jobs.groovy?rev=1843032&r1=1843031&r2=1843032&view=diff
==============================================================================
--- poi/branches/hemf/jenkins/create_jobs.groovy (original)
+++ poi/branches/hemf/jenkins/create_jobs.groovy Sat Oct 6 19:33:27 2018
@@ -25,19 +25,6 @@ def poijobs = [
// the JDK is missing on some slaves so builds are unstable
skipcigame: true
],
- [ name: 'POI-DSL-1.9', jdk: '1.9', trigger: triggerSundays,
- properties: ['-Djava9addmods=--add-modules=java.xml.bind',
- '-Djavadoc9addmods=--add-modules=java.xml.bind',
- '-Djava9addmodsvalue=-Dsun.reflect.debugModuleAccessChecks=true',
- '-Djava9addopens1=--add-opens=java.xml/com.sun.org.apache.xerces.internal.util=ALL-UNNAMED',
- '-Djava9addopens2=--add-opens=java.base/java.io=ALL-UNNAMED',
- '-Djava9addopens3=--add-opens=java.base/java.nio=ALL-UNNAMED',
- '-Djava9addopens4=--add-opens=java.base/java.lang=ALL-UNNAMED',
- '-Djava9addopens5=--add-opens=java.base/jdk.internal.ref=ALL-UNNAMED',
- '-Djava9addopens6=--add-opens=java.base/java.lang=java.xml.bind',
- '-Djava.locale.providers=JRE,CLDR'],
- skipcigame: true
- ],
[ name: 'POI-DSL-1.10', jdk: '1.10', trigger: triggerSundays,
properties: ['-Djava9addmods=--add-modules=java.xml.bind',
'-Djavadoc9addmods=--add-modules=java.xml.bind',
@@ -114,7 +101,14 @@ def poijobs = [
],
]
+def xmlbeansjobs = [
+ [ name: 'POI-XMLBeans-DSL-1.6', jdk: '1.6', trigger: 'H */12 * * *', skipcigame: true
+ ]
+]
+
def svnBase = 'https://svn.apache.org/repos/asf/poi/trunk'
+def xmlbeansSvnBase = 'https://svn.apache.org/repos/asf/xmlbeans/trunk'
+
def defaultJdk = '1.8'
def defaultTrigger = 'H/15 * * * *' // check SCM every 60/15 = 4 minutes
def defaultEmail = 'dev@poi.apache.org'
@@ -123,8 +117,8 @@ def defaultAnt = 'Ant 1.9.9'
def defaultSlaves = '(ubuntu||beam)&&!cloud-slave&&!H15&&!H17&&!H18&&!H24&&!ubuntu-4&&!H21'
def jdkMapping = [
+ '1.6': 'JDK 1.6 (latest)',
'1.8': 'JDK 1.8 (latest)',
- '1.9': 'JDK 1.9 (latest)',
'1.10': 'JDK 10 (latest)',
'1.11': 'JDK 11 (latest)',
'1.12': 'JDK 12 (latest)',
@@ -141,7 +135,7 @@ static def shellEx(def context, String c
}
def defaultDesc = '''
-<img src="https://poi.apache.org/resources/images/project-logo.jpg" />
+<img src="https://poi.apache.org/images/project-header.png" />
<p>
Apache POI - the Java API for Microsoft Documents
</p>
@@ -233,7 +227,7 @@ poijobs.each { poijob ->
label(slaves)
environmentVariables {
env('LANG', 'en_US.UTF-8')
- if(jdkKey == '1.9' || jdkKey == '1.10') {
+ if(jdkKey == '1.10') {
// when using JDK 9/10 for running Ant, we need to provide more modules for the forbidden-api-checks task
// on JDK 11 and newer there is no such module any more, so do not add it here
env('ANT_OPTS', '--add-modules=java.xml.bind --add-opens=java.xml/com.sun.org.apache.xerces.internal.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED')
@@ -442,6 +436,92 @@ poijobs.each { poijob ->
}
}
+xmlbeansjobs.each { xjob ->
+ def jdkKey = xjob.jdk ?: defaultJdk
+ def trigger = xjob.trigger ?: defaultTrigger
+ def email = xjob.email ?: defaultEmail
+ def slaves = xjob.slaves ?: defaultSlaves + (xjob.slaveAdd ?: '')
+ def antRT = defaultAnt + (xjob.windows ? ' (Windows)' : '')
+
+ job(xjob.name) {
+ if (xjob.disabled) {
+ disabled()
+ }
+
+ description( defaultDesc + (xjob.apicheck ? apicheckDesc : sonarDesc) )
+ logRotator {
+ numToKeep(5)
+ artifactNumToKeep(1)
+ }
+ label(slaves)
+ environmentVariables {
+ env('LANG', 'en_US.UTF-8')
+ if(jdkKey == '1.10') {
+ // when using JDK 9/10 for running Ant, we need to provide more modules for the forbidden-api-checks task
+ // on JDK 11 and newer there is no such module any more, so do not add it here
+ env('ANT_OPTS', '--add-modules=java.xml.bind --add-opens=java.xml/com.sun.org.apache.xerces.internal.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED')
+ }
+ env('FORREST_HOME', xjob.windows ? 'f:\\jenkins\\tools\\forrest\\latest' : '/home/jenkins/tools/forrest/latest')
+ }
+ wrappers {
+ timeout {
+ absolute(180)
+ abortBuild()
+ writeDescription('Build was aborted due to timeout')
+ }
+ }
+ jdk(jdkMapping.get(jdkKey))
+ scm {
+ svn(xmlbeansSvnBase) { svnNode ->
+ svnNode / browser(class: 'hudson.scm.browsers.ViewSVN') /
+ url << 'http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN'
+ }
+ }
+ checkoutRetryCount(3)
+
+ triggers {
+ scm(trigger)
+ }
+
+ def shellcmds = (xjob.windows ? shellCmdsWin : shellCmdsUnix).replace('POIJOBSHELL', xjob.shell ?: '')
+
+ // Create steps and publishers depending on the type of Job that is selected
+ steps {
+ shellEx(delegate, shellcmds, xjob)
+ if(xjob.addShell) {
+ shellEx(delegate, xjob.addShell, xjob)
+ }
+ ant {
+ targets(['clean'])
+ antInstallation(antRT)
+ }
+ ant {
+ targets(['checkintest'])
+ antInstallation(antRT)
+ }
+ ant {
+ targets(['dist'])
+ antInstallation(antRT)
+ }
+ }
+ publishers {
+ archiveArtifacts('build/private/**')
+ //archiveJunit('build/test/reports/*.xml') {
+ // testDataPublishers {
+ // publishTestStabilityData()
+ // }
+ //}
+
+ if (!xjob.skipcigame) {
+ configure { project ->
+ project / publishers << 'hudson.plugins.cigame.GamePublisher' {}
+ }
+ }
+ mailer(email, false, false)
+ }
+ }
+}
+
/*
Add a special job which spans a two-dimensional matrix of all JDKs that we want to use and
all slaves that we would like to use and test if the java and ant binaries are available
@@ -471,8 +551,6 @@ Unfortunately we often see builds break
'OpenJDK 8 (on Ubuntu only) ', // blank is required here until the name in the Jenkins instance is fixed!
'IBM 1.8 64-bit (on Ubuntu only)',
- 'JDK 1.9 (latest)',
-
'JDK 10 (latest)',
'JDK 10 b46 (Windows Only)',
'OpenJDK 10.0.2 (on Ubuntu only)',
Modified: poi/branches/hemf/maven/poi-ooxml.pom
URL: http://svn.apache.org/viewvc/poi/branches/hemf/maven/poi-ooxml.pom?rev=1843032&r1=1843031&r2=1843032&view=diff
==============================================================================
--- poi/branches/hemf/maven/poi-ooxml.pom (original)
+++ poi/branches/hemf/maven/poi-ooxml.pom Sat Oct 6 19:33:27 2018
@@ -77,7 +77,7 @@
<dependency>
<groupId>com.github.virtuald</groupId>
<artifactId>curvesapi</artifactId>
- <version>1.04</version>
+ <version>1.05</version>
</dependency>
</dependencies>
</project>
Modified: poi/branches/hemf/maven/poi.pom
URL: http://svn.apache.org/viewvc/poi/branches/hemf/maven/poi.pom?rev=1843032&r1=1843031&r2=1843032&view=diff
==============================================================================
--- poi/branches/hemf/maven/poi.pom (original)
+++ poi/branches/hemf/maven/poi.pom Sat Oct 6 19:33:27 2018
@@ -76,7 +76,17 @@
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
- <version>1.10</version>
+ <version>1.11</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-collections4</artifactId>
+ <version>4.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-math3</artifactId>
+ <version>3.6.1</version>
</dependency>
<dependency>
@@ -91,11 +101,6 @@
<scope>test</scope>
<version>4.12</version>
</dependency>
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-collections4</artifactId>
- <version>4.2</version>
- </dependency>
</dependencies>
</project>
Modified: poi/branches/hemf/sonar/ooxml/pom.xml
URL: http://svn.apache.org/viewvc/poi/branches/hemf/sonar/ooxml/pom.xml?rev=1843032&r1=1843031&r2=1843032&view=diff
==============================================================================
--- poi/branches/hemf/sonar/ooxml/pom.xml (original)
+++ poi/branches/hemf/sonar/ooxml/pom.xml Sat Oct 6 19:33:27 2018
@@ -12,64 +12,64 @@
<packaging>jar</packaging>
<name>Apache POI OOXML package</name>
-
+
<build>
- <plugins>
- <!-- copy sources, resources and tests in place as otherwise Sonar does not pick them up correctly! -->
- <plugin>
- <artifactId>maven-resources-plugin</artifactId>
- <version>${maven.plugin.resources.version}</version>
- <executions>
- <execution>
- <id>copy-sources</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>copy-resources</goal>
- </goals>
- <configuration>
- <outputDirectory>${basedir}/src/main/java</outputDirectory>
- <resources>
- <resource>
- <directory>../../src/ooxml/java</directory>
- </resource>
- </resources>
- </configuration>
- </execution>
- <execution>
- <id>copy-resources</id>
- <phase>generate-resources</phase>
- <goals>
- <goal>copy-resources</goal>
- </goals>
- <configuration>
- <outputDirectory>${basedir}/src/main/resources</outputDirectory>
- <resources>
- <resource>
- <directory>../../src/resources/ooxml</directory>
- </resource>
- </resources>
- </configuration>
- </execution>
- <execution>
- <id>copy-tests</id>
- <phase>generate-test-sources</phase>
- <goals>
- <goal>copy-resources</goal>
- </goals>
- <configuration>
- <outputDirectory>${basedir}/src/test/java</outputDirectory>
- <resources>
- <resource>
- <directory>../../src/ooxml/testcases</directory>
- </resource>
- </resources>
- </configuration>
- </execution>
- </executions>
- </plugin>
+ <plugins>
+ <!-- copy sources, resources and tests in place as otherwise Sonar does not pick them up correctly! -->
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>${maven.plugin.resources.version}</version>
+ <executions>
+ <execution>
+ <id>copy-sources</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${basedir}/src/main/java</outputDirectory>
+ <resources>
+ <resource>
+ <directory>../../src/ooxml/java</directory>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ <execution>
+ <id>copy-resources</id>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${basedir}/src/main/resources</outputDirectory>
+ <resources>
+ <resource>
+ <directory>../../src/resources/ooxml</directory>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ <execution>
+ <id>copy-tests</id>
+ <phase>generate-test-sources</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${basedir}/src/test/java</outputDirectory>
+ <resources>
+ <resource>
+ <directory>../../src/ooxml/testcases</directory>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
- <!-- clean copied sources afterwards -->
- <plugin>
+ <!-- clean copied sources afterwards -->
+ <plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>${maven.plugin.clean.version}</version>
<configuration>
@@ -96,88 +96,94 @@
<argLine>@{argLine} -Duser.language=en -Duser.country=US -Xmx1024m -Djava.io.tmpdir=target/tmp -XX:-OmitStackTraceInFastThrow</argLine>
</configuration>
</plugin>
- </plugins>
+ </plugins>
</build>
<dependencies>
<dependency>
- <groupId>${project.groupId}</groupId>
+ <groupId>${project.groupId}</groupId>
<artifactId>poi-ooxml-schema</artifactId>
- <version>${project.version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>poi-ooxml-schema-encryption</artifactId>
- <version>${project.version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
- <groupId>${project.groupId}</groupId>
+ <groupId>${project.groupId}</groupId>
<artifactId>poi-ooxml-schema-security</artifactId>
- <version>${project.version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>poi-main</artifactId>
- <version>${project.version}</version>
+ <version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>poi-main</artifactId>
- <version>${project.version}</version>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>poi-main</artifactId>
+ <version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
- </dependency>
+ </dependency>
- <dependency>
- <groupId>org.apache.xmlbeans</groupId>
- <artifactId>xmlbeans</artifactId>
- <version>${xmlbeans.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.bouncycastle</groupId>
- <artifactId>bcpkix-jdk15on</artifactId>
- <version>1.59</version>
- </dependency>
- <dependency>
- <groupId>org.bouncycastle</groupId>
- <artifactId>bcprov-jdk15on</artifactId>
- <version>1.59</version>
- </dependency>
- <dependency>
- <groupId>org.apache.santuario</groupId>
- <artifactId>xmlsec</artifactId>
- <version>2.1.0</version>
- </dependency>
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-compress</artifactId>
- <version>1.18</version>
- </dependency>
- <dependency>
- <groupId>com.github.virtuald</groupId>
- <artifactId>curvesapi</artifactId>
- <version>1.05</version>
- </dependency>
+ <dependency>
+ <groupId>org.apache.xmlbeans</groupId>
+ <artifactId>xmlbeans</artifactId>
+ <version>${xmlbeans.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.bouncycastle</groupId>
+ <artifactId>bcpkix-jdk15on</artifactId>
+ <version>1.60</version>
+ </dependency>
+ <dependency>
+ <groupId>org.bouncycastle</groupId>
+ <artifactId>bcprov-jdk15on</artifactId>
+ <version>1.60</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.santuario</groupId>
+ <artifactId>xmlsec</artifactId>
+ <version>2.1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-compress</artifactId>
+ <version>1.18</version>
+ </dependency>
+ <dependency>
+ <groupId>com.github.virtuald</groupId>
+ <artifactId>curvesapi</artifactId>
+ <version>1.05</version>
+ </dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
- <scope>test</scope>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.reflections</groupId>
+ <artifactId>reflections</artifactId>
+ <version>0.9.11</version>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-core</artifactId>
<version>1.19</version>
- <scope>test</scope>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-generator-annprocess</artifactId>
<version>1.19</version>
- <scope>test</scope>
+ <scope>test</scope>
</dependency>
</dependencies>
</project>
Modified: poi/branches/hemf/src/examples/src/org/apache/poi/hssf/view/SVBorder.java
URL: http://svn.apache.org/viewvc/poi/branches/hemf/src/examples/src/org/apache/poi/hssf/view/SVBorder.java?rev=1843032&r1=1843031&r2=1843032&view=diff
==============================================================================
--- poi/branches/hemf/src/examples/src/org/apache/poi/hssf/view/SVBorder.java (original)
+++ poi/branches/hemf/src/examples/src/org/apache/poi/hssf/view/SVBorder.java Sat Oct 6 19:33:27 2018
@@ -348,14 +348,16 @@ public void paintBorder(Component c, Gra
// if there are borders on the west or east then
// the second line shouldn't cross them
- if (westBorder)
- leftx = x+3;
+ if (westBorder) {
+ leftx = x + 3;
+ }
+
+ if (eastBorder) {
+ rightx = width - 3;
+ }
- if (eastBorder)
- rightx = width-3;
-
- g.drawLine(x,y,width,y);
- g.drawLine(leftx,y+2,rightx,y+2);
+ g.drawLine(x,y,width,y);
+ g.drawLine(leftx,y+2,rightx,y+2);
}
if (eastBorder &&
@@ -370,11 +372,13 @@ public void paintBorder(Component c, Gra
int topy=y;
int bottomy=height;
- if (northBorder)
- topy=y+3;
-
- if (southBorder)
- bottomy=height-3;
+ if (northBorder) {
+ topy = y + 3;
+ }
+
+ if (southBorder) {
+ bottomy = height - 3;
+ }
g.drawLine(width-1,y,width-1,height);
g.drawLine(width-3,topy,width-3,bottomy);
Modified: poi/branches/hemf/src/examples/src/org/apache/poi/ss/examples/ConditionalFormats.java
URL: http://svn.apache.org/viewvc/poi/branches/hemf/src/examples/src/org/apache/poi/ss/examples/ConditionalFormats.java?rev=1843032&r1=1843031&r2=1843032&view=diff
==============================================================================
--- poi/branches/hemf/src/examples/src/org/apache/poi/ss/examples/ConditionalFormats.java (original)
+++ poi/branches/hemf/src/examples/src/org/apache/poi/ss/examples/ConditionalFormats.java Sat Oct 6 19:33:27 2018
@@ -53,7 +53,7 @@ import org.apache.poi.xssf.usermodel.XSS
* Excel Conditional Formatting -- Examples
*
* <p>
- * Partly based on the code snippets from
+ * Partly based on the code snippets from
* http://www.contextures.com/xlcondformat03.html
* </p>
*/
@@ -89,7 +89,7 @@ public class ConditionalFormats {
// print overlapping rule results
evaluateRules(wb, "Overlapping");
-
+
// Write the output to a file
String file = "cf-poi.xls";
if(wb instanceof XSSFWorkbook) {
@@ -178,11 +178,11 @@ public class ConditionalFormats {
sheet.getRow(2).createCell(4).setCellValue("<== Condition 1: Formula Is =$B2>75 (Blue Fill)");
}
-
+
/**
* Multiple conditional formatting rules can apply to
* one cell, some combining, some beating others.
- * Done in order of the rules added to the
+ * Done in order of the rules added to the
* SheetConditionalFormatting object
*/
static void overlapping(Sheet sheet) {
@@ -210,39 +210,39 @@ public class ConditionalFormats {
}
sheet.autoSizeColumn(0);
sheet.autoSizeColumn(1);
-
+
sheet.getRow(1).createCell(3).setCellValue("Even rows are blue");
sheet.getRow(2).createCell(3).setCellValue("Multiples of 3 have a grey background");
sheet.getRow(4).createCell(3).setCellValue("Multiples of 5 are bold");
sheet.getRow(9).createCell(3).setCellValue("Multiples of 10 are red (beats even)");
-
+
SheetConditionalFormatting sheetCF = sheet.getSheetConditionalFormatting();
-
+
// Condition 1: Row divides by 10, red (will beat #1)
- ConditionalFormattingRule rule1 =
+ ConditionalFormattingRule rule1 =
sheetCF.createConditionalFormattingRule("MOD(ROW(),10)=0");
FontFormatting font1 = rule1.createFontFormatting();
font1.setFontColorIndex(IndexedColors.RED.index);
-
+
// Condition 2: Row is even, blue
- ConditionalFormattingRule rule2 =
+ ConditionalFormattingRule rule2 =
sheetCF.createConditionalFormattingRule("MOD(ROW(),2)=0");
FontFormatting font2 = rule2.createFontFormatting();
font2.setFontColorIndex(IndexedColors.BLUE.index);
-
+
// Condition 3: Row divides by 5, bold
- ConditionalFormattingRule rule3 =
+ ConditionalFormattingRule rule3 =
sheetCF.createConditionalFormattingRule("MOD(ROW(),5)=0");
FontFormatting font3 = rule3.createFontFormatting();
font3.setFontStyle(false, true);
-
+
// Condition 4: Row divides by 3, grey background
- ConditionalFormattingRule rule4 =
+ ConditionalFormattingRule rule4 =
sheetCF.createConditionalFormattingRule("MOD(ROW(),3)=0");
PatternFormatting fill4 = rule4.createPatternFormatting();
fill4.setFillBackgroundColor(IndexedColors.GREY_25_PERCENT.index);
fill4.setFillPattern(PatternFormatting.SOLID_FOREGROUND);
-
+
// Apply
CellRangeAddress[] regions = {
CellRangeAddress.valueOf("A1:F41")
@@ -441,7 +441,7 @@ public class ConditionalFormats {
}
/**
- * You can use Excel conditional formatting to shade bands of rows on the worksheet.
+ * You can use Excel conditional formatting to shade bands of rows on the worksheet.
* In this example, 3 rows are shaded light grey, and 3 are left with no shading.
* In the MOD function, the total number of rows in the set of banded rows (6) is entered.
*/
@@ -462,7 +462,7 @@ public class ConditionalFormats {
sheet.createRow(0).createCell(1).setCellValue("Shade Bands of Rows");
sheet.createRow(1).createCell(1).setCellValue("Condition: Formula Is =MOD(ROW(),6)<2 (Light Grey Fill)");
}
-
+
/**
* Icon Sets / Multi-States allow you to have icons shown which vary
* based on the values, eg Red traffic light / Yellow traffic light /
@@ -487,7 +487,7 @@ public class ConditionalFormats {
r.createCell(3).setCellValue(10);
SheetConditionalFormatting sheetCF = sheet.getSheetConditionalFormatting();
-
+
CellRangeAddress[] regions = { CellRangeAddress.valueOf("B1:B4") };
ConditionalFormattingRule rule1 =
sheetCF.createConditionalFormattingRule(IconSet.GYR_3_TRAFFIC_LIGHTS);
@@ -497,7 +497,7 @@ public class ConditionalFormats {
im1.getThresholds()[1].setValue(33d);
im1.getThresholds()[2].setRangeType(RangeType.MAX);
sheetCF.addConditionalFormatting(regions, rule1);
-
+
regions = new CellRangeAddress[] { CellRangeAddress.valueOf("C1:C4") };
ConditionalFormattingRule rule2 =
sheetCF.createConditionalFormattingRule(IconSet.GYR_3_FLAGS);
@@ -509,7 +509,7 @@ public class ConditionalFormats {
im2.getThresholds()[2].setRangeType(RangeType.PERCENT);
im2.getThresholds()[2].setValue(67d);
sheetCF.addConditionalFormatting(regions, rule2);
-
+
regions = new CellRangeAddress[] { CellRangeAddress.valueOf("D1:D4") };
ConditionalFormattingRule rule3 =
sheetCF.createConditionalFormattingRule(IconSet.GYR_3_SYMBOLS_CIRCLE);
@@ -522,7 +522,7 @@ public class ConditionalFormats {
im3.getThresholds()[2].setValue(7d);
sheetCF.addConditionalFormatting(regions, rule3);
}
-
+
/**
* Color Scales / Colour Scales / Colour Gradients allow you shade the
* background colour of the cell based on the values, eg from Red to
@@ -533,12 +533,12 @@ public class ConditionalFormats {
Row r = sheet.createRow(1);
r.createCell(0).setCellValue("Red-Yellow-Green");
for (int i=1; i<=7; i++) {
- r.createCell(i).setCellValue((i-1)*5);
+ r.createCell(i).setCellValue((i-1)*5.0);
}
r = sheet.createRow(2);
r.createCell(0).setCellValue("Red-White-Blue");
for (int i=1; i<=9; i++) {
- r.createCell(i).setCellValue((i-1)*5);
+ r.createCell(i).setCellValue((i-1)*5.0);
}
r = sheet.createRow(3);
r.createCell(0).setCellValue("Blue-Green");
@@ -546,9 +546,9 @@ public class ConditionalFormats {
r.createCell(i).setCellValue((i-1));
}
sheet.setColumnWidth(0, 5000);
-
+
SheetConditionalFormatting sheetCF = sheet.getSheetConditionalFormatting();
-
+
CellRangeAddress[] regions = { CellRangeAddress.valueOf("B2:H2") };
ConditionalFormattingRule rule1 =
sheetCF.createConditionalFormattingColorScaleRule();
@@ -561,7 +561,7 @@ public class ConditionalFormats {
((ExtendedColor)cs1.getColors()[1]).setARGBHex("FFFFEB84");
((ExtendedColor)cs1.getColors()[2]).setARGBHex("FF63BE7B");
sheetCF.addConditionalFormatting(regions, rule1);
-
+
regions = new CellRangeAddress[] { CellRangeAddress.valueOf("B3:J3") };
ConditionalFormattingRule rule2 =
sheetCF.createConditionalFormattingColorScaleRule();
@@ -574,7 +574,7 @@ public class ConditionalFormats {
((ExtendedColor)cs2.getColors()[1]).setARGBHex("FFFCFCFF");
((ExtendedColor)cs2.getColors()[2]).setARGBHex("FF5A8AC6");
sheetCF.addConditionalFormatting(regions, rule2);
-
+
regions = new CellRangeAddress[] { CellRangeAddress.valueOf("B4:Q4") };
ConditionalFormattingRule rule3=
sheetCF.createConditionalFormattingColorScaleRule();
@@ -586,7 +586,7 @@ public class ConditionalFormats {
((ExtendedColor)cs3.getColors()[1]).setARGBHex("FF63BE7B");
sheetCF.addConditionalFormatting(regions, rule3);
}
-
+
/**
* DataBars / Data-Bars allow you to have bars shown vary
* based on the values, from full to empty
@@ -623,7 +623,7 @@ public class ConditionalFormats {
sheet.setColumnWidth(3, 5000);
SheetConditionalFormatting sheetCF = sheet.getSheetConditionalFormatting();
-
+
ExtendedColor color = sheet.getWorkbook().getCreationHelper().createExtendedColor();
color.setARGBHex("FF63BE7B");
CellRangeAddress[] regions = { CellRangeAddress.valueOf("B2:B7") };
@@ -632,7 +632,7 @@ public class ConditionalFormats {
db1.getMinThreshold().setRangeType(RangeType.MIN);
db1.getMaxThreshold().setRangeType(RangeType.MAX);
sheetCF.addConditionalFormatting(regions, rule1);
-
+
color = sheet.getWorkbook().getCreationHelper().createExtendedColor();
color.setARGBHex("FF5A8AC6");
regions = new CellRangeAddress[] { CellRangeAddress.valueOf("C2:C7") };
@@ -641,7 +641,7 @@ public class ConditionalFormats {
db2.getMinThreshold().setRangeType(RangeType.MIN);
db2.getMaxThreshold().setRangeType(RangeType.MAX);
sheetCF.addConditionalFormatting(regions, rule2);
-
+
color = sheet.getWorkbook().getCreationHelper().createExtendedColor();
color.setARGBHex("FFF8696B");
regions = new CellRangeAddress[] { CellRangeAddress.valueOf("D2:D7") };
@@ -651,7 +651,7 @@ public class ConditionalFormats {
db3.getMaxThreshold().setRangeType(RangeType.MAX);
sheetCF.addConditionalFormatting(regions, rule3);
}
-
+
/**
* Print out a summary of the conditional formatting rules applied to cells on the given sheet.
* Only cells with a matching rule are printed, and for those, all matching rules are sumarized.
@@ -661,15 +661,19 @@ public class ConditionalFormats {
final ConditionalFormattingEvaluator cfEval = new ConditionalFormattingEvaluator(wb, wbEvalProv);
// if cell values have changed, clear cached format results
cfEval.clearAllCachedValues();
-
+
final Sheet sheet = wb.getSheet(sheetName);
for (Row r : sheet) {
for (Cell c : r) {
final List<EvaluationConditionalFormatRule> rules = cfEval.getConditionalFormattingForCell(c);
// check rules list for null, although current implementation will return an empty list, not null, then do what you want with results
- if (rules == null || rules.isEmpty()) continue;
+ if (rules == null || rules.isEmpty()) {
+ continue;
+ }
final CellReference ref = ConditionalFormattingEvaluator.getRef(c);
- if (rules.isEmpty()) continue;
+ if (rules.isEmpty()) {
+ continue;
+ }
System.out.println("\n"
+ ref.formatAsString()
@@ -682,7 +686,7 @@ public class ConditionalFormats {
b.append("\tRule ")
.append(rule.getFormattingIndex())
.append(": ");
-
+
// check for color scale
if (cf.getColorScaleFormatting() != null) {
b.append("\n\t\tcolor scale (caller must calculate bucket)");
@@ -709,13 +713,19 @@ public class ConditionalFormats {
b.append("\n\t\tfont format ")
.append("color index ")
.append(ff.getFontColorIndex());
- if (ff.isBold()) b.append(" bold");
- if (ff.isItalic()) b.append(" italic");
- if (ff.isStruckout()) b.append(" strikeout");
+ if (ff.isBold()) {
+ b.append(" bold");
+ }
+ if (ff.isItalic()) {
+ b.append(" italic");
+ }
+ if (ff.isStruckout()) {
+ b.append(" strikeout");
+ }
b.append(" underline index ")
.append(ff.getUnderlineType());
}
-
+
System.out.println(b);
}
}
Modified: poi/branches/hemf/src/examples/src/org/apache/poi/ss/examples/html/ToHtml.java
URL: http://svn.apache.org/viewvc/poi/branches/hemf/src/examples/src/org/apache/poi/ss/examples/html/ToHtml.java?rev=1843032&r1=1843031&r2=1843032&view=diff
==============================================================================
--- poi/branches/hemf/src/examples/src/org/apache/poi/ss/examples/html/ToHtml.java (original)
+++ poi/branches/hemf/src/examples/src/org/apache/poi/ss/examples/html/ToHtml.java Sat Oct 6 19:33:27 2018
@@ -33,7 +33,6 @@ import java.util.Set;
import java.util.TreeMap;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
-import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.ss.format.CellFormat;
import org.apache.poi.ss.format.CellFormatResult;
import org.apache.poi.ss.usermodel.BorderStyle;
@@ -96,10 +95,10 @@ public class ToHtml {
BorderStyle.SLANTED_DASH_DOT, "dashed 2pt",
BorderStyle.THICK, "solid 3pt",
BorderStyle.THIN, "dashed 1pt");
-
+
private static final int IDX_TABLE_WIDTH = -2;
private static final int IDX_HEADER_COL_WIDTH = -1;
-
+
@SuppressWarnings({"unchecked"})
private static <K, V> Map<K, V> mapFor(Object... mapping) {
@@ -189,9 +188,14 @@ public class ToHtml {
return;
}
- ToHtml toHtml = create(args[0], new PrintWriter(new FileWriter(args[1])));
- toHtml.setCompleteHTML(true);
- toHtml.printPage();
+ try (
+ FileWriter fw = new FileWriter(args[1]);
+ PrintWriter pw = new PrintWriter(fw)
+ ) {
+ ToHtml toHtml = create(args[0], pw);
+ toHtml.setCompleteHTML(true);
+ toHtml.printPage();
+ }
}
public void setCompleteHTML(boolean completeHTML) {
@@ -350,32 +354,32 @@ public class ToHtml {
public void printSheet(Sheet sheet) {
ensureOut();
Map<Integer, Integer> widths = computeWidths(sheet);
- int tableWidth = widths.get(IDX_TABLE_WIDTH);
+ int tableWidth = widths.get(IDX_TABLE_WIDTH);
out.format("<table class=%s style=\"width:%dpx;\">%n", DEFAULTS_CLASS, tableWidth);
printCols(widths);
printSheetContent(sheet);
out.format("</table>%n");
}
-
+
/**
- * computes the column widths, defined by the sheet.
- *
+ * computes the column widths, defined by the sheet.
+ *
* @param sheet The sheet for which to compute widths
* @return Map with key: column index; value: column width in pixels
- * <br>special keys:
+ * <br>special keys:
* <br>{@link #IDX_HEADER_COL_WIDTH} - width of the header column
- * <br>{@link #IDX_TABLE_WIDTH} - width of the entire table
+ * <br>{@link #IDX_TABLE_WIDTH} - width of the entire table
*/
private Map<Integer, Integer> computeWidths(Sheet sheet) {
Map<Integer, Integer> ret = new TreeMap<>();
int tableWidth = 0;
ensureColumnBounds(sheet);
-
+
// compute width of the header column
int lastRowNum = sheet.getLastRowNum();
int headerCharCount = String.valueOf(lastRowNum).length();
- int headerColWidth = widthToPixels((headerCharCount + 1) * 256);
+ int headerColWidth = widthToPixels((headerCharCount + 1) * 256.0);
ret.put(IDX_HEADER_COL_WIDTH, headerColWidth);
tableWidth += headerColWidth;
@@ -384,11 +388,11 @@ public class ToHtml {
ret.put(i, colWidth);
tableWidth += colWidth;
}
-
+
ret.put(IDX_TABLE_WIDTH, tableWidth);
return ret ;
}
-
+
/**
* Probably platform-specific, but appears to be a close approximation on some systems
* @param widthUnits POI's native width unit (twips)
Modified: poi/branches/hemf/src/examples/src/org/apache/poi/xslf/usermodel/BarChartDemo.java
URL: http://svn.apache.org/viewvc/poi/branches/hemf/src/examples/src/org/apache/poi/xslf/usermodel/BarChartDemo.java?rev=1843032&r1=1843031&r2=1843032&view=diff
==============================================================================
--- poi/branches/hemf/src/examples/src/org/apache/poi/xslf/usermodel/BarChartDemo.java (original)
+++ poi/branches/hemf/src/examples/src/org/apache/poi/xslf/usermodel/BarChartDemo.java Sat Oct 6 19:33:27 2018
@@ -59,26 +59,30 @@ public class BarChartDemo {
BufferedReader modelReader = new BufferedReader(new FileReader(args[1]))) {
String chartTitle = modelReader.readLine(); // first line is chart title
+ String[] series = modelReader.readLine().split(",");
// Category Axis Data
- List<String> listCategories = new ArrayList<String>(3);
+ List<String> listLanguages = new ArrayList<>(10);
// Values
- List<Double> listValues = new ArrayList<Double>(3);
+ List<Double> listCountries = new ArrayList<>(10);
+ List<Double> listSpeakers = new ArrayList<>(10);
// set model
String ln;
- while((ln = modelReader.readLine()) != null){
- String[] vals = ln.split("\\s+");
- listCategories.add(vals[0]);
- listValues.add(Double.valueOf(vals[1]));
+ while((ln = modelReader.readLine()) != null) {
+ String[] vals = ln.split(",");
+ listCountries.add(Double.valueOf(vals[0]));
+ listSpeakers.add(Double.valueOf(vals[1]));
+ listLanguages.add(vals[2]);
}
- String[] categories = listCategories.toArray(new String[listCategories.size()]);
- Double[] values = listValues.toArray(new Double[listValues.size()]);
+ String[] categories = listLanguages.toArray(new String[listLanguages.size()]);
+ Double[] values1 = listCountries.toArray(new Double[listCountries.size()]);
+ Double[] values2 = listSpeakers.toArray(new Double[listSpeakers.size()]);
try (XMLSlideShow pptx = new XMLSlideShow(argIS)) {
XSLFSlide slide = pptx.getSlides().get(0);
- setBarData(findChart(slide), chartTitle, categories, values);
+ setBarData(findChart(slide), chartTitle, series, categories, values1, values2);
XSLFChart chart = findChart(pptx.createSlide().importContent(slide));
setColumnData(chart, "Column variant");
@@ -91,30 +95,41 @@ public class BarChartDemo {
}
}
- private static void setBarData(XSLFChart chart, String chartTitle, String[] categories, Double[] values) {
- final List<XDDFChartData> series = chart.getChartSeries();
- final XDDFBarChartData bar = (XDDFBarChartData) series.get(0);
+ private static void setBarData(XSLFChart chart, String chartTitle, String[] series, String[] categories, Double[] values1, Double[] values2) {
+ final List<XDDFChartData> data = chart.getChartSeries();
+ final XDDFBarChartData bar = (XDDFBarChartData) data.get(0);
final int numOfPoints = categories.length;
final String categoryDataRange = chart.formatRange(new CellRangeAddress(1, numOfPoints, 0, 0));
final String valuesDataRange = chart.formatRange(new CellRangeAddress(1, numOfPoints, 1, 1));
- final XDDFDataSource<?> categoriesData = XDDFDataSourcesFactory.fromArray(categories, categoryDataRange);
- final XDDFNumericalDataSource<? extends Number> valuesData = XDDFDataSourcesFactory.fromArray(values, valuesDataRange);
+ final String valuesDataRange2 = chart.formatRange(new CellRangeAddress(1, numOfPoints, 2, 2));
+ final XDDFDataSource<?> categoriesData = XDDFDataSourcesFactory.fromArray(categories, categoryDataRange, 0);
+ final XDDFNumericalDataSource<? extends Number> valuesData = XDDFDataSourcesFactory.fromArray(values1, valuesDataRange, 1);
+ values1[6] = 16.0; // if you ever want to change the underlying data
+ final XDDFNumericalDataSource<? extends Number> valuesData2 = XDDFDataSourcesFactory.fromArray(values2, valuesDataRange2, 2);
+
+ XDDFChartData.Series series1 = bar.getSeries().get(0);
+ series1.replaceData(categoriesData, valuesData);
+ series1.setTitle(series[0], chart.setSheetTitle(series[0], 0));
+ XDDFChartData.Series series2 = bar.addSeries(categoriesData, valuesData2);
+ series2.setTitle(series[1], chart.setSheetTitle(series[1], 1));
- bar.getSeries().get(0).replaceData(categoriesData, valuesData);
- bar.getSeries().get(0).setTitle(chartTitle, chart.setSheetTitle(chartTitle));
chart.plot(bar);
+ chart.setTitleText(chartTitle); // https://stackoverflow.com/questions/30532612
+ // chart.setTitleOverlay(overlay);
}
private static void setColumnData(XSLFChart chart, String chartTitle) {
// Series Text
List<XDDFChartData> series = chart.getChartSeries();
XDDFBarChartData bar = (XDDFBarChartData) series.get(0);
- bar.getSeries().get(0).setTitle(chartTitle, chart.setSheetTitle(chartTitle));
// in order to transform a bar chart into a column chart, you just need to change the bar direction
bar.setBarDirection(BarDirection.COL);
+ // looking for "Stacked Bar Chart"? uncomment the following line
+ // bar.setBarGrouping(BarGrouping.STACKED);
+
// additionally, you can adjust the axes
bar.getCategoryAxis().setOrientation(AxisOrientation.MAX_MIN);
bar.getValueAxes().get(0).setPosition(AxisPosition.TOP);
Modified: poi/branches/hemf/src/examples/src/org/apache/poi/xslf/usermodel/PieChartDemo.java
URL: http://svn.apache.org/viewvc/poi/branches/hemf/src/examples/src/org/apache/poi/xslf/usermodel/PieChartDemo.java?rev=1843032&r1=1843031&r2=1843032&view=diff
==============================================================================
--- poi/branches/hemf/src/examples/src/org/apache/poi/xslf/usermodel/PieChartDemo.java (original)
+++ poi/branches/hemf/src/examples/src/org/apache/poi/xslf/usermodel/PieChartDemo.java Sat Oct 6 19:33:27 2018
@@ -77,10 +77,10 @@ public class PieChartDemo {
XDDFPieChartData pie = (XDDFPieChartData) series.get(0);
// Category Axis Data
- List<String> listCategories = new ArrayList<String>(3);
+ List<String> listCategories = new ArrayList<>(3);
// Values
- List<Double> listValues = new ArrayList<Double>(3);
+ List<Double> listValues = new ArrayList<>(3);
// set model
String ln;
@@ -100,7 +100,7 @@ public class PieChartDemo {
XDDFPieChartData.Series firstSeries = (XDDFPieChartData.Series) pie.getSeries().get(0);
firstSeries.replaceData(categoriesData, valuesData);
- firstSeries.setTitle(chartTitle, chart.setSheetTitle(chartTitle));
+ firstSeries.setTitle(chartTitle, chart.setSheetTitle(chartTitle, 0));
firstSeries.setExplosion(25);
chart.plot(pie);
Modified: poi/branches/hemf/src/examples/src/org/apache/poi/xslf/usermodel/bar-chart-data.txt
URL: http://svn.apache.org/viewvc/poi/branches/hemf/src/examples/src/org/apache/poi/xslf/usermodel/bar-chart-data.txt?rev=1843032&r1=1843031&r2=1843032&view=diff
==============================================================================
--- poi/branches/hemf/src/examples/src/org/apache/poi/xslf/usermodel/bar-chart-data.txt (original)
+++ poi/branches/hemf/src/examples/src/org/apache/poi/xslf/usermodel/bar-chart-data.txt Sat Oct 6 19:33:27 2018
@@ -1,4 +1,12 @@
-My Bar or Column Chart
-First 1.0
-Second 3.0
-Third 4.0
\ No newline at end of file
+10 languages with most speakers as first language
+countries,speakers,language
+58,315,اÙعربÙØ©
+4,243,বাà¦à¦²à¦¾
+38,1299,ä¸æ
+118,378,English
+4,260,हिनà¥à¤¦à¥
+2,128,æ¥æ¬èª
+15,223,português
+6,119,ਪੰà¨à¨¾à¨¬à©
+18,154,Ð ÑÑÑкий ÑзÑк
+31,442,español
Modified: poi/branches/hemf/src/examples/src/org/apache/poi/xssf/usermodel/examples/BarChart.java
URL: http://svn.apache.org/viewvc/poi/branches/hemf/src/examples/src/org/apache/poi/xssf/usermodel/examples/BarChart.java?rev=1843032&r1=1843031&r2=1843032&view=diff
==============================================================================
--- poi/branches/hemf/src/examples/src/org/apache/poi/xssf/usermodel/examples/BarChart.java (original)
+++ poi/branches/hemf/src/examples/src/org/apache/poi/xssf/usermodel/examples/BarChart.java Sat Oct 6 19:33:27 2018
@@ -28,8 +28,10 @@ import org.apache.poi.xddf.usermodel.XDD
import org.apache.poi.xddf.usermodel.XDDFSolidFillProperties;
import org.apache.poi.xddf.usermodel.chart.AxisCrosses;
import org.apache.poi.xddf.usermodel.chart.AxisPosition;
+import org.apache.poi.xddf.usermodel.chart.BarDirection;
import org.apache.poi.xddf.usermodel.chart.ChartTypes;
import org.apache.poi.xddf.usermodel.chart.LegendPosition;
+import org.apache.poi.xddf.usermodel.chart.XDDFBarChartData;
import org.apache.poi.xddf.usermodel.chart.XDDFCategoryAxis;
import org.apache.poi.xddf.usermodel.chart.XDDFChartData;
import org.apache.poi.xddf.usermodel.chart.XDDFChartLegend;
@@ -61,7 +63,7 @@ public class BarChart {
row = sheet.createRow((short) rowIndex);
for (int colIndex = 0; colIndex < NUM_OF_COLUMNS; colIndex++) {
cell = row.createCell((short) colIndex);
- cell.setCellValue(colIndex * (rowIndex + 1));
+ cell.setCellValue(colIndex * (rowIndex + 1.0));
}
}
@@ -69,12 +71,16 @@ public class BarChart {
XSSFClientAnchor anchor = drawing.createAnchor(0, 0, 0, 0, 0, 5, 10, 15);
XSSFChart chart = drawing.createChart(anchor);
+ chart.setTitleText("x = 2x and x = 3x");
+ chart.setTitleOverlay(false);
XDDFChartLegend legend = chart.getOrAddLegend();
legend.setPosition(LegendPosition.TOP_RIGHT);
// Use a category axis for the bottom axis.
XDDFCategoryAxis bottomAxis = chart.createCategoryAxis(AxisPosition.BOTTOM);
+ bottomAxis.setTitle("x"); // https://stackoverflow.com/questions/32010765
XDDFValueAxis leftAxis = chart.createValueAxis(AxisPosition.LEFT);
+ leftAxis.setTitle("f(x)");
leftAxis.setCrosses(AxisCrosses.AUTO_ZERO);
XDDFDataSource<Double> xs = XDDFDataSourcesFactory.fromNumericCellRange(sheet, new CellRangeAddress(0, 0, 0, NUM_OF_COLUMNS - 1));
@@ -82,18 +88,20 @@ public class BarChart {
XDDFNumericalDataSource<Double> ys2 = XDDFDataSourcesFactory.fromNumericCellRange(sheet, new CellRangeAddress(2, 2, 0, NUM_OF_COLUMNS - 1));
XDDFChartData data = chart.createData(ChartTypes.BAR, bottomAxis, leftAxis);
- data.addSeries(xs, ys1);
- data.addSeries(xs, ys2);
+ XDDFChartData.Series series1 = data.addSeries(xs, ys1);
+ series1.setTitle("2x", null); // https://stackoverflow.com/questions/21855842
+ XDDFChartData.Series series2 = data.addSeries(xs, ys2);
+ series2.setTitle("3x", null);
chart.plot(data);
- XDDFSolidFillProperties fill = new XDDFSolidFillProperties(XDDFColor.from(PresetColor.CHARTREUSE));
- XDDFChartData.Series firstSeries = data.getSeries().get(0);
- XDDFShapeProperties properties = firstSeries.getShapeProperties();
- if (properties == null) {
- properties = new XDDFShapeProperties();
- }
- properties.setFillProperties(fill);
- firstSeries.setShapeProperties(properties);
+ // in order to transform a bar chart into a column chart, you just need to change the bar direction
+ XDDFBarChartData bar = (XDDFBarChartData) data;
+ bar.setBarDirection(BarDirection.COL);
+ // looking for "Stacked Bar Chart"? uncomment the following line
+ // bar.setBarGrouping(BarGrouping.STACKED);
+
+ solidFillSeries(data, 0, PresetColor.CHARTREUSE);
+ solidFillSeries(data, 1, PresetColor.TURQUOISE);
// Write the output to a file
try (FileOutputStream fileOut = new FileOutputStream("ooxml-bar-chart.xlsx")) {
@@ -101,4 +109,15 @@ public class BarChart {
}
}
}
+
+ private static void solidFillSeries(XDDFChartData data, int index, PresetColor color) {
+ XDDFSolidFillProperties fill = new XDDFSolidFillProperties(XDDFColor.from(color));
+ XDDFChartData.Series series = data.getSeries().get(index);
+ XDDFShapeProperties properties = series.getShapeProperties();
+ if (properties == null) {
+ properties = new XDDFShapeProperties();
+ }
+ properties.setFillProperties(fill);
+ series.setShapeProperties(properties);
+ }
}
Modified: poi/branches/hemf/src/examples/src/org/apache/poi/xssf/usermodel/examples/BigGridDemo.java
URL: http://svn.apache.org/viewvc/poi/branches/hemf/src/examples/src/org/apache/poi/xssf/usermodel/examples/BigGridDemo.java?rev=1843032&r1=1843031&r2=1843032&view=diff
==============================================================================
--- poi/branches/hemf/src/examples/src/org/apache/poi/xssf/usermodel/examples/BigGridDemo.java (original)
+++ poi/branches/hemf/src/examples/src/org/apache/poi/xssf/usermodel/examples/BigGridDemo.java Sat Oct 6 19:33:27 2018
@@ -58,18 +58,18 @@ import org.apache.poi.xssf.usermodel.XSS
* <p>
* If you really want to use this approach, which is also the one that SXSSF
* does for you, it works as follows:
- *
+ *
* 1. create a template workbook, create sheets and global objects such as cell styles, number formats, etc.
* 2. create an application that streams data in a text file
* 3. Substitute the sheet in the template with the generated data
*
* <p>
- * Since 3.8 POI provides a low-memory footprint SXSSF API, which implements
+ * Since 3.8 POI provides a low-memory footprint SXSSF API, which implements
* ths "BigGridDemo" strategy. SXSSF is an API-compatible streaming extension
- * of XSSF to be used when very large spreadsheets have to be produced, and
- * heap space is limited. SXSSF achieves its low memory footprint by limiting
- * access to the rows that are within a sliding window, while XSSF gives access
- * to all rows in the document. Older rows that are no longer in the window
+ * of XSSF to be used when very large spreadsheets have to be produced, and
+ * heap space is limited. SXSSF achieves its low memory footprint by limiting
+ * access to the rows that are within a sliding window, while XSSF gives access
+ * to all rows in the document. Older rows that are no longer in the window
* become inaccessible, as they are written to the disk.
* </p>
* See <a "http://poi.apache.org/spreadsheet/how-to.html#sxssf">
@@ -79,7 +79,7 @@ public final class BigGridDemo {
private static final String XML_ENCODING = "UTF-8";
private BigGridDemo() {}
-
+
public static void main(String[] args) throws Exception {
// Step 1. Create a template file. Setup sheets and workbook-level objects such as
@@ -99,7 +99,10 @@ public final class BigGridDemo {
//Step 2. Generate XML file.
File tmp = File.createTempFile("sheet", ".xml");
- try (Writer fw = new OutputStreamWriter(new FileOutputStream(tmp), XML_ENCODING)) {
+ try (
+ FileOutputStream stream = new FileOutputStream(tmp);
+ Writer fw = new OutputStreamWriter(stream, XML_ENCODING)
+ ) {
generate(fw, styles);
}
@@ -265,7 +268,9 @@ public final class BigGridDemo {
public void createCell(int columnIndex, String value, int styleIndex) throws IOException {
String ref = new CellReference(_rownum, columnIndex).formatAsString();
_out.write("<c r=\""+ref+"\" t=\"inlineStr\"");
- if(styleIndex != -1) _out.write(" s=\""+styleIndex+"\"");
+ if(styleIndex != -1) {
+ _out.write(" s=\""+styleIndex+"\"");
+ }
_out.write(">");
_out.write("<is><t>"+value+"</t></is>");
_out.write("</c>");
@@ -278,7 +283,9 @@ public final class BigGridDemo {
public void createCell(int columnIndex, double value, int styleIndex) throws IOException {
String ref = new CellReference(_rownum, columnIndex).formatAsString();
_out.write("<c r=\""+ref+"\" t=\"n\"");
- if(styleIndex != -1) _out.write(" s=\""+styleIndex+"\"");
+ if(styleIndex != -1) {
+ _out.write(" s=\""+styleIndex+"\"");
+ }
_out.write(">");
_out.write("<v>"+value+"</v>");
_out.write("</c>");
Modified: poi/branches/hemf/src/examples/src/org/apache/poi/xssf/usermodel/examples/CreateTable.java
URL: http://svn.apache.org/viewvc/poi/branches/hemf/src/examples/src/org/apache/poi/xssf/usermodel/examples/CreateTable.java?rev=1843032&r1=1843031&r2=1843032&view=diff
==============================================================================
--- poi/branches/hemf/src/examples/src/org/apache/poi/xssf/usermodel/examples/CreateTable.java (original)
+++ poi/branches/hemf/src/examples/src/org/apache/poi/xssf/usermodel/examples/CreateTable.java Sat Oct 6 19:33:27 2018
@@ -33,14 +33,18 @@ import org.apache.poi.xssf.usermodel.XSS
* Demonstrates how to create a simple table using Apache POI.
*/
public class CreateTable {
-
+
public static void main(String[] args) throws IOException {
-
+
try (Workbook wb = new XSSFWorkbook()) {
XSSFSheet sheet = (XSSFSheet) wb.createSheet();
+ // Set which area the table should be placed in
+ AreaReference reference = wb.getCreationHelper().createAreaReference(
+ new CellReference(0, 0), new CellReference(2, 2));
+
// Create
- XSSFTable table = sheet.createTable();
+ XSSFTable table = sheet.createTable(reference);
table.setName("Test");
table.setDisplayName("Test_Table");
@@ -70,7 +74,7 @@ public class CreateTable {
if (i == 0) {
cell.setCellValue("Column" + (j + 1));
} else {
- cell.setCellValue((i + 1) * (j + 1));
+ cell.setCellValue((i + 1.0) * (j + 1.0));
}
}
}
@@ -79,11 +83,6 @@ public class CreateTable {
table.createColumn("Column 2");
table.createColumn("Column 3");
- // Set which area the table should be placed in
- AreaReference reference = wb.getCreationHelper().createAreaReference(
- new CellReference(0, 0), new CellReference(2, 2));
- table.setCellReferences(reference);
-
// Save
try (FileOutputStream fileOut = new FileOutputStream("ooxml-table.xlsx")) {
wb.write(fileOut);
Modified: poi/branches/hemf/src/examples/src/org/apache/poi/xssf/usermodel/examples/IterateCells.java
URL: http://svn.apache.org/viewvc/poi/branches/hemf/src/examples/src/org/apache/poi/xssf/usermodel/examples/IterateCells.java?rev=1843032&r1=1843031&r2=1843032&view=diff
==============================================================================
--- poi/branches/hemf/src/examples/src/org/apache/poi/xssf/usermodel/examples/IterateCells.java (original)
+++ poi/branches/hemf/src/examples/src/org/apache/poi/xssf/usermodel/examples/IterateCells.java Sat Oct 6 19:33:27 2018
@@ -32,7 +32,10 @@ import org.apache.poi.xssf.usermodel.XSS
public class IterateCells {
public static void main(String[] args) throws IOException {
- try (Workbook wb = new XSSFWorkbook(new FileInputStream(args[0]))) {
+ try (
+ FileInputStream is = new FileInputStream(args[0]);
+ Workbook wb = new XSSFWorkbook(is)
+ ) {
for (int i = 0; i < wb.getNumberOfSheets(); i++) {
Sheet sheet = wb.getSheetAt(i);
System.out.println(wb.getSheetName(i));
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org