Compare commits

..

1 Commits

1309 changed files with 10634 additions and 56823 deletions

View File

@ -1,7 +1,7 @@
# https://github.com/apache/infrastructure-asfyaml/blob/main/README.md
# https://cwiki.apache.org/confluence/display/INFRA/Git+-+.asf.yaml+features
github:
description: "Mirror of Apache POI gitbox. The Java API for Microsoft Documents."
description: "Mirror of Apache POI subversion. The Java API for Microsoft Documents."
homepage: https://poi.apache.org/
labels:
- poi
@ -14,35 +14,10 @@ github:
- powerpoint
- visio
dependabot_alerts: true
dependabot_updates: false
features:
# Enable wiki for documentation
wiki: false
# Enable issue management
issues: true
issues: false
# Enable projects for project management boards
projects: false
# Enable github discussions
discussions: true
enabled_merge_buttons:
squash: true
merge: false
rebase: true
protected_branches:
trunk: {}
5.5.x: {}
asf-site: {}
notifications:
commits: commits@poi.apache.org
issues: dev@poi.apache.org
pullrequests: dev@poi.apache.org
discussions: dev@poi.apache.org
jobs: dev@poi.apache.org
publish:
whoami: asf-site

View File

@ -5,9 +5,9 @@ name: Java CI with Gradle
on:
push:
branches: [ trunk, 5.5.x ]
branches: [ trunk ]
pull_request:
branches: [ trunk, 5.5.x ]
branches: [ trunk ]
permissions: {}
@ -17,10 +17,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v5
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'

84
KEYS
View File

@ -2545,12 +2545,14 @@ bpjAhwE2YmGQ7oB+3V798HtAmceRNf8AY0GWrZswJlg7xUn+WJNwQ9uIHI1fxYHx
2Nr+AmDDs6ZOEI5zhwxioePw/Cg=
=9lKb
-----END PGP PUBLIC KEY BLOCK-----
pub rsa2048 2018-05-02 [SC] [expires: 2026-05-11]
6BA4DA8B1C88A49428A29C3D0C69C1EF41181E13
uid [ unknown] PJ Fanning (http://www.apache.org/) <fanningpj@apache.org>
uid [ unknown] PJ Fanning (GitHub noreply address) <pjfanning@users.noreply.github.com>
uid [ unknown] PJ Fanning <fanningpj@yahoo.com>
sub rsa2048 2018-05-02 [E] [expires: 2026-05-11]
pub rsa2048 2018-05-02 [SC] [expires: 2024-05-25]
6BA4 DA8B 1C88 A494 28A2 9C3D 0C69 C1EF 4118 1E13
uid [ultimate] PJ Fanning <fanningpj@yahoo.com>
sig 3 0C69C1EF41181E13 2022-04-06 PJ Fanning <fanningpj@yahoo.com>
uid [ultimate] PJ Fanning (http://www.apache.org/) <fanningpj@apache.org>
sig 3 0C69C1EF41181E13 2022-04-06 PJ Fanning <fanningpj@yahoo.com>
sub rsa2048 2018-05-02 [E] [expires: 2024-05-25]
sig 0C69C1EF41181E13 2022-04-06 PJ Fanning <fanningpj@yahoo.com>
-----BEGIN PGP PUBLIC KEY BLOCK-----
@ -2559,45 +2561,37 @@ ARFmtFPnwYwLTdz3ECqWWsC3RkI62079DweNasXV8nBz9sUt6mQqSMx3W/s6389/
k9iywPLvhHH7rpp05js8zwJoA8Fr1YwPtBjyhrxl58LQ5ihd/1f2ud2tnwQw1dI2
8fuTS3QaKP4Zdx2diD5rYhkAecWaFRwxn1L7Tye5dfD1uPElPCHGKqfaeQXtl01u
TOwYB1p9tKPHvfni1qgD3QLWUJ2oyBGSA9IgEF5rm8LtR6vADKQwORjg99a7HE2h
lDBZi/tmu23fgWSioiy084fB5GqmApK/681DABEBAAG0SFBKIEZhbm5pbmcgKEdp
dEh1YiBub3JlcGx5IGFkZHJlc3MpIDxwamZhbm5pbmdAdXNlcnMubm9yZXBseS5n
aXRodWIuY29tPokBVwQTAQgAQQIbAwULCQgHAgIiAgYVCgkICwIEFgIDAQIeBwIX
gBYhBGuk2osciKSUKKKcPQxpwe9BGB4TBQJmJYbdBQkPGNgHAAoJEAxpwe9BGB4T
5Z4H/3sDqi2QozHbsUy2dm+xS105bpmiNn3aDYzEyjOBggypDWpG5fmlD6ya3Yfd
H172auahZ1SK6t7Q7u97QdtrvMKTVBBq+DahkHnvw4nsPwBI00aTy616of1+CirZ
lDPo912aLrWlouizuy6qeJE0EfB0PGXtuZP3E0yZHqgmIOBrQw5fJQtrka5WWK3C
AqO2Z1hZLh9ftheJtKSYX1gZnPEAWs3ZBG2tCk4+qAjB8y5kRvrJFpC36FkisYlg
YTtAOSMHED/3YFsDsXFvLmrSkNBImjdAnRW59TD5XUgEMDZ9Dylz3/b4/gtNi2SX
9WSYWC60/3Jgxh4u3cTUnUtW2yC0IFBKIEZhbm5pbmcgPGZhbm5pbmdwakB5YWhv
by5jb20+iQFUBBMBCAA+AhsDBQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAFiEEa6Ta
ixyIpJQoopw9DGnB70EYHhMFAmYlhuUFCQ8Y2AcACgkQDGnB70EYHhOecwgApleV
9IOazPAk8pF0WfkslRWNrGHzaGoqO+WVhMS4doxR8bjqkrHwuI4c8Z2vCCMnKqb1
LF7djz9GXFGklvoyV7rQYrDx15bYWjtassvM4KExcnoPGxx9Kb7f0j0WSZwtwMUl
XWvsrS0+BkbRz+PIpGtDJhlI++aRoZdWCz5j5st5HzmacC0GVuYGvRPj8uMW2LN5
5HvGzlzqWIQ7l68KQPz7g5KIFKUrCPyzZS0m8Nj+gRWhF3+u3/1SY2hoCzobSMJj
PNhEovdpi8h5qbUOpHn2OM7l8/nioRaJwAmcMTnmlh1lqeyxIFYnFIBT24o3aEtN
N2d1xg/moXvzNTq7yrQ6UEogRmFubmluZyAoaHR0cDovL3d3dy5hcGFjaGUub3Jn
LykgPGZhbm5pbmdwakBhcGFjaGUub3JnPokBVAQTAQgAPgIbAwULCQgHAgYVCgkI
CwIEFgIDAQIeAQIXgBYhBGuk2osciKSUKKKcPQxpwe9BGB4TBQJmJYblBQkPGNgH
AAoJEAxpwe9BGB4TgwMIAJj3aQYKSxt9iyIP5nFhIWAFSPZcZ0gRB6jYMuANVoJE
yelbhIziN2dXLOjHWpia2x9p7krxY6ZLtogkL4MjfVpCaaXwsaYOq6LeuPN27/Pt
9rRcDz7j5lA9u9MShc6O8lwNbVReCWR08H0oiEdS09xwZY3aiZniptRBeK+mcsNc
Zw7kNmPHC79WaI6Rb/qnPLHJDD0l8vrVSShgmEeVJJoC/YjuVzKoiy2BmjSOpOLF
d88NlquWbvLO6j2tzboUs+93Kc4MwG57hwRIqS7wfsENkecSRj23KQN0UOpxgwz7
b0+ii9F9jsddEqqpXspcM8zaacf+FpIwO6rk7v1U8LG5AQ0EWulz1gEIAORuS4e+
Ek+d+0gBMlnigNJ2HoQalKFaERf5K/iQZY4E6Z2ahJ4UFIj7ri3isWgOleP+REJJ
PfeSrWQ5XgdklDlHHyv4O5iMkEFWQHttiaTuvdomDncQrNRPTaIOe9iQgfQzDw6m
qsb7ZWd5ICA8Krd97BwNHjq/CZ9+WrU6GDc6ImissLVVGGdkEGO7qZTqNUCeH4Zn
m/00mNMI4OH8xkwA2vzV5o3J5116zIuv29XQDtcSM+9NQ/HdsjKIA0OpDyWE7Ek/
SO+/CvkylwaOcmkuf33ADNjpF4BsBxn7L9XI1WJDtRaMkpbqMsymIxi35VUOGD+m
s+72CcUStfYj4NEAEQEAAYkBPAQYAQgAJgIbDBYhBGuk2osciKSUKKKcPQxpwe9B
GB4TBQJmJYcPBQkPGNg5AAoJEAxpwe9BGB4TTswH/3RmARIBV2LV72Sqk3rBcKLG
mY808npRuL6tQDVnrFPl9J8Q1/zItINYUc+2p8rHPW/N/5vyun4oVF9mT+Swqmuy
FkciQ8vCTdPlocGsGmb8eIKSvkzyRb3B8RkiXq2btDQBCVqVWbB6fh3FSI8L5442
r/IAQOKyd5wDGP2vDt1wGQ+0aV60gO2lWXOMi6U7dvt/+9vFaMciNdeZt7llNFIF
OzQuaMAqRP8viuuA29GAsy59x92LWEhm6RRSyU6rMGqfhbHQEs6FZ0x6zuBq8Ru7
T9wf/cc6uGGG6BqnjxFbWL/g9XJeU8gDxQ+ElJbYDXHT255g8kb92mHbJziPbxM=
=WUaV
lDBZi/tmu23fgWSioiy084fB5GqmApK/681DABEBAAG0OlBKIEZhbm5pbmcgKGh0
dHA6Ly93d3cuYXBhY2hlLm9yZy8pIDxmYW5uaW5ncGpAYXBhY2hlLm9yZz6JAVQE
EwEIAD4CGwMFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AWIQRrpNqLHIiklCiinD0M
acHvQRgeEwUCYk2YRAUJC2h2bgAKCRAMacHvQRgeE7nTB/4tZq9/gQcpCKgPVKI8
MKtY/NWOc9nRr5LrNjY/qFU2Z2gMoUQT1fIBm6gjd9iI92QgLMeekuR2fXBBOx3y
JbiklXfQVGytEOochkemylwtaCZTHB61KWkemDfS+YeG3qBKwFa5B+zJvp7LqYdQ
GrNFFgtHwkhNiviDN7JFxsMGM2IpopgvNYB72B35q3YnrDsgDNlD3eraKU25sMx7
2vNHABrdHzd1ZnKDA1hSV6any5Ifw4NJsPaM0RrmwuwoWkL7WHPftbqkM0zy6RIe
O+2tlKsJ6cKfOCYL9fbS7/UmkVVcrSLpJCCwmdsra3/57uha7TofDvl+R32CWzrv
yWfXtCBQSiBGYW5uaW5nIDxmYW5uaW5ncGpAeWFob28uY29tPokBVAQTAQgAPgIb
AwULCQgHAgYVCgkICwIEFgIDAQIeAQIXgBYhBGuk2osciKSUKKKcPQxpwe9BGB4T
BQJiTZhKBQkLaHZuAAoJEAxpwe9BGB4T58UH/RBEOnA9TDTKTi7T4y+R1/q2SUp+
tMzv91jhmlaDvNnA2lGVFNGj1tdy1O7xoCEEw9diKCVqVwHecuBQCaLI70r1W4Qw
qixjKJwDDnPoMKfhjuvHEHRZV0Pg+uZ50DxkFNn+bPPlXABGelliAPTvetK3ELPJ
EIRzVJkFsS0McHwXJgmIPAz8ZVlwd1/Xu21MIKOkPzgXML7uq4PN++L+mM4RmpGU
phOetyxLO1xf6ZixCoUnA7Ayi0hAKUAhu9acuc8SoDacfKm1EQ26SHUhOTNm0YCH
PPfucHJbUgqSUOYjkEftOtT0ZqVGWS7tR3iEIJu90MJ6SJRovag7khCsYY65AQ0E
Wulz1gEIAORuS4e+Ek+d+0gBMlnigNJ2HoQalKFaERf5K/iQZY4E6Z2ahJ4UFIj7
ri3isWgOleP+REJJPfeSrWQ5XgdklDlHHyv4O5iMkEFWQHttiaTuvdomDncQrNRP
TaIOe9iQgfQzDw6mqsb7ZWd5ICA8Krd97BwNHjq/CZ9+WrU6GDc6ImissLVVGGdk
EGO7qZTqNUCeH4Znm/00mNMI4OH8xkwA2vzV5o3J5116zIuv29XQDtcSM+9NQ/Hd
sjKIA0OpDyWE7Ek/SO+/CvkylwaOcmkuf33ADNjpF4BsBxn7L9XI1WJDtRaMkpbq
MsymIxi35VUOGD+ms+72CcUStfYj4NEAEQEAAYkBPAQYAQgAJgIbDBYhBGuk2osc
iKSUKKKcPQxpwe9BGB4TBQJiTZhrBQkLaHaVAAoJEAxpwe9BGB4TfjUH/24Q/H5u
vXlb/Dpx4eFcyLhRVgREoMwwAlzM5GKInHO1W7SHeD7iVR8H1XQVHTgUBNBQ1bUd
f2R2fyNAbSgCP9VooN6Q/+uTjRsm5gRD7KY5NHxjTC/SZMwKNy/haXQk/qSjDLUy
cD/2fQovuSLgoqZrTvyvz9e4JhFPk0i1it7I6KWnyyLGOItKc3Cv4p/vkD1ldYKN
XBhAxmErC9KHQK8pNi8y5z+F1JuZV74i3FRWa+3L2730qIDfR9K3jGIqOow59iqZ
c8cQLjcGU9lL4dzHh5Hcph8OC5U2aZaJOuMpCndD6XXPvq5/3QQU5rMqP//6tuVi
aAMwT8RaYPiJJPI=
=2Ips
-----END PGP PUBLIC KEY BLOCK-----
pub 2048R/1556F3A4 2016-10-04
uid Greg Woolsey <gwoolsey@apache.org>

View File

@ -1,4 +1,6 @@
# Apache POI™
Apache POI
======================
A Java library for reading and writing Microsoft Office binary and OOXML file formats.
@ -33,45 +35,36 @@ And lower-level, supporting components:
| Components named H??F are for reading or writing OLE2 binary formats.
| Components named X??F are for reading or writing OpenOffice XML (OOXML) formats.
# Getting started
Getting started
------------------
Website: https://poi.apache.org/
[Mailing lists](https://poi.apache.org/mailinglists.html):
`Mailing lists`_:
* [Developers](https://lists.apache.org/list.html?dev@poi.apache.org)
* [Users](https://lists.apache.org/list.html?user@poi.apache.org) Including Announcements
* [General](https://lists.apache.org/list.html?general@poi.apache.org)
* `Developers`_
* `Users`_
* `General`_ (release announcements)
## Bug trackers
Bug tracker:
* [Bugzilla](https://bz.apache.org/bugzilla/buglist.cgi?product=POI)
* [GitHub](https://github.com/apache/poi/issues)
* `Bugzilla`_
* `GitHub pull requests`_
## Source code
Source code:
* https://github.com/apache/poi
* Official `Apache Subversion repo`_ at apache.org
* `ViewVC repo browser`_ at apache.org
* `GitHub git mirror`_ at github.com
Requires Java 11 or later. `trunk` branch is used for 6.0.0 development. POI 4 and 5 releases require Java 8 or later.
Requires Java 1.8 or later.
Contributing
------------------
## Jars
* Download and install svn or git, Java JDK 1.8+, and Apache Ant 1.8+ or Gradle
A good resource for finding the published jars and forming build tool dependency definitions is https://mvnrepository.com/artifact/org.apache.poi.
* poi - main jar, including shared interfaces
* poi-scratchpad - extra classes to support legacy MS file formats (`H**F`)
* poi-ooxml - support for newer OOXML file formats (`X**F`)
* poi-ooxml-lite - generated classes based on MS XSDs used by poi-ooxml (only includes the most commonly used classes)
* poi-ooxml-full - generated classes based on MS XSDs (can be used instead of poi-ooxml-lite if you need support for less commonly used features)
* poi-excelant - tools for working with Excel files in Apache Ant scripts
* poi-examples
# Contributing
* Download and install git, Java JDK 11+, and Apache Ant 1.8+ or Gradle
* Check out the code from git
* Check out the code from svn or git
* Import the project into Eclipse or your favorite IDE
@ -89,12 +82,25 @@ A good resource for finding the published jars and forming build tool dependency
* Scratchpad (Binary formats): poi-scratchpad/src/main/java/org/apache/poi/
* Examples: poi-examples/src/main/java/org/apache/poi/
* More info: [How To Build page](https://poi.apache.org/devel/)
* More info: `How To Build page`_ at apache.org
# Building jar files
Building jar files
------------------
To build the jar files for poi, poi-ooxml, poi-ooxml-lite, poi-ooxml-full and poi-examples::
./gradlew jar
gradlew jar
.. _Mailing lists: https://poi.apache.org/mailinglists.html
.. _Developers: https://lists.apache.org/list.html?dev@poi.apache.org
.. _Users: https://lists.apache.org/list.html?user@poi.apache.org
.. _General: https://lists.apache.org/list.html?general@poi.apache.org
.. _Bugzilla: https://bz.apache.org/bugzilla/buglist.cgi?product=POI
.. _GitHub pull requests: https://github.com/apache/poi/pulls
.. _Apache Subversion repo: https://svn.apache.org/repos/asf/poi/trunk
.. _ViewVC repo browser: https://svn.apache.org/viewvc/poi/trunk
.. _GitHub git mirror: https://github.com/apache/poi
.. _How To Build page: http://poi.apache.org/devel/

View File

@ -24,28 +24,21 @@ import javax.xml.xpath.XPathFactory
buildscript {
repositories {
maven { url = 'https://plugins.gradle.org/m2/' }
maven { url 'https://plugins.gradle.org/m2/' }
mavenCentral()
}
}
plugins {
id 'base'
id 'com.dorongold.task-tree' version '4.0.1'
id 'org.nosphere.apache.rat' version '0.8.1'
id 'com.dorongold.task-tree' version '2.1.1'
id 'org.nosphere.apache.rat' version '0.8.0'
id 'distribution'
// 6.2.0+ requires JDK 11
// this is the version of the Gradle plugin, it usually includes a
// different version of spotbugs itself
// Latest spotbugs: https://github.com/spotbugs/spotbugs
// Latest gradle plugin: https://plugins.gradle.org/plugin/com.github.spotbugs
id 'com.github.spotbugs' version '6.4.8'
id 'de.thetaphi.forbiddenapis' version '3.10'
id 'org.sonarqube' version '7.2.2.6593'
id 'org.cyclonedx.bom' version '2.4.1'
id 'com.adarshr.test-logger' version '4.0.0'
id "com.github.spotbugs" version '5.2.1'
id 'de.thetaphi.forbiddenapis' version '3.6'
id 'org.sonarqube' version '4.0.0.2929'
id 'org.cyclonedx.bom' version '1.8.1'
id 'com.adarshr.test-logger' version '3.2.0'
}
repositories {
@ -74,8 +67,8 @@ configurations {
}
dependencies {
antLibs("org.junit.jupiter:junit-jupiter:5.13.4")
antLibs("org.apache.ant:ant-junitlauncher:1.10.15")
antLibs("org.junit.jupiter:junit-jupiter:5.10.1")
antLibs("org.apache.ant:ant-junitlauncher:1.10.14")
}
ant.taskdef(name: "junit",
@ -84,9 +77,20 @@ ant.taskdef(name: "junit",
wrapper {
gradleVersion = '8.14.3'
gradleVersion = '8.4'
}
task adjustWrapperPropertiesFile {
doLast {
ant.replaceregexp(match:'^#.*', replace:'', flags:'g', byline:true) {
fileset(dir: project.projectDir, includes: 'gradle/wrapper/gradle-wrapper.properties')
}
new File(project.projectDir, 'gradle/wrapper/gradle-wrapper.properties').with { it.text = it.readLines().findAll { it }.sort().join('\n') }
ant.fixcrlf(file: 'gradle/wrapper/gradle-wrapper.properties', eol: 'lf')
}
}
wrapper.finalizedBy adjustWrapperPropertiesFile
group = 'org.apache.poi'
/**
@ -96,7 +100,7 @@ allprojects {
// apply plugin: 'eclipse'
apply plugin: 'idea'
version = '6.0.0-SNAPSHOT'
version = '5.2.5'
}
/**
@ -114,57 +118,56 @@ subprojects {
apply plugin: 'com.adarshr.test-logger'
ext {
bouncyCastleVersion = '1.83'
commonsCodecVersion = '1.21.0'
commonsCompressVersion = '1.28.0'
commonsIoVersion = '2.21.0'
bouncyCastleVersion = '1.77'
commonsCodecVersion = '1.16.0'
commonsCompressVersion = '1.25.0'
commonsIoVersion = '2.15.0'
commonsMathVersion = '3.6.1'
junitVersion = '5.13.4'
log4jVersion = '2.25.3'
mockitoVersion = '5.21.0'
hamcrestVersion = '3.0'
xmlbeansVersion = '5.3.0'
batikVersion = '1.19'
graphics2dVersion = '3.0.5'
pdfboxVersion = '3.0.6'
saxonVersion = '12.9'
xmlSecVersion = '3.0.6'
junitVersion = '5.10.1'
log4jVersion = '2.21.1'
mockitoVersion = '4.11.0'
hamcrestVersion = '2.2'
xmlbeansVersion = '5.2.0'
batikVersion = '1.17'
graphics2dVersion = '0.43'
pdfboxVersion = '2.0.29'
saxonVersion = '12.3'
apiGuardianVersion = '1.1.2'
jdkVersion = (project.properties['jdkVersion'] ?: '11') as int
jdkVersion = (project.properties['jdkVersion'] ?: '8') as int
// see https://github.com/gradle/gradle/blob/master/subprojects/jvm-services/src/main/java/org/gradle/internal/jvm/inspection/JvmVendor.java
jdkVendor = (project.properties['jdkVendor'] ?: '') as String
JAVA9_SRC = 'src/main/java9'
JAVA9_OUT = layout.buildDirectory.dir('classes/java9/main/').get().asFile.absolutePath
JAVA9_OUT = "${buildDir}/classes/java9/main/"
TEST9_SRC = 'src/test/java9'
TEST9_OUT = layout.buildDirectory.dir('classes/java9/test/').get().asFile.absolutePath
VERSIONS9 = '/META-INF/versions/9'
TEST9_OUT = "${buildDir}/classes/java9/test/"
VERSIONS9 = 'META-INF/versions/9'
NO_SCRATCHPAD = (findProperty("scratchpad.ignore") == "true")
SAXON_TEST = (findProperty("saxon.test") == "true")
}
configurations {
configureEach {
all {
resolutionStrategy {
force "commons-io:commons-io:${commonsIoVersion}"
force 'org.slf4j:slf4j-api:2.0.17'
force 'com.fasterxml.woodstox:woodstox-core:7.1.1'
force 'org.slf4j:slf4j-api:2.0.9'
force 'com.fasterxml.woodstox:woodstox-core:6.5.1'
}
}
}
tasks.withType(JavaCompile).configureEach {
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
options.compilerArgs += '-Xlint:unchecked'
options.deprecation = true
options.incremental = true
}
tasks.withType(Test).configureEach {
tasks.withType(Test) {
systemProperty "file.encoding", "UTF-8"
}
tasks.withType(Javadoc).configureEach {
tasks.withType(Javadoc) {
options.encoding = 'UTF-8'
}
tasks.withType(AbstractArchiveTask).configureEach {
@ -178,14 +181,10 @@ subprojects {
}
dependencies {
api platform("org.apache.logging.log4j:log4j-bom:${log4jVersion}")
api 'org.apache.logging.log4j:log4j-api'
testImplementation platform("org.junit:junit-bom:${junitVersion}")
testImplementation 'org.junit.jupiter:junit-jupiter'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
testImplementation "org.junit.jupiter:junit-jupiter:${junitVersion}"
testImplementation "org.mockito:mockito-core:${mockitoVersion}"
testImplementation "org.hamcrest:hamcrest:${hamcrestVersion}"
testImplementation 'org.apache.logging.log4j:log4j-core'
testImplementation "org.apache.logging.log4j:log4j-core:${log4jVersion}"
if (SAXON_TEST) {
testRuntimeOnly("net.sf.saxon:Saxon-HE:${saxonVersion}") {
@ -212,93 +211,33 @@ subprojects {
doFirst {
options {
addBooleanOption('html5', true)
if (jdkVersion > 8) addBooleanOption('html5', true)
addBooleanOption('Xdoclint:all,-missing', true)
links 'https://poi.apache.org/apidocs/dev/'
if (jdkVersion >= 23) links 'https://docs.oracle.com/en/java/javase/23/docs/api/' else links 'https://docs.oracle.com/en/java/javase/11/docs/api/'
links 'https://docs.oracle.com/javase/8/docs/api/'
links 'https://xmlbeans.apache.org/docs/5.0.0/'
links 'https://www.javadocs.dev/org.apache.commons/commons-compress/1.28.0/'
links 'https://commons.apache.org/proper/commons-compress/apidocs/'
use = true
splitIndex = true
source = "11"
source = "1.8"
}
}
}
// helper-target to get a directory with all third-party libraries
// this is used for mass-regression-testing
tasks.register('getDeps', Copy) {
task getDeps(type: Copy) {
from sourceSets.main.runtimeClasspath
into 'build/runtime/'
}
tasks.withType(Jar).configureEach {
duplicatesStrategy = DuplicatesStrategy.FAIL
destinationDirectory = file("../build/dist/maven/${base.archivesName.get()}")
tasks.withType(Jar) {
duplicatesStrategy = 'fail'
destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}")
doLast {
// make sure we do not have distribution jar-files with different versions
// in the build-dir as those lead to strange errors about "duplicate modules"
// when building java9 JPMS class files ("java9")
ant.delete(failOnError: true, verbose: true) {
fileset(dir: "../build/dist/maven/${base.archivesName.get()}", erroronmissingdir: false) {
include(name: '*.jar')
exclude(name: "*${version}.jar")
exclude(name: "*${version}-sources.jar")
include(name: '*.jar.asc')
exclude(name: "*${version}.jar.asc")
exclude(name: "*${version}-sources.jar.asc")
include(name: '*.jar.sha256')
exclude(name: "*${version}.jar.sha256")
exclude(name: "*${version}-sources.jar.sha256")
include(name: '*.jar.sha512')
exclude(name: "*${version}.jar.sha512")
exclude(name: "*${version}-sources.jar.sha512")
include(name: '*.pom')
exclude(name: "*${version}.pom")
include(name: '*.pom.asc')
exclude(name: "*${version}.pom.asc")
}
}
// use failOnError=false for -javadoc and -tests as not all modules create this directory
ant.delete(failOnError: false, verbose: true) {
fileset(dir: "../build/dist/maven/${base.archivesName.get()}-javadoc", erroronmissingdir: false) {
include(name: '*-javadoc.jar')
exclude(name: "*${version}-javadoc.jar")
include(name: '*-javadoc.jar.asc')
exclude(name: "*${version}-javadoc.jar.asc")
include(name: '*-javadoc.jar.sha256')
exclude(name: "*${version}-javadoc.jar.sha256")
include(name: '*-javadoc.jar.sha512')
exclude(name: "*${version}-javadoc.jar.sha512")
}
}
ant.delete(failOnError: false, verbose: true) {
fileset(dir: "../build/dist/maven/${base.archivesName.get()}-tests", erroronmissingdir: false) {
include(name: '*-tests.jar')
exclude(name: "*${version}-tests.jar")
include(name: '*-tests.jar.asc')
exclude(name: "*${version}-tests.jar.asc")
include(name: '*-tests.jar.sha256')
exclude(name: "*${version}-tests.jar.sha256")
include(name: '*-tests.jar.sha512')
exclude(name: "*${version}-tests.jar.sha512")
}
}
ant.checksum(file: it.archiveFile.get().asFile, algorithm: 'SHA-256', fileext: '.sha256', format: 'MD5SUM')
ant.checksum(file: it.archiveFile.get().asFile, algorithm: 'SHA-512', fileext: '.sha512', format: 'MD5SUM')
ant.checksum(file: it.archivePath, algorithm: 'SHA-256', fileext: '.sha256', format: 'MD5SUM')
ant.checksum(file: it.archivePath, algorithm: 'SHA-512', fileext: '.sha512', format: 'MD5SUM')
}
}
@ -326,19 +265,15 @@ subprojects {
javadocJar {
// if javadocs and binaries are in the same directory, JPMS complaints about duplicated modules
// in the module-path
destinationDirectory = file("../build/dist/maven/${base.archivesName.get()}-javadoc")
destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}-javadoc")
}
sourcesJar {
destinationDirectory = file("../build/dist/maven/${base.archivesName.get()}")
destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}")
exclude 'META-INF/services/**'
}
test {
// use US locale for tests
systemProperty "user.language", "en"
systemProperty "user.country", "US"
// make XML test-results available for Jenkins CI
useJUnitPlatform()
reports {
@ -375,10 +310,10 @@ subprojects {
]
// detect if running on Jenkins/CI
isCIBuild |= Boolean.valueOf(System.getenv("CI_BUILD"))
isCIBuild |= Boolean.valueOf(System.getenv("CI_BUILD"));
if (isCIBuild) {
System.out.println("Run with reduced parallelism for CI build")
System.out.println("Run with reduced parallelism for CI build");
jvmArgs += [
// Strictly serial
@ -421,25 +356,27 @@ subprojects {
systemProperties['java.locale.providers'] = 'JRE,CLDR'
doFirst {
// some options were removed in JDK 18
if (jdkVersion < 18) {
if (jdkVersion > 8) {
// some options were removed in JDK 18
if (jdkVersion < 18) {
jvmArgs += [
'--illegal-access=warn',
]
}
jvmArgs += [
'--illegal-access=warn',
// see https://github.com/java9-modularity/gradle-modules-plugin/issues/97
// opposed to the recommendation there, it doesn't work to add ... to the dependencies
// testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.10.1'
// gradles gradle-worker.jar is still not a JPMS module and thus runs as unnamed module
'--add-exports','org.junit.platform.commons/org.junit.platform.commons.util=org.apache.poi.poi',
'--add-exports','org.junit.platform.commons/org.junit.platform.commons.util=ALL-UNNAMED',
'--add-exports','org.junit.platform.commons/org.junit.platform.commons.logging=ALL-UNNAMED',
'-Dsun.reflect.debugModuleAccessChecks=true',
'-Dcom.sun.xml.bind.v2.bytecode.ClassTailor.noOptimize=true',
]
}
jvmArgs += [
// see https://github.com/java9-modularity/gradle-modules-plugin/issues/97
// opposed to the recommendation there, it doesn't work to add ... to the dependencies
// testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.13.2'
// gradles gradle-worker.jar is still not a JPMS module and thus runs as unnamed module
'--add-exports','org.junit.platform.commons/org.junit.platform.commons.util=org.apache.poi.poi',
'--add-exports','org.junit.platform.commons/org.junit.platform.commons.util=ALL-UNNAMED',
'--add-exports','org.junit.platform.commons/org.junit.platform.commons.logging=ALL-UNNAMED',
'-Dsun.reflect.debugModuleAccessChecks=true',
'-Dcom.sun.xml.bind.v2.bytecode.ClassTailor.noOptimize=true',
]
}
jacoco {
@ -452,7 +389,7 @@ subprojects {
}
jacoco {
toolVersion = '0.8.13'
toolVersion = '0.8.10'
}
jacocoTestReport {
@ -471,7 +408,7 @@ subprojects {
//
// Some additional properties are currently set in the Jenkins-DSL, see jenkins/create_jobs.groovy
//
sonar {
sonarqube {
properties {
// as we currently use build/<module>/ as project-basedir, we need to tell Sonar to use
// the root-folder as "basedir" for the projects
@ -498,20 +435,21 @@ subprojects {
}
forbiddenApisTest {
// forbiddenapis:3.8 bundled signatures max supported version is 23
targetCompatibility = (JavaVersion.VERSION_23.isCompatibleWith(JavaVersion.current()) ? JavaVersion.current() : JavaVersion.VERSION_23)
// forbiddenapis bundled signatures max supported version is 17
// also see https://github.com/policeman-tools/forbidden-apis/issues/191
targetCompatibility = (JavaVersion.VERSION_17.isCompatibleWith(JavaVersion.current()) ? JavaVersion.current() : JavaVersion.VERSION_17)
}
forbiddenApisMain {
signaturesFiles += files('../src/resources/devtools/forbidden-signatures-prod.txt')
targetCompatibility = (JavaVersion.VERSION_23.isCompatibleWith(JavaVersion.current()) ? JavaVersion.current() : JavaVersion.VERSION_23)
targetCompatibility = (JavaVersion.VERSION_17.isCompatibleWith(JavaVersion.current()) ? JavaVersion.current() : JavaVersion.VERSION_17)
}
publishing {
publications {
POI(MavenPublication) {
groupId = 'org.apache.poi'
artifactId = base.archivesName.get()
groupId 'org.apache.poi'
artifactId project.archivesBaseName
from components.java
@ -592,9 +530,9 @@ subprojects {
}
}
generatePomFileForPOIPublication.destination = "../build/dist/maven/${base.archivesName.get()}/${base.archivesName.get()}-${project.version}.pom"
generatePomFileForPOIPublication.destination = "../build/dist/maven/${project.archivesBaseName}/${project.archivesBaseName}-${project.version}.pom"
tasks.withType(GenerateModuleMetadata).configureEach {
tasks.withType(GenerateModuleMetadata) {
enabled = false
}
@ -622,14 +560,14 @@ subprojects {
}
// initial try to provide a combined JavaDoc, grouping is still missing here, though!
tasks.register('allJavaDoc', Javadoc) {
var prj = [project(':poi'), project(':poi-excelant'), project(':poi-ooxml'), project(':poi-scratchpad')]
task allJavaDoc(type: Javadoc) {
var prj = [ project(':poi'), project(':poi-excelant'), project(':poi-ooxml'), project(':poi-scratchpad') ]
source prj.collect { it.sourceSets.main.allJava }
// for possible settings see https://docs.gradle.org/current/dsl/org.gradle.api.tasks.javadoc.Javadoc.html
classpath = files(subprojects.collect { it.sourceSets.main.compileClasspath })
destinationDir = layout.buildDirectory.dir('docs/javadoc').get().asFile
maxMemory = "2048M"
destinationDir = file("${buildDir}/docs/javadoc")
maxMemory="2048M"
// for possible options see https://docs.gradle.org/current/javadoc/org/gradle/external/javadoc/StandardJavadocDocletOptions.html
options.use = true
@ -644,7 +582,7 @@ tasks.register('allJavaDoc', Javadoc) {
options.group('SS - Common Spreadsheet Format', 'org.apache.poi.ss*')
options.group('HSSF - Horrible Spreadsheet Format', 'org.apache.poi.hssf*')
options.group('XSSF - Open Office XML Spreadsheet Format', 'org.apache.poi.xssf*')
options.group('SL - Common Slideshow Format', 'org.apache.poi.sl*')
options.group('SL - Common Slideshow Format', 'org.apache.poi.sl*')
options.group('HSLF - Horrible Slideshow Format', 'org.apache.poi.hslf*', 'org.apache.poi.hwmf*', 'org.apache.poi.hemf*')
options.group('XSLF - Open Office XML Slideshow Format', 'org.apache.poi.xslf*')
options.group('HWPF - Horrible Word Processor Format', 'org.apache.poi.hwpf*')
@ -705,9 +643,7 @@ rat {
"osgi/README.md",
"src/resources/ooxml-lite-report.*",
// ignore svn conflict artifacts
"**/module-info.*",
"poi-examples/src/main/groovy/settings.gradle",
"poi-examples/src/main/groovy/.gradle/**"
"**/module-info.*"
]
/*
@ -722,21 +658,21 @@ rat {
}
task jenkins(dependsOn: [
'replaceVersion',
subprojects.build,
subprojects.check,
subprojects.javadoc,
subprojects.jacocoTestReport,
subprojects.getDeps,
'srcDistZip',
'srcDistTar',
rat
'replaceVersion',
subprojects.build,
subprojects.check,
subprojects.javadoc,
subprojects.jacocoTestReport,
subprojects.getDeps,
'srcDistZip',
'srcDistTar',
rat
]) {}
task jenkinsLite(dependsOn: [
'replaceVersion',
subprojects.build,
subprojects.test
'replaceVersion',
subprojects.build,
subprojects.test
]) {}
/*task downloadJarsToLibs() {
@ -750,14 +686,14 @@ task jenkinsLite(dependsOn: [
//compileJava.dependsOn 'downloadJarsToLibs'
tasks.register('replaceVersion') {
task replaceVersion() {
outputs.upToDateWhen { false }
var version = subprojects[0].version
var tokens = [
['osgi', 'pom.xml', '(packaging>\\n\\s*<version>)[0-9.]+(?:-SNAPSHOT|-RC\\d+)?', "\\1${version}"],
['osgi', 'pom.xml', '(<poi.version>)[0-9.]+(?:-SNAPSHOT|-RC\\d+)?', "\\1${version}"]
// [ '.', 'build.gradle', ' version = \'[0-9.]+(?:-SNAPSHOT)?\'', " version = '${version}'" ]
[ 'osgi', 'pom.xml', '(packaging>\\n\\s*<version>)[0-9.]+(?:-SNAPSHOT|-RC\\d+)?', "\\1${version}" ],
[ 'osgi', 'pom.xml', '(<poi.version>)[0-9.]+(?:-SNAPSHOT|-RC\\d+)?', "\\1${version}" ]
// [ '.', 'build.gradle', ' version = \'[0-9.]+(?:-SNAPSHOT)?\'', " version = '${version}'" ]
]
doLast {
@ -781,7 +717,7 @@ task zipJavadocs(type: Zip, dependsOn: allJavaDoc) {
archiveExtension = 'jar'
}
tasks.withType(Tar).configureEach {
tasks.withType(Tar) {
compression = Compression.GZIP
archiveExtension = 'tgz'
}
@ -840,7 +776,7 @@ distributions {
}
}
tasks.register('soLinkCheck') {
task soLinkCheck() {
doLast {
def path = ant.path {
fileset(dir: '.', includes: '**/*.java') {
@ -877,14 +813,14 @@ var srcDep = [
':poi-ooxml-lite:generateModuleInfo'
]
srcDistTar.setArchiveFileName("apache-poi-src-${subprojects[0].version}-${dateSuffix}.tgz")
srcDistZip.setArchiveFileName("apache-poi-src-${subprojects[0].version}-${dateSuffix}.zip")
srcDistTar.setArchiveFileName("poi-src-${subprojects[0].version}-${dateSuffix}.tgz")
srcDistZip.setArchiveFileName("poi-src-${subprojects[0].version}-${dateSuffix}.zip")
srcDistTar.dependsOn srcDep
srcDistZip.dependsOn srcDep
soLinkCheck.dependsOn srcDep
rat.dependsOn soLinkCheck
tasks.register('fixDistDir') {
task fixDistDir {
doLast {
ant.mkdir(dir: 'build/dist')
ant.move(todir: 'build/dist') {

559
build.xml
View File

@ -26,7 +26,7 @@ under the License.
To build the documentation you will need to install forrest and set
the FORREST_HOME environment variable.
Since POI 6.0 you will need JDK 11 or newer to build and run POI.
Since POI 4.0 you will need JDK 1.8 or newer to build and run POI.
Some people may find the tests hang when run through Ant. If this
happens to you, try giving Ant some more memory when you run it, eg:
@ -42,7 +42,7 @@ under the License.
<description>The Apache POI project Ant build.</description>
<property name="version.id" value="6.0.0-SNAPSHOT"/>
<property name="version.id" value="5.2.5"/>
<property name="release.rc" value=""/>
<property environment="env"/>
@ -60,8 +60,8 @@ under the License.
<!-- compiler options -->
<property name="jdk.version.source" value="11" description="JDK version of source code"/>
<property name="jdk.version.class" value="11" description="JDK version of generated class files"/>
<property name="jdk.version.source" value="1.8" description="JDK version of source code"/>
<property name="jdk.version.class" value="1.8" description="JDK version of generated class files"/>
<property name="compile.debug" value="true"/>
<condition property="isIBMVM">
@ -69,7 +69,7 @@ under the License.
</condition>
<condition property="isJava8" else="false">
<equals arg1="${ant.java.version}" arg2="11"/>
<equals arg1="${ant.java.version}" arg2="1.8"/>
</condition>
<!-- add addOpens parameter for Java 9 and higher -->
@ -263,95 +263,92 @@ under the License.
<!-- jars in the /lib directory, see the fetch-jars target-->
<dependency prefix="main.commons-codec" artifact="commons-codec:commons-codec:1.19.0" usage="main"/>
<dependency prefix="main.commons-collections4" artifact="org.apache.commons:commons-collections4:4.5.0" usage="main"/>
<dependency prefix="main.commons-codec" artifact="commons-codec:commons-codec:1.16.0" usage="main"/>
<dependency prefix="main.commons-collections4" artifact="org.apache.commons:commons-collections4:4.4" usage="main"/>
<dependency prefix="main.commons-math3" artifact="org.apache.commons:commons-math3:3.6.1" usage="main"/>
<dependency prefix="main.commons-io" artifact="commons-io:commons-io:2.20.0" usage="main"/>
<dependency prefix="main.commons-io" artifact="commons-io:commons-io:2.15.0" usage="main"/>
<dependency prefix="main.com.zaxxer" artifact="com.zaxxer:SparseBitSet:1.3" usage="main"/>
<dependency prefix="main.log4j-api" artifact="org.apache.logging.log4j:log4j-api:2.25.3" usage="main"/>
<dependency prefix="main.log4j-api" artifact="org.apache.logging.log4j:log4j-api:2.21.1" usage="main"/>
<dependency prefix="main.junit-api" artifact="org.junit.jupiter:junit-jupiter-api:5.13.4" usage="main-tests"/>
<dependency prefix="main.junit-jengine" artifact="org.junit.jupiter:junit-jupiter-engine:5.13.4" usage="main-tests"/>
<dependency prefix="main.junit-params" artifact="org.junit.jupiter:junit-jupiter-params:5.13.4" usage="main-tests"/>
<dependency prefix="main.junit-api" artifact="org.junit.jupiter:junit-jupiter-api:5.10.1" usage="main-tests"/>
<dependency prefix="main.junit-jengine" artifact="org.junit.jupiter:junit-jupiter-engine:5.10.1" usage="main-tests"/>
<dependency prefix="main.junit-params" artifact="org.junit.jupiter:junit-jupiter-params:5.10.1" usage="main-tests"/>
<dependency prefix="main.junit-opentest4j" artifact="org.opentest4j:opentest4j:1.2.0" usage="main-tests"/>
<dependency prefix="main.junit-apiguardian" artifact="org.apiguardian:apiguardian-api:1.1.2" usage="main-tests"/>
<dependency prefix="main.junit-pcommons" artifact="org.junit.platform:junit-platform-commons:1.13.4" usage="main-tests"/>
<dependency prefix="main.junit-pengine" artifact="org.junit.platform:junit-platform-engine:1.13.4" usage="main-tests"/>
<dependency prefix="main.junit-plauncher" artifact="org.junit.platform:junit-platform-launcher:1.13.4" usage="main-tests"/>
<dependency prefix="main.junit-pcommons" artifact="org.junit.platform:junit-platform-commons:1.10.1" usage="main-tests"/>
<dependency prefix="main.junit-pengine" artifact="org.junit.platform:junit-platform-engine:1.10.1" usage="main-tests"/>
<dependency prefix="main.junit-plauncher" artifact="org.junit.platform:junit-platform-launcher:1.10.1" usage="main-tests"/>
<dependency prefix="main.jmh" artifact="org.openjdk.jmh:jmh-core:1.35" usage="main-tests"/>
<dependency prefix="main.jmhAnnotation" artifact="org.openjdk.jmh:jmh-generator-annprocess:1.35" usage="main-tests"/>
<dependency prefix="main.hamcrest" artifact="org.hamcrest:hamcrest:3.0" usage="main-tests"/>
<dependency prefix="main.xmlunit" artifact="org.xmlunit:xmlunit-core:2.10.3" usage="main-tests"/>
<dependency prefix="main.mockito" artifact="org.mockito:mockito-core:5.20.0" usage="main-tests"/>
<dependency prefix="main.byte-buddy" artifact="net.bytebuddy:byte-buddy:1.17.5" usage="main-tests"/>
<dependency prefix="main.byte-buddy-agent" artifact="net.bytebuddy:byte-buddy-agent:1.17.5" usage="main-tests"/>
<dependency prefix="main.hamcrest" artifact="org.hamcrest:hamcrest:2.2" usage="main-tests"/>
<dependency prefix="main.xmlunit" artifact="org.xmlunit:xmlunit-core:2.9.1" usage="main-tests"/>
<dependency prefix="main.mockito" artifact="org.mockito:mockito-core:4.11.0" usage="main-tests"/>
<dependency prefix="main.byte-buddy" artifact="net.bytebuddy:byte-buddy:1.14.9" usage="main-tests"/>
<dependency prefix="main.byte-buddy-agent" artifact="net.bytebuddy:byte-buddy-agent:1.14.9" usage="main-tests"/>
<dependency prefix="main.objenesis" artifact="org.objenesis:objenesis:3.1" usage="main-tests"/>
<dependency prefix="main.log4j-core" artifact="org.apache.logging.log4j:log4j-core:2.25.3" usage="main-tests"/>
<dependency prefix="main.log4j-core" artifact="org.apache.logging.log4j:log4j-core:2.21.1" usage="main-tests"/>
<dependency prefix="main.commons-logging" artifact="commons-logging:commons-logging:1.2" usage="main-tests"/>
<dependency prefix="main.ant" artifact="org.apache.ant:ant:1.10.15" usage="excelant"/>
<dependency prefix="main.antlauncher" artifact="org.apache.ant:ant-launcher:1.10.15" usage="excelant"/>
<dependency prefix="main.ant" artifact="org.apache.ant:ant:1.10.14" usage="excelant"/>
<dependency prefix="main.antlauncher" artifact="org.apache.ant:ant-launcher:1.10.14" usage="excelant"/>
<!-- xml signature libs - not part of the distribution -->
<dependency prefix="dsig.xmlsec" artifact="org.apache.santuario:xmlsec:3.0.6" usage="ooxml-provided"/>
<dependency prefix="dsig.bouncycastle-prov" artifact="org.bouncycastle:bcprov-jdk18on:1.82" usage="ooxml-provided"/>
<dependency prefix="dsig.bouncycastle-pkix" artifact="org.bouncycastle:bcpkix-jdk18on:1.82" usage="ooxml-provided"/>
<dependency prefix="dsig.bouncycastle-util" artifact="org.bouncycastle:bcutil-jdk18on:1.82" usage="ooxml-provided"/>
<dependency prefix="dsig.xmlsec" artifact="org.apache.santuario:xmlsec:3.0.3" usage="ooxml-provided"/>
<dependency prefix="dsig.bouncycastle-prov" artifact="org.bouncycastle:bcprov-jdk18on:1.77" usage="ooxml-provided"/>
<dependency prefix="dsig.bouncycastle-pkix" artifact="org.bouncycastle:bcpkix-jdk18on:1.77" usage="ooxml-provided"/>
<dependency prefix="dsig.bouncycastle-util" artifact="org.bouncycastle:bcutil-jdk18on:1.77" usage="ooxml-provided"/>
<!-- only used for signing the release - not used with the ooxml signatures -->
<dependency prefix="dsig.bouncycastle-bcpg" artifact="org.bouncycastle:bcpg-jdk18on:1.82" usage="util"/>
<dependency prefix="dsig.bouncycastle-bcpg" artifact="org.bouncycastle:bcpg-jdk18on:1.77" usage="util"/>
<dependency prefix="ooxml.test.stax2" artifact="org.codehaus.woodstox:stax2-api:4.2.1" usage="ooxml-provided"/>
<!-- svg/batik/pdf libs - not part of the distribution - move batik to its own directory because of JPMS module-path issues -->
<dependency prefix="svg.xml-apis-ext" artifact="xml-apis:xml-apis-ext:1.3.04" usage="ooxml-batik"/>
<dependency prefix="svg.xmlgraphics-commons" artifact="org.apache.xmlgraphics:xmlgraphics-commons:2.11" usage="ooxml-batik"/>
<dependency prefix="svg.batik-anim" artifact="org.apache.xmlgraphics:batik-anim:1.19" usage="ooxml-batik"/>
<dependency prefix="svg.batik-awt-util" artifact="org.apache.xmlgraphics:batik-awt-util:1.19" usage="ooxml-batik"/>
<dependency prefix="svg.batik-bridge" artifact="org.apache.xmlgraphics:batik-bridge:1.19" usage="ooxml-batik"/>
<dependency prefix="svg.batik-codec" artifact="org.apache.xmlgraphics:batik-codec:1.19" usage="ooxml-batik"/>
<dependency prefix="svg.batik-constants" artifact="org.apache.xmlgraphics:batik-constants:1.19" usage="ooxml-batik"/>
<dependency prefix="svg.batik-css" artifact="org.apache.xmlgraphics:batik-css:1.19" usage="ooxml-batik"/>
<dependency prefix="svg.batik-dom" artifact="org.apache.xmlgraphics:batik-dom:1.19" usage="ooxml-batik"/>
<dependency prefix="svg.batik-ext" artifact="org.apache.xmlgraphics:batik-ext:1.19" usage="ooxml-batik"/>
<dependency prefix="svg.batik-gvt" artifact="org.apache.xmlgraphics:batik-gvt:1.19" usage="ooxml-batik"/>
<dependency prefix="svg.batik-i18n" artifact="org.apache.xmlgraphics:batik-i18n:1.19" usage="ooxml-batik"/>
<dependency prefix="svg.batik-parser" artifact="org.apache.xmlgraphics:batik-parser:1.19" usage="ooxml-batik"/>
<dependency prefix="svg.batik-script" artifact="org.apache.xmlgraphics:batik-script:1.19" usage="ooxml-batik"/>
<dependency prefix="svg.batik-shared-resources" artifact="org.apache.xmlgraphics:batik-shared-resources:1.19" usage="ooxml-batik"/>
<dependency prefix="svg.batik-svg-dom" artifact="org.apache.xmlgraphics:batik-svg-dom:1.19" usage="ooxml-batik"/>
<dependency prefix="svg.batik-svggen" artifact="org.apache.xmlgraphics:batik-svggen:1.19" usage="ooxml-batik"/>
<dependency prefix="svg.batik-svgrasterizer" artifact="org.apache.xmlgraphics:batik-svgrasterizer:1.19" usage="ooxml-batik"/>
<dependency prefix="svg.batik-transcoder" artifact="org.apache.xmlgraphics:batik-transcoder:1.19" usage="ooxml-batik"/>
<dependency prefix="svg.batik-util" artifact="org.apache.xmlgraphics:batik-util:1.19" usage="ooxml-batik"/>
<dependency prefix="svg.batik-xml" artifact="org.apache.xmlgraphics:batik-xml:1.19" usage="ooxml-batik"/>
<dependency prefix="pdf.pdfbox" artifact="org.apache.pdfbox:pdfbox:3.0.5" usage="ooxml-provided"/>
<dependency prefix="pdf.pdfbox.io" artifact="org.apache.pdfbox:pdfbox-io:3.0.5" usage="ooxml-provided"/>
<dependency prefix="pdf.fontbox" artifact="org.apache.pdfbox:fontbox:3.0.5" usage="ooxml-provided"/>
<dependency prefix="pdf.graphics2d" artifact="de.rototor.pdfbox:graphics2d:3.0.3" usage="ooxml-provided"/>
<dependency prefix="svg.xmlgraphics-commons" artifact="org.apache.xmlgraphics:xmlgraphics-commons:2.7" usage="ooxml-batik"/>
<dependency prefix="svg.batik-anim" artifact="org.apache.xmlgraphics:batik-anim:1.17" usage="ooxml-batik"/>
<dependency prefix="svg.batik-awt-util" artifact="org.apache.xmlgraphics:batik-awt-util:1.17" usage="ooxml-batik"/>
<dependency prefix="svg.batik-bridge" artifact="org.apache.xmlgraphics:batik-bridge:1.17" usage="ooxml-batik"/>
<dependency prefix="svg.batik-codec" artifact="org.apache.xmlgraphics:batik-codec:1.17" usage="ooxml-batik"/>
<dependency prefix="svg.batik-constants" artifact="org.apache.xmlgraphics:batik-constants:1.17" usage="ooxml-batik"/>
<dependency prefix="svg.batik-css" artifact="org.apache.xmlgraphics:batik-css:1.17" usage="ooxml-batik"/>
<dependency prefix="svg.batik-dom" artifact="org.apache.xmlgraphics:batik-dom:1.17" usage="ooxml-batik"/>
<dependency prefix="svg.batik-ext" artifact="org.apache.xmlgraphics:batik-ext:1.17" usage="ooxml-batik"/>
<dependency prefix="svg.batik-gvt" artifact="org.apache.xmlgraphics:batik-gvt:1.17" usage="ooxml-batik"/>
<dependency prefix="svg.batik-i18n" artifact="org.apache.xmlgraphics:batik-i18n:1.17" usage="ooxml-batik"/>
<dependency prefix="svg.batik-parser" artifact="org.apache.xmlgraphics:batik-parser:1.17" usage="ooxml-batik"/>
<dependency prefix="svg.batik-script" artifact="org.apache.xmlgraphics:batik-script:1.17" usage="ooxml-batik"/>
<dependency prefix="svg.batik-shared-resources" artifact="org.apache.xmlgraphics:batik-shared-resources:1.17" usage="ooxml-batik"/>
<dependency prefix="svg.batik-svg-dom" artifact="org.apache.xmlgraphics:batik-svg-dom:1.17" usage="ooxml-batik"/>
<dependency prefix="svg.batik-svggen" artifact="org.apache.xmlgraphics:batik-svggen:1.17" usage="ooxml-batik"/>
<dependency prefix="svg.batik-svgrasterizer" artifact="org.apache.xmlgraphics:batik-svgrasterizer:1.17" usage="ooxml-batik"/>
<dependency prefix="svg.batik-transcoder" artifact="org.apache.xmlgraphics:batik-transcoder:1.17" usage="ooxml-batik"/>
<dependency prefix="svg.batik-util" artifact="org.apache.xmlgraphics:batik-util:1.17" usage="ooxml-batik"/>
<dependency prefix="svg.batik-xml" artifact="org.apache.xmlgraphics:batik-xml:1.17" usage="ooxml-batik"/>
<dependency prefix="pdf.pdfbox" artifact="org.apache.pdfbox:pdfbox:2.0.29" usage="ooxml-provided"/>
<dependency prefix="pdf.fontbox" artifact="org.apache.pdfbox:fontbox:2.0.29" usage="ooxml-provided"/>
<dependency prefix="pdf.graphics2d" artifact="de.rototor.pdfbox:graphics2d:0.43" usage="ooxml-provided"/>
<!-- jars in the ooxml-lib directory, see the fetch-ooxml-jars target-->
<dependency prefix="ooxml.curvesapi" artifact="com.github.virtuald:curvesapi:1.08" usage="ooxml"/>
<dependency prefix="ooxml.xmlbeans" artifact="org.apache.xmlbeans:xmlbeans:5.3.0" usage="ooxml"/>
<dependency prefix="ooxml.commons-compress" artifact="org.apache.commons:commons-compress:1.28.0" usage="ooxml"/>
<dependency prefix="ooxml.commons-lang3" artifact="org.apache.commons:commons-lang3:3.18.0" usage="ooxml"/>
<dependency prefix="ooxml.xmlbeans" artifact="org.apache.xmlbeans:xmlbeans:5.2.0" usage="ooxml"/>
<dependency prefix="ooxml.commons-compress" artifact="org.apache.commons:commons-compress:1.25.0" usage="ooxml"/>
<!-- jars in the ooxml-test-lib directory, see the fetch-ooxml-jars target-->
<dependency prefix="ooxml.test.reflections" artifact="org.reflections:reflections:0.10.2" usage="ooxml-tests"/>
<dependency prefix="ooxml.test.guava" artifact="com.google.guava:guava:33.4.8-jre" usage="ooxml-tests"/>
<dependency prefix="ooxml.test.guava.failureaccess" artifact="com.google.guava:failureaccess:1.0.3" usage="ooxml-tests"/>
<dependency prefix="ooxml.test.guava" artifact="com.google.guava:guava:32.1.1-jre" usage="ooxml-tests"/>
<dependency prefix="ooxml.test.javassist" artifact="org.javassist:javassist:3.27.0-GA" usage="ooxml-tests"/>
<dependency prefix="ooxml.test.slf4j-api" artifact="org.slf4j:slf4j-api:2.0.17" usage="ooxml-tests"/>
<dependency prefix="ooxml.test.slf4j-api" artifact="org.slf4j:slf4j-api:2.0.9" usage="ooxml-tests"/>
<dependency prefix="ooxml.test.opczip" artifact="com.github.rzymek:opczip:1.2.0" usage="ooxml-tests"/>
<!-- coverage libs -->
<dependency prefix="jacoco" artifact="org.jacoco:jacoco:0.8.13" usage="util" packaging="zip"/>
<dependency prefix="jacoco" artifact="org.jacoco:jacoco:0.8.10" usage="util" packaging="zip"/>
<dependency prefix="asm" artifact="org.ow2.asm:asm:9.5" usage="util"/>
<dependency prefix="asm-commons" artifact="org.ow2.asm:asm-commons:9.5" usage="util"/>
<dependency prefix="asm-tree" artifact="org.ow2.asm:asm-tree:9.5" usage="util"/>
<!-- license and api checks -->
<dependency prefix="rat" artifact="org.apache.rat:apache-rat:0.16.1" usage="util"/>
<dependency prefix="rat" artifact="org.apache.rat:apache-rat:0.15" usage="util"/>
<dependency prefix="forbidden" artifact="de.thetaphi:forbiddenapis:3.5.1" usage="util"/>
<!-- See https://www.ecma-international.org/publications/standards/Ecma-376.htm -->
@ -384,7 +381,7 @@ under the License.
<property name="rat.report" value="${rat.reportdir}/report.txt"/>
<!-- build and distro settings -->
<property name="jar.name" value="apache-poi"/>
<property name="jar.name" value="poi"/>
<property name="build.site" location="build/site"/>
<property name="javadocs.report.dir" location="${build.site}/apidocs/dev"/>
<property name="dist.dir" location="build/dist"/>
@ -398,6 +395,27 @@ under the License.
<!-- jars required for maven helper targets -->
<dependency prefix="maven.ant" artifact="org.apache.maven:maven-ant-tasks:2.1.3" usage="util"/>
<!-- subclipse.tigris.org is gone - left-over is hosted at https://bintray.com/openmeetings/maven/org.tigris.subclipse.svnant -->
<!-- request will be forwarded to d29vzk4ow07wi7.cloudfront.net which is an Atlassian Marketplace instance -->
<dependency prefix="dist.svnant" artifact="org.tigris.subclipse:svnant:1.3.1" usage="util"
repo="https://dl.bintray.com/openmeetings/maven"/>
<!-- hosted at https://bintray.com/subclipse/maven/svnclientadapter - https://github.com/subclipse/svnclientadapter -->
<dependency prefix="dist.svnclientadapter-base" artifact="org.tigris.svnclientadapter:adapter-base:1.12.0" usage="util"
repo="https://dl.bintray.com/subclipse/maven"/>
<dependency prefix="dist.svnclientadapter-svnkit" artifact="org.tigris.svnclientadapter:adapter-svnkit:1.12.0" usage="util"
repo="https://dl.bintray.com/subclipse/maven"/>
<dependency prefix="dist.svnclientadapter-javahl" artifact="org.tigris.svnclientadapter:adapter-javahl:1.12.0" usage="util"
repo="https://dl.bintray.com/subclipse/maven"/>
<dependency prefix="dist.svnkit" artifact="org.tmatesoft.svnkit:svnkit:1.10.1" usage="util"/>
<dependency prefix="dist.svnkit-javahl16" artifact="org.tmatesoft.svnkit:svnkit-javahl16:1.10.1" usage="util"/>
<dependency prefix="dist.sqljet" artifact="org.tmatesoft.sqljet:sqljet:1.1.13" usage="util"/>
<dependency prefix="dist.antlr" artifact="org.antlr:antlr-runtime:3.5.2" usage="util"/>
<dependency prefix="dist.sequence-library" artifact="de.regnis.q.sequence:sequence-library:1.0.4" usage="util"/>
<dependency prefix="dist.lz4-java" artifact="org.lz4:lz4-java:1.7.1" usage="util"/>
<propertyset id="junit.properties">
<propertyref name="POI.testdata.path"/>
<propertyref name="java.awt.headless"/>
@ -460,11 +478,9 @@ under the License.
<pathelement location="${ooxml.curvesapi.jar}"/>
<pathelement location="${ooxml.xmlbeans.jar}"/>
<pathelement location="${ooxml.commons-compress.jar}"/>
<pathelement location="${ooxml.commons-lang3.jar}"/>
<path refid="main.classpath"/>
<pathelement location="${main.output.dir}"/>
<pathelement location="${ooxml.test.guava.jar}"/>
<pathelement location="${ooxml.test.guava.failureaccess.jar}"/>
<pathelement location="${ooxml.test.opczip.jar}"/>
<!-- classes are omitted on test cases outside the xml-dsign area to avoid classpath poisoning -->
<!--path refid="ooxml.xmlsec.classpath"/-->
@ -498,7 +514,6 @@ under the License.
<path id="pdfbox.classpath">
<pathelement location="${pdf.pdfbox.jar}"/>
<pathelement location="${pdf.pdfbox.io.jar}"/>
<pathelement location="${pdf.fontbox.jar}"/>
<pathelement location="${pdf.graphics2d.jar}"/>
</path>
@ -518,7 +533,6 @@ under the License.
<path id="test.ooxml.reflections.classpath">
<pathelement location="${ooxml.test.reflections.jar}"/>
<pathelement location="${ooxml.test.guava.jar}"/>
<pathelement location="${ooxml.test.guava.failureaccess.jar}"/>
<pathelement location="${ooxml.test.javassist.jar}"/>
</path>
@ -670,7 +684,11 @@ under the License.
<fileset dir="${basedir}/lib/main-tests">
<include name="byte-buddy-*1.12*.jar"/>
<include name="mockito-core-3*.jar"/>
<include name="mockito-core-4*.jar"/>
<include name="mockito-core-4.0*.jar"/>
<include name="mockito-core-4.2*.jar"/>
<include name="mockito-core-4.5*.jar"/>
<include name="mockito-core-4.6*.jar"/>
<include name="mockito-core-4.8*.jar"/>
<include name="hamcrest-core*"/>
<include name="junit-4*.jar"/>
<include name="*slf4j*.jar"/>
@ -688,7 +706,6 @@ under the License.
<include name="xmlbeans-4*.jar"/>
<include name="xmlbeans-5.0*.jar"/>
<include name="xmlbeans-5.1.0.jar"/>
<include name="xmlbeans-5.2.2.jar"/>
</fileset>
<fileset dir="${basedir}/lib/ooxml-provided">
<include name="bc*-1.6*.jar"/>
@ -697,7 +714,6 @@ under the License.
<include name="batik*.jar"/>
<include name="slf4j*-1.*.jar"/>
<include name="xmlsec-2*.jar"/>
<include name="xmlgraphics-commons-*.jar"/>
</fileset>
<fileset dir="${basedir}/lib/ooxml-tests">
<include name="guava-20.0.jar"/>
@ -709,8 +725,6 @@ under the License.
<include name="org.jacoco.*-0.8.5.*.jar"/>
<include name="org.jacoco.*-0.8.6.*.jar"/>
<include name="org.jacoco.*-0.8.8.*.jar"/>
<include name="org.jacoco.*-0.8.10.*.jar"/>
<include name="org.jacoco.*-0.8.11.*.jar"/>
<include name="forbiddenapis-3.1.jar"/>
<include name="forbiddenapis-3.4.jar"/>
</fileset>
@ -718,8 +732,6 @@ under the License.
<include name="jacoco-0.8.5.zip"/>
<include name="jacoco-0.8.6.zip"/>
<include name="jacoco-0.8.8.zip"/>
<include name="jacoco-0.8.10.zip"/>
<include name="jacoco-0.8.11.zip"/>
</fileset>
<fileset dir="${basedir}/lib">
<include name="jacoco-*.zip"/>
@ -830,10 +842,8 @@ under the License.
<available file="${ooxml.curvesapi.jar}"/>
<available file="${ooxml.xmlbeans.jar}"/>
<available file="${ooxml.commons-compress.jar}"/>
<available file="${ooxml.commons-lang3.jar}"/>
<available file="${ooxml.test.reflections.jar}"/>
<available file="${ooxml.test.guava.jar}"/>
<available file="${ooxml.test.guava.failureaccess.jar}"/>
<available file="${ooxml.test.javassist.jar}"/>
<available file="${ooxml.test.slf4j-api.jar}"/>
<available file="${ooxml.test.opczip.jar}"/>
@ -860,7 +870,6 @@ under the License.
<available file="${svg.batik-xml.jar}"/>
<available file="${svg.xmlgraphics-commons.jar}"/>
<available file="${pdf.pdfbox.jar}"/>
<available file="${pdf.pdfbox.io.jar}"/>
<available file="${pdf.fontbox.jar}"/>
<available file="${pdf.graphics2d.jar}"/>
</and>
@ -874,10 +883,8 @@ under the License.
<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.commons-lang3.url}" dest="${ooxml.commons-lang3.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.guava.failureaccess.url}" dest="${ooxml.test.guava.failureaccess.jar}"/>
<downloadfile src="${ooxml.test.javassist.url}" dest="${ooxml.test.javassist.jar}"/>
<downloadfile src="${ooxml.test.slf4j-api.url}" dest="${ooxml.test.slf4j-api.jar}"/>
<downloadfile src="${ooxml.test.opczip.url}" dest="${ooxml.test.opczip.jar}"/>
@ -904,11 +911,42 @@ under the License.
<downloadfile src="${svg.xml-apis-ext.url}" dest="${svg.xml-apis-ext.jar}"/>
<downloadfile src="${svg.xmlgraphics-commons.url}" dest="${svg.xmlgraphics-commons.jar}"/>
<downloadfile src="${pdf.pdfbox.url}" dest="${pdf.pdfbox.jar}"/>
<downloadfile src="${pdf.pdfbox.io.url}" dest="${pdf.pdfbox.io.jar}"/>
<downloadfile src="${pdf.fontbox.url}" dest="${pdf.fontbox.jar}"/>
<downloadfile src="${pdf.graphics2d.url}" dest="${pdf.graphics2d.jar}"/>
</target>
<target name="check-svn-jars">
<condition property="svn.jars.present">
<or>
<and>
<available file="${dist.svnant.jar}"/>
<available file="${dist.svnclientadapter-base.jar}"/>
<available file="${dist.svnclientadapter-svnkit.jar}"/>
<available file="${dist.svnclientadapter-javahl.jar}"/>
<available file="${dist.svnkit.jar}"/>
<available file="${dist.svnkit-javahl16.jar}"/>
<available file="${dist.sqljet.jar}"/>
<available file="${dist.antlr.jar}"/>
<available file="${dist.sequence-library.jar}"/>
<available file="${dist.lz4-java.jar}"/>
</and>
<isset property="disconnected"/>
</or>
</condition>
</target>
<target name="fetch-svn-jars" depends="check-svn-jars" unless="svn.jars.present">
<!-- some jars are gone since bintray.dl is shutting down, so we started to include them in the sources for now -->
<copy todir="lib/util">
<fileset dir="lib.stored/" includes="*.jar"/>
</copy>
<downloadfile src="${dist.svnkit.url}" dest="${dist.svnkit.jar}"/>
<downloadfile src="${dist.svnkit-javahl16.url}" dest="${dist.svnkit-javahl16.jar}"/>
<downloadfile src="${dist.sqljet.url}" dest="${dist.sqljet.jar}"/>
<downloadfile src="${dist.antlr.url}" dest="${dist.antlr.jar}"/>
<downloadfile src="${dist.sequence-library.url}" dest="${dist.sequence-library.jar}"/>
<downloadfile src="${dist.lz4-java.url}" dest="${dist.lz4-java.jar}"/>
</target>
<target name="check-compiled-ooxml-xsds">
<condition property="ooxml-compiled-xsds.present">
<and>
@ -938,7 +976,7 @@ under the License.
<zipfileset src="${ooxml.xsds.izip.1}"/>
<fileset dir="${ooxml.visio.xsd.dir}"/>
<fileset dir="${ooxml.schema.xsdconfig.dir}" includes="ooxmlSchemas.xsdconfig,markup-compatibility.xsd,vmlDrawing.xsd"/>
<fileset dir="${ooxml.schema.xsdconfig.dir}" includes="dml-drawing.xsd,word10.xsd,word12.xsd,XAdES*.xsd,xlThreaded*.xsd,xmldsig*.xsd"/>
<fileset dir="${ooxml.schema.xsdconfig.dir}" includes="dml-drawing.xsd,word12.xsd,XAdES*.xsd,xlThreaded*.xsd,xmldsig*.xsd"/>
<zipfileset src="${ooxml.xsds.izip.2}" includes="opc-digSig.xsd,opc-relationships.xsd"/>
<fileset dir="${ooxml.security.xsd.dir}" includes="signatureInfo.xsd"/>
</copy>
@ -983,7 +1021,7 @@ under the License.
</classpath>
</javac>
<javac release="11"
<javac release="9"
srcdir="${basedir}/poi-ooxml-full/src/main/java9"
destdir="${basedir}/poi-ooxml-full/src/main/java9"
includeantruntime="false"
@ -1083,7 +1121,7 @@ under the License.
<echo message="Building java9+ classes for @{module}"/>
<!-- compile jigsaw files to sources, so we don't forget to update/provide them for Java 8 builds -->
<javac release="11"
<javac release="9"
srcdir="${basedir}/@{module}/src/main/java9"
destdir="${basedir}/@{module}/src/main/java9"
includeantruntime="false"
@ -1122,7 +1160,7 @@ under the License.
</jar>
<!-- compile the tests -->
<javac release="11"
<javac release="8"
target="${jdk.version.class}"
source="${jdk.version.source}"
destdir="@{test-classes}"
@ -1144,7 +1182,7 @@ under the License.
<path location="@{test-classes}"/>
</pathconvert>
<javac release="11"
<javac release="9"
srcdir="${basedir}/@{module}/src/test/java9"
destdir="${basedir}/@{module}/src/test/java9"
includeantruntime="false"
@ -1272,7 +1310,7 @@ under the License.
<!-- create ooxml-lite-agent jar -->
<mkdir dir="${ooxml.lite.output.dir}"/>
<javac release="11"
<javac release="8"
srcdir="${basedir}/poi-ooxml-lite-agent/src/main/java"
destdir="${ooxml.lite.output.dir}"
includeantruntime="false"
@ -1283,7 +1321,7 @@ under the License.
</classpath>
</javac>
<javac release="11"
<javac release="9"
srcdir="${basedir}/poi-ooxml-lite-agent/src/main/java9"
destdir="${basedir}/poi-ooxml-lite-agent/src/main/java9"
includeantruntime="false"
@ -1491,7 +1529,7 @@ under the License.
</target>
<target name="compile-integration" depends="compile-scratchpad, compile-main, compile-ooxml, compile-examples">
<javac release="11"
<javac release="8"
target="${jdk.version.class}"
source="${jdk.version.source}"
destdir="${integration.output.test.dir}"
@ -1518,7 +1556,7 @@ under the License.
<mkdir dir="${integration.output.test.dir}/META-INF/versions/9"/>
<javac release="11"
<javac release="9"
srcdir="${basedir}/poi-integration/src/test/java9"
destdir="${integration.output.test.dir}/META-INF/versions/9"
includeantruntime="false"
@ -1568,6 +1606,7 @@ under the License.
<copy file="${main.version.template}" tofile="${main.version.java}" overwrite="true">
<filterset>
<filter token="VERSION" value="${version.id}"/>
<filter token="DSTAMP" value="${DSTAMP}"/>
</filterset>
</copy>
@ -1892,7 +1931,7 @@ under the License.
<echo output="${basedir}/poi-ooxml-lite/src/main/java9/module-info.java">${full.schema}${lite.exports}}</echo>
<javac release="11"
<javac release="9"
srcdir="${basedir}/poi-ooxml-lite/src/main/java9"
destdir="${basedir}/poi-ooxml-lite/src/main/java9"
includeantruntime="false"
@ -2042,13 +2081,6 @@ under the License.
unless="main.docs.notRequired" description="Builds the HTML pages of the POI website">
<echo message="Using Apache Forrest from ${env.FORREST_HOME}"/>
<echo message="Adjusting http -> https in forrset itself"/>
<replace dir="${env.FORREST_HOME}"
token="'http://'"
value="'https://'"
summary="true"
includes="**/*.xsl"/>
<exec executable="${env.FORREST_HOME}/bin/forrest" osfamily="unix"/>
<exec executable="cmd" osfamily="windows">
<arg value="/c"/>
@ -2097,7 +2129,6 @@ under the License.
<!-- Generates the latest/development API documentation. -->
<target name="javadocs"
depends="compile-ooxml"
description="Generates the API documentation">
<echo message="Generating latest Javadocs in ${javadocs.report.dir}"/>
<javadoc verbose="false" author="true" destdir="${javadocs.report.dir}"
@ -2246,7 +2277,7 @@ under the License.
<echo message="Building maven-jar for @{module}, module-name: ${module-name} with isJava8: ${isJava8} and src: @{src}"/>
<javac release="11"
<javac release="9"
srcdir="${basedir}/@{module}/src/main/java9"
destdir="@{src}/META-INF/versions/9"
includeantruntime="false"
@ -2421,7 +2452,7 @@ under the License.
<!-- continuous integration targets -->
<target name="jenkins"
depends="replaceVersion, compile, test-all, jar, javadocs, assemble, findbugs, release-notes, rat-check, forbidden-apis-check, help, maventask"
depends="replaceVersion, compile, test-all, jar, javadocs, assemble, findbugs, release-notes, rat-check, forbidden-apis-check, help, fetch-svn-jars, maventask"
description="Target run by Jenkins on a continuous basis. Builds and tests POI, generates artifacts and documentation, and searches for problems."/>
<target name="maventask" depends="init">
@ -2443,11 +2474,7 @@ under the License.
uri="antlib:org.apache.rat.anttasks"
classpath="${rat.jar}" />
<rat:report xmlns:rat="antlib:org.apache.rat.anttasks" reportFile="${rat.report}">
<fileset dir="poi-examples/src">
<exclude name="main/java/org/apache/poi/**/*-chart-data.txt" />
<exclude name="main/groovy/settings.gradle" />
<exclude name="main/groovy/.gradle/**" />
</fileset>
<fileset dir="poi-examples/src" excludes="main/java/org/apache/poi/**/*-chart-data.txt"/>
<fileset dir="poi-excelant/src"/>
<fileset dir="poi-integration/src"/>
<fileset dir="poi/src">
@ -2573,31 +2600,30 @@ under the License.
<!-- findbugs successor, spotbugs ... need to use the dependencies used in the spotbugs release. -->
<!-- compare with the entries found in the MANIFEST.MF of spotbugs.jar -->
<dependency prefix="spotbugs" artifact="com.github.spotbugs:spotbugs:4.9.8" usage="${spotbugs.lib}" target="spotbugs.jar"/>
<dependency prefix="spotbugs-ant" artifact="com.github.spotbugs:spotbugs-ant:4.9.8" usage="${spotbugs.lib}" target="spotbugs-ant.jar"/>
<dependency prefix="spotbugs-anno" artifact="com.github.spotbugs:spotbugs-annotations:4.9.8" usage="${spotbugs.lib}" target="spotbugs-annotations.jar"/>
<dependency prefix="spotbugs.asm" artifact="org.ow2.asm:asm:9.9" usage="${spotbugs.lib}"/>
<dependency prefix="spotbugs.asm-analysis" artifact="org.ow2.asm:asm-analysis:9.9" usage="${spotbugs.lib}"/>
<dependency prefix="spotbugs.asm-commons" artifact="org.ow2.asm:asm-commons:9.9" usage="${spotbugs.lib}"/>
<dependency prefix="spotbugs.asm-tree" artifact="org.ow2.asm:asm-tree:9.9" usage="${spotbugs.lib}"/>
<dependency prefix="spotbugs.asm-util" artifact="org.ow2.asm:asm-util:9.9" usage="${spotbugs.lib}"/>
<dependency prefix="spotbugs" artifact="com.github.spotbugs:spotbugs:4.7.3" usage="${spotbugs.lib}" target="spotbugs.jar"/>
<dependency prefix="spotbugs-ant" artifact="com.github.spotbugs:spotbugs-ant:4.7.3" usage="${spotbugs.lib}" target="spotbugs-ant.jar"/>
<dependency prefix="spotbugs-anno" artifact="com.github.spotbugs:spotbugs-annotations:4.7.3" usage="${spotbugs.lib}" target="spotbugs-annotations.jar"/>
<dependency prefix="spotbugs.asm" artifact="org.ow2.asm:asm:9.5" usage="${spotbugs.lib}"/>
<dependency prefix="spotbugs.asm-analysis" artifact="org.ow2.asm:asm-analysis:9.5" usage="${spotbugs.lib}"/>
<dependency prefix="spotbugs.asm-commons" artifact="org.ow2.asm:asm-commons:9.5" usage="${spotbugs.lib}"/>
<dependency prefix="spotbugs.asm-tree" artifact="org.ow2.asm:asm-tree:9.5" usage="${spotbugs.lib}"/>
<dependency prefix="spotbugs.asm-util" artifact="org.ow2.asm:asm-util:9.5" usage="${spotbugs.lib}"/>
<dependency prefix="spotbugs.jsr305" artifact="com.google.code.findbugs:jsr305:3.0.2" usage="${spotbugs.lib}"/>
<dependency prefix="spotbugs.dom4j" artifact="org.dom4j:dom4j:2.2.0" usage="${spotbugs.lib}"/>
<dependency prefix="spotbugs.jaxen" artifact="jaxen:jaxen:2.0.0" usage="${spotbugs.lib}"/>
<dependency prefix="spotbugs.bcel" artifact="org.apache.bcel:bcel:6.11.0" usage="${spotbugs.lib}"/>
<dependency prefix="spotbugs.slf4j-api" artifact="org.slf4j:slf4j-api:2.0.17" usage="${spotbugs.lib}"/>
<dependency prefix="spotbugs.commons-lang" artifact="org.apache.commons:commons-lang3:3.19.0" usage="${spotbugs.lib}"/>
<dependency prefix="spotbugs.commons-text" artifact="org.apache.commons:commons-text:1.14.0" usage="${spotbugs.lib}"/>
<dependency prefix="spotbugs.commons-codec" artifact="commons-codec:commons-codec:1.15" usage="${spotbugs.lib}"/>
<dependency prefix="spotbugs.commons-io" artifact="commons-io:commons-io:2.20.0" usage="${spotbugs.lib}"/>
<dependency prefix="spotbugs.dom4j" artifact="org.dom4j:dom4j:2.1.3" usage="${spotbugs.lib}"/>
<dependency prefix="spotbugs.jaxen" artifact="jaxen:jaxen:1.2.0" usage="${spotbugs.lib}"/>
<dependency prefix="spotbugs.bcel" artifact="org.apache.bcel:bcel:6.5.0" usage="${spotbugs.lib}"/>
<dependency prefix="spotbugs.slf4j-api" artifact="org.slf4j:slf4j-api:2.0.0" usage="${spotbugs.lib}"/>
<dependency prefix="spotbugs.commons-lang3" artifact="org.apache.commons:commons-lang3:3.12.0" usage="${spotbugs.lib}"/>
<dependency prefix="spotbugs.commons-text" artifact="org.apache.commons:commons-text:1.10.0" usage="${spotbugs.lib}"/>
<dependency prefix="spotbugs.commons-codec" artifact="commons-codec:commons-codec:1.11" usage="${spotbugs.lib}"/>
<dependency prefix="spotbugs.commons-logging" artifact="commons-logging:commons-logging:1.2" usage="${spotbugs.lib}"/>
<dependency prefix="spotbugs.jcip-annotations" artifact="net.jcip:jcip-annotations:1.0" usage="${spotbugs.lib}"/>
<dependency prefix="spotbugs.icu4j" artifact="com.ibm.icu:icu4j:68.2" usage="${spotbugs.lib}" target="icu4j-68.2.jar"/>
<dependency prefix="spotbugs.log4j-api" artifact="org.apache.logging.log4j:log4j-api:2.25.2" usage="${spotbugs.lib}"/>
<dependency prefix="spotbugs.log4j-core" artifact="org.apache.logging.log4j:log4j-core:2.25.2" usage="${spotbugs.lib}"/>
<dependency prefix="spotbugs.log4j-slf4j18-impl" artifact="org.apache.logging.log4j:log4j-slf4j2-impl:2.25.2" usage="${spotbugs.lib}"/>
<dependency prefix="spotbugs.saxon" artifact="net.sf.saxon:Saxon-HE:12.9" usage="${spotbugs.lib}"/>
<dependency prefix="spotbugs.xmlresolver" artifact="org.xmlresolver:xmlresolver:5.2.2" usage="${spotbugs.lib}"/>
<dependency prefix="spotbugs.log4j-api" artifact="org.apache.logging.log4j:log4j-api:2.17.2" usage="${spotbugs.lib}"/>
<dependency prefix="spotbugs.log4j-core" artifact="org.apache.logging.log4j:log4j-core:2.17.2" usage="${spotbugs.lib}"/>
<dependency prefix="spotbugs.log4j-slf4j18-impl" artifact="org.apache.logging.log4j:log4j-slf4j18-impl:2.17.2" usage="${spotbugs.lib}"/>
<dependency prefix="spotbugs.saxon" artifact="net.sf.saxon:Saxon-HE:11.5" usage="${spotbugs.lib}"/>
<dependency prefix="spotbugs.xmlresolver" artifact="org.xmlresolver:xmlresolver:4.2.0" usage="${spotbugs.lib}"/>
<mkdir dir="${basedir}${spotbugs.lib}/config"/>
@ -2608,10 +2634,9 @@ under the License.
<downloadfile src="${spotbugs.jaxen.url}" dest="${spotbugs.jaxen.jar}"/>
<downloadfile src="${spotbugs.bcel.url}" dest="${spotbugs.bcel.jar}"/>
<downloadfile src="${spotbugs.slf4j-api.url}" dest="${spotbugs.slf4j-api.jar}"/>
<downloadfile src="${spotbugs.commons-lang.url}" dest="${spotbugs.commons-lang.jar}"/>
<downloadfile src="${spotbugs.commons-lang3.url}" dest="${spotbugs.commons-lang3.jar}"/>
<downloadfile src="${spotbugs.commons-text.url}" dest="${spotbugs.commons-text.jar}"/>
<downloadfile src="${spotbugs.commons-codec.url}" dest="${spotbugs.commons-codec.jar}"/>
<downloadfile src="${spotbugs.commons-io.url}" dest="${spotbugs.commons-io.jar}"/>
<downloadfile src="${spotbugs.commons-logging.url}" dest="${spotbugs.commons-logging.jar}"/>
<downloadfile src="${spotbugs.jcip-annotations.url}" dest="${spotbugs.jcip-annotations.jar}"/>
<downloadfile src="${spotbugs.jsr305.url}" dest="${spotbugs.jsr305.jar}"/>
@ -2668,7 +2693,6 @@ under the License.
<auxClasspath path="${ooxml.curvesapi.jar}" />
<auxClasspath path="${ooxml.xmlbeans.jar}" />
<auxClasspath path="${ooxml.commons-compress.jar}" />
<auxClasspath path="${ooxml.commons-lang3.jar}" />
<auxClasspath path="${main.commons-collections4.jar}" />
<auxClasspath path="${main.commons-math3.jar}" />
<auxClasspath path="${main.commons-io.jar}" />
@ -2710,7 +2734,6 @@ under the License.
<auxClasspath path="${svg.xml-apis-ext.jar}"/>
<auxClasspath path="${svg.xmlgraphics-commons.jar}"/>
<auxClasspath path="${pdf.pdfbox.jar}"/>
<auxClasspath path="${pdf.pdfbox.io.jar}"/>
<auxClasspath path="${pdf.fontbox.jar}"/>
<auxClasspath path="${pdf.graphics2d.jar}"/>
<sourcePath path="poi/src/main/java" />
@ -2799,6 +2822,286 @@ under the License.
</openpgp:signer>
</target>
<target name="dist-nexus" depends="load-maven-server-settings,dist-checksum"
description="upload build artifacts to nexus">
<delete dir="build/repo"/>
<delete dir="build/nexus-stage"/>
<nexus-upload artifactId="poi"/>
<nexus-upload artifactId="poi-examples"/>
<nexus-upload artifactId="poi-excelant"/>
<nexus-upload artifactId="poi-ooxml"/>
<nexus-upload artifactId="poi-ooxml-lite"/>
<nexus-upload artifactId="poi-ooxml-full"/>
<nexus-upload artifactId="poi-scratchpad"/>
</target>
<macrodef name="nexus-upload">
<attribute name="artifactId"/>
<sequential>
<local name="repo"/>
<property name="repo" location="build/repo/@{artifactId}"/>
<copy todir="${repo}">
<mappedresources>
<!-- add sha-512 when nexus rules are updated (1/2) -->
<fileset dir="build/dist/maven" includes="@{artifactId}/**" excludes="**/*.sha512,**/*.sha256"/>
<regexpmapper from="^([^/]+)/(.*)$$" to="org/apache/poi/\1/${version.id}/\2" handledirsep="true"/>
</mappedresources>
</copy>
<local name="lastUpdated"/>
<tstamp>
<format property="lastUpdated" pattern="yyyyMMddHHmmss" timezone="UTC"/>
</tstamp>
<local name="metadir"/>
<property name="metadir" location="${repo}/org/apache/poi/@{artifactId}"/>
<echo file="${metadir}/maven-metadata.xml"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<groupId>org.apache.poi</groupId>
<artifactId>@{artifactId}</artifactId>
<versioning>
<latest>${version.id}</latest>
<release>${version.id}</release>
<versions>
<version>${version.id}</version>
</versions>
<lastUpdated>${lastUpdated}</lastUpdated>
</versioning>
</metadata>]]></echo>
<fixcrlf srcdir="${metadir}" includes="maven-metadata.xml" eol="unix" eof="remove" />
<!-- add sha-512 when nexus rules are updated (2/2) -->
<!--checksum algorithm="SHA-512" fileext=".sha512" format="MD5SUM">
<fileset dir="${metadir}" includes="maven-metadata.xml"/>
</checksum-->
<checksum algorithm="sha1" format="MD5SUM">
<fileset dir="${metadir}" includes="maven-metadata.xml"/>
</checksum>
<checksum algorithm="md5" format="MD5SUM">
<fileset dir="${metadir}" includes="maven-metadata.xml"/>
</checksum>
<fixcrlf srcDir="${metadir}" includes="*.md5,*.sha1,*.sha256,*.sha512" eol="unix"/>
<downloadfile src="${dist.nexus-staging.url}" dest="${dist.nexus-staging.jar}"/>
<taskdef uri="antlib:org.sonatype.nexus.ant.staging" resource="org/sonatype/nexus/ant/staging/antlib.xml">
<classpath><pathelement path="${dist.nexus-staging.jar}"/></classpath>
</taskdef>
<staging:stageLocally description="@{artifactId} ${version.id}">
<staging:nexusStagingInfo stagingDirectory="build/nexus-stage/@{artifactId}"/>
<fileset dir="${repo}" />
</staging:stageLocally>
<!-- if this throws a "... dh keypair ..." exception, use Java 7+ for executing the task -->
<staging:stageRemotely description="@{artifactId} ${version.id}">
<staging:nexusStagingInfo stagingDirectory="build/nexus-stage/@{artifactId}">
<staging:projectInfo groupId="org.apache.poi" artifactId="@{artifactId}" version="${version.id}" />
<staging:connectionInfo baseUrl="https://repository.apache.org/">
<staging:authentication username="${settings.apache-id.username}" password="${settings.apache-id.password}" />
</staging:connectionInfo>
</staging:nexusStagingInfo>
</staging:stageRemotely>
</sequential>
</macrodef>
<target name="-init-svn" depends="init,fetch-svn-jars,load-maven-server-settings">
<!-- JAVA_HOME needs to point to a JRE/JDK7+, otherwise the svn/https connection throws a "Could not generate DH keypair"-->
<fail message="Environment needs to point to Java 8+">
<condition>
<or>
<equals arg1="${ant.java.version}" arg2="1.7"/>
<equals arg1="${ant.java.version}" arg2="1.6"/>
<equals arg1="${ant.java.version}" arg2="1.5"/>
</or>
</condition>
</fail>
<path id="path.svnant">
<pathelement location="${dist.svnant.jar}"/>
<pathelement location="${dist.svnclientadapter-base.jar}"/>
<pathelement location="${dist.svnclientadapter-svnkit.jar}"/>
<pathelement location="${dist.svnclientadapter-javahl.jar}"/>
<pathelement location="${dist.svnkit.jar}"/>
<pathelement location="${dist.svnkit-javahl16.jar}"/>
<pathelement location="${dist.sqljet.jar}"/>
<pathelement location="${dist.antlr.jar}"/>
<pathelement location="${dist.sequence-library.jar}"/>
<pathelement location="${dist.lz4-java.jar}"/>
</path>
<taskdef resource="org/tigris/subversion/svnant/svnantlib.xml" classpathref="path.svnant"/>
<svnSetting
svnkit="true"
javahl="false"
username="${settings.apache-id.username}"
password="${settings.apache-id.password}"
id="svn.settings"
/>
</target>
<target name="release-prep0" depends="-init-svn" description="check to make sure the release tag doesn't exist yet">
<!-- verify that svn username/password are valid ... -->
<fail message="Unable to connect to SVN repo. Verify apache-id username and password. If these are correct, change the release-prep0 target to check over http, which would indicate a problem with your https setup.">
<condition>
<not><svnExists refid="svn.settings" target="https://svn.apache.org/repos/asf/poi/"/></not>
</condition>
</fail>
<!-- verify that the release tag that we're about to create in release-prep1 does not already exist (no overwriting tags!) -->
<fail message="Cannot create release tag. https://svn.apache.org/repos/asf/poi/tags/${RELEASE_TAG} already exists. Verify the requested release version (${version.id}).">
<condition>
<svnExists refid="svn.settings" target="https://svn.apache.org/repos/asf/poi/tags/${RELEASE_TAG}/"/>
</condition>
</fail>
</target>
<!-- experimental release preparation ... tbd. ... -->
<target name="release-prep1" depends="-init-svn,release-prep0" description="update the documentation and create the svn tag - needs Java7+">
<local name="tstamp_rel"/>
<local name="tstamp_next"/>
<local name="rel_next"/>
<tstamp>
<format property="tstamp_rel" pattern="yyyy-MM-dd" offset="7" unit="day"/>
<format property="tstamp_next" pattern="yyyy-MM" offset="3" unit="month"/>
</tstamp>
<taskdef name="NextRelease" classname="NextRelease" classpath="poi-excelant/build/poi-ant-contrib"/>
<NextRelease property="rel_next"/>
<antcall target="-update-build.xml">
<param name="version_id" value="${version.id}"/>
</antcall>
<replaceregexp byline="true">
<regexp pattern="&lt;release.*date=&quot;.*\?\?&quot;&gt;"/>
<substitution expression="&lt;!-- release version=&quot;${rel_next}&quot; date=&quot;${tstamp_next}-??&quot;&gt;&#10; &lt;/release --&gt;&#10;&#10; &lt;release version=&quot;${version.id}&quot; date=&quot;${tstamp_rel}&quot;&gt;"/>
<fileset dir="src/documentation/content/xdocs">
<include name="changes.xml"/>
</fileset>
</replaceregexp>
<fixcrlf srcdir="." includes="src/documentation/content/xdocs/changes.xml" eol="unix" eof="remove" />
<!-- can't combine updating and pinning of the documentation ... so we need two commits -->
<!-- (revision)properties can't be set and read within one svn block -->
<echo message="updating build.xml and changes.xml"/>
<exec command="svn ci --username ${settings.apache-id.username} --password ${settings.apache-id.password} -m 'release prepare for ${version.id} - updating build.xml and changes.xml' build.xml src/documentation/content/xdocs/changes.xml"/>
<svn refid="svn.settings">
<!--<commit message="release prepare for ${version.id} - updating build.xml and changes.xml" recurse="false">
<fileset dir="." includes="build.xml,src/documentation/content/xdocs/changes.xml"/>
</commit>-->
<update dir="." recurse="true"/>
<status path="." revisionProperty="svn_version1"/>
</svn>
<echo message="pin documentation - release ${svn_version1}"/>
<exec command="svn ci --username ${settings.apache-id.username} --password ${settings.apache-id.password} -m 'release prepare for ${version.id} - pin documentation' src"/>
<svn refid="svn.settings">
<propset path="src" name="svn:externals" value="documentation -r${svn_version1} https://svn.apache.org/repos/asf/poi/site/src/documentation"/>
<!-- <commit message="release prepare for ${version.id} - pin documentation" dir="src" recurse="false"/>-->
<update dir="." recurse="true"/>
<status path="." revisionProperty="svn_version2"/>
</svn>
<echo message="create release tag"/>
<svn refid="svn.settings">
<copy
srcUrl="https://svn.apache.org/repos/asf/poi/trunk"
destUrl="https://svn.apache.org/repos/asf/poi/tags/${RELEASE_TAG}"
message="tag r${svn_version2} as ${version.id}"/>
</svn>
<!-- update build.xml to the next snapshot version -->
<antcall target="-update-build.xml">
<param name="version_id" value="${rel_next}"/>
</antcall>
<!-- unpin documentation and commit next snapshot version -->
<svn refid="svn.settings">
<update dir="." recurse="true"/>
<propset path="src" name="svn:externals" value="documentation https://svn.apache.org/repos/asf/poi/site/src/documentation"/>
<!--<commit message="prepare for ${rel_next}" recurse="false">
<fileset dir="." includes="build.xml"/>
<dirset dir="src"/>
</commit>-->
</svn>
<exec command="svn ci --username ${settings.apache-id.username} --password ${settings.apache-id.password} -m 'prepare for ${rel_next}' build.xml src poi*"/>
<mkdir dir="build/release"/>
<svn refid="svn.settings">
<checkout url="https://svn.apache.org/repos/asf/poi/tags/${RELEASE_TAG}" destPath="build/release" ignoreExternals="false"/>
</svn>
</target>
<target name="release-prep2" depends="init" description="compile the freshly checked out svn tag and upload it to the nexus - needs a JDK6">
<!-- JAVA_HOME needs to point to a JDK8, otherwise the ant invocation is failing on a missing javac -->
<fail message="Environment needs to point to a Java 8 JDK">
<condition>
<not><equals arg1="${ant.java.version}" arg2="1.8"/></not>
</condition>
</fail>
<local name="DSTAMP"/>
<tstamp>
<format property="DSTAMP" pattern="yyyyMMdd" offset="7" unit="day"/>
</tstamp>
<ant dir="build/release" inheritAll="false" inheritRefs="false" useNativeBasedir="true">
<property name="DSTAMP" value="${DSTAMP}"/>
<target name="dist" />
</ant>
</target>
<target name="release-prep3" depends="-init-svn" description="write the dist to the release candidate repo - needs Java7+">
<ant dir="build/release" inheritAll="false" inheritRefs="false" useNativeBasedir="true">
<target name="dist-nexus" />
</ant>
<svn refid="svn.settings">
<import path="build/release/build/dist"
url="https://dist.apache.org/repos/dist/dev/poi"
newEntry="${version.id}-${release.rc}"
message="release candidate POI ${version.id}"/>
</svn>
</target>
<target name="release-finish" description="write the dist to the release candidate repo - needs Java7+">
<!--svn refid="svn.settings">
<update dir="." recurse="true"/>
</svn-->
<local name="rel_prev"/>
<local name="file_date"/>
<local name="file_date_iso"/>
<tstamp>
<!-- usually overwritten by a command line argument -->
<!-- for convenience this is kept in the same format as in the release-prep call -->
<format property="file_date" pattern="yyyyMMdd" locale="US"/>
</tstamp>
<taskdef name="NextRelease" classname="NextRelease" classpath="poi-excelant/build/poi-ant-contrib"/>
<NextRelease property="rel_prev" increment="-1"/>
<!-- we don't simply generate a new iso file date with tstamp,
but potentially use the date given as an argument to ant -->
<loadresource property="file_date_iso">
<string>${file_date}</string>
<filterchain>
<replaceregex pattern="([0-9]{4})([0-9]{2})([0-9]{2})" replace="\1-\2-\3"/>
</filterchain>
</loadresource>
<replaceregexp file="build.gradle" match="( +version += +)'[^']+'" replace="\1'${version.id}'"/>
<replaceregexp file="poi-examples/src/main/groovy/build.gradle" match="( *compile 'org.apache.poi:[^0-9]+)([0-9.]+)'" replace="\1${rel_prev}'" byline="true"/>
<replaceregexp file="poi-examples/src/main/scala/build.sbt" match='( *org.apache.poi.* ")[0-9.]+(.+)' replace="\1${rel_prev}\2" byline="true"/>
<replaceregexp file="osgi/pom.xml" match="version>${rel_prev}[^&lt;]+" replace="version>${version.id}"/>
<replaceregexp file="doap_POI.rdf" match="&lt;release&gt;" replace="&lt;release&gt;&#10; &lt;Version&gt;&#10; &lt;name&gt;Apache POI ${rel_prev}&lt;/name&gt;&#10; &lt;created&gt;${file_date_iso}&lt;/created&gt;&#10; &lt;revision&gt;${rel_prev}&lt;/revision&gt;&#10; &lt;/Version&gt;&#10; &lt;/release&gt;&#10; &lt;release&gt;"/>
</target>
<target name="-update-build.xml">
<replaceregexp byline="true">
<regexp pattern="(&lt;property name=&quot;version.id&quot; value=&quot;)[^&quot;]+(&quot;/>)"/>

View File

@ -35,48 +35,6 @@
<programming-language>Java</programming-language>
<category rdf:resource="https://projects.apache.org/category/content" />
<category rdf:resource="https://projects.apache.org/category/library" />
<release>
<Version>
<name>Apache POI 5.5.1</name>
<created>2025-11-30</created>
<revision>5.5.1</revision>
</Version>
</release>
<release>
<Version>
<name>Apache POI 5.5.0</name>
<created>2025-11-15</created>
<revision>5.5.0</revision>
</Version>
</release>
<release>
<Version>
<name>Apache POI 5.4.1</name>
<created>2025-04-06</created>
<revision>5.4.1</revision>
</Version>
</release>
<release>
<Version>
<name>Apache POI 5.4.0</name>
<created>2025-01-08</created>
<revision>5.4.0</revision>
</Version>
</release>
<release>
<Version>
<name>Apache POI 5.3.0</name>
<created>2024-07-02</created>
<revision>5.3.0</revision>
</Version>
</release>
<release>
<Version>
<name>Apache POI 5.2.5</name>
<created>2023-11-25</created>
<revision>5.2.5</revision>
</Version>
</release>
<release>
<Version>
<name>Apache POI 5.2.4</name>
@ -267,10 +225,10 @@
</Version>
</release>
<repository>
<GitRepository>
<location rdf:resource="https://github.com/apache/poi.git"/>
<browse rdf:resource="https://github.com/apache/poi/"/>
</GitRepository>
<SVNRepository>
<location rdf:resource="https://svn.apache.org/repos/asf/poi/"/>
<browse rdf:resource="https://svn.apache.org/viewvc/poi/"/>
</SVNRepository>
</repository>
<maintainer>
<foaf:Person>

View File

@ -1,11 +1,11 @@
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Less than 2G definitely slows things down. Increased to 3G due to OOM issues on ci-builds.apache.org.
# -XX:+HeapDumpOnOutOfMemoryError
org.gradle.jvmargs=-Xmx3G -Dfile.encoding=UTF-8
# Less than 2G definitely slows things down. -XX:+HeapDumpOnOutOfMemoryError
org.gradle.jvmargs=-Xmx2G -Dfile.encoding=UTF-8
# Activating will be much faster, but break the build of 'poi-ooxml-lite'
org.gradle.caching=true
# @todo: look into poi-ooxml-lite task generateModuleInfo and enforce running whatever is needed before
org.gradle.caching=false
# Modularise your project and enable parallel build
org.gradle.parallel=true

Binary file not shown.

View File

@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME

24
gradlew vendored
View File

@ -15,8 +15,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
##############################################################################
#
@ -57,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
@ -86,7 +84,7 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
@ -114,7 +112,7 @@ case "$( uname )" in #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH="\\\"\\\""
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
@ -147,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
@ -155,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
@ -204,16 +202,16 @@ fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Stop when "xargs" is not available.

186
gradlew.bat vendored
View File

@ -1,94 +1,92 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
:execute
@rem Setup the command line
set CLASSPATH=
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
:end
@rem End local scope for the variables with windows NT shell
if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

View File

@ -1,20 +1,3 @@
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
// This script is used as input to the Jenkins Job DSL plugin to create all the build-jobs that
// Apache POI uses on the public Jenkins instance at https://ci-builds.apache.org/job/POI/
//
@ -31,31 +14,42 @@ def xercesUrl = 'https://repo1.maven.org/maven2/xerces/xercesImpl/2.6.1/xercesIm
def xercesLib = './xercesImpl-2.6.1.jar'
def poijobs = [
[ name: 'POI-DSL-1.8',
jdk: '1.8',
trigger: 'H */12 * * *',
jenkinsLite: true,
disabled: true // JDK 8 is no longer supported by POI 6
[ name: 'POI-DSL-1.8', trigger: 'H */12 * * *', jenkinsLite: true
],
[ name: 'POI-DSL-1.8-branch-5.5.x',
jdk: '1.8',
branch: '5.5.x',
trigger: 'H */12 * * *',
jenkinsLite: true,
[ name: 'POI-DSL-OpenJDK', jdk: 'OpenJDK 1.8', trigger: 'H */12 * * *',
// only a limited set of nodes still have OpenJDK 8 (on Ubuntu) installed
slaves: 'ubuntu',
skipcigame: true,
jenkinsLite: true
],
[ name: 'POI-DSL-1.11', jdk: '1.11', trigger: triggerSundays, skipcigame: true
],
[ name: 'POI-DSL-1.15', jdk: '1.15', trigger: triggerSundays, skipcigame: true,
// let's save some CPU cycles here, 15 is not an LTS and JDK 16 is GA
disabled: true
],
[ name: 'POI-DSL-1.16', jdk: '1.16', trigger: triggerSundays, skipcigame: true,
// let's save some CPU cycles here, 16 is not an LTS and JDK 17 is GA
disabled: true
],
[ name: 'POI-DSL-1.17', jdk: '1.17', trigger: 'H */12 * * *', skipcigame: true
],
[ name: 'POI-DSL-1.21', jdk: '1.21', trigger: 'H */12 * * *', skipcigame: true
// Jenkins on ci-builds.apache.org does not support spotbugs with a new enough version of asm for Java18+
[ name: 'POI-DSL-1.18', jdk: '1.18', trigger: triggerSundays, skipcigame: true, skipSpotbugs: true,
// let's save some CPU cycles here, 18 is not a LTS and JDK 20 is out
disabled: true
],
[ name: 'POI-DSL-1.24', jdk: '1.24', trigger: triggerSundays, skipcigame: true,
// Jenkins on ci-builds.apache.org does not support spotbugs with a new enough version of asm for Java18+
[ name: 'POI-DSL-1.19', jdk: '1.19', trigger: triggerSundays, skipcigame: true, skipSpotbugs: true
],
[ name: 'POI-DSL-1.25', jdk: '1.25', trigger: triggerSundays, skipcigame: true, skipSpotbugs: true,
// use Ant for building until Gradle supports JDK 25
// see https://docs.gradle.org/current/userguide/compatibility.html
// and https://github.com/gradle/gradle/issues/31625
useAnt: true
// Jenkins on ci-builds.apache.org does not support spotbugs with a new enough version of asm for Java18+
[ name: 'POI-DSL-1.20', jdk: '1.20', trigger: triggerSundays, skipcigame: true, skipSpotbugs: true
],
// Jenkins on ci-builds.apache.org does not support spotbugs with a new enough version of asm for Java18+
[ name: 'POI-DSL-1.21', jdk: '1.21', trigger: 'H */12 * * *', skipcigame: true, skipSpotbugs: true
],
// Jenkins on ci-builds.apache.org does not support spotbugs with a new enough version of asm for Java18+
[ name: 'POI-DSL-1.22', jdk: '1.22', trigger: triggerSundays, skipcigame: true, skipSpotbugs: true
],
// Use Ant-build for now as selecting IBM JDK via toolchain does not work (yet)
[ name: 'POI-DSL-IBM-JDK', jdk: 'IBMJDK', trigger: triggerSundays, skipcigame: true, useAnt: true
@ -66,11 +60,17 @@ def poijobs = [
// the property triggers using Xerces as XML Parser and previously showed some exception that can occur
properties: ["-Dadditionaljar=${xercesLib}"]
],
// [ name: 'POI-DSL-Maven', trigger: 'H */4 * * *', maven: true,
// // not needed any more now that we use Gradle for SonarQube
// disabled: true
// ],
[ name: 'POI-DSL-regenerate-javadoc', trigger: triggerSundays, javadoc: true
],
// it was impossible to make this run stable in Gradle, thus disabling this for now
[ name: 'POI-DSL-API-Check', trigger: '@daily', apicheck: true, disabled: true, useAnt: true
],
// [ name: 'POI-DSL-Gradle', trigger: triggerSundays, email: 'centic@apache.org'
// ],
[ name: 'POI-DSL-no-scratchpad', trigger: triggerSundays, noScratchpad: true
],
[ name: 'POI-DSL-saxon-test', trigger: triggerSundays, saxonTest: true
@ -80,30 +80,33 @@ def poijobs = [
// // replaced by Gradle-based build now
// disabled: true
// ],
[ name: 'POI-DSL-SonarQube-Gradle', jdk: '1.17', trigger: 'H 7 * * *', sonar: true, skipcigame: true
[ name: 'POI-DSL-SonarQube-Gradle', jdk: '1.11', trigger: 'H 7 * * *', sonar: true, skipcigame: true
],
[ name: 'POI-DSL-Windows-1.8',
trigger: 'H */12 * * *',
windows: true,
slaves: 'Windows',
jenkinsLite: true,
disabled: true // JDK 8 is no longer supported by POI 6
[ name: 'POI-DSL-Windows-1.8', trigger: 'H */12 * * *', windows: true, slaves: 'Windows', jenkinsLite: true
],
[ name: 'POI-DSL-Windows-1.11', jdk: '1.11', trigger: triggerSundays, windows: true, slaves: 'Windows',
jenkinsLite: true
],
[ name: 'POI-DSL-Windows-1.15', jdk: '1.15', trigger: triggerSundays, windows: true, slaves: 'Windows', skipcigame: true,
// let's save some CPU cycles here, 14 is not an LTS and JDK 15 is GA as of 15 September 2020
disabled: true
],
[ name: 'POI-DSL-Windows-1.16', jdk: '1.16', trigger: triggerSundays, windows: true, slaves: 'Windows', skipcigame: true,
// let's save some CPU cycles here, 16 is not an LTS and JDK 17 is GA
disabled: true
],
[ name: 'POI-DSL-Windows-1.17', jdk: '1.17', trigger: 'H */12 * * *', windows: true, slaves: 'Windows', skipcigame: true
],
[ name: 'POI-DSL-Windows-1.18', jdk: '1.18', trigger: triggerSundays, windows: true, slaves: 'Windows', skipcigame: true,
skipSpotbugs: true,
// let's save some CPU cycles here, 18 is not an LTS and JDK 20 is out
disabled: true
],
[ name: 'POI-DSL-Windows-1.20', jdk: '1.20', trigger: triggerSundays, windows: true, slaves: 'Windows', skipcigame: true
],
[ name: 'POI-DSL-Windows-1.21', jdk: '1.21', trigger: 'H */12 * * *', windows: true, slaves: 'Windows', skipcigame: true
],
[ name: 'POI-DSL-Windows-1.24', jdk: '1.24', trigger: triggerSundays, windows: true, slaves: 'Windows', skipcigame: true,
],
[ name: 'POI-DSL-Windows-1.25', jdk: '1.25', trigger: triggerSundays, windows: true, slaves: 'Windows', skipcigame: true,
skipSpotbugs: true,
// use Ant for building until Gradle supports JDK 24
// see https://docs.gradle.org/current/userguide/compatibility.html
// and https://github.com/gradle/gradle/issues/31625
useAnt: true
[ name: 'POI-DSL-Windows-1.22', jdk: '1.22', trigger: triggerSundays, windows: true, slaves: 'Windows', skipcigame: true
],
[ name: 'POI-DSL-Github-PullRequests', trigger: '', skipcigame: true, disabled: true
],
@ -114,25 +117,37 @@ def xmlbeansjobs = [
],
[ name: 'POI-XMLBeans-DSL-1.11', jdk: '1.11', trigger: triggerSundays, skipcigame: true,
],
[ name: 'POI-XMLBeans-DSL-1.16', jdk: '1.16', trigger: triggerSundays, skipcigame: true,
// let's save some CPU cycles here, 16 is not an LTS and JDK 17 is GA
disabled: true
],
[ name: 'POI-XMLBeans-DSL-1.17', jdk: '1.17', trigger: 'H */12 * * *', skipcigame: true,
],
[ name: 'POI-XMLBeans-DSL-1.18', jdk: '1.18', trigger: triggerSundays, skipcigame: true,
// let's save some CPU cycles here, 18 is not an LTS and JDK 20 is out
disabled: true
],
[ name: 'POI-XMLBeans-DSL-1.19', jdk: '1.19', trigger: triggerSundays, skipcigame: true,
// let's save some CPU cycles here, 19 is not an LTS
disabled: true
],
[ name: 'POI-XMLBeans-DSL-1.20', jdk: '1.20', trigger: triggerSundays, skipcigame: true,
],
[ name: 'POI-XMLBeans-DSL-1.21', jdk: '1.21', trigger: 'H */12 * * *', skipcigame: true,
],
[ name: 'POI-XMLBeans-DSL-1.24', jdk: '1.24', trigger: triggerSundays, skipcigame: true,
disabled: true
[ name: 'POI-XMLBeans-DSL-1.22', jdk: '1.22', trigger: triggerSundays, skipcigame: true,
],
[ name: 'POI-XMLBeans-DSL-1.25', jdk: '1.25', trigger: triggerSundays, skipcigame: true,
[ name: 'POI-XMLBeans-DSL-1.20', jdk: '1.20', trigger: triggerSundays, skipcigame: true,
],
[ name: 'POI-XMLBeans-DSL-Sonar', jdk: '1.17', trigger: triggerSundays, skipcigame: true,
[ name: 'POI-XMLBeans-DSL-Sonar', jdk: '1.11', trigger: triggerSundays, skipcigame: true,
sonar: true
]
]
def gitBase = 'https://github.com/apache/poi.git'
def xmlbeansGitBase = 'https://github.com/apache/xmlbeans.git'
def svnBase = 'https://svn.apache.org/repos/asf/poi/trunk'
def xmlbeansSvnBase = 'https://svn.apache.org/repos/asf/xmlbeans/trunk'
def defaultJdk = '1.11'
def defaultBranch = 'trunk'
def defaultJdk = '1.8'
def defaultTrigger = 'H/15 * * * *' // check SCM every 60/15 = 4 minutes
def defaultEmail = 'dev@poi.apache.org'
def defaultAnt = 'ant_1.10_latest'
@ -144,12 +159,16 @@ def defaultSlaves = '(ubuntu)&&!beam&&!cloud-slave&&!H29'
def jdkMapping = [
'1.8': [ jenkinsJdk: 'jdk_1.8_latest', jdkVersion: 8, jdkVendor: '' ],
'1.11': [ jenkinsJdk: 'jdk_11_latest', jdkVersion: 11, jdkVendor: '' ],
'1.15': [ jenkinsJdk: 'jdk_15_latest', jdkVersion: 15, jdkVendor: '' ],
'1.16': [ jenkinsJdk: 'jdk_16_latest', jdkVersion: 16, jdkVendor: '' ],
'1.17': [ jenkinsJdk: 'jdk_17_latest', jdkVersion: 17, jdkVendor: '' ],
'1.18': [ jenkinsJdk: 'jdk_18_latest', jdkVersion: 18, jdkVendor: '' ],
'1.19': [ jenkinsJdk: 'jdk_19_latest', jdkVersion: 19, jdkVendor: '' ],
'1.20': [ jenkinsJdk: 'jdk_20_latest', jdkVersion: 20, jdkVendor: '' ],
'1.21': [ jenkinsJdk: 'jdk_21_latest', jdkVersion: 21, jdkVendor: '' ],
'1.24': [ jenkinsJdk: 'jdk_24_latest', jdkVersion: 24, jdkVendor: '' ],
'1.25': [ jenkinsJdk: 'jdk_25_latest', jdkVersion: 25, jdkVendor: '' ],
// one of the few IBM JDKs that is still supported on ci-builds.apache.org
'IBMJDK': [ jenkinsJdk: 'ibm_semeru_21.0.2_13', jdkVersion: 21, jdkVendor: 'ibm' ]
'1.22': [ jenkinsJdk: 'jdk_22_latest', jdkVersion: 22, jdkVendor: '' ],
'OpenJDK 1.8': [ jenkinsJdk: 'adoptopenjdk_hotspot_8u282', jdkVersion: 8, jdkVendor: 'adoptopenjdk' ],
'IBMJDK': [ jenkinsJdk: 'ibmjdk_1.8.0_261', jdkVersion: 8, jdkVendor: 'ibm' ]
]
static def shellEx(def context, String cmd, def poijob) {
@ -167,7 +186,7 @@ Apache POI - the Java API for Microsoft Documents
</p>
<p>
<b>This is an automatically generated Job Config, do not edit it here!
Instead change the Jenkins Job DSL at <a href="https://github.com/apache/poi/blob/trunk/jenkins/">https://github.com/apache/poi/blob/trunk/jenkins/</a>,
Instead change the Jenkins Job DSL at <a href="https://svn.apache.org/repos/asf/poi/trunk/jenkins">https://svn.apache.org/repos/asf/poi/trunk/jenkins</a>,
see <a href="https://github.com/jenkinsci/job-dsl-plugin/wiki">https://github.com/jenkinsci/job-dsl-plugin/wiki</a>
for more details about the DSL.</b>
</p>'''
@ -197,9 +216,10 @@ def shellCmdsUnix =
rm -rf examples excelant integrationtest main ooxml ooxml-schema scratchpad build.javacheck.xml
# show which files are currently modified in the working copy
git status || true
svn status || true
# make sure no changed module-class-files or ooxml-lite-report-files are lingering on
git reset --hard || true
svn revert poi*/src/*/java9/module-info.* || true
svn revert src/resources/ooxml-lite-report.* || true
# print out information about which exact version of java we are using
echo Java-Home: $JAVA_HOME
@ -232,9 +252,11 @@ exit 0'''
def shellCmdsWin =
'''@echo off
:: show which files are currently modified in the working copy
git status
svn status
:: make sure no changed module-class-files are lingering on
git reset --hard
svn revert poi*\\src\\*\\java9\\module-info.*
:: also revert some files directly as the wildcard-based revert seems to fail sometimes
svn revert poi\\src\\main\\java9\\module-info.class poi\\src\\test\\java9\\module-info.class poi-examples\\src\\main\\java9\\module-info.class poi-excelant\\src\\main\\java9\\module-info.class poi-excelant\\src\\test\\java9\\module-info.class poi-integration\\src\\test\\java9\\module-info.class poi-ooxml\\src\\main\\java9\\module-info.class poi-ooxml\\src\\test\\java9\\module-info.class poi-ooxml-full\\src\\main\\java9\\module-info.class poi-ooxml-lite\\src\\main\\java9\\module-info.class poi-ooxml-lite\\src\\main\\java9\\module-info.java poi-ooxml-lite-agent\\src\\main\\java9\\module-info.class poi-scratchpad\\src\\main\\java9\\module-info.class poi-scratchpad\\src\\test\\java9\\module-info.class src\\resources\\ooxml-lite-report.clazz src\\resources\\ooxml-lite-report.xsb
:: print out information about which exact version of java we are using
echo Java-Home: %JAVA_HOME%
@ -252,7 +274,6 @@ poijobs.each { poijob ->
def email = poijob.email ?: defaultEmail
def slaves = poijob.slaves ?: defaultSlaves + (poijob.slaveAdd ?: '')
def antRT = poijob.windows ? defaultAntWindows : defaultAnt
def checkoutBranch = poijob.branch ?: defaultBranch
job('POI/' + poijob.name) {
if (poijob.disabled) {
@ -297,11 +318,9 @@ poijobs.each { poijob ->
}
jdk(jdkMapping.get(jdkKey).jenkinsJdk)
scm {
git {
remote {
url(gitBase)
}
branch("*/${checkoutBranch}")
svn(svnBase) { svnNode ->
svnNode / browser(class: 'hudson.scm.browsers.ViewSVN') /
url << 'https://svn.apache.org/viewcvs.cgi/?root=Apache-SVN'
}
}
checkoutRetryCount(3)
@ -339,7 +358,7 @@ poijobs.each { poijob ->
gradle {
switches('-PenableSonar')
switches('-Dsonar.token=${POI_SONAR_TOKEN}')
switches('-Dsonar.login=${POI_SONAR_TOKEN}')
switches('-Dsonar.organization=apache')
switches('-Dsonar.projectKey=poi-parent')
switches('-Dsonar.host.url=https://sonarcloud.io')
@ -350,7 +369,7 @@ poijobs.each { poijob ->
tasks('clean')
tasks('check')
tasks('jacocoTestReport')
tasks('sonar')
tasks('sonarqube')
useWrapper(true)
}
}
@ -439,7 +458,7 @@ poijobs.each { poijob ->
}
}
// in archive, junit and jacoco publishers, matches beneath build/*/build/... are for Gradle-build results
archiveArtifacts('build/dist/*.zip,build/dist/*.tgz,build/dist/maven/*/*.jar,build/dist/maven/*/*.pom,build/dist/maven/*/*.asc,build/dist/maven/*/*.sha256,build/dist/maven/*/*.sha512,build/coverage/**,*/build/reports/*.bom.*,build/hs_err*.log')
archiveArtifacts('build/dist/*.zip,build/dist/*.tgz,build/dist/maven/*/*.jar,build/coverage/**,*/build/reports/*.bom.*,build/hs_err*.log')
/* this plugin is currently missing on the Apache Jenkins instance
warnings(['Java Compiler (javac)', 'JavaDoc Tool'], null) {
resolveRelativePaths()
@ -490,8 +509,8 @@ xmlbeansjobs.each { xjob ->
label(slaves)
environmentVariables {
env('LANG', 'en_US.UTF-8')
if (jdkKey == '1.11' || jdkKey == '1.17' || jdkKey == '1.21'
|| jdkKey == '1.23' || jdkKey == '1.24' || jdkKey == '1.25') {
if (jdkKey == '1.11' || jdkKey == '1.15' || jdkKey == '1.16' || jdkKey == '1.17'
|| jdkKey == '1.18' || jdkKey == '1.19' || jdkKey == '1.20' || jdkKey == '1.21') {
env('ANT_OPTS', '--add-opens=java.xml/com.sun.org.apache.xerces.internal.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED')
}
// will be needed for forbidden-apis-check: env('ANT_HOME', xjob.windows ? 'f:\\jenkins\\tools\\ant\\latest' : '/usr/share/ant')
@ -514,11 +533,9 @@ xmlbeansjobs.each { xjob ->
}
jdk(jdkMapping.get(jdkKey).jenkinsJdk)
scm {
git {
remote {
url(xmlbeansGitBase)
}
branch('*/trunk')
svn(xmlbeansSvnBase) { svnNode ->
svnNode / browser(class: 'hudson.scm.browsers.ViewSVN') /
url << 'https://svn.apache.org/viewcvs.cgi/?root=Apache-SVN'
}
}
checkoutRetryCount(3)
@ -539,7 +556,7 @@ xmlbeansjobs.each { xjob ->
gradle {
if (xjob.sonar) {
switches('-PenableSonar')
switches('-Dsonar.token=${POI_SONAR_TOKEN}')
switches('-Dsonar.login=${POI_SONAR_TOKEN}')
switches('-Dsonar.organization=apache')
switches('-Dsonar.projectKey=apache_xmlbeans')
switches('-Dsonar.host.url=https://sonarcloud.io')
@ -552,7 +569,7 @@ xmlbeansjobs.each { xjob ->
tasks('jenkins')
tasks('jacocoTestReport')
if (xjob.sonar) {
tasks('sonar')
tasks('sonarqube')
}
useWrapper(true)
}
@ -611,19 +628,26 @@ Unfortunately we often see builds break because of changes/new machines...''')
}
axes {
jdk(
'jdk_8_latest',
'jdk_1.8_latest',
'jdk_11_latest',
/* don't look for JDKs that are out of support
'jdk_10_latest',
'jdk_12_latest',
'jdk_13_latest',
'jdk_14_latest',
'jdk_15_latest',
'jdk_16_latest',*/
'jdk_17_latest',
'jdk_18_latest',
'jdk_19_latest',
'jdk_20_latest',
'jdk_21_latest',
'jdk_23_latest',
'jdk_24_latest',
'jdk_25_latest',
'jdk_26_latest',
'ibm_semeru_21.0.2_13'
'jdk_22_latest',
'adoptopenjdk_hotspot_8u282',
'ibmjdk_1.8.0_261'
)
// Note H50 is reserved according to its node-description
label('Nodes','builds22','builds23','builds24','builds25','builds26','builds27','builds28','builds29','builds30','builds31','builds32','builds33','builds34','builds35','builds36','builds37','builds38','builds39','builds40','builds50','builds56','builds57','builds58','builds59','builds60',
'jenkins-win-azr-1','jenkins-win-azr-2','jenkins-win-azr-3','jenkins-win-azr-4','jenkins-win-azr-5','jenkins-win-azr-6','jenkins-win-azr-7','jenkins-win-azr-8','jenkins-win-azr-10','jenkins-win-azr-11','jenkins-win-azr-12')
label('Nodes','builds22','builds23','builds24','builds25','builds26','builds27','builds28','builds29','builds30','builds31','builds32','builds33','builds34','builds35','builds36','builds37','builds38','builds39','builds40','builds50','builds56','builds57','builds58','builds59','builds60')
}
steps {
conditionalSteps {
@ -633,7 +657,7 @@ Unfortunately we often see builds break because of changes/new machines...''')
runner('DontRun')
steps {
shell(
'''which git || true
'''which svn || true
which javac
javac -version
echo '<?xml version="1.0"?><project name="POI Build" default="test"><target name="test"><echo>Using Ant: ${ant.version} from ${ant.home}</echo></target></project>' > build.xml
@ -675,3 +699,64 @@ echo ^<?xml version=^"1.0^"?^>^<project name=^"POI Build^" default=^"test^"^>^<t
}
}
}
/* I tried to put the view into a sub-folder/sub-view, but failed, there are multiple related
plugins so this is all a bit confusing :(, see also https://issues.apache.org/jira/browse/INFRA-14002
dashboardView("P/POI-new") {
columns {
status()
weather()
configureProject()
buildButton()
cronTrigger()
lastBuildConsole()
name()
lastSuccess()
lastFailure()
lastDuration()
//lastSuccessDescription()
jacoco()
}
description("<table>\n" +
" <tr>\n" +
" <td><img src=\"https://poi.apache.org/images/project-header.png\" /></td>\n" +
" <td> \n" +
" <p>Apache POI - the Java API for Microsoft Documents</p>\n" +
" <p><b>Most of the POI Jobs are automatically generated by Jenkins Job DSL\n" +
" at <a href=\"https://svn.apache.org/repos/asf/poi/trunk/jenkins\">https://svn.apache.org/repos/asf/poi/trunk/jenkins</a>,<br/>\n" +
" see <a href=\"https://github.com/jenkinsci/job-dsl-plugin/wiki\">https://github.com/jenkinsci/job-dsl-plugin/wiki</a>\n" +
" for more details about the DSL.</b>\n" +
" </p>\n" +
" <p>\n" +
" <b><a href=\"job/POI-DSL-1.8/lastSuccessfulBuild/findbugsResult/\" target=\"_blank\">Findbugs report of latest build</a></b> -\n" +
" <b><a href=\"https://sonarcloud.io/dashboard?id=poi-parent\" target=\"_blank\">Sonar reports</a></b> -\n" +
" <b><a href=\"job/POI-DSL-1.8/lastSuccessfulBuild/artifact/build/coverage/index.html\" target=\"_blank\">Coverage of latest build</a></b>\n" +
" </p>\n" +
" </td>\n" +
" </tr>\n" +
"</table>")
filterBuildQueue(false)
filterExecutors(false)
// Job selection
jobs {*/
//regex(/.*POI.*/)
/*}
// Layout
topPortlets {
jenkinsJobsList {
displayName('POI jobs')
}
}
leftPortlets {
testStatisticsChart()
}
rightPortlets {
testTrendChart()
}
bottomPortlets {
testStatisticsGrid()
buildStatistics()
}
}*/

View File

@ -1,5 +1,5 @@
Apache POI
Copyright 2003-2026 The Apache Software Foundation
Copyright 2003-2023 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (https://www.apache.org/).

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
lib.stored/svnant-1.3.1.jar Normal file

Binary file not shown.

View File

@ -25,11 +25,11 @@ Available in Maven Central: https://mvnrepository.com/artifact/net.sf.saxon/Saxo
3. Apache XML Security for Java, Bouncy Castle and XML Commons Resolver
These are required to sign or validate signed Office documents. The OSGi bundles are available in Maven Central:
- Apache XML Security for Java: https://mvnrepository.com/artifact/org.apache.santuario/xmlsec/3.0.6
- Apache XML Security for Java: https://mvnrepository.com/artifact/org.apache.santuario/xmlsec/3.0.3
- XML Commons Resolver: https://mvnrepository.com/artifact/xml-resolver/xml-resolver/1.2-osgi
- Bouncy Castle: https://mvnrepository.com/artifact/org.bouncycastle/bcprov-ext-jdk18on/1.82, https://mvnrepository.com/artifact/org.bouncycastle/bcpkix-jdk18on/1.82
- Bouncy Castle: https://mvnrepository.com/artifact/org.bouncycastle/bcprov-ext-jdk18on/1.77, https://mvnrepository.com/artifact/org.bouncycastle/bcpkix-jdk18on/1.77
4. PDFBox and PDFBox Graphics2D
Required to render to PDF documents.
The required jars can be downloaded from:

View File

@ -24,13 +24,13 @@
<groupId>org.apache.poi</groupId>
<artifactId>poi-bundle</artifactId>
<packaging>bundle</packaging>
<version>6.0.0-SNAPSHOT</version>
<version>5.2.5</version>
<name>Apache POI OSGi bundle</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<poi.version>6.0.0-SNAPSHOT</poi.version>
<pax.exam.version>4.14.0</pax.exam.version>
<poi.version>5.2.5</poi.version>
<pax.exam.version>4.12.0</pax.exam.version>
</properties>
<build>
@ -39,8 +39,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>11</source>
<target>11</target>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
@ -176,7 +176,7 @@
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
<version>4.13.2</version>
<version>4.13.1</version>
</dependency>
<!-- Pax Exam -->
@ -231,7 +231,7 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.25.3</version>
<version>2.21.1</version>
<scope>test</scope>
</dependency>
</dependencies>

View File

@ -35,6 +35,8 @@ dependencies {
implementation project(path: ':poi-scratchpad', configuration: 'archives')
}
implementation "org.apache.logging.log4j:log4j-api:${log4jVersion}"
testImplementation(project(path: ':poi-ooxml', configuration: 'tests')) {
if (NO_SCRATCHPAD) {
exclude group: 'org.apache.poi', module: 'poi-scratchpad'
@ -47,27 +49,27 @@ final String MODULE_NAME = 'org.apache.poi.examples'
final Pattern MODULE_REGEX = ~'\\.jar$'
final List MODULE_COMPILE_PATH = sourceSets.main.compileClasspath.findAll{ it.path =~ MODULE_REGEX }.collect{ it.parent }.unique()
tasks.register('compileJava9', JavaCompile) {
task compileJava9(type: JavaCompile) {
dependsOn 'compileJava', ':poi-ooxml:jar', ':poi-scratchpad:jar'
javaCompiler = javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(Math.max(11, jdkVersion))
}
sourceCompatibility = 11
targetCompatibility = 11
sourceCompatibility = 1.9
targetCompatibility = 1.9
destinationDirectory = file(JAVA9_OUT + VERSIONS9)
source = file(JAVA9_SRC)
classpath = files()
options.compilerArgs = [
'--patch-module', "${MODULE_NAME}=${sourceSets.main.output.classesDirs.asPath}",
'--module-path', files(MODULE_COMPILE_PATH).asPath
'--patch-module', "${MODULE_NAME}=${sourceSets.main.output.classesDirs.asPath}",
'--module-path', files(MODULE_COMPILE_PATH).asPath
]
}
jar {
dependsOn compileJava9
destinationDirectory = file("../build/dist/maven/${base.archivesName.get()}")
destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}")
manifest {
attributes('Automatic-Module-Name': MODULE_NAME, 'Multi-Release': 'true')

View File

@ -36,7 +36,7 @@ WorkbookFactory.create(f,null,true).withCloseable { workbook ->
def sheet = workbook.getSheetAt(sheetNum)
sheet.each { row ->
def nonEmptyCells = row.grep { c -> c.getCellType() != CellType.BLANK }
def nonEmptyCells = row.grep { c -> c.getCellType() != Cell.CELL_TYPE_BLANK }
println " Row ${row.getRowNum()} has ${nonEmptyCells.size()} non-empty cells:"
nonEmptyCells.each { c ->
def cRef = [c] as CellReference
@ -52,7 +52,7 @@ WorkbookFactory.create(f,null,true).withCloseable { workbook ->
ns1.createRow(1).createCell(0).setCellValue("TODO - Populate with data")
Sheet ns2 = workbook.createSheet("Generated 2")
exportHeader(ns2, headerStyle, "This is a demo sheet",
exportHeader(ns2, headerStyle, "This is a demo sheet",
["ID","Title","Date","Author","Num"] as String[])
ns2.createRow(2).createCell(0).setCellValue(1)
ns2.createRow(3).createCell(0).setCellValue(4)

View File

@ -21,11 +21,10 @@ apply plugin: 'groovy'
repositories {
mavenCentral()
}
dependencies {
implementation 'org.codehaus.groovy:groovy-all:2.4.21'
implementation 'org.apache.poi:poi:5.3.0'
implementation 'org.apache.poi:poi-ooxml:5.3.0'
compile 'org.codehaus.groovy:groovy-all:2.4.21'
compile 'org.apache.poi:poi:5.2.2'
compile 'org.apache.poi:poi-ooxml:5.2.2'
}
// Our files are in the current directory
@ -34,11 +33,11 @@ sourceSets {
}
// Run out read demo by default
tasks.withType(JavaExec).configureEach {
classpath = sourceSets.main.runtimeClasspath
tasks.withType(JavaExec) {
classpath = sourceSets.main.runtimeClasspath
}
tasks.register('runScript', JavaExec) {
task runScript(type: JavaExec) {
mainClass = "SpreadSheetDemo"
args = ["../../../../test-data/spreadsheet/Simple.xls"]
args = ["../../../test-data/spreadsheet/Simple.xls"]
}
defaultTasks 'runScript'

View File

@ -1 +0,0 @@
// empty file required to have a standalone build

View File

@ -21,7 +21,7 @@ package org.apache.poi.examples.crypt;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.security.GeneralSecurityException;
import java.util.Optional;
import java.util.function.Predicate;
@ -72,7 +72,7 @@ public final class OOXMLPasswordsTry {
};
// Try each password in turn, reporting progress
try (Stream<String> lines = Files.lines(Path.of(words))) {
try (Stream<String> lines = Files.lines(Paths.get(words))) {
Optional<String> found = lines.filter(counter).filter(w -> isValid(d, w)).findFirst();
System.out.println(found.map(s -> "Password found: " + s).orElse("Error - No password matched"));
}

View File

@ -253,10 +253,6 @@ public class XLS2CSVmra implements HSSFListener {
// Format
thisStr = formatListener.formatNumberDateCell(numrec);
if (thisStr.contains(",")) {
thisStr = '"' + thisStr + '"';
}
break;
case RKRecord.sid:
RKRecord rkrec = (RKRecord) record;

View File

@ -16,21 +16,15 @@
==================================================================== */
package org.apache.poi.ss.usermodel;
package org.apache.poi.examples.hssf.usermodel;
import org.apache.poi.util.Removal;
/**
* The CellPropertyCategory enum represents the different categories of cell properties.
* Each category is used to classify and organize the cell properties based on their characteristics.
*
* @since 5.4.0
* Placeholder Class - this is now handled in the Common SS example
* @deprecated in 5.1.0 - use {@link org.apache.poi.examples.ss.AddDimensionedImage}
*/
public enum CellPropertyCategory {
SHORT,
COLOR,
INT,
BOOL,
BORDER_TYPE,
OTHER
}
@Removal(version="6.0.0")
@Deprecated
public class AddDimensionedImage extends org.apache.poi.examples.ss.AddDimensionedImage {
}

View File

@ -23,6 +23,7 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
@ -31,7 +32,6 @@ import org.apache.poi.hssf.usermodel.HSSFRichTextString;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.logging.PoiLogManager;
/**
* This class contains code that demonstrates how to insert plain, numbered
@ -50,7 +50,7 @@ import org.apache.poi.logging.PoiLogManager;
*/
@SuppressWarnings({"java:S106","java:S4823"})
public class InCellLists {
private static final Logger LOG = PoiLogManager.getLogger(InCellLists.class);
private static final Logger LOG = LogManager.getLogger(InCellLists.class);
// This character looks like a solid, black, loser case letter 'o'

View File

@ -22,12 +22,12 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.logging.PoiLogManager;
/**
* Creates outlines.
@ -35,7 +35,7 @@ import org.apache.poi.logging.PoiLogManager;
public class Outlines implements Closeable {
public static void main(String[] args)
throws IOException, IllegalAccessException, InvocationTargetException, NoSuchMethodException {
Logger LOGGER = PoiLogManager.getLogger(Outlines.class);
Logger LOGGER = LogManager.getLogger(Outlines.class);
for (int i=1; i<=13; i++) {
try (Outlines o = new Outlines()) {
String log = (String) Outlines.class.getDeclaredMethod("test" + i).invoke(o);

View File

@ -59,7 +59,7 @@ public final class Word2Forrest
{
Paragraph p = r.getParagraph (x);
String text = p.text ();
if (text.trim().isEmpty())
if (text.trim ().length () == 0)
{
continue;
}

View File

@ -22,7 +22,7 @@ package org.apache.poi.examples.ss;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
@ -95,7 +95,7 @@ public final class ConditionalFormats {
if (wb instanceof XSSFWorkbook) {
file += "x";
}
try (OutputStream out = Files.newOutputStream(Path.of(file))) {
try (OutputStream out = Files.newOutputStream(Paths.get(file))) {
wb.write(out);
}
System.out.println("Generated: " + file);
@ -203,7 +203,7 @@ public final class ConditionalFormats {
if (rn%10 == 0) {
str = str + "x10 ";
}
if (str.isEmpty()) {
if (str.length() == 0) {
str = "nothing special...";
}
r.createCell(1).setCellValue("It is " + str);

View File

@ -28,8 +28,8 @@ import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.util.ArrayList;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.poi.logging.PoiLogManager;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellType;
import org.apache.poi.ss.usermodel.DataFormatter;
@ -134,7 +134,7 @@ import org.apache.poi.ss.usermodel.WorkbookFactory;
*/
@SuppressWarnings({"java:S106","java:S4823","java:S1192"})
public class ToCSV {
private static final Logger LOG = PoiLogManager.getLogger(ToCSV.class);
private static final Logger LOG = LogManager.getLogger(ToCSV.class);
private Workbook workbook;
private ArrayList<ArrayList<String>> csvData;

View File

@ -23,7 +23,7 @@ import org.apache.poi.util.DefaultTempFileCreationStrategy;
import org.apache.poi.util.TempFile;
import java.io.File;
import java.nio.file.Path;
import java.nio.file.Paths;
public final class TempFileUtils {
private TempFileUtils() {
@ -31,7 +31,7 @@ public final class TempFileUtils {
@SuppressWarnings("java:S106")
public static void checkTempFiles() {
File tempDir = Path.of(System.getProperty(TempFile.JAVA_IO_TMPDIR), DefaultTempFileCreationStrategy.POIFILES).toFile();
File tempDir = Paths.get(System.getProperty(TempFile.JAVA_IO_TMPDIR), DefaultTempFileCreationStrategy.POIFILES).toFile();
if(tempDir.exists()) {
String[] tempFiles = tempDir.list();
if(tempFiles != null && tempFiles.length > 0) {

View File

@ -1,251 +1,251 @@
/*
* ====================================================================
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ====================================================================
*/
package org.apache.poi.xslf.usermodel;
import java.awt.Rectangle;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URL;
import java.text.DecimalFormat;
import javax.imageio.ImageIO;
import javax.xml.namespace.QName;
import org.apache.poi.openxml4j.opc.PackagePart;
import org.apache.poi.openxml4j.opc.PackagePartName;
import org.apache.poi.openxml4j.opc.PackageRelationship;
import org.apache.poi.openxml4j.opc.PackagingURIHelper;
import org.apache.poi.openxml4j.opc.TargetMode;
import org.apache.poi.sl.usermodel.PictureData.PictureType;
import org.apache.xmlbeans.XmlCursor;
import org.openxmlformats.schemas.drawingml.x2006.main.CTHyperlink;
import org.openxmlformats.schemas.officeDocument.x2006.relationships.STRelationshipId;
import org.openxmlformats.schemas.presentationml.x2006.main.CTApplicationNonVisualDrawingProps;
import org.openxmlformats.schemas.presentationml.x2006.main.CTExtension;
import org.openxmlformats.schemas.presentationml.x2006.main.CTPicture;
import org.openxmlformats.schemas.presentationml.x2006.main.CTSlide;
import org.openxmlformats.schemas.presentationml.x2006.main.CTTLCommonMediaNodeData;
import org.openxmlformats.schemas.presentationml.x2006.main.CTTLCommonTimeNodeData;
import org.openxmlformats.schemas.presentationml.x2006.main.CTTimeNodeList;
import org.openxmlformats.schemas.presentationml.x2006.main.STTLTimeIndefinite;
import org.openxmlformats.schemas.presentationml.x2006.main.STTLTimeNodeFillType;
import org.openxmlformats.schemas.presentationml.x2006.main.STTLTimeNodeRestartType;
import org.openxmlformats.schemas.presentationml.x2006.main.STTLTimeNodeType;
import com.xuggle.mediatool.IMediaReader;
import com.xuggle.mediatool.MediaListenerAdapter;
import com.xuggle.mediatool.ToolFactory;
import com.xuggle.mediatool.event.IVideoPictureEvent;
import com.xuggle.xuggler.Global;
import com.xuggle.xuggler.IContainer;
import com.xuggle.xuggler.io.InputOutputStreamHandler;
/**
* Adding multiple videos to a slide
*
* need the Xuggler 5.4 jars:
* &lt;repositories&gt;
* &lt;repository&gt;
* &lt;id&gt;xuggle repo&lt;/id&gt;
* &lt;url&gt;http://xuggle.googlecode.com/svn/trunk/repo/share/java/&lt;/url&gt;
* &lt;/repository&gt;
* &lt;/repositories&gt;
* ...
* &lt;dependency&gt;
* &lt;groupId&gt;xuggle&lt;/groupId&gt;
* &lt;artifactId&gt;xuggle-xuggler&lt;/artifactId&gt;
* &lt;version&gt;5.4&lt;/version&gt;
* &lt;/dependency&gt;
*
* @see <a href="http://stackoverflow.com/questions/15197300/apache-poi-xslf-adding-movie-to-the-slide">Apache POI XSLF Adding movie to the slide</a>
* @see <a href="http://apache-poi.1045710.n5.nabble.com/Question-about-embedded-video-in-PPTX-files-tt5718461.html">Question about embedded video in PPTX files</a>
*/
public class AddVideoToPptx {
static DecimalFormat df_time = new DecimalFormat("0.####");
public static void main(String[] args) throws Exception {
URL video = new URL("http://archive.org/download/test-mpeg/test-mpeg.mpg");
// URL video = new URL("file:test-mpeg.mpg");
XMLSlideShow pptx = new XMLSlideShow();
// add video file
String videoFileName = video.getPath().substring(video.getPath().lastIndexOf('/')+1);
PackagePartName partName = PackagingURIHelper.createPartName("/ppt/media/"+videoFileName);
PackagePart part = pptx.getPackage().createPart(partName, "video/mpeg");
OutputStream partOs = part.getOutputStream();
InputStream fis = video.openStream();
byte buf[] = new byte[1024];
for (int readBytes; (readBytes = fis.read(buf)) != -1; partOs.write(buf, 0, readBytes));
fis.close();
partOs.close();
XSLFSlide slide1 = pptx.createSlide();
XSLFPictureShape pv1 = addPreview(pptx, slide1, part, 5, 50, 50);
addVideo(pptx, slide1, part, pv1, 5);
addTimingInfo(slide1, pv1);
XSLFPictureShape pv2 = addPreview(pptx, slide1, part, 9, 50, 250);
addVideo(pptx, slide1, part, pv2, 9);
addTimingInfo(slide1, pv2);
FileOutputStream fos = new FileOutputStream("pptx-with-video.pptx");
pptx.write(fos);
fos.close();
pptx.close();
}
static XSLFPictureShape addPreview(XMLSlideShow pptx, XSLFSlide slide1, PackagePart videoPart, double seconds, int x, int y) throws IOException {
// get preview after 5 sec.
IContainer ic = IContainer.make();
InputOutputStreamHandler iosh = new InputOutputStreamHandler(videoPart.getInputStream());
if (ic.open(iosh, IContainer.Type.READ, null) < 0) return null;
IMediaReader mediaReader = ToolFactory.makeReader(ic);
// stipulate that we want BufferedImages created in BGR 24bit color space
mediaReader.setBufferedImageTypeToGenerate(BufferedImage.TYPE_3BYTE_BGR);
ImageSnapListener isl = new ImageSnapListener(seconds);
mediaReader.addListener(isl);
// read out the contents of the media file and
// dispatch events to the attached listener
while (!isl.hasFired && mediaReader.readPacket() == null) ;
mediaReader.close();
ic.close();
// add snapshot
BufferedImage image1 = isl.image;
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ImageIO.write(image1, "jpeg", bos);
XSLFPictureData snap = pptx.addPicture(bos.toByteArray(), PictureType.JPEG);
XSLFPictureShape pic1 = slide1.createPicture(snap);
pic1.setAnchor(new Rectangle(x, y, image1.getWidth(), image1.getHeight()));
return pic1;
}
static void addVideo(XMLSlideShow pptx, XSLFSlide slide1, PackagePart videoPart, XSLFPictureShape pic1, double seconds) throws IOException {
// add video shape
PackagePartName partName = videoPart.getPartName();
PackageRelationship prsEmbed1 = slide1.getPackagePart().addRelationship(partName, TargetMode.INTERNAL, "http://schemas.microsoft.com/office/2007/relationships/media");
PackageRelationship prsExec1 = slide1.getPackagePart().addRelationship(partName, TargetMode.INTERNAL, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/video");
CTPicture xpic1 = (CTPicture)pic1.getXmlObject();
CTHyperlink link1 = xpic1.getNvPicPr().getCNvPr().addNewHlinkClick();
link1.setId("");
link1.setAction("ppaction://media");
// add video relation
CTApplicationNonVisualDrawingProps nvPr = xpic1.getNvPicPr().getNvPr();
nvPr.addNewVideoFile().setLink(prsExec1.getId());
CTExtension ext = nvPr.addNewExtLst().addNewExt();
// see http://msdn.microsoft.com/en-us/library/dd950140(v=office.12).aspx
ext.setUri("{DAA4B4D4-6D71-4841-9C94-3DE7FCFB9230}");
String p14Ns = "http://schemas.microsoft.com/office/powerpoint/2010/main";
try (XmlCursor cur = ext.newCursor()) {
cur.toEndToken();
cur.beginElement(new QName(p14Ns, "media", "p14"));
cur.insertNamespace("p14", p14Ns);
cur.insertAttributeWithValue(new QName(STRelationshipId.type.getName().getNamespaceURI(), "embed"), prsEmbed1.getId());
cur.beginElement(new QName(p14Ns, "trim", "p14"));
cur.insertAttributeWithValue("st", df_time.format(seconds*1000.0));
}
}
static void addTimingInfo(XSLFSlide slide1, XSLFPictureShape pic1) {
// add slide timing information, so video can be controlled
CTSlide xslide = slide1.getXmlObject();
CTTimeNodeList ctnl;
if (!xslide.isSetTiming()) {
CTTLCommonTimeNodeData ctn = xslide.addNewTiming().addNewTnLst().addNewPar().addNewCTn();
ctn.setDur(STTLTimeIndefinite.INDEFINITE);
ctn.setRestart(STTLTimeNodeRestartType.NEVER);
ctn.setNodeType(STTLTimeNodeType.TM_ROOT);
ctnl = ctn.addNewChildTnLst();
} else {
ctnl = xslide.getTiming().getTnLst().getParArray(0).getCTn().getChildTnLst();
}
CTTLCommonMediaNodeData cmedia = ctnl.addNewVideo().addNewCMediaNode();
cmedia.setVol(80000);
CTTLCommonTimeNodeData ctn = cmedia.addNewCTn();
ctn.setFill(STTLTimeNodeFillType.HOLD);
ctn.setDisplay(false);
ctn.addNewStCondLst().addNewCond().setDelay(STTLTimeIndefinite.INDEFINITE);
cmedia.addNewTgtEl().addNewSpTgt().setSpid(""+pic1.getShapeId());
}
static class ImageSnapListener extends MediaListenerAdapter {
final double SECONDS_BETWEEN_FRAMES;
final long MICRO_SECONDS_BETWEEN_FRAMES;
boolean hasFired = false;
BufferedImage image = null;
// The video stream index, used to ensure we display frames from one and
// only one video stream from the media container.
int mVideoStreamIndex = -1;
// Time of last frame write
long mLastPtsWrite = Global.NO_PTS;
public ImageSnapListener(double seconds) {
SECONDS_BETWEEN_FRAMES = seconds;
MICRO_SECONDS_BETWEEN_FRAMES =
(long)(Global.DEFAULT_PTS_PER_SECOND * SECONDS_BETWEEN_FRAMES);
}
@Override
public void onVideoPicture(IVideoPictureEvent event) {
if (event.getStreamIndex() != mVideoStreamIndex) {
// if the selected video stream id is not yet set, go ahead an
// select this lucky video stream
if (mVideoStreamIndex != -1) return;
mVideoStreamIndex = event.getStreamIndex();
}
long evtTS = event.getTimeStamp();
// if uninitialized, back date mLastPtsWrite to get the very first frame
if (mLastPtsWrite == Global.NO_PTS)
mLastPtsWrite = Math.max(0, evtTS - MICRO_SECONDS_BETWEEN_FRAMES);
// if its time to write the next frame
if (evtTS - mLastPtsWrite >= MICRO_SECONDS_BETWEEN_FRAMES) {
if (!hasFired) {
image = event.getImage();
hasFired = true;
}
// update last write time
mLastPtsWrite += MICRO_SECONDS_BETWEEN_FRAMES;
}
}
}
}
/*
* ====================================================================
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ====================================================================
*/
package org.apache.poi.xslf.usermodel;
import java.awt.Rectangle;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URL;
import java.text.DecimalFormat;
import javax.imageio.ImageIO;
import javax.xml.namespace.QName;
import org.apache.poi.openxml4j.opc.PackagePart;
import org.apache.poi.openxml4j.opc.PackagePartName;
import org.apache.poi.openxml4j.opc.PackageRelationship;
import org.apache.poi.openxml4j.opc.PackagingURIHelper;
import org.apache.poi.openxml4j.opc.TargetMode;
import org.apache.poi.sl.usermodel.PictureData.PictureType;
import org.apache.xmlbeans.XmlCursor;
import org.openxmlformats.schemas.drawingml.x2006.main.CTHyperlink;
import org.openxmlformats.schemas.officeDocument.x2006.relationships.STRelationshipId;
import org.openxmlformats.schemas.presentationml.x2006.main.CTApplicationNonVisualDrawingProps;
import org.openxmlformats.schemas.presentationml.x2006.main.CTExtension;
import org.openxmlformats.schemas.presentationml.x2006.main.CTPicture;
import org.openxmlformats.schemas.presentationml.x2006.main.CTSlide;
import org.openxmlformats.schemas.presentationml.x2006.main.CTTLCommonMediaNodeData;
import org.openxmlformats.schemas.presentationml.x2006.main.CTTLCommonTimeNodeData;
import org.openxmlformats.schemas.presentationml.x2006.main.CTTimeNodeList;
import org.openxmlformats.schemas.presentationml.x2006.main.STTLTimeIndefinite;
import org.openxmlformats.schemas.presentationml.x2006.main.STTLTimeNodeFillType;
import org.openxmlformats.schemas.presentationml.x2006.main.STTLTimeNodeRestartType;
import org.openxmlformats.schemas.presentationml.x2006.main.STTLTimeNodeType;
import com.xuggle.mediatool.IMediaReader;
import com.xuggle.mediatool.MediaListenerAdapter;
import com.xuggle.mediatool.ToolFactory;
import com.xuggle.mediatool.event.IVideoPictureEvent;
import com.xuggle.xuggler.Global;
import com.xuggle.xuggler.IContainer;
import com.xuggle.xuggler.io.InputOutputStreamHandler;
/**
* Adding multiple videos to a slide
*
* need the Xuggler 5.4 jars:
* &lt;repositories&gt;
* &lt;repository&gt;
* &lt;id&gt;xuggle repo&lt;/id&gt;
* &lt;url&gt;http://xuggle.googlecode.com/svn/trunk/repo/share/java/&lt;/url&gt;
* &lt;/repository&gt;
* &lt;/repositories&gt;
* ...
* &lt;dependency&gt;
* &lt;groupId&gt;xuggle&lt;/groupId&gt;
* &lt;artifactId&gt;xuggle-xuggler&lt;/artifactId&gt;
* &lt;version&gt;5.4&lt;/version&gt;
* &lt;/dependency&gt;
*
* @see <a href="http://stackoverflow.com/questions/15197300/apache-poi-xslf-adding-movie-to-the-slide">Apache POI XSLF Adding movie to the slide</a>
* @see <a href="http://apache-poi.1045710.n5.nabble.com/Question-about-embedded-video-in-PPTX-files-tt5718461.html">Question about embedded video in PPTX files</a>
*/
public class AddVideoToPptx {
static DecimalFormat df_time = new DecimalFormat("0.####");
public static void main(String[] args) throws Exception {
URL video = new URL("http://archive.org/download/test-mpeg/test-mpeg.mpg");
// URL video = new URL("file:test-mpeg.mpg");
XMLSlideShow pptx = new XMLSlideShow();
// add video file
String videoFileName = video.getPath().substring(video.getPath().lastIndexOf('/')+1);
PackagePartName partName = PackagingURIHelper.createPartName("/ppt/media/"+videoFileName);
PackagePart part = pptx.getPackage().createPart(partName, "video/mpeg");
OutputStream partOs = part.getOutputStream();
InputStream fis = video.openStream();
byte buf[] = new byte[1024];
for (int readBytes; (readBytes = fis.read(buf)) != -1; partOs.write(buf, 0, readBytes));
fis.close();
partOs.close();
XSLFSlide slide1 = pptx.createSlide();
XSLFPictureShape pv1 = addPreview(pptx, slide1, part, 5, 50, 50);
addVideo(pptx, slide1, part, pv1, 5);
addTimingInfo(slide1, pv1);
XSLFPictureShape pv2 = addPreview(pptx, slide1, part, 9, 50, 250);
addVideo(pptx, slide1, part, pv2, 9);
addTimingInfo(slide1, pv2);
FileOutputStream fos = new FileOutputStream("pptx-with-video.pptx");
pptx.write(fos);
fos.close();
pptx.close();
}
static XSLFPictureShape addPreview(XMLSlideShow pptx, XSLFSlide slide1, PackagePart videoPart, double seconds, int x, int y) throws IOException {
// get preview after 5 sec.
IContainer ic = IContainer.make();
InputOutputStreamHandler iosh = new InputOutputStreamHandler(videoPart.getInputStream());
if (ic.open(iosh, IContainer.Type.READ, null) < 0) return null;
IMediaReader mediaReader = ToolFactory.makeReader(ic);
// stipulate that we want BufferedImages created in BGR 24bit color space
mediaReader.setBufferedImageTypeToGenerate(BufferedImage.TYPE_3BYTE_BGR);
ImageSnapListener isl = new ImageSnapListener(seconds);
mediaReader.addListener(isl);
// read out the contents of the media file and
// dispatch events to the attached listener
while (!isl.hasFired && mediaReader.readPacket() == null) ;
mediaReader.close();
ic.close();
// add snapshot
BufferedImage image1 = isl.image;
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ImageIO.write(image1, "jpeg", bos);
XSLFPictureData snap = pptx.addPicture(bos.toByteArray(), PictureType.JPEG);
XSLFPictureShape pic1 = slide1.createPicture(snap);
pic1.setAnchor(new Rectangle(x, y, image1.getWidth(), image1.getHeight()));
return pic1;
}
static void addVideo(XMLSlideShow pptx, XSLFSlide slide1, PackagePart videoPart, XSLFPictureShape pic1, double seconds) throws IOException {
// add video shape
PackagePartName partName = videoPart.getPartName();
PackageRelationship prsEmbed1 = slide1.getPackagePart().addRelationship(partName, TargetMode.INTERNAL, "http://schemas.microsoft.com/office/2007/relationships/media");
PackageRelationship prsExec1 = slide1.getPackagePart().addRelationship(partName, TargetMode.INTERNAL, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/video");
CTPicture xpic1 = (CTPicture)pic1.getXmlObject();
CTHyperlink link1 = xpic1.getNvPicPr().getCNvPr().addNewHlinkClick();
link1.setId("");
link1.setAction("ppaction://media");
// add video relation
CTApplicationNonVisualDrawingProps nvPr = xpic1.getNvPicPr().getNvPr();
nvPr.addNewVideoFile().setLink(prsExec1.getId());
CTExtension ext = nvPr.addNewExtLst().addNewExt();
// see http://msdn.microsoft.com/en-us/library/dd950140(v=office.12).aspx
ext.setUri("{DAA4B4D4-6D71-4841-9C94-3DE7FCFB9230}");
String p14Ns = "http://schemas.microsoft.com/office/powerpoint/2010/main";
try (XmlCursor cur = ext.newCursor()) {
cur.toEndToken();
cur.beginElement(new QName(p14Ns, "media", "p14"));
cur.insertNamespace("p14", p14Ns);
cur.insertAttributeWithValue(new QName(STRelationshipId.type.getName().getNamespaceURI(), "embed"), prsEmbed1.getId());
cur.beginElement(new QName(p14Ns, "trim", "p14"));
cur.insertAttributeWithValue("st", df_time.format(seconds*1000.0));
}
}
static void addTimingInfo(XSLFSlide slide1, XSLFPictureShape pic1) {
// add slide timing information, so video can be controlled
CTSlide xslide = slide1.getXmlObject();
CTTimeNodeList ctnl;
if (!xslide.isSetTiming()) {
CTTLCommonTimeNodeData ctn = xslide.addNewTiming().addNewTnLst().addNewPar().addNewCTn();
ctn.setDur(STTLTimeIndefinite.INDEFINITE);
ctn.setRestart(STTLTimeNodeRestartType.NEVER);
ctn.setNodeType(STTLTimeNodeType.TM_ROOT);
ctnl = ctn.addNewChildTnLst();
} else {
ctnl = xslide.getTiming().getTnLst().getParArray(0).getCTn().getChildTnLst();
}
CTTLCommonMediaNodeData cmedia = ctnl.addNewVideo().addNewCMediaNode();
cmedia.setVol(80000);
CTTLCommonTimeNodeData ctn = cmedia.addNewCTn();
ctn.setFill(STTLTimeNodeFillType.HOLD);
ctn.setDisplay(false);
ctn.addNewStCondLst().addNewCond().setDelay(STTLTimeIndefinite.INDEFINITE);
cmedia.addNewTgtEl().addNewSpTgt().setSpid(""+pic1.getShapeId());
}
static class ImageSnapListener extends MediaListenerAdapter {
final double SECONDS_BETWEEN_FRAMES;
final long MICRO_SECONDS_BETWEEN_FRAMES;
boolean hasFired = false;
BufferedImage image = null;
// The video stream index, used to ensure we display frames from one and
// only one video stream from the media container.
int mVideoStreamIndex = -1;
// Time of last frame write
long mLastPtsWrite = Global.NO_PTS;
public ImageSnapListener(double seconds) {
SECONDS_BETWEEN_FRAMES = seconds;
MICRO_SECONDS_BETWEEN_FRAMES =
(long)(Global.DEFAULT_PTS_PER_SECOND * SECONDS_BETWEEN_FRAMES);
}
@Override
public void onVideoPicture(IVideoPictureEvent event) {
if (event.getStreamIndex() != mVideoStreamIndex) {
// if the selected video stream id is not yet set, go ahead an
// select this lucky video stream
if (mVideoStreamIndex != -1) return;
mVideoStreamIndex = event.getStreamIndex();
}
long evtTS = event.getTimeStamp();
// if uninitialized, back date mLastPtsWrite to get the very first frame
if (mLastPtsWrite == Global.NO_PTS)
mLastPtsWrite = Math.max(0, evtTS - MICRO_SECONDS_BETWEEN_FRAMES);
// if its time to write the next frame
if (evtTS - mLastPtsWrite >= MICRO_SECONDS_BETWEEN_FRAMES) {
if (!hasFired) {
image = event.getImage();
hasFired = true;
}
// update last write time
mLastPtsWrite += MICRO_SECONDS_BETWEEN_FRAMES;
}
}
}
}

View File

@ -25,7 +25,7 @@ import java.io.FileOutputStream;
import java.io.OutputStream;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
@ -64,7 +64,7 @@ public final class BarChartDemo {
}
try (FileInputStream argIS = new FileInputStream(args[0]);
BufferedReader modelReader = Files.newBufferedReader(Path.of(args[1]), StandardCharsets.UTF_8)) {
BufferedReader modelReader = Files.newBufferedReader(Paths.get(args[1]), StandardCharsets.UTF_8)) {
String chartTitle = modelReader.readLine(); // first line is chart title
String seriesText = modelReader.readLine();

View File

@ -26,7 +26,7 @@ import java.io.FileOutputStream;
import java.io.OutputStream;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
@ -72,7 +72,7 @@ public final class ChartFromScratch {
return;
}
try (BufferedReader modelReader = Files.newBufferedReader(Path.of(args[0]), StandardCharsets.UTF_8)) {
try (BufferedReader modelReader = Files.newBufferedReader(Paths.get(args[0]), StandardCharsets.UTF_8)) {
String chartTitle = modelReader.readLine(); // first line is chart title
String seriesText = modelReader.readLine();

View File

@ -41,7 +41,7 @@ import java.io.FileOutputStream;
import java.io.OutputStream;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
@ -64,7 +64,7 @@ public final class DoughnutChartFromScratch {
return;
}
try (BufferedReader modelReader = Files.newBufferedReader(Path.of(args[0]), StandardCharsets.UTF_8)) {
try (BufferedReader modelReader = Files.newBufferedReader(Paths.get(args[0]), StandardCharsets.UTF_8)) {
String chartTitle = modelReader.readLine(); // first line is chart title
String seriesText = modelReader.readLine();

View File

@ -25,7 +25,7 @@ import java.io.FileOutputStream;
import java.io.OutputStream;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
@ -61,7 +61,7 @@ public final class PieChartDemo {
}
try (FileInputStream argIS = new FileInputStream(args[0]);
BufferedReader modelReader = Files.newBufferedReader(Path.of(args[1]), StandardCharsets.UTF_8)) {
BufferedReader modelReader = Files.newBufferedReader(Paths.get(args[1]), StandardCharsets.UTF_8)) {
String chartTitle = modelReader.readLine(); // first line is chart title
try (XMLSlideShow pptx = new XMLSlideShow(argIS)) {

View File

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

View File

@ -1,4 +1,4 @@
My Chart
First 1.0
Second 3.0
My Chart
First 1.0
Second 3.0
Third 4.0

View File

@ -136,7 +136,7 @@ public class FromHowTo {
if(nextIsString && StringUtil.isNotBlank(lastContents)) {
Integer idx = Integer.valueOf(lastContents);
lastContents = lruCache.get(idx);
if (lastContents == null && !lruCache.containsKey(idx) && sst != null) {
if (lastContents == null && !lruCache.containsKey(idx)) {
lastContents = sst.getItemAt(idx).getString();
lruCache.put(idx, lastContents);
}

View File

@ -20,12 +20,12 @@
package org.apache.poi.examples.xssf.eventusermodel;
import java.io.InputStream;
import java.util.Iterator;
import org.apache.poi.examples.xssf.usermodel.LoadPasswordProtectedXlsx;
import org.apache.poi.openxml4j.opc.OPCPackage;
import org.apache.poi.poifs.crypt.temp.AesZipFileZipEntrySource;
import org.apache.poi.xssf.eventusermodel.XSSFReader;
import org.apache.poi.xssf.eventusermodel.XSSFReader.SheetIterator;
/**
* An example that loads a password protected workbook and counts the sheets.
@ -48,12 +48,11 @@ public final class LoadPasswordProtectedXlsxStreaming {
try (AesZipFileZipEntrySource source = AesZipFileZipEntrySource.createZipEntrySource(inputStream);
OPCPackage pkg = OPCPackage.open(source)) {
XSSFReader reader = new XSSFReader(pkg);
Iterator<InputStream> iter = reader.getSheetsData();
SheetIterator iter = (SheetIterator)reader.getSheetsData();
int count = 0;
while(iter.hasNext()) {
try (InputStream stream = iter.next()) {
count++;
}
iter.next();
count++;
}
System.out.println("sheet count: " + count);
}

View File

@ -212,7 +212,7 @@ public class XLSX2CSV {
styles, null, strings, sheetHandler, formatter, false);
sheetParser.setContentHandler(handler);
sheetParser.parse(sheetSource);
} catch (ParserConfigurationException e) {
} catch(ParserConfigurationException e) {
throw new RuntimeException("SAX parser appears to be broken - " + e.getMessage());
}
}
@ -234,12 +234,7 @@ public class XLSX2CSV {
String sheetName = iter.getSheetName();
this.output.println();
this.output.println(sheetName + " [index=" + index + "]:");
try {
processSheet(styles, strings, new SheetToCSV(), stream);
} catch (NumberFormatException e) {
throw new IOException("Failed to parse sheet " + sheetName, e);
}
processSheet(styles, strings, new SheetToCSV(), stream);
}
++index;
}

View File

@ -53,13 +53,12 @@ public class DeferredGeneration {
try (FileOutputStream fileOut = new FileOutputStream("DeferredGeneration.xlsx")) {
wb.write(fileOut);
// writeAvoidingTempFiles was added as an experimental change in POI 5.1.0
// wb.writeAvoidingTempFiles(fileOut);
//writeAvoidingTempFiles was added as an experimental change in POI 5.1.0
//wb.writeAvoidingTempFiles(fileOut);
} finally {
//the dispose call is necessary to ensure temp files are removed
wb.dispose();
}
// finally {
// the dispose call is no longer necessary to ensure temp files are removed
// wb.dispose();
// }
System.out.println("wrote DeferredGeneration.xlsx");
}
}

View File

@ -46,11 +46,10 @@ public class Outlining {
try (FileOutputStream fileOut = new FileOutputStream("outlining_collapsed.xlsx")) {
wb2.write(fileOut);
} finally {
//the dispose call is necessary to ensure temp files are removed
wb2.dispose();
}
// finally {
// the dispose call is no longer necessary to ensure temp files are removed
// wb2.dispose();
// }
}
}
}

View File

@ -58,7 +58,8 @@ public final class SavePasswordProtectedXlsx {
TempFileUtils.checkTempFiles();
String filename = args[0];
String password = args[1];
try (SXSSFWorkbookWithCustomZipEntrySource wb = new SXSSFWorkbookWithCustomZipEntrySource()) {
SXSSFWorkbookWithCustomZipEntrySource wb = new SXSSFWorkbookWithCustomZipEntrySource();
try {
for(int i = 0; i < 10; i++) {
SXSSFSheet sheet = wb.createSheet("Sheet" + i);
for(int r = 0; r < 1000; r++) {
@ -77,6 +78,10 @@ public final class SavePasswordProtectedXlsx {
} finally {
tempData.dispose();
}
} finally {
wb.close();
//the dispose call is necessary to ensure temp files are removed
wb.dispose();
}
TempFileUtils.checkTempFiles();
}

View File

@ -35,8 +35,8 @@ import java.util.Random;
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream;
import org.apache.commons.compress.archivers.zip.ZipFile;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.poi.logging.PoiLogManager;
import org.apache.poi.openxml4j.opc.internal.ZipHelper;
import org.apache.poi.ss.usermodel.DateUtil;
import org.apache.poi.ss.usermodel.FillPatternType;
@ -77,7 +77,7 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
* See <a href="https://poi.apache.org/spreadsheet/how-to.html#sxssf">SXSSF (Streaming Usermodel API)</a>.
*/
public final class BigGridDemo {
private static final Logger LOG = PoiLogManager.getLogger(BigGridDemo.class);
private static final Logger LOG = LogManager.getLogger(BigGridDemo.class);
private static final Random rnd = new Random();

View File

@ -26,7 +26,7 @@ import java.io.FileOutputStream;
import java.io.OutputStream;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
@ -63,7 +63,7 @@ public final class BarChartExample {
}
try (FileInputStream argIS = new FileInputStream(args[0]);
BufferedReader modelReader = Files.newBufferedReader(Path.of(args[1]), StandardCharsets.UTF_8)) {
BufferedReader modelReader = Files.newBufferedReader(Paths.get(args[1]), StandardCharsets.UTF_8)) {
String chartTitle = modelReader.readLine(); // first line is chart title
String seriesText = modelReader.readLine();

View File

@ -24,7 +24,7 @@ import java.io.FileOutputStream;
import java.io.OutputStream;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
@ -67,7 +67,7 @@ public final class ChartFromScratch {
return;
}
try (BufferedReader modelReader = Files.newBufferedReader(Path.of(args[0]), StandardCharsets.UTF_8)) {
try (BufferedReader modelReader = Files.newBufferedReader(Paths.get(args[0]), StandardCharsets.UTF_8)) {
String chartTitle = modelReader.readLine(); // first line is chart title
String seriesText = modelReader.readLine();

View File

@ -22,10 +22,10 @@ import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import org.apache.poi.common.usermodel.PictureType;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.util.Units;
import org.apache.poi.xwpf.usermodel.BreakType;
import org.apache.poi.xwpf.usermodel.Document;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.apache.poi.xwpf.usermodel.XWPFParagraph;
import org.apache.poi.xwpf.usermodel.XWPFRun;
@ -45,30 +45,30 @@ public final class SimpleImages {
XWPFRun r = p.createRun();
for (String imgFile : args) {
PictureType format;
int format;
if (imgFile.endsWith(".emf")) {
format = PictureType.EMF;
format = Document.PICTURE_TYPE_EMF;
} else if (imgFile.endsWith(".wmf")) {
format = PictureType.WMF;
format = Document.PICTURE_TYPE_WMF;
} else if (imgFile.endsWith(".pict")) {
format = PictureType.PICT;
format = Document.PICTURE_TYPE_PICT;
} else if (imgFile.endsWith(".jpeg") || imgFile.endsWith(".jpg")) {
format = PictureType.JPEG;
format = Document.PICTURE_TYPE_JPEG;
} else if (imgFile.endsWith(".png")) {
format = PictureType.PNG;
format = Document.PICTURE_TYPE_PNG;
} else if (imgFile.endsWith(".dib")) {
format = PictureType.DIB;
format = Document.PICTURE_TYPE_DIB;
} else if (imgFile.endsWith(".gif")) {
format = PictureType.GIF;
format = Document.PICTURE_TYPE_GIF;
} else if (imgFile.endsWith(".tiff")) {
format = PictureType.TIFF;
format = Document.PICTURE_TYPE_TIFF;
} else if (imgFile.endsWith(".eps")) {
format = PictureType.EPS;
format = Document.PICTURE_TYPE_EPS;
} else if (imgFile.endsWith(".bmp")) {
format = PictureType.BMP;
format = Document.PICTURE_TYPE_BMP;
} else if (imgFile.endsWith(".wpg")) {
format = PictureType.WPG;
format = Document.PICTURE_TYPE_WPG;
} else {
System.err.println("Unsupported picture: " + imgFile +
". Expected emf|wmf|pict|jpeg|png|dib|gif|tiff|eps|bmp|wpg");

View File

@ -44,7 +44,7 @@ import org.apache.poi.xwpf.usermodel.XWPFDocument;
* SpreadsheetML workbook embedded into the document.<p>
*
* This code was successfully tested with the following file from the POI test collection:
* test-data/document/EmbeddedDocument.docx
* http://svn.apache.org/repos/asf/poi/trunk/test-data/document/EmbeddedDocument.docx
*/
@SuppressWarnings({"java:S106","java:S4823","java:S1192"})
public class UpdateEmbeddedDoc {

View File

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

View File

@ -1,115 +0,0 @@
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
package org.apache.poi.examples.hssf.eventusermodel;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.io.ByteArrayOutputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.nio.charset.StandardCharsets;
import org.apache.poi.hssf.HSSFTestDataSamples;
import org.apache.poi.hssf.record.NumberRecord;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import org.junit.jupiter.api.Test;
class TestXLS2CSVmra {
@Test
void test() throws Exception {
XLS2CSVmra.main(new String[] { HSSFTestDataSamples.getSampleFile("SampleSS.xls").getAbsolutePath() });
}
@Test
void testWithMinCols() throws Exception {
XLS2CSVmra.main(new String[] { HSSFTestDataSamples.getSampleFile("SampleSS.xls").getAbsolutePath(), "100" });
}
@Test
void testProcess() throws IOException {
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
PrintStream out = new PrintStream(outStream, false, StandardCharsets.UTF_8.name());
XLS2CSVmra cvs = new XLS2CSVmra(
new POIFSFileSystem(new FileInputStream(HSSFTestDataSamples.getSampleFile("SampleSS.xls").getAbsolutePath())),
out, -1);
cvs.process();
outStream.flush();
assertEquals(sanitize("\n"
+ "First Sheet [1]:\n"
+ "\"Test spreadsheet\"\n"
+ "\"2nd row\",\"2nd row 2nd column\"\n"
+ "\n"
+ "\"This one is red\"\n"
+ "\n"
+ "Sheet Number 2 [2]:\n"
+ "\"Start of 2nd sheet\"\n"
+ "\"Sheet 2 row 2\"\n"
+ "\n"
+ "\"I'm in bold blue, on a yellow background\"\n"
+ "\n"
+ "\"cb=1\",\"cb=10\",\"cb=2\",\"cb=sum\"\n"
+ "1,10,2,13\n"
+ "\n"
+ "Sheet3 [3]:\n"), sanitize(new String(outStream.toByteArray(), StandardCharsets.UTF_8)));
}
@Test
void testProcessNumberRecord() throws IOException {
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
PrintStream out = new PrintStream(outStream, false, StandardCharsets.UTF_8.name());
XLS2CSVmra cvs = new XLS2CSVmra(
new POIFSFileSystem(new FileInputStream(HSSFTestDataSamples.getSampleFile("empty.xls").getAbsolutePath())),
out, -1);
// need to call process() first to initialize members
cvs.process();
outStream.flush();
assertEquals(sanitize("\n"
+ "Лист1 [1]:\n"
+ "\n"
+ "Лист2 [2]:\n"
+ "\n"
+ "Лист3 [3]:\n"), sanitize(new String(outStream.toByteArray(), StandardCharsets.UTF_8)));
NumberRecord record = new NumberRecord();
record.setValue(1.243);
cvs.processRecord(record);
outStream.flush();
assertEquals(sanitize("\n"
+ "Лист1 [1]:\n"
+ "\n"
+ "Лист2 [2]:\n"
+ "\n"
+ "Лист3 [3]:\n"
+ "1.243"), sanitize(new String(outStream.toByteArray(), StandardCharsets.UTF_8)));
}
private String sanitize(String str) {
return str.replace("\r\n", "\n");
}
}

View File

@ -18,11 +18,9 @@
package org.apache.poi.integration;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.IOException;
import java.io.PrintStream;
import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;
@ -35,11 +33,8 @@ import org.apache.poi.openxml4j.opc.PackageAccess;
import org.apache.poi.xssf.XSSFTestDataSamples;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import net.bytebuddy.utility.RandomString;
public class TestXLSX2CSV {
private PrintStream err;
private final UnsynchronizedByteArrayOutputStream errorBytes = UnsynchronizedByteArrayOutputStream.builder().get();
@ -135,87 +130,7 @@ public class TestXLSX2CSV {
assertEquals("", errorOutput);
String output = outputBytes.toString(StandardCharsets.UTF_8);
assertTrue(output.contains("\"Lorem\",111,,,"), "Had: " + output);
assertTrue(output.contains(",\"hello, xssf\",,\"hello, xssf\","), "Had: " + output);
}
@Disabled("Used for local micro-benchmarking")
@Test
public void microBenchmark() {
checkReplace("str");
checkReplace("str.123");
checkReplace("str.123,");
checkReplace("str,,,.123,,,,");
for (int i = 0; i < 1000;i++) {
checkReplace(RandomString.make(20));
}
for (int i = 0;i < 10;i++) {
long start = System.currentTimeMillis();
String str = RandomString.make(100) + "\"\"" + RandomString.make(100) + "\"\"" + RandomString.make(100);
String expected = str.replace("\"", "\"\"");
for (int j = 0;j < 300000;j++) {
//assertEquals(expected, replaceString(str, "\"", "\"\""));
assertEquals(expected, replaceDirect(str, "\"", "\"\""));
}
System.out.println(" , " + (System.currentTimeMillis() - start));
}
// Java 8: replaceString: 1001, 921, 1264, 1019, 1258, 990, 1089, 1430, 1153, 907
// Java 8: replaceDirect: 375, 282, 240, 246, 264, 271, 258, 250, 263, 259
// Java 11: replaceString: 510, 218, 202, 205, 202, 198, 202, 198, 208, 201
// Java 11: replaceDirect: 384, 228, 204, 201, 201, 200, 206, 196, 200, 200
//
// => On Java 8, a custom implementation would make sense, however on Java 9
// String.replace() was optimized so that it does not make any difference
// anymore!
}
private void checkReplace(String orig) {
assertEquals(replaceString(orig, ",", "."), replaceDirect(orig, ",", "."),
"Did have a difference with " + orig);
}
public static String replaceString(String originalStr, String oldStr, String newStr) {
return originalStr.replace(oldStr, newStr);
}
public static String replaceDirect(String originalStr, String oldStr, String newStr) {
int p = originalStr.indexOf(oldStr);
if (p == -1) {
return originalStr;
} else {
StringBuilder result = new StringBuilder();
result.append(originalStr, 0, p);
result.append(newStr);
int q = p + oldStr.length();
while ((p = originalStr.indexOf(oldStr, q)) != -1) {
result.append(originalStr, q, p);
result.append(newStr);
q = p + oldStr.length();
}
result.append(originalStr, q, originalStr.length());
return result.toString();
}
}
@Test
public void testDeepFile() {
// returns with some System.err
try {
assertThrows(IOException.class,
() -> XLSX2CSV.main(new String[] { XSSFTestDataSamples.getSampleFile("deep-data.xlsx").getAbsolutePath() }));
} catch (Throwable e) {
// restore output-streams again to get proper error output
System.setErr(err);
throw e;
}
String output = errorBytes.toString(StandardCharsets.UTF_8);
assertFalse(output.contains("Not found"), "Had: " + output);
System.out.println(output);
assertTrue(output.contains("\"Lorem\",111,,,"), "Had: " + output);
assertTrue(output.contains(",\"hello, xssf\",,\"hello, xssf\","), "Had: " + output);
}
}

View File

@ -31,7 +31,7 @@ sourceSets {
}
dependencies {
api 'org.apache.ant:ant:1.10.15'
api 'org.apache.ant:ant:1.10.14'
api project(':poi-ooxml')
compileOnly project(path: ':poi-ooxml', configuration: 'archives')
@ -41,9 +41,9 @@ dependencies {
testImplementation(project(path: ':poi-ooxml', configuration: 'tests')) {
exclude group: 'org.apache.poi', module: 'poi-scratchpad'
}
testImplementation 'com.google.guava:guava:33.5.0-jre'
testImplementation 'com.google.guava:guava:32.1.1-jre'
testImplementation "org.apache.logging.log4j:log4j-slf4j2-impl:${log4jVersion}"
testImplementation 'org.slf4j:slf4j-simple:2.0.17'
testImplementation 'org.slf4j:slf4j-simple:2.0.9'
testRuntimeOnly "org.apiguardian:apiguardian-api:${apiGuardianVersion}"
}
@ -57,36 +57,36 @@ final String OOXML_LITE_AGENT = "../build/dist/maven/poi-ooxml-lite-agent/poi-oo
final String OOXML_LITE_REPORT = '../src/resources/ooxml-lite-report'
final String OOXML_LITE_INCLUDES = "^(com/microsoft/schemas|org/(etsi|openxmlformats|w3/)|org/apache/poi/schemas)"
tasks.register('compileJava9', JavaCompile) {
task compileJava9(type: JavaCompile) {
dependsOn 'compileJava', ':poi-ooxml:jar', ':poi-scratchpad:jar'
javaCompiler = javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(Math.max(11, jdkVersion))
}
sourceCompatibility = 11
targetCompatibility = 11
sourceCompatibility = 1.9
targetCompatibility = 1.9
destinationDirectory = file(JAVA9_OUT + VERSIONS9)
source = file(JAVA9_SRC)
classpath = files()
options.compilerArgs = [
'--patch-module', "${MODULE_NAME}=${sourceSets.main.output.classesDirs.asPath}",
'--module-path', files(MAIN_MODULE_PATH).asPath
'--patch-module', "${MODULE_NAME}=${sourceSets.main.output.classesDirs.asPath}",
'--module-path', files(MAIN_MODULE_PATH).asPath
]
}
tasks.register('compileTest9', JavaCompile) {
task compileTest9(type: JavaCompile) {
dependsOn 'compileTestJava', ':poi-ooxml:jar', ':poi-scratchpad:jar'
javaCompiler = javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(Math.max(11, jdkVersion))
}
sourceCompatibility = 11
targetCompatibility = 11
sourceCompatibility = 1.9
targetCompatibility = 1.9
destinationDirectory = file(TEST9_OUT + VERSIONS9)
source = file(TEST9_SRC)
options.compilerArgs = [
'--patch-module', "${MODULE_NAME}=${(sourceSets.main.output.classesDirs + sourceSets.test.output.classesDirs).asPath}",
'--module-path', files(TEST_MODULE_PATH).asPath
'--patch-module', "${MODULE_NAME}=${(sourceSets.main.output.classesDirs + sourceSets.test.output.classesDirs).asPath}",
'--module-path', files(TEST_MODULE_PATH).asPath
]
classpath = files()
}
@ -95,7 +95,7 @@ tasks.register('compileTest9', JavaCompile) {
jar {
dependsOn compileJava9
destinationDirectory = file("../build/dist/maven/${base.archivesName.get()}")
destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}")
manifest {
attributes('Automatic-Module-Name': MODULE_NAME, 'Multi-Release': 'true')
@ -119,11 +119,11 @@ sourcesJar {
// Create a separate jar for test-code to depend on it in other projects
// See http://stackoverflow.com/questions/5144325/gradle-test-dependency
task testJar(type: Jar, dependsOn: [ testClasses, compileTest9 ] ) {
destinationDirectory = file("../build/dist/maven/${base.archivesName.get()}-tests")
destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}-tests")
setArchiveClassifier 'tests'
// ignore second module-info.class from main
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
duplicatesStrategy = 'exclude'
from sourceSets.test.output + sourceSets.main.output
@ -142,9 +142,13 @@ test {
doFirst {
jvmArgs += [
"-javaagent:${OOXML_LITE_AGENT}=${OOXML_LITE_REPORT}|${OOXML_LITE_INCLUDES}",
'--add-modules', MODULE_NAME,
'--module-path', '../build/dist/maven/poi-excelant-tests' + File.pathSeparator + files(TEST_MODULE_PATH).asPath,
]
if (jdkVersion > 8) {
jvmArgs += [
'--add-modules', MODULE_NAME,
'--module-path', '../build/dist/maven/poi-excelant-tests' + File.pathSeparator + files(TEST_MODULE_PATH).asPath,
]
}
}
}

View File

@ -27,7 +27,7 @@ import java.util.Map;
*/
public final class ExcelAntWorkbookUtilFactory {
private static final Map<String, ExcelAntWorkbookUtil> workbookUtilMap = new HashMap<>();
private static Map<String, ExcelAntWorkbookUtil> workbookUtilMap;
private ExcelAntWorkbookUtilFactory() {
}
@ -41,14 +41,16 @@ public final class ExcelAntWorkbookUtilFactory {
* a freshly instantiated one if none did exist before.
*/
public static ExcelAntWorkbookUtil getInstance(String fileName) {
synchronized (workbookUtilMap) {
if(workbookUtilMap.containsKey(fileName)) {
return workbookUtilMap.get(fileName);
}
ExcelAntWorkbookUtil wbu = new ExcelAntWorkbookUtil(fileName);
workbookUtilMap.put(fileName, wbu);
return wbu;
if(workbookUtilMap == null) {
workbookUtilMap = new HashMap<>();
}
if(workbookUtilMap.containsKey(fileName)) {
return workbookUtilMap.get(fileName);
}
ExcelAntWorkbookUtil wbu = new ExcelAntWorkbookUtil(fileName);
workbookUtilMap.put(fileName, wbu);
return wbu;
}
}

View File

@ -18,7 +18,6 @@
module org.apache.poi.excelant {
requires ant;
requires transitive org.apache.poi.poi;
requires org.apache.poi.ooxml;
exports org.apache.poi.ss.excelant;

View File

@ -1,3 +1,5 @@
import java.util.regex.Pattern
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@ -15,10 +17,8 @@
limitations under the License.
==================================================================== */
import java.util.regex.Pattern
final String TEST9_SRC = 'src/test/java9'
final String TEST9_OUT = layout.buildDirectory.dir('classes/java9/test/').get().asFile.absolutePath
final String TEST9_OUT = "${buildDir}/classes/java9/test/"
final String VERSIONS9 = 'META-INF/versions/9'
final boolean IBMVM = System.getProperty("java.vendor").contains("IBM")
@ -39,9 +39,9 @@ sourceSets {
}
dependencies {
testImplementation 'org.apache.ant:ant:1.10.15'
testImplementation 'org.apache.commons:commons-collections4:4.5.0'
testImplementation 'com.google.guava:guava:33.5.0-jre'
testImplementation 'org.apache.ant:ant:1.10.14'
testImplementation 'org.apache.commons:commons-collections4:4.4'
testImplementation 'com.google.guava:guava:32.1.1-jre'
misc(project(':poi-ooxml')) {
capabilities {
@ -76,7 +76,7 @@ dependencies {
}
testImplementation project(path: ':poi-ooxml-lite-agent', configuration: 'archives')
testImplementation "org.apache.logging.log4j:log4j-slf4j2-impl:${log4jVersion}"
testImplementation 'org.slf4j:slf4j-simple:2.0.17'
testImplementation 'org.slf4j:slf4j-simple:2.0.9'
testRuntimeOnly "org.apiguardian:apiguardian-api:${apiGuardianVersion}"
}
@ -90,26 +90,26 @@ final String OOXML_LITE_AGENT = "../build/dist/maven/poi-ooxml-lite-agent/poi-oo
final String OOXML_LITE_REPORT = '../src/resources/ooxml-lite-report'
final String OOXML_LITE_INCLUDES = "^(com/microsoft/schemas|org/(etsi|openxmlformats|w3/)|org/apache/poi/schemas)"
tasks.register('compileTest9', JavaCompile) {
task compileTest9(type: JavaCompile) {
dependsOn 'compileTestJava', ':poi-ooxml:testJar', ':poi-scratchpad:testJar', ':poi-examples:jar'
javaCompiler = javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(Math.max(11, jdkVersion))
}
sourceCompatibility = 11
targetCompatibility = 11
sourceCompatibility = 1.9
targetCompatibility = 1.9
destinationDirectory = file(TEST9_OUT + VERSIONS9)
source = file(TEST9_SRC)
options.compilerArgs = [
'--patch-module', "${MODULE_NAME}=${(sourceSets.main.output.classesDirs + sourceSets.test.output.classesDirs).asPath}",
'--module-path', files(MODULE_COMPILE_PATH).asPath
'--patch-module', "${MODULE_NAME}=${(sourceSets.main.output.classesDirs + sourceSets.test.output.classesDirs).asPath}",
'--module-path', files(MODULE_COMPILE_PATH).asPath
]
classpath = files()
}
jar {
destinationDirectory = file("../build/dist/maven/${base.archivesName.get()}")
destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}")
manifest {
attributes('Automatic-Module-Name': MODULE_NAME, 'Multi-Release': 'true')
@ -119,11 +119,11 @@ jar {
// Create a separate jar for test-code to depend on it in other projects
// See http://stackoverflow.com/questions/5144325/gradle-test-dependency
task testJar(type: Jar, dependsOn: [ testClasses, compileTest9 ] ) {
destinationDirectory = file("../build/dist/maven/${base.archivesName.get()}-tests")
destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}-tests")
setArchiveClassifier 'tests'
// ignore second module-info.class from main
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
duplicatesStrategy = 'exclude'
from sourceSets.test.output + sourceSets.main.output
@ -143,26 +143,29 @@ test {
dependsOn { testJar }
systemProperties['junit.jupiter.execution.parallel.enabled'] = 'true'
if (jdkVersion == 8) {
systemProperties['sun.java2d.renderer'] = 'sun.java2d.marlin.MarlinRenderingEngine'
}
doFirst {
jvmArgs += [
"-javaagent:${OOXML_LITE_AGENT}=${OOXML_LITE_REPORT}|${OOXML_LITE_INCLUDES}",
'--add-modules', MODULE_NAME,
'--module-path', '../build/dist/maven/poi-integration-tests' + File.pathSeparator + files(MODULE_RUNTIME_PATH).asPath,
]
if (jdkVersion > 8) {
jvmArgs += [
'--add-modules', MODULE_NAME,
'--module-path', '../build/dist/maven/poi-integration-tests' + File.pathSeparator + files(MODULE_RUNTIME_PATH).asPath,
]
}
if (NO_SCRATCHPAD) {
systemProperty 'scratchpad.ignore', 'true'
}
}
}
javadoc {
enabled = false
}
javadoc { enabled(false) }
sourcesJar {
enabled = false
}
sourcesJar { enabled(false) }
generateMetadataFileForPOIPublication.enabled = false
publishPOIPublicationToMavenLocal.enabled = false

View File

@ -27,14 +27,11 @@ Before running this, you should execute the "jar" target in the main build.gradl
<property name="dist" value="../build/dist"/>
<property name="build" value="../build/distsourcebuild"/>
<!-- Gradle is executed in ../build/poi-<version>, so three ".." are needed to use gradle from the root-dir -->
<condition property="gradle.executable" value="../../../gradlew.bat" else="../../../gradlew">
<condition property="gradle.executable" value="../gradlew.bat" else="../gradlew">
<os family="windows" />
</condition>
<target name="init" depends="">
<echo message="Using Ant: ${ant.version} from ${ant.home}, Ant detected Java ${ant.java.version} (may be different than actual Java sometimes...)" />
<echo message="Using Java: ${java.version}/${java.runtime.version}/${java.vm.version}/${java.vm.name} from ${java.vm.vendor} on ${os.name}: ${os.version}" />
</target>
<target name="run" depends="init,runSourceBuild,runCompileTest"/>
@ -51,14 +48,14 @@ Before running this, you should execute the "jar" target in the main build.gradl
<date xmlns="antlib:org.apache.tools.ant.types.resources.comparators"/>
<resources>
<fileset dir="${dist}">
<include name="apache-poi-src-*.zip"/>
<include name="poi-src-*.zip"/>
</fileset>
</resources>
</sort>
</last>
</pathconvert>
<echo message="Found source package with pattern 'apache-poi-src-*.zip' in ${dist} at '${srcpackage}'. Run Gradle-task 'srcDistZip' in the main directory if it is missing"/>
<echo message="Found source package at ${srcpackage}"/>
<unzip src="${srcpackage}" dest="${build}" failOnEmptyArchive="true"/>
<!-- look for name of sub-dir, do this dynamically as it changes with every (beta|rc)-release -->
@ -77,7 +74,7 @@ Before running this, you should execute the "jar" target in the main build.gradl
<!-- finally call Ant on the extracted source to check if we can build the packages -->
<echo message="Building in temporary dir ${dirversion}/"/>
<!--ant dir="${dirversion}" target="assemble" inheritAll="false" inheritRefs="false" useNativeBasedir="true"/-->
<exec executable="${gradle.executable}" dir="${dirversion}" failonerror="true">
<exec executable="${gradle.executable}" dir="." failonerror="true">
<arg value="assemble" />
</exec>
</target>
@ -94,9 +91,9 @@ Before running this, you should execute the "jar" target in the main build.gradl
<sort>
<resources>
<fileset dir="${dist}">
<include name="**/poi-6.*.jar"/>
<include name="**/poi-ooxml-6.*.jar"/>
<include name="**/poi-ooxml-lite-6.*.jar"/>
<include name="**/poi-5.*.jar"/>
<include name="**/poi-ooxml-5.*.jar"/>
<include name="**/poi-ooxml-lite-5.*.jar"/>
<exclude name="**/*-javadoc*"/>
<exclude name="**/*-sources*"/>
</fileset>
@ -126,7 +123,7 @@ Before running this, you should execute the "jar" target in the main build.gradl
<echo message="Compiling examples without linking to scratchpad.jar to ensure that only some specific ones require this jar"/>
<javac srcdir="../poi-examples/src/main/java" destdir="${build}"
target="11" source="11" debug="true"
target="1.8" source="1.8" debug="true"
encoding="ASCII" fork="yes" includeantruntime="false"
excludes="org/apache/poi/examples/hslf/**,org/apache/poi/examples/hsmf/**,org/apache/poi/examples/hwmf/**,**/EmbeddedObjects.java,**/EmeddedObjects.java,**/LoadEmbedded.java,**/Word2Forrest.java"
classpath="${jarpackage}" classpathref="libs">
@ -137,10 +134,10 @@ Before running this, you should execute the "jar" target in the main build.gradl
<sort>
<resources>
<fileset dir="${dist}">
<include name="**/poi-6.*.jar"/>
<include name="**/poi-ooxml-6.*.jar"/>
<include name="**/poi-ooxml-lite-6.*.jar"/>
<include name="**/poi-scratchpad-6.*.jar"/>
<include name="**/poi-5.*.jar"/>
<include name="**/poi-ooxml-5.*.jar"/>
<include name="**/poi-ooxml-lite-5.*.jar"/>
<include name="**/poi-scratchpad-5.*.jar"/>
<exclude name="**/*-javadoc*"/>
<exclude name="**/*-sources*"/>
</fileset>
@ -150,7 +147,7 @@ Before running this, you should execute the "jar" target in the main build.gradl
<echo message="Compiling all examples with the additional scratchpad.jar"/>
<javac srcdir="../poi-examples/src/main/java" destdir="${build}"
target="11" source="11" debug="true"
target="1.8" source="1.8" debug="true"
encoding="ASCII" fork="yes" includeantruntime="false"
classpath="${jarpackagescratchpad}" classpathref="libs">
</javac>

View File

@ -109,38 +109,13 @@ public abstract class AbstractFileHandler implements FileHandler {
assertEquals(modified, file.lastModified(), "File should not be modified by extractor");
if (extractor instanceof POIOLE2TextExtractor) {
POIOLE2TextExtractor ole2Extractor = (POIOLE2TextExtractor) extractor;
ole2Extractor.getRoot();
if (!(ole2Extractor instanceof EventBasedExcelExtractor)) {
ole2Extractor.getSummaryInformation();
ole2Extractor.getDocSummaryInformation();
}
try (HPSFPropertiesExtractor hpsfExtractor = new HPSFPropertiesExtractor(ole2Extractor)) {
try (HPSFPropertiesExtractor hpsfExtractor = new HPSFPropertiesExtractor((POIOLE2TextExtractor) extractor)) {
assertNotNull(hpsfExtractor.getDocumentSummaryInformationText());
assertNotNull(hpsfExtractor.getSummaryInformationText());
String text = hpsfExtractor.getText();
//System.out.println(text);
assertNotNull(text);
}
if (ole2Extractor.getRoot() != null && !Boolean.getBoolean("scratchpad.ignore")) {
POITextExtractor[] embedded = ExtractorFactory.getEmbeddedDocsTextExtractors(ole2Extractor);
try {
for (POITextExtractor poiTextExtractor : embedded) {
poiTextExtractor.getText();
poiTextExtractor.getDocument();
poiTextExtractor.getFilesystem();
POITextExtractor metaData = poiTextExtractor.getMetadataTextExtractor();
metaData.getFilesystem();
metaData.getText();
}
} finally {
for (POITextExtractor embeddedExtractor : embedded) {
embeddedExtractor.close();
}
}
}
}
// test again with including formulas and cell-comments as this caused some bugs
@ -191,11 +166,6 @@ public abstract class AbstractFileHandler implements FileHandler {
assertNotNull(streamExtractor);
assertNotNull(streamExtractor.getText());
POITextExtractor metadataTextExtractor = streamExtractor.getMetadataTextExtractor();
assertNotNull(metadataTextExtractor);
assertNotNull(metadataTextExtractor.getText());
}
}
}

View File

@ -29,8 +29,6 @@ public enum FileHandlerKnown {
HSLF,
HSMF,
HSSF,
HEMF,
HWMF,
HWPF,
OPC,
POIFS,

View File

@ -1,85 +0,0 @@
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
package org.apache.poi.stress;
import static org.junit.jupiter.api.Assertions.assertInstanceOf;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import org.apache.poi.hemf.record.emf.HemfRecord;
import org.apache.poi.hemf.record.emf.HemfRecordType;
import org.apache.poi.hemf.record.emf.HemfText;
import org.apache.poi.hemf.usermodel.HemfPicture;
import org.junit.jupiter.api.Test;
public class HEMFFileHandler implements FileHandler {
@Override
public void handleExtracting(File file) throws Exception {
try (InputStream stream = new BufferedInputStream(new FileInputStream(file))) {
HemfPicture picture = new HemfPicture(stream);
// mimic a bit what e.g. Tika does to extract some information from .emf files
for (HemfRecord record : picture.getRecords()) {
if (record.getEmfRecordType().equals(HemfRecordType.extTextOutW)) {
assertInstanceOf(HemfText.EmfExtTextOutW.class, record);
HemfText.EmfExtTextOutW textOut = (HemfText.EmfExtTextOutW) record;
textOut.getText(StandardCharsets.UTF_16LE);
} else if (record.getEmfRecordType().equals(HemfRecordType.extTextOutA)) {
assertInstanceOf(HemfText.EmfExtTextOutA.class, record);
HemfText.EmfExtTextOutA textOut = (HemfText.EmfExtTextOutA) record;
textOut.getText(StandardCharsets.UTF_8);
}
}
}
}
@Override
public void handleAdditional(File file) throws Exception {
// no additional checks for now
}
@Override
public void handleFile(InputStream stream, String path) throws Exception {
HemfPicture picture = new HemfPicture(stream);
for (HemfRecord record : picture.getRecords()) {
record.getEmfRecordType();
record.getGenericRecordType();
}
BufferedImage dest = new BufferedImage(256, 256, BufferedImage.TYPE_INT_ARGB);
picture.draw(dest.createGraphics(), new Rectangle2D.Double(0, 0, 256, 256));
}
@Test
void test() throws Exception {
String file = "test-data/slideshow/wrench.emf";
try (InputStream stream = new BufferedInputStream(new FileInputStream(file))) {
handleFile(stream, file);
}
handleExtracting(new File(file));
}
}

View File

@ -23,15 +23,15 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.poi.logging.PoiLogManager;
import org.apache.poi.hslf.usermodel.HSLFSlideShow;
import org.apache.poi.hslf.usermodel.HSLFSlideShowImpl;
import org.junit.jupiter.api.Test;
public class HSLFFileHandler extends SlideShowHandler {
private static final Logger LOGGER = PoiLogManager.getLogger(HSLFFileHandler.class);
private static final Logger LOGGER = LogManager.getLogger(HSLFFileHandler.class);
@Override
public void handleFile(InputStream stream, String path) throws Exception {

View File

@ -1,93 +0,0 @@
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
package org.apache.poi.stress;
import static org.junit.jupiter.api.Assertions.assertInstanceOf;
import java.awt.image.BufferedImage;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.nio.charset.Charset;
import org.apache.poi.hwmf.record.HwmfFont;
import org.apache.poi.hwmf.record.HwmfRecord;
import org.apache.poi.hwmf.record.HwmfRecordType;
import org.apache.poi.hwmf.record.HwmfText;
import org.apache.poi.hwmf.usermodel.HwmfPicture;
import org.apache.poi.util.LocaleUtil;
import org.junit.jupiter.api.Test;
public class HWMFFileHandler implements FileHandler {
@Override
public void handleExtracting(File file) throws Exception {
try (InputStream stream = new BufferedInputStream(new FileInputStream(file))) {
HwmfPicture picture = new HwmfPicture(stream);
Charset charset = LocaleUtil.CHARSET_1252;
// mimic a bit what e.g. Tika does to extract some information from .wmf files
for (HwmfRecord record : picture.getRecords()) {
if (record.getWmfRecordType().equals(HwmfRecordType.createFontIndirect)) {
HwmfFont font = ((HwmfText.WmfCreateFontIndirect) record).getFont();
charset = (font.getCharset() == null || font.getCharset().getCharset() == null) ?
LocaleUtil.CHARSET_1252 : font.getCharset().getCharset();
}
if (record.getWmfRecordType().equals(HwmfRecordType.extTextOut)) {
assertInstanceOf(HwmfText.WmfExtTextOut.class, record);
HwmfText.WmfExtTextOut textOut = (HwmfText.WmfExtTextOut) record;
textOut.getText(charset);
} else if (record.getWmfRecordType().equals(HwmfRecordType.textOut)) {
assertInstanceOf(HwmfText.WmfTextOut.class, record);
HwmfText.WmfTextOut textOut = (HwmfText.WmfTextOut) record;
textOut.getText(charset);
}
}
}
}
@Override
public void handleAdditional(File file) throws Exception {
// no additional checks for now
}
@Override
public void handleFile(InputStream stream, String path) throws Exception {
HwmfPicture picture = new HwmfPicture(stream);
for (HwmfRecord record : picture.getRecords()) {
record.getWmfRecordType();
record.getGenericRecordType();
}
BufferedImage dest = new BufferedImage(256, 256, BufferedImage.TYPE_INT_ARGB);
picture.draw(dest.createGraphics());
}
@Test
void test() throws Exception {
String file = "test-data/slideshow/santa.wmf";
try (InputStream stream = new BufferedInputStream(new FileInputStream(file))) {
handleFile(stream, file);
}
handleExtracting(new File(file));
}
}

View File

@ -29,7 +29,6 @@ import java.lang.ref.WeakReference;
import org.apache.commons.io.output.UnsynchronizedByteArrayOutputStream;
import org.apache.poi.sl.draw.Drawable;
import org.apache.poi.sl.usermodel.GroupShape;
import org.apache.poi.sl.usermodel.MasterSheet;
import org.apache.poi.sl.usermodel.Notes;
import org.apache.poi.sl.usermodel.PictureData;
import org.apache.poi.sl.usermodel.Shape;
@ -77,11 +76,8 @@ public abstract class SlideShowHandler extends POIFSFileHandler {
}
}
MasterSheet<?, ?> masterSheet = s.getMasterSheet();
if (masterSheet != null) {
for (Shape<?,?> shape : masterSheet) {
readShapes(shape);
}
for (Shape<?,?> shape : s.getMasterSheet()) {
readShapes(shape);
}
}
}

View File

@ -37,8 +37,6 @@ public abstract class SpreadsheetHandler extends AbstractFileHandler {
// try to access some of the content
readContent(wb);
extractEmbedded(wb);
// write out the file
writeToArray(wb);

View File

@ -96,19 +96,14 @@ public class TestAllFiles {
"poifs/protected_sha512.xlsx",
"poifs/60320-protected.xlsx",
"poifs/protected_sha512.xlsx",
// stress docs
"document/deep-table-cell.docx",
// invalid files
"spreadsheet/bug69769.xlsx",
// NOTE: Expected failures should usually be added in file "stress.xls" instead
// of being listed here in order to also verify the expected exception details!
};
// cheap workaround of skipping the few problematic files
public static final String[] SCAN_EXCLUDES_NOSCRATCHPAD = concat(SCAN_EXCLUDES, new String[] {
public static final String[] SCAN_EXCLUDES_NOSCRATCHPAD = {
"**/.svn/**",
"lost+found",
"**/.git/**",
"**/ExternalEntityInText.docx", //the DocType (DTD) declaration causes this to fail
"**/right-to-left.xlsx", //the threaded comments in this file cause XSSF clone to fail
"document/word2.doc",
"document/cpansearch.perl.org_src_tobyink_acme-rundoc-0.001_word-lib_hello_world.docm",
@ -138,25 +133,17 @@ public class TestAllFiles {
"spreadsheet/clusterfuzz-testcase-minimized-POIHSSFFuzzer-5436547081830400.xls",
"spreadsheet/clusterfuzz-testcase-minimized-POIHSSFFuzzer-4819588401201152.xls",
"diagram/clusterfuzz-testcase-minimized-POIVisioFuzzer-4537225637134336.vsd",
"spreadsheet/clusterfuzz-testcase-minimized-POIHSSFFuzzer-6537773940867072.xls",
"spreadsheet/clusterfuzz-testcase-minimized-POIHSSFFuzzer-4977868385681408.xls",
"spreadsheet/clusterfuzz-testcase-minimized-POIHSSFFuzzer-4651309315719168.xls",
"document/clusterfuzz-testcase-POIHWPFFuzzer-5696094627495936.doc",
"spreadsheet/clusterfuzz-testcase-minimized-POIHSSFFuzzer-4657005060816896.xls",
"diagram/clusterfuzz-testcase-minimized-POIHDGFFuzzer-4913778037489664.vsd",
"diagram/clusterfuzz-testcase-minimized-POIHDGFFuzzer-6478389109981184.vsd",
"publisher/clusterfuzz-testcase-minimized-POIHPBFFuzzer-4918886059278336.pub",
"publisher/clusterfuzz-testcase-minimized-POIHPBFFuzzer-4918886059278336.pub",
"publisher/clusterfuzz-testcase-minimized-POIHPBFFuzzer-6325615354773504.pub",
"spreadsheet/clusterfuzz-testcase-minimized-POIHSSFFuzzer-4734163573080064.xls",
"spreadsheet/rde.imf.ru_sites_default_files_rde_documents_vodootvedenie_2020.xlsb.xls",
"publisher/clusterfuzz-testcase-minimized-POIHPBFFuzzer-6325615354773504.pub",
});
// exclude files failing on windows nodes, because of limited JCE policies
"document/bug53475-password-is-pass.docx",
"poifs/60320-protected.xlsx",
"poifs/protected_sha512.xlsx",
"poifs/60320-protected.xlsx",
"poifs/protected_sha512.xlsx",
};
private static final Set<String> EXPECTED_FAILURES = StressTestUtils.unmodifiableHashSet(
"document/truncated62886.docx",
// this document fails with IBM JDK because of a different exception being thrown
"spreadsheet/clusterfuzz-testcase-minimized-POIXSSFFuzzer-5089447305609216.xlsx"
"document/truncated62886.docx"
);
public static Stream<Arguments> allfiles(String testName) throws IOException {
@ -178,7 +165,6 @@ public class TestAllFiles {
continue;
}
boolean found = false;
for (FileHandlerKnown handler : sm.getHandler(file)) {
ExcInfo info1 = sm.getExcInfo(file, testName, handler);
if (info1 == null || info1.isValid(testName, handler.name())) {
@ -189,13 +175,8 @@ public class TestAllFiles {
(info1 != null) ? info1.getExClazz() : null,
(info1 != null) ? info1.getExMessage() : null
));
found = true;
}
}
if (!found) {
System.out.println("Could not find a handler for " + file);
}
}
return result.stream();
@ -263,9 +244,6 @@ public class TestAllFiles {
String threadName = Thread.currentThread().getName();
try {
Thread.currentThread().setName("Additional - " + file + " - " + handler);
if (StressTestUtils.excludeFile(file, EXPECTED_FAILURES))
return;
System.out.println("Running additionals on "+file);
FileHandler fileHandler = handler.getHandler();
assertNotNull(fileHandler, "Did not find a handler for file " + file);
@ -309,10 +287,9 @@ public class TestAllFiles {
errPrefix + " for " + exClass + " expected message '" + exMessage + "' but had '" + actMsg + "': " + e);
if (actMsg != null &&
// in newer JDK versions IndexOutOfBoundsException switch from empty message
// to more useful content
// sometimes ArrayIndexOutOfBoundsException has null-message?!?
// so skip the check for this type of exception if expected message is null
(exMessage != null || !IndexOutOfBoundsException.class.isAssignableFrom(exClass))) {
(exMessage != null || !ArrayIndexOutOfBoundsException.class.isAssignableFrom(exClass))) {
assertNotNull(exMessage,
errPrefix + "Expected message was null, but actMsg wasn't: Message: " + actMsg + ": " + e);
assertTrue(actMsg.contains(exMessage),
@ -355,11 +332,4 @@ public class TestAllFiles {
private static boolean isJava8() {
return System.getProperty("java.version").startsWith("1.8");
}
private static String[] concat(String[] a, String[] b) {
String[] result = new String[a.length + b.length];
System.arraycopy(a, 0, result, 0, a.length);
System.arraycopy(b, 0, result, a.length, b.length);
return result;
}
}

View File

@ -78,7 +78,7 @@ public class XSSFBFileHandler extends AbstractFileHandler {
XSSFBEventBasedExcelExtractor ex = new XSSFBEventBasedExcelExtractor(pkg);
String txt = ex.getText();
if (txt.length() < 1) {
throw new IllegalArgumentException("Should have gotten some text.");
throw new RuntimeException("Should have gotten some text.");
}
}

View File

@ -203,7 +203,7 @@ public class XSSFFileHandler extends SpreadsheetHandler {
XLSX2CSV.main(new String[]{file.getAbsolutePath()});
ExcelComparator.main(new String[]{file.getAbsolutePath(), file.getAbsolutePath()});
assertFalse(EXPECTED_ADDITIONAL_FAILURES.contains(testFile), "Expected Extraction to fail for file " + file + " and handler " + this + ", but did not fail!" );
assertFalse( EXPECTED_ADDITIONAL_FAILURES.contains(testFile), "Expected Extraction to fail for file " + file + " and handler " + this + ", but did not fail!" );
} catch (OLE2NotOfficeXmlFileException e) {
// we have some files that are not actually OOXML and thus cannot be tested here

View File

@ -22,7 +22,6 @@ import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Set;
import org.apache.commons.io.output.NullOutputStream;
import org.apache.poi.ooxml.POIXMLException;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.junit.jupiter.api.Test;
@ -42,8 +41,6 @@ public class XWPFFileHandler extends AbstractFileHandler {
try (XWPFDocument doc = new XWPFDocument(stream)) {
new POIXMLDocumentHandler().handlePOIXMLDocument(doc);
POIXMLDocumentHandler.cursorRecursive(doc.getDocument());
doc.write(NullOutputStream.INSTANCE);
} catch (POIXMLException e) {
Exception cause = (Exception)e.getCause();
throw cause == null ? e : cause;

View File

@ -16,6 +16,7 @@
==================================================================== */
module org.apache.poi.stress {
requires org.apache.logging.log4j;
requires org.junit.jupiter.api;
requires org.junit.jupiter.params;
requires net.bytebuddy;
@ -23,7 +24,6 @@ module org.apache.poi.stress {
requires org.apache.commons.collections4;
requires org.apache.commons.io;
requires transitive org.apache.poi.poi;
requires org.apache.poi.examples;
requires org.apache.poi.scratchpad;

View File

@ -37,7 +37,6 @@
<Logger name="org.apache.poi.xssf.usermodel.XSSFWorkbook" level="ERROR" />
<Logger name="org.apache.poi.hslf.usermodel.HSLFGroupShape" level="WARN" />
<Logger name="org.apache.poi.hslf.record.Record" level="ERROR" />
<Logger name="org.apache.poi.hwpf.sprm.ParagraphSprmUncompressor" level="FATAL" />
<!-- Change to DEBUG or another level to get log output -->
<Root level="ERROR">

View File

@ -1,3 +1,5 @@
import java.util.regex.Pattern
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@ -15,11 +17,9 @@
limitations under the License.
==================================================================== */
import java.util.regex.Pattern
final String MODULE_NAME = 'org.apache.poi.ooxml.schemas'
final String BEANS_SRC = layout.buildDirectory.dir('generated-sources').get().asFile.absolutePath
final String BEANS_RES = layout.buildDirectory.dir('generated-resources').get().asFile.absolutePath
final String BEANS_SRC = "${buildDir}/generated-sources"
final String BEANS_RES = "${buildDir}/generated-resources"
sourceSets {
main {
@ -54,36 +54,36 @@ compileJava {
options.forkOptions.jvmArgs += '-Xmx2G'
}
tasks.register('compileJava9', JavaCompile) {
task compileJava9(type: JavaCompile) {
dependsOn 'compileJava'
javaCompiler = javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(Math.max(11, jdkVersion))
}
sourceCompatibility = 11
targetCompatibility = 11
sourceCompatibility = 1.9
targetCompatibility = 1.9
destinationDirectory = file(JAVA9_OUT + VERSIONS9)
source = file(JAVA9_SRC)
classpath = files()
options.compilerArgs = [
'--patch-module', "${MODULE_NAME}=${sourceSets.main.output.asPath}",
'--module-path', files(MAIN_MODULE_PATH).asPath
'--patch-module', "${MODULE_NAME}=${sourceSets.main.output.asPath}",
'--module-path', files(MAIN_MODULE_PATH).asPath
]
}
tasks.register('copy_xsds', Copy) {
from('src/main/xmlschema/org/apache/poi/xdgf')
from('src/main/xmlschema/org/apache/poi/schemas') {
task copy_xsds(type: Copy) {
from ('src/main/xmlschema/org/apache/poi/xdgf')
from ('src/main/xmlschema/org/apache/poi/schemas') {
include 'XAdES*.xsd', '*.xsdconfig', 'xmldsig*.xsd', 'ooxmlSchemas.xsdconfig', 'markup-compatibility.xsd',
'vmlDrawing.xsd', 'word10.xsd', 'word12.xsd', 'xlThreaded*.xsd', 'dml-drawing.xsd', 'drawing-chart2012.xsd',
'vmlDrawing.xsd', 'word12.xsd', 'xlThreaded*.xsd', 'dml-drawing.xsd', 'drawing-chart2012.xsd',
'chartEx.xsd'
exclude '*.zip'
}
from('src/main/xmlschema/org/apache/poi/poifs/crypt') {
from ('src/main/xmlschema/org/apache/poi/poifs/crypt') {
include 'signatureInfo.xsd'
}
from(zipTree('src/main/xmlschema/org/apache/poi/schemas/OfficeOpenXML-XMLSchema-Transitional.zip'))
from(zipTree('src/main/xmlschema/org/apache/poi/schemas/OpenPackagingConventions-XMLSchema.zip')) {
from (zipTree('src/main/xmlschema/org/apache/poi/schemas/OfficeOpenXML-XMLSchema-Transitional.zip'))
from (zipTree('src/main/xmlschema/org/apache/poi/schemas/OpenPackagingConventions-XMLSchema.zip')) {
include 'opc-digSig.xsd', 'opc-relationships.xsd'
}
into 'build/xsds'
@ -95,30 +95,30 @@ task generate_beans(dependsOn: copy_xsds) {
doLast {
ant.uptodate(
property: 'xmlbeans_uptodate',
targetfile: 'build/generated-resources/org/apache/poi/schemas/ooxml/system/ooxml/TypeSystemHolder.class'
property: 'xmlbeans_uptodate',
targetfile: 'build/generated-resources/org/apache/poi/schemas/ooxml/system/ooxml/TypeSystemHolder.class'
) {
srcFiles(dir: 'build/xsds', includes: '*.xsd')
}
ant.taskdef(
name: 'xmlbean',
classname: 'org.apache.xmlbeans.impl.tool.XMLBean',
classpath: sourceSets.main.runtimeClasspath.asPath
name: 'xmlbean',
classname: 'org.apache.xmlbeans.impl.tool.XMLBean',
classpath: sourceSets.main.runtimeClasspath.asPath
)
if (!ant.properties.xmlbeans_uptodate) {
ant.xmlbean(
schema: 'build/xsds',
srcgendir: BEANS_SRC,
classgendir: BEANS_RES,
destfile: 'build/xsds.jar',
srconly: true,
failonerror: true,
fork: true,
memoryMaximumSize: '1536m',
typesystemname: 'ooxml',
repackage: 'org.apache.xmlbeans.metadata:org.apache.poi.schemas.ooxml'
schema: 'build/xsds',
srcgendir: BEANS_SRC,
classgendir: BEANS_RES,
destfile: 'build/xsds.jar',
srconly: true,
failonerror: true,
fork: true,
memoryMaximumSize: '1536m',
typesystemname: 'ooxml',
repackage: 'org.apache.xmlbeans.metadata:org.apache.poi.schemas.ooxml'
) {
classpath = sourceSets.main.runtimeClasspath.asPath
}
@ -126,7 +126,7 @@ task generate_beans(dependsOn: copy_xsds) {
}
}
tasks.register('sourceJar', Jar) {
task sourceJar(type: Jar) {
setArchiveClassifier 'sources'
from sourceSets.main.allJava
}

View File

@ -1,39 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
====================================================================
-->
<xs:schema xmlns="http://schemas.microsoft.com/office/2006/keyEncryptor/certificate" xmlns:e="http://schemas.microsoft.com/office/2006/encryption" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://schemas.microsoft.com/office/2006/keyEncryptor/certificate" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:import namespace="http://schemas.microsoft.com/office/2006/encryption" schemaLocation="encryptionInfo.xsd"/>
<xs:simpleType name="ST_PasswordKeyEncryptorUri">
<xs:restriction base="xs:token">
<xs:enumeration value="http://schemas.microsoft.com/office/2006/keyEncryptor/certificate"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="CT_CertificateKeyEncryptor">
<xs:attribute name="encryptedKeyValue" type="xs:base64Binary" use="required">
<xs:annotation><xs:documentation>A base64-encoded value that specifies the encrypted form of the intermediate key, which is encrypted with the public key contained within the X509Certificate attribute.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="X509Certificate" type="xs:base64Binary" use="required">
<xs:annotation><xs:documentation>A base64-encoded value that specifies a DER-encoded X.509 certificate (1) used to encrypt the intermediate key. The certificate (1) MUST contain only the public portion of the public-private key pair.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="certVerifier" type="xs:base64Binary" use="required">
<xs:annotation><xs:documentation>A base64-encoded value that specifies the HMAC of the binary data obtained by base64-decoding the X509Certificate attribute. The hashing algorithm used to derive the HMAC MUST be the hashing algorithm specified for the Encryption.keyData element. The secret key used to derive the HMAC MUST be the intermediate key. If the intermediate key is reset, any CertificateKeyEncryptor elements are also reset to contain the new intermediate key, except that the certVerifier attribute MUST match the value calculated using the current intermediate key, to verify that the CertificateKeyEncryptor element actually encrypted the current intermediate key. If a CertificateKeyEncryptor element does not have a correct certVerifier attribute, it MUST be discarded.</xs:documentation></xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:element name="encryptedKey" type="CT_CertificateKeyEncryptor"/>
</xs:schema>
<?xml version="1.0" encoding="utf-8"?>
<!--
====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
====================================================================
-->
<xs:schema xmlns="http://schemas.microsoft.com/office/2006/keyEncryptor/certificate" xmlns:e="http://schemas.microsoft.com/office/2006/encryption" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://schemas.microsoft.com/office/2006/keyEncryptor/certificate" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:import namespace="http://schemas.microsoft.com/office/2006/encryption" schemaLocation="encryptionInfo.xsd"/>
<xs:simpleType name="ST_PasswordKeyEncryptorUri">
<xs:restriction base="xs:token">
<xs:enumeration value="http://schemas.microsoft.com/office/2006/keyEncryptor/certificate"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="CT_CertificateKeyEncryptor">
<xs:attribute name="encryptedKeyValue" type="xs:base64Binary" use="required">
<xs:annotation><xs:documentation>A base64-encoded value that specifies the encrypted form of the intermediate key, which is encrypted with the public key contained within the X509Certificate attribute.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="X509Certificate" type="xs:base64Binary" use="required">
<xs:annotation><xs:documentation>A base64-encoded value that specifies a DER-encoded X.509 certificate (1) used to encrypt the intermediate key. The certificate (1) MUST contain only the public portion of the public-private key pair.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="certVerifier" type="xs:base64Binary" use="required">
<xs:annotation><xs:documentation>A base64-encoded value that specifies the HMAC of the binary data obtained by base64-decoding the X509Certificate attribute. The hashing algorithm used to derive the HMAC MUST be the hashing algorithm specified for the Encryption.keyData element. The secret key used to derive the HMAC MUST be the intermediate key. If the intermediate key is reset, any CertificateKeyEncryptor elements are also reset to contain the new intermediate key, except that the certVerifier attribute MUST match the value calculated using the current intermediate key, to verify that the CertificateKeyEncryptor element actually encrypted the current intermediate key. If a CertificateKeyEncryptor element does not have a correct certVerifier attribute, it MUST be discarded.</xs:documentation></xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:element name="encryptedKey" type="CT_CertificateKeyEncryptor"/>
</xs:schema>

View File

@ -1,24 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
====================================================================
-->
<xb:config xmlns:xb="http://xml.apache.org/xmlbeans/2004/02/xbean/config" xmlns:c="http://schemas.microsoft.com/office/2006/keyEncryptor/certificate">
<xb:qname name="c:encryptedKey" javaname="EncryptedCertificateKey"/>
<?xml version="1.0" encoding="UTF-8"?>
<!--
====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
====================================================================
-->
<xb:config xmlns:xb="http://xml.apache.org/xmlbeans/2004/02/xbean/config" xmlns:c="http://schemas.microsoft.com/office/2006/keyEncryptor/certificate">
<xb:qname name="c:encryptedKey" javaname="EncryptedCertificateKey"/>
</xb:config>

View File

@ -1,259 +1,259 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
====================================================================
-->
<xs:schema xmlns="http://schemas.microsoft.com/office/2006/encryption" xmlns:p="http://schemas.microsoft.com/office/2006/keyEncryptor/password" xmlns:c="http://schemas.microsoft.com/office/2006/keyEncryptor/certificate" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://schemas.microsoft.com/office/2006/encryption" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:import namespace="http://schemas.microsoft.com/office/2006/keyEncryptor/password" schemaLocation="encryptionPassword.xsd"/>
<xs:import namespace="http://schemas.microsoft.com/office/2006/keyEncryptor/certificate" schemaLocation="encryptionCertificate.xsd"/>
<xs:simpleType name="ST_SaltSize">
<xs:annotation>
<xs:documentation>An unsigned integer that specifies the number of bytes used by a salt. It MUST be at least 1 and no greater than 65,536.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:unsignedInt">
<xs:minInclusive value="1"/>
<xs:maxInclusive value="65536"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ST_BlockSize">
<xs:annotation>
<xs:documentation>An unsigned integer that specifies the number of bytes used to encrypt one block of data. It MUST be at least 2, no greater than 4096, and a multiple of 2.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:unsignedInt">
<xs:minInclusive value="2"/>
<xs:maxInclusive value="4096"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ST_KeyBits">
<xs:annotation>
<xs:documentation>An unsigned integer that specifies the number of bits used by an encryption algorithm. It MUST be at least 8 and a multiple of 8.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:unsignedInt">
<xs:minInclusive value="8"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ST_HashSize">
<xs:annotation>
<xs:documentation>An unsigned integer that specifies the number of bytes used by a hash value. It MUST be at least 1, no greater than 65,536, and the same number of bytes as the hash algorithm emits.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:unsignedInt">
<xs:minInclusive value="1"/>
<xs:maxInclusive value="65536"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ST_SpinCount">
<xs:annotation>
<xs:documentation>An unsigned integer that specifies the number of times to iterate on a hash of a password. It MUST NOT be greater than 10,000,000.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:unsignedInt">
<xs:minInclusive value="0"/>
<xs:maxInclusive value="10000000"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ST_CipherAlgorithm">
<xs:annotation>
<xs:appinfo>modified for poi - list is restricted to given list in [ms-offcrypto]</xs:appinfo>
<xs:documentation>A string that specifies the cipher algorithm. Values that are not defined MAY be used, and a compliant implementation is not required to support all defined values. Any algorithm that can be resolved by name by the underlying operating system can be used for hashing or encryption. Only block algorithms are supported for encryption. AES-128 is the default encryption algorithm, and SHA-1 is the default hashing algorithm if no other algorithms have been configured.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:token">
<xs:enumeration value="AES">
<xs:annotation>
<xs:documentation>MUST conform to the AES algorithm.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="RC2">
<xs:annotation>
<xs:documentation>MUST conform to the algorithm as specified in [RFC2268] (http://tools.ietf.org/html/rfc2268). The use of RC2 is not recommended. If RC2 is used with a key length of less than 128 bits, documents could interoperate incorrectly across different versions of Windows.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="RC4">
<xs:annotation>
<xs:documentation>MUST NOT be used.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="DES">
<xs:annotation>
<xs:documentation>MUST conform to the DES algorithm. The use of DES is not recommended. If DES is used, the key length specified in the KeyBits element is required to be set to 64 for 56-bit encryption, and the key decrypted from encryptedKeyValue of KeyEncryptor is required to include the DES parity bits.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="DESX">
<xs:annotation>
<xs:documentation>MUST conform to the algorithm as specified in [DRAFT-DESX] (http://tools.ietf.org/html/draft-ietf-ipsec-ciph-desx-00). The use of DESX is not recommended. If DESX is used, documents could interoperate incorrectly across different versions of Windows.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="3DES">
<xs:annotation>
<xs:documentation>MUST conform to the algorithm as specified in [RFC1851] (http://tools.ietf.org/html/rfc1851). If 3DES or 3DES_112 is used, the key length specified in the KeyBits element is required to be set to 192 for 168-bit encryption and 128 for 112-bit encryption, and the key decrypted from encryptedKeyValue of KeyEncryptor is required to include the DES parity bits.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="3DES_112">
<xs:annotation>
<xs:documentation>see 3DES</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ST_CipherChaining">
<xs:annotation>
<xs:documentation>A string that specifies the chaining mode used by CipherAlgorithm. For more details about chaining modes, see [BCMO800-38A] (http://csrc.nist.gov/publications/nistpubs/800-38a/sp800-38a.pdf).</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:token">
<xs:enumeration value="ChainingModeCBC">
<xs:annotation>
<xs:documentation>block chaining (CBC)</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="ChainingModeCFB">
<xs:annotation>
<xs:documentation>Cipher feedback chaining (CFB), with an 8-bit window</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ST_HashAlgorithm">
<xs:annotation>
<xs:appinfo>modified for poi - list is restricted to given list in [ms-offcrypto]</xs:appinfo>
<xs:documentation>A string specifying a hashing algorithm. Values that are not defined MAY be used, and a compliant implementation is not required to support all defined values.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:token">
<xs:enumeration value="SHA1">
<xs:annotation>
<xs:documentation>MUST conform to the algorithm as specified in [RFC4634] (http://tools.ietf.org/html/rfc4634).</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="SHA256">
<xs:annotation>
<xs:documentation>see SHA1</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="SHA384">
<xs:annotation>
<xs:documentation>see SHA1</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="SHA512">
<xs:annotation>
<xs:documentation>see SHA1</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="MD5">
<xs:annotation>
<xs:documentation>MUST conform to MD5.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="MD4">
<xs:annotation>
<xs:documentation>MUST conform to the algorithm as specified in [RFC1320] (http://tools.ietf.org/html/rfc1320).</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="MD2">
<xs:annotation>
<xs:documentation>MUST conform to the algorithm as specified in [RFC1319] (http://tools.ietf.org/html/rfc1319).</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="RIPEMD-128">
<xs:annotation>
<xs:documentation>MUST conform to the hash functions specified in [ISO/IEC 10118]. (https://en.wikipedia.org/wiki/RIPEMD)</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="RIPEMD-160">
<xs:annotation>
<xs:documentation>see RIPEMD-128 (https://en.wikipedia.org/wiki/RIPEMD)</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="WHIRLPOOL">
<xs:annotation>
<xs:documentation>see RIPEMD-128 (https://en.wikipedia.org/wiki/ISO/IEC_10118-3)</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="CT_KeyData">
<xs:annotation>
<xs:documentation>A complex type that specifies the encryption used within this element. The saltValue attribute is a base64-encoded binary value that is randomly generated. The number of bytes required to decode the saltValue attribute MUST be equal to the value of the saltSize attribute.</xs:documentation>
</xs:annotation>
<xs:attribute name="saltSize" type="ST_SaltSize" use="required"/>
<xs:attribute name="blockSize" type="ST_BlockSize" use="required"/>
<xs:attribute name="keyBits" type="ST_KeyBits" use="required"/>
<xs:attribute name="hashSize" type="ST_HashSize" use="required"/>
<xs:attribute name="cipherAlgorithm" type="ST_CipherAlgorithm" use="required"/>
<xs:attribute name="cipherChaining" type="ST_CipherChaining" use="required"/>
<xs:attribute name="hashAlgorithm" type="ST_HashAlgorithm" use="required"/>
<xs:attribute name="saltValue" type="xs:base64Binary" use="required"/>
</xs:complexType>
<xs:complexType name="CT_DataIntegrity">
<xs:annotation>
<xs:documentation>A complex type that specifies data used to verify whether the encrypted data passes an integrity check. It MUST be generated using the method specified in section 2.3.4.14 (http://msdn.microsoft.com/en-us/library/dd924068(v=office.12).aspx).</xs:documentation>
</xs:annotation>
<xs:attribute name="encryptedHmacKey" type="xs:base64Binary" use="required">
<xs:annotation>
<xs:documentation>A base64-encoded value that specifies an encrypted key used in calculating the encryptedHmacValue.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="encryptedHmacValue" type="xs:base64Binary" use="required">
<xs:annotation>
<xs:documentation>A base64-encoded value that specifies an HMAC derived from encryptedHmacKey and the encrypted data.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="CT_KeyEncryptor">
<xs:annotation>
<xs:appinfo>modified for POI</xs:appinfo>
<xs:documentation>A complex type that specifies the parameters used to encrypt an intermediate key, which is used to perform the final encryption of the document. To ensure extensibility, arbitrary elements can be defined to encrypt the intermediate key. The intermediate key MUST be the same for all KeyEncryptor elements.</xs:documentation>
</xs:annotation>
<xs:choice>
<xs:element ref="p:encryptedKey"/>
<xs:element ref="c:encryptedKey"/>
</xs:choice>
<xs:attribute name="uri">
<xs:annotation>
<xs:appinfo>modified for POI</xs:appinfo>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="http://schemas.microsoft.com/office/2006/keyEncryptor/password"/>
<xs:enumeration value="http://schemas.microsoft.com/office/2006/keyEncryptor/certificate"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
<xs:complexType name="CT_KeyEncryptors">
<xs:annotation>
<xs:documentation>A sequence of KeyEncryptor elements. Exactly one KeyEncryptors element MUST be present, and the KeyEncryptors element MUST contain at least one KeyEncryptor.</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="keyEncryptor" type="CT_KeyEncryptor" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="CT_Encryption">
<xs:sequence>
<xs:element name="keyData" type="CT_KeyData"/>
<xs:element name="dataIntegrity" type="CT_DataIntegrity">
<xs:annotation>
<xs:appinfo>modified for POI</xs:appinfo>
<xs:documentation>All ECMA-376 documents [ECMA-376] encrypted by Microsoft Office using agile encryption will have a DataIntegrity element present. The schema allows for a DataIntegrity element to not be present because the encryption schema can be used by applications that do not create ECMA-376 documents [ECMA-376].</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="keyEncryptors" type="CT_KeyEncryptors">
<xs:annotation>
<xs:documentation>The KeyEncryptor element, which MUST be used when encrypting password-protected agile encryption documents, is either a PasswordKeyEncryptor or a CertificateKeyEncryptor. Exactly one PasswordKeyEncryptor MUST be present. Zero or more CertificateKeyEncryptor elements are contained within the KeyEncryptors element.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:element name="encryption" type="CT_Encryption"/>
</xs:schema>
<?xml version="1.0" encoding="utf-8"?>
<!--
====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
====================================================================
-->
<xs:schema xmlns="http://schemas.microsoft.com/office/2006/encryption" xmlns:p="http://schemas.microsoft.com/office/2006/keyEncryptor/password" xmlns:c="http://schemas.microsoft.com/office/2006/keyEncryptor/certificate" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://schemas.microsoft.com/office/2006/encryption" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:import namespace="http://schemas.microsoft.com/office/2006/keyEncryptor/password" schemaLocation="encryptionPassword.xsd"/>
<xs:import namespace="http://schemas.microsoft.com/office/2006/keyEncryptor/certificate" schemaLocation="encryptionCertificate.xsd"/>
<xs:simpleType name="ST_SaltSize">
<xs:annotation>
<xs:documentation>An unsigned integer that specifies the number of bytes used by a salt. It MUST be at least 1 and no greater than 65,536.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:unsignedInt">
<xs:minInclusive value="1"/>
<xs:maxInclusive value="65536"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ST_BlockSize">
<xs:annotation>
<xs:documentation>An unsigned integer that specifies the number of bytes used to encrypt one block of data. It MUST be at least 2, no greater than 4096, and a multiple of 2.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:unsignedInt">
<xs:minInclusive value="2"/>
<xs:maxInclusive value="4096"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ST_KeyBits">
<xs:annotation>
<xs:documentation>An unsigned integer that specifies the number of bits used by an encryption algorithm. It MUST be at least 8 and a multiple of 8.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:unsignedInt">
<xs:minInclusive value="8"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ST_HashSize">
<xs:annotation>
<xs:documentation>An unsigned integer that specifies the number of bytes used by a hash value. It MUST be at least 1, no greater than 65,536, and the same number of bytes as the hash algorithm emits.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:unsignedInt">
<xs:minInclusive value="1"/>
<xs:maxInclusive value="65536"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ST_SpinCount">
<xs:annotation>
<xs:documentation>An unsigned integer that specifies the number of times to iterate on a hash of a password. It MUST NOT be greater than 10,000,000.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:unsignedInt">
<xs:minInclusive value="0"/>
<xs:maxInclusive value="10000000"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ST_CipherAlgorithm">
<xs:annotation>
<xs:appinfo>modified for poi - list is restricted to given list in [ms-offcrypto]</xs:appinfo>
<xs:documentation>A string that specifies the cipher algorithm. Values that are not defined MAY be used, and a compliant implementation is not required to support all defined values. Any algorithm that can be resolved by name by the underlying operating system can be used for hashing or encryption. Only block algorithms are supported for encryption. AES-128 is the default encryption algorithm, and SHA-1 is the default hashing algorithm if no other algorithms have been configured.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:token">
<xs:enumeration value="AES">
<xs:annotation>
<xs:documentation>MUST conform to the AES algorithm.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="RC2">
<xs:annotation>
<xs:documentation>MUST conform to the algorithm as specified in [RFC2268] (http://tools.ietf.org/html/rfc2268). The use of RC2 is not recommended. If RC2 is used with a key length of less than 128 bits, documents could interoperate incorrectly across different versions of Windows.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="RC4">
<xs:annotation>
<xs:documentation>MUST NOT be used.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="DES">
<xs:annotation>
<xs:documentation>MUST conform to the DES algorithm. The use of DES is not recommended. If DES is used, the key length specified in the KeyBits element is required to be set to 64 for 56-bit encryption, and the key decrypted from encryptedKeyValue of KeyEncryptor is required to include the DES parity bits.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="DESX">
<xs:annotation>
<xs:documentation>MUST conform to the algorithm as specified in [DRAFT-DESX] (http://tools.ietf.org/html/draft-ietf-ipsec-ciph-desx-00). The use of DESX is not recommended. If DESX is used, documents could interoperate incorrectly across different versions of Windows.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="3DES">
<xs:annotation>
<xs:documentation>MUST conform to the algorithm as specified in [RFC1851] (http://tools.ietf.org/html/rfc1851). If 3DES or 3DES_112 is used, the key length specified in the KeyBits element is required to be set to 192 for 168-bit encryption and 128 for 112-bit encryption, and the key decrypted from encryptedKeyValue of KeyEncryptor is required to include the DES parity bits.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="3DES_112">
<xs:annotation>
<xs:documentation>see 3DES</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ST_CipherChaining">
<xs:annotation>
<xs:documentation>A string that specifies the chaining mode used by CipherAlgorithm. For more details about chaining modes, see [BCMO800-38A] (http://csrc.nist.gov/publications/nistpubs/800-38a/sp800-38a.pdf).</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:token">
<xs:enumeration value="ChainingModeCBC">
<xs:annotation>
<xs:documentation>block chaining (CBC)</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="ChainingModeCFB">
<xs:annotation>
<xs:documentation>Cipher feedback chaining (CFB), with an 8-bit window</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ST_HashAlgorithm">
<xs:annotation>
<xs:appinfo>modified for poi - list is restricted to given list in [ms-offcrypto]</xs:appinfo>
<xs:documentation>A string specifying a hashing algorithm. Values that are not defined MAY be used, and a compliant implementation is not required to support all defined values.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:token">
<xs:enumeration value="SHA1">
<xs:annotation>
<xs:documentation>MUST conform to the algorithm as specified in [RFC4634] (http://tools.ietf.org/html/rfc4634).</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="SHA256">
<xs:annotation>
<xs:documentation>see SHA1</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="SHA384">
<xs:annotation>
<xs:documentation>see SHA1</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="SHA512">
<xs:annotation>
<xs:documentation>see SHA1</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="MD5">
<xs:annotation>
<xs:documentation>MUST conform to MD5.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="MD4">
<xs:annotation>
<xs:documentation>MUST conform to the algorithm as specified in [RFC1320] (http://tools.ietf.org/html/rfc1320).</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="MD2">
<xs:annotation>
<xs:documentation>MUST conform to the algorithm as specified in [RFC1319] (http://tools.ietf.org/html/rfc1319).</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="RIPEMD-128">
<xs:annotation>
<xs:documentation>MUST conform to the hash functions specified in [ISO/IEC 10118]. (https://en.wikipedia.org/wiki/RIPEMD)</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="RIPEMD-160">
<xs:annotation>
<xs:documentation>see RIPEMD-128 (https://en.wikipedia.org/wiki/RIPEMD)</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="WHIRLPOOL">
<xs:annotation>
<xs:documentation>see RIPEMD-128 (https://en.wikipedia.org/wiki/ISO/IEC_10118-3)</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="CT_KeyData">
<xs:annotation>
<xs:documentation>A complex type that specifies the encryption used within this element. The saltValue attribute is a base64-encoded binary value that is randomly generated. The number of bytes required to decode the saltValue attribute MUST be equal to the value of the saltSize attribute.</xs:documentation>
</xs:annotation>
<xs:attribute name="saltSize" type="ST_SaltSize" use="required"/>
<xs:attribute name="blockSize" type="ST_BlockSize" use="required"/>
<xs:attribute name="keyBits" type="ST_KeyBits" use="required"/>
<xs:attribute name="hashSize" type="ST_HashSize" use="required"/>
<xs:attribute name="cipherAlgorithm" type="ST_CipherAlgorithm" use="required"/>
<xs:attribute name="cipherChaining" type="ST_CipherChaining" use="required"/>
<xs:attribute name="hashAlgorithm" type="ST_HashAlgorithm" use="required"/>
<xs:attribute name="saltValue" type="xs:base64Binary" use="required"/>
</xs:complexType>
<xs:complexType name="CT_DataIntegrity">
<xs:annotation>
<xs:documentation>A complex type that specifies data used to verify whether the encrypted data passes an integrity check. It MUST be generated using the method specified in section 2.3.4.14 (http://msdn.microsoft.com/en-us/library/dd924068(v=office.12).aspx).</xs:documentation>
</xs:annotation>
<xs:attribute name="encryptedHmacKey" type="xs:base64Binary" use="required">
<xs:annotation>
<xs:documentation>A base64-encoded value that specifies an encrypted key used in calculating the encryptedHmacValue.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="encryptedHmacValue" type="xs:base64Binary" use="required">
<xs:annotation>
<xs:documentation>A base64-encoded value that specifies an HMAC derived from encryptedHmacKey and the encrypted data.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="CT_KeyEncryptor">
<xs:annotation>
<xs:appinfo>modified for POI</xs:appinfo>
<xs:documentation>A complex type that specifies the parameters used to encrypt an intermediate key, which is used to perform the final encryption of the document. To ensure extensibility, arbitrary elements can be defined to encrypt the intermediate key. The intermediate key MUST be the same for all KeyEncryptor elements.</xs:documentation>
</xs:annotation>
<xs:choice>
<xs:element ref="p:encryptedKey"/>
<xs:element ref="c:encryptedKey"/>
</xs:choice>
<xs:attribute name="uri">
<xs:annotation>
<xs:appinfo>modified for POI</xs:appinfo>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="http://schemas.microsoft.com/office/2006/keyEncryptor/password"/>
<xs:enumeration value="http://schemas.microsoft.com/office/2006/keyEncryptor/certificate"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
<xs:complexType name="CT_KeyEncryptors">
<xs:annotation>
<xs:documentation>A sequence of KeyEncryptor elements. Exactly one KeyEncryptors element MUST be present, and the KeyEncryptors element MUST contain at least one KeyEncryptor.</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="keyEncryptor" type="CT_KeyEncryptor" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="CT_Encryption">
<xs:sequence>
<xs:element name="keyData" type="CT_KeyData"/>
<xs:element name="dataIntegrity" type="CT_DataIntegrity">
<xs:annotation>
<xs:appinfo>modified for POI</xs:appinfo>
<xs:documentation>All ECMA-376 documents [ECMA-376] encrypted by Microsoft Office using agile encryption will have a DataIntegrity element present. The schema allows for a DataIntegrity element to not be present because the encryption schema can be used by applications that do not create ECMA-376 documents [ECMA-376].</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="keyEncryptors" type="CT_KeyEncryptors">
<xs:annotation>
<xs:documentation>The KeyEncryptor element, which MUST be used when encrypting password-protected agile encryption documents, is either a PasswordKeyEncryptor or a CertificateKeyEncryptor. Exactly one PasswordKeyEncryptor MUST be present. Zero or more CertificateKeyEncryptor elements are contained within the KeyEncryptors element.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:element name="encryption" type="CT_Encryption"/>
</xs:schema>

View File

@ -1,25 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
====================================================================
-->
<xb:config xmlns:xb="http://xml.apache.org/xmlbeans/2004/02/xbean/config" xmlns:c="http://schemas.microsoft.com/office/2006/keyEncryptor/certificate" xmlns:p="http://schemas.microsoft.com/office/2006/keyEncryptor/password">
<xb:qname name="c:encryptedKey" javaname="EncryptedCertificateKey"/>
<xb:qname name="p:encryptedKey" javaname="EncryptedPasswordKey"/>
<?xml version="1.0" encoding="UTF-8"?>
<!--
====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
====================================================================
-->
<xb:config xmlns:xb="http://xml.apache.org/xmlbeans/2004/02/xbean/config" xmlns:c="http://schemas.microsoft.com/office/2006/keyEncryptor/certificate" xmlns:p="http://schemas.microsoft.com/office/2006/keyEncryptor/password">
<xb:qname name="c:encryptedKey" javaname="EncryptedCertificateKey"/>
<xb:qname name="p:encryptedKey" javaname="EncryptedPasswordKey"/>
</xb:config>

View File

@ -1,66 +1,66 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
====================================================================
-->
<xs:schema xmlns="http://schemas.microsoft.com/office/2006/keyEncryptor/password" xmlns:e="http://schemas.microsoft.com/office/2006/encryption" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://schemas.microsoft.com/office/2006/keyEncryptor/password" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:import namespace="http://schemas.microsoft.com/office/2006/encryption" schemaLocation="encryptionInfo.xsd"/>
<xs:simpleType name="ST_PasswordKeyEncryptorUri">
<xs:restriction base="xs:token">
<xs:enumeration value="http://schemas.microsoft.com/office/2006/keyEncryptor/password"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="CT_PasswordKeyEncryptor">
<xs:attribute name="saltSize" type="e:ST_SaltSize" use="required">
<xs:annotation><xs:documentation>A SaltSize that specifies the size of the salt for a PasswordKeyEncryptor.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="blockSize" type="e:ST_BlockSize" use="required">
<xs:annotation><xs:documentation>A BlockSize that specifies the block size for a PasswordKeyEncryptor.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="keyBits" type="e:ST_KeyBits" use="required">
<xs:annotation><xs:documentation>A KeyBits that specifies the number of bits for a PasswordKeyEncryptor.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="hashSize" type="e:ST_HashSize" use="required">
<xs:annotation><xs:documentation>A HashSize that specifies the size of the binary form of the hash for a PasswordKeyEncryptor.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="cipherAlgorithm" type="e:ST_CipherAlgorithm" use="required">
<xs:annotation><xs:documentation>A CipherAlgorithm that specifies the cipher algorithm for a PasswordKeyEncryptor. The cipher algorithm specified MUST be the same as the cipher algorithm specified for the Encryption.keyData element.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="cipherChaining" type="e:ST_CipherChaining" use="required">
<xs:annotation><xs:documentation>A CipherChaining that specifies the cipher chaining mode for a PasswordKeyEncryptor.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="hashAlgorithm" type="e:ST_HashAlgorithm" use="required">
<xs:annotation><xs:documentation>A HashAlgorithm that specifies the hashing algorithm for a PasswordKeyEncryptor. The hashing algorithm specified MUST be the same as the hashing algorithm specified for the Encryption.keyData element.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="saltValue" type="xs:base64Binary" use="required">
<xs:annotation><xs:documentation>A base64-encoded binary byte array that specifies the salt value for a PasswordKeyEncryptor. The number of bytes required by the decoded form of this element MUST be saltSize.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="spinCount" type="e:ST_SpinCount" use="required">
<xs:annotation><xs:documentation>A SpinCount that specifies the spin count for a PasswordKeyEncryptor.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="encryptedVerifierHashInput" type="xs:base64Binary" use="required">
<xs:annotation><xs:documentation>A base64-encoded value that specifies the encrypted verifier hash input for a PasswordKeyEncryptor used in password verification.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="encryptedVerifierHashValue" type="xs:base64Binary" use="required">
<xs:annotation><xs:documentation>A base64-encoded value that specifies the encrypted verifier hash value for a PasswordKeyEncryptor used in password verification.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="encryptedKeyValue" type="xs:base64Binary" use="required">
<xs:annotation><xs:documentation>A base64-encoded value that specifies the encrypted form of the intermediate key.</xs:documentation></xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:element name="encryptedKey" type="CT_PasswordKeyEncryptor"/>
</xs:schema>
<?xml version="1.0" encoding="utf-8"?>
<!--
====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
====================================================================
-->
<xs:schema xmlns="http://schemas.microsoft.com/office/2006/keyEncryptor/password" xmlns:e="http://schemas.microsoft.com/office/2006/encryption" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://schemas.microsoft.com/office/2006/keyEncryptor/password" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:import namespace="http://schemas.microsoft.com/office/2006/encryption" schemaLocation="encryptionInfo.xsd"/>
<xs:simpleType name="ST_PasswordKeyEncryptorUri">
<xs:restriction base="xs:token">
<xs:enumeration value="http://schemas.microsoft.com/office/2006/keyEncryptor/password"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="CT_PasswordKeyEncryptor">
<xs:attribute name="saltSize" type="e:ST_SaltSize" use="required">
<xs:annotation><xs:documentation>A SaltSize that specifies the size of the salt for a PasswordKeyEncryptor.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="blockSize" type="e:ST_BlockSize" use="required">
<xs:annotation><xs:documentation>A BlockSize that specifies the block size for a PasswordKeyEncryptor.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="keyBits" type="e:ST_KeyBits" use="required">
<xs:annotation><xs:documentation>A KeyBits that specifies the number of bits for a PasswordKeyEncryptor.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="hashSize" type="e:ST_HashSize" use="required">
<xs:annotation><xs:documentation>A HashSize that specifies the size of the binary form of the hash for a PasswordKeyEncryptor.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="cipherAlgorithm" type="e:ST_CipherAlgorithm" use="required">
<xs:annotation><xs:documentation>A CipherAlgorithm that specifies the cipher algorithm for a PasswordKeyEncryptor. The cipher algorithm specified MUST be the same as the cipher algorithm specified for the Encryption.keyData element.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="cipherChaining" type="e:ST_CipherChaining" use="required">
<xs:annotation><xs:documentation>A CipherChaining that specifies the cipher chaining mode for a PasswordKeyEncryptor.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="hashAlgorithm" type="e:ST_HashAlgorithm" use="required">
<xs:annotation><xs:documentation>A HashAlgorithm that specifies the hashing algorithm for a PasswordKeyEncryptor. The hashing algorithm specified MUST be the same as the hashing algorithm specified for the Encryption.keyData element.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="saltValue" type="xs:base64Binary" use="required">
<xs:annotation><xs:documentation>A base64-encoded binary byte array that specifies the salt value for a PasswordKeyEncryptor. The number of bytes required by the decoded form of this element MUST be saltSize.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="spinCount" type="e:ST_SpinCount" use="required">
<xs:annotation><xs:documentation>A SpinCount that specifies the spin count for a PasswordKeyEncryptor.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="encryptedVerifierHashInput" type="xs:base64Binary" use="required">
<xs:annotation><xs:documentation>A base64-encoded value that specifies the encrypted verifier hash input for a PasswordKeyEncryptor used in password verification.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="encryptedVerifierHashValue" type="xs:base64Binary" use="required">
<xs:annotation><xs:documentation>A base64-encoded value that specifies the encrypted verifier hash value for a PasswordKeyEncryptor used in password verification.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="encryptedKeyValue" type="xs:base64Binary" use="required">
<xs:annotation><xs:documentation>A base64-encoded value that specifies the encrypted form of the intermediate key.</xs:documentation></xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:element name="encryptedKey" type="CT_PasswordKeyEncryptor"/>
</xs:schema>

View File

@ -1,24 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
====================================================================
-->
<xb:config xmlns:xb="http://xml.apache.org/xmlbeans/2004/02/xbean/config" xmlns:p="http://schemas.microsoft.com/office/2006/keyEncryptor/password">
<xb:qname name="p:encryptedKey" javaname="EncryptedPasswordKey"/>
<?xml version="1.0" encoding="UTF-8"?>
<!--
====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
====================================================================
-->
<xb:config xmlns:xb="http://xml.apache.org/xmlbeans/2004/02/xbean/config" xmlns:p="http://schemas.microsoft.com/office/2006/keyEncryptor/password">
<xb:qname name="p:encryptedKey" javaname="EncryptedPasswordKey"/>
</xb:config>

View File

@ -1,103 +1,103 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
====================================================================
-->
<xsd:schema targetNamespace="http://schemas.microsoft.com/office/2006/digsig" elementFormDefault="qualified" xmlns="http://schemas.microsoft.com/office/2006/digsig" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:simpleType name="ST_PositiveInteger">
<xsd:restriction base="xsd:int">
<xsd:minExclusive value="0"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="ST_SignatureComments">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="255"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="ST_SignatureProviderUrl">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="2083"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="ST_SignatureText">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="100"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="ST_SignatureType">
<xsd:restriction base="xsd:int">
<xsd:enumeration value="1"/>
<xsd:enumeration value="2"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="ST_Version">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="64"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="ST_UniqueIdentifierWithBraces">
<xsd:restriction base="xsd:string">
<xsd:pattern value="\{[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}\}|"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:group name="EG_RequiredChildren">
<xsd:sequence>
<xsd:element name="SetupID" type="ST_UniqueIdentifierWithBraces"/>
<xsd:element name="SignatureText" type="ST_SignatureText"/>
<xsd:element name="SignatureImage" type="xsd:base64Binary"/>
<xsd:element name="SignatureComments" type="ST_SignatureComments"/>
<xsd:element name="WindowsVersion" type="ST_Version"/>
<xsd:element name="OfficeVersion" type="ST_Version"/>
<xsd:element name="ApplicationVersion" type="ST_Version"/>
<xsd:element name="Monitors" type="ST_PositiveInteger"/>
<xsd:element name="HorizontalResolution" type="ST_PositiveInteger"/>
<xsd:element name="VerticalResolution" type="ST_PositiveInteger"/>
<xsd:element name="ColorDepth" type="ST_PositiveInteger"/>
<xsd:element name="SignatureProviderId" type="ST_UniqueIdentifierWithBraces"/>
<xsd:element name="SignatureProviderUrl" type="ST_SignatureProviderUrl"/>
<xsd:element name="SignatureProviderDetails" type="xsd:int"/>
<xsd:element name="SignatureType" type="ST_SignatureType"/>
</xsd:sequence>
</xsd:group>
<xsd:group name="EG_OptionalChildren">
<xsd:sequence>
<xsd:element name="DelegateSuggestedSigner" type="xsd:string"/>
<xsd:element name="DelegateSuggestedSigner2" type="xsd:string"/>
<xsd:element name="DelegateSuggestedSignerEmail" type="xsd:string"/>
<xsd:element name="ManifestHashAlgorithm" type="xsd:anyURI" minOccurs="0"/>
</xsd:sequence>
</xsd:group>
<xsd:group name="EG_OptionalChildrenV2">
<xsd:sequence>
<xsd:element name="Address1" type="xsd:string"/>
<xsd:element name="Address2" type="xsd:string"/>
</xsd:sequence>
</xsd:group>
<xsd:complexType name="CT_SignatureInfoV1">
<xsd:sequence>
<xsd:group ref="EG_RequiredChildren"/>
<xsd:group ref="EG_OptionalChildren" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CT_SignatureInfoV2">
<xsd:sequence>
<xsd:group ref="EG_OptionalChildrenV2" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="SignatureInfoV1" type="CT_SignatureInfoV1"/>
<xsd:element name="SignatureInfoV2" type="CT_SignatureInfoV2"/>
<?xml version="1.0" encoding="utf-8"?>
<!--
====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
====================================================================
-->
<xsd:schema targetNamespace="http://schemas.microsoft.com/office/2006/digsig" elementFormDefault="qualified" xmlns="http://schemas.microsoft.com/office/2006/digsig" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:simpleType name="ST_PositiveInteger">
<xsd:restriction base="xsd:int">
<xsd:minExclusive value="0"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="ST_SignatureComments">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="255"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="ST_SignatureProviderUrl">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="2083"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="ST_SignatureText">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="100"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="ST_SignatureType">
<xsd:restriction base="xsd:int">
<xsd:enumeration value="1"/>
<xsd:enumeration value="2"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="ST_Version">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="64"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="ST_UniqueIdentifierWithBraces">
<xsd:restriction base="xsd:string">
<xsd:pattern value="\{[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}\}|"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:group name="EG_RequiredChildren">
<xsd:sequence>
<xsd:element name="SetupID" type="ST_UniqueIdentifierWithBraces"/>
<xsd:element name="SignatureText" type="ST_SignatureText"/>
<xsd:element name="SignatureImage" type="xsd:base64Binary"/>
<xsd:element name="SignatureComments" type="ST_SignatureComments"/>
<xsd:element name="WindowsVersion" type="ST_Version"/>
<xsd:element name="OfficeVersion" type="ST_Version"/>
<xsd:element name="ApplicationVersion" type="ST_Version"/>
<xsd:element name="Monitors" type="ST_PositiveInteger"/>
<xsd:element name="HorizontalResolution" type="ST_PositiveInteger"/>
<xsd:element name="VerticalResolution" type="ST_PositiveInteger"/>
<xsd:element name="ColorDepth" type="ST_PositiveInteger"/>
<xsd:element name="SignatureProviderId" type="ST_UniqueIdentifierWithBraces"/>
<xsd:element name="SignatureProviderUrl" type="ST_SignatureProviderUrl"/>
<xsd:element name="SignatureProviderDetails" type="xsd:int"/>
<xsd:element name="SignatureType" type="ST_SignatureType"/>
</xsd:sequence>
</xsd:group>
<xsd:group name="EG_OptionalChildren">
<xsd:sequence>
<xsd:element name="DelegateSuggestedSigner" type="xsd:string"/>
<xsd:element name="DelegateSuggestedSigner2" type="xsd:string"/>
<xsd:element name="DelegateSuggestedSignerEmail" type="xsd:string"/>
<xsd:element name="ManifestHashAlgorithm" type="xsd:anyURI" minOccurs="0"/>
</xsd:sequence>
</xsd:group>
<xsd:group name="EG_OptionalChildrenV2">
<xsd:sequence>
<xsd:element name="Address1" type="xsd:string"/>
<xsd:element name="Address2" type="xsd:string"/>
</xsd:sequence>
</xsd:group>
<xsd:complexType name="CT_SignatureInfoV1">
<xsd:sequence>
<xsd:group ref="EG_RequiredChildren"/>
<xsd:group ref="EG_OptionalChildren" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CT_SignatureInfoV2">
<xsd:sequence>
<xsd:group ref="EG_OptionalChildrenV2" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="SignatureInfoV1" type="CT_SignatureInfoV1"/>
<xsd:element name="SignatureInfoV2" type="CT_SignatureInfoV2"/>
</xsd:schema>

View File

@ -1,466 +1,466 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://uri.etsi.org/01903/v1.3.2#" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://uri.etsi.org/01903/v1.3.2#" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" elementFormDefault="qualified">
<xsd:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd"/>
<!-- Start auxiliary types definitions: AnyType, ObjectIdentifierType,
EncapsulatedPKIDataType and containers for time-stamp tokens -->
<!-- Start AnyType -->
<xsd:element name="Any" type="AnyType"/>
<xsd:complexType name="AnyType" mixed="true">
<xsd:sequence minOccurs="0" maxOccurs="unbounded">
<xsd:any namespace="##any" processContents="lax"/>
</xsd:sequence>
<xsd:anyAttribute namespace="##any"/>
</xsd:complexType>
<!-- End AnyType -->
<!-- Start ObjectIdentifierType-->
<xsd:element name="ObjectIdentifier" type="ObjectIdentifierType"/>
<xsd:complexType name="ObjectIdentifierType">
<xsd:sequence>
<xsd:element name="Identifier" type="IdentifierType"/>
<xsd:element name="Description" type="xsd:string" minOccurs="0"/>
<xsd:element name="DocumentationReferences" type="DocumentationReferencesType" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="IdentifierType">
<xsd:simpleContent>
<xsd:extension base="xsd:anyURI">
<xsd:attribute name="Qualifier" type="QualifierType" use="optional"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
<xsd:simpleType name="QualifierType">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="OIDAsURI"/>
<xsd:enumeration value="OIDAsURN"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="DocumentationReferencesType">
<xsd:sequence maxOccurs="unbounded">
<xsd:element name="DocumentationReference" type="xsd:anyURI"/>
</xsd:sequence>
</xsd:complexType>
<!-- End ObjectIdentifierType-->
<!-- Start EncapsulatedPKIDataType-->
<xsd:element name="EncapsulatedPKIData" type="EncapsulatedPKIDataType"/>
<xsd:complexType name="EncapsulatedPKIDataType">
<xsd:simpleContent>
<xsd:extension base="xsd:base64Binary">
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
<xsd:attribute name="Encoding" type="xsd:anyURI" use="optional"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
<!-- End EncapsulatedPKIDataType -->
<!-- Start time-stamp containers types -->
<!-- Start GenericTimeStampType -->
<xsd:element name="Include" type="IncludeType"/>
<xsd:complexType name="IncludeType">
<xsd:attribute name="URI" type="xsd:anyURI" use="required"/>
<xsd:attribute name="referencedData" type="xsd:boolean" use="optional"/>
</xsd:complexType>
<xsd:element name="ReferenceInfo" type="ReferenceInfoType"/>
<xsd:complexType name="ReferenceInfoType">
<xsd:sequence>
<xsd:element ref="ds:DigestMethod"/>
<xsd:element ref="ds:DigestValue"/>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
<xsd:attribute name="URI" type="xsd:anyURI" use="optional"/>
</xsd:complexType>
<xsd:complexType name="GenericTimeStampType" abstract="true">
<xsd:sequence>
<xsd:choice minOccurs="0">
<xsd:element ref="Include" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="ReferenceInfo" maxOccurs="unbounded"/>
</xsd:choice>
<xsd:element ref="ds:CanonicalizationMethod" minOccurs="0"/>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="EncapsulatedTimeStamp" type="EncapsulatedPKIDataType"/>
<xsd:element name="XMLTimeStamp" type="AnyType"/>
</xsd:choice>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End GenericTimeStampType -->
<!-- Start XAdESTimeStampType -->
<xsd:element name="XAdESTimeStamp" type="XAdESTimeStampType"/>
<xsd:complexType name="XAdESTimeStampType">
<xsd:complexContent>
<xsd:restriction base="GenericTimeStampType">
<xsd:sequence>
<xsd:element ref="Include" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="ds:CanonicalizationMethod" minOccurs="0"/>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="EncapsulatedTimeStamp" type="EncapsulatedPKIDataType"/>
<xsd:element name="XMLTimeStamp" type="AnyType"/>
</xsd:choice>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
<!-- End XAdESTimeStampType -->
<!-- Start OtherTimeStampType -->
<xsd:element name="OtherTimeStamp" type="OtherTimeStampType"/>
<xsd:complexType name="OtherTimeStampType">
<xsd:complexContent>
<xsd:restriction base="GenericTimeStampType">
<xsd:sequence>
<xsd:element ref="ReferenceInfo" maxOccurs="unbounded"/>
<xsd:element ref="ds:CanonicalizationMethod" minOccurs="0"/>
<xsd:choice>
<xsd:element name="EncapsulatedTimeStamp" type="EncapsulatedPKIDataType"/>
<xsd:element name="XMLTimeStamp" type="AnyType"/>
</xsd:choice>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
<!-- End OtherTimeStampType -->
<!-- End time-stamp containers types -->
<!-- End auxiliary types definitions-->
<!-- Start container types -->
<!-- Start QualifyingProperties -->
<xsd:element name="QualifyingProperties" type="QualifyingPropertiesType"/>
<xsd:complexType name="QualifyingPropertiesType">
<xsd:sequence>
<xsd:element name="SignedProperties" type="SignedPropertiesType" minOccurs="0"/>
<xsd:element name="UnsignedProperties" type="UnsignedPropertiesType" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="Target" type="xsd:anyURI" use="required"/>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End QualifyingProperties -->
<!-- Start SignedProperties-->
<xsd:element name="SignedProperties" type="SignedPropertiesType"/>
<xsd:complexType name="SignedPropertiesType">
<xsd:sequence>
<xsd:element name="SignedSignatureProperties" type="SignedSignaturePropertiesType" minOccurs="0"/>
<xsd:element name="SignedDataObjectProperties" type="SignedDataObjectPropertiesType" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End SignedProperties-->
<!-- Start UnsignedProperties-->
<xsd:element name="UnsignedProperties" type="UnsignedPropertiesType"/>
<xsd:complexType name="UnsignedPropertiesType">
<xsd:sequence>
<xsd:element name="UnsignedSignatureProperties" type="UnsignedSignaturePropertiesType" minOccurs="0"/>
<xsd:element name="UnsignedDataObjectProperties" type="UnsignedDataObjectPropertiesType" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End UnsignedProperties-->
<!-- Start SignedSignatureProperties-->
<xsd:element name="SignedSignatureProperties" type="SignedSignaturePropertiesType"/>
<xsd:complexType name="SignedSignaturePropertiesType">
<xsd:sequence>
<xsd:element name="SigningTime" type="xsd:dateTime" minOccurs="0"/>
<xsd:element name="SigningCertificate" type="CertIDListType" minOccurs="0"/>
<xsd:element name="SignaturePolicyIdentifier" type="SignaturePolicyIdentifierType" minOccurs="0"/>
<xsd:element name="SignatureProductionPlace" type="SignatureProductionPlaceType" minOccurs="0"/>
<xsd:element name="SignerRole" type="SignerRoleType" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End SignedSignatureProperties-->
<!-- Start SignedDataObjectProperties-->
<xsd:element name="SignedDataObjectProperties" type="SignedDataObjectPropertiesType"/>
<xsd:complexType name="SignedDataObjectPropertiesType">
<xsd:sequence>
<xsd:element name="DataObjectFormat" type="DataObjectFormatType" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="CommitmentTypeIndication" type="CommitmentTypeIndicationType" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="AllDataObjectsTimeStamp" type="XAdESTimeStampType" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="IndividualDataObjectsTimeStamp" type="XAdESTimeStampType" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End SignedDataObjectProperties-->
<!-- Start UnsignedSignatureProperties-->
<xsd:element name="UnsignedSignatureProperties" type="UnsignedSignaturePropertiesType"/>
<xsd:complexType name="UnsignedSignaturePropertiesType">
<xsd:choice maxOccurs="unbounded">
<xsd:element name="CounterSignature" type="CounterSignatureType"/>
<xsd:element name="SignatureTimeStamp" type="XAdESTimeStampType"/>
<xsd:element name="CompleteCertificateRefs" type="CompleteCertificateRefsType"/>
<xsd:element name="CompleteRevocationRefs" type="CompleteRevocationRefsType"/>
<xsd:element name="AttributeCertificateRefs" type="CompleteCertificateRefsType"/>
<xsd:element name="AttributeRevocationRefs" type="CompleteRevocationRefsType"/>
<xsd:element name="SigAndRefsTimeStamp" type="XAdESTimeStampType"/>
<xsd:element name="RefsOnlyTimeStamp" type="XAdESTimeStampType"/>
<xsd:element name="CertificateValues" type="CertificateValuesType"/>
<xsd:element name="RevocationValues" type="RevocationValuesType"/>
<xsd:element name="AttrAuthoritiesCertValues" type="CertificateValuesType"/>
<xsd:element name="AttributeRevocationValues" type="RevocationValuesType"/>
<xsd:element name="ArchiveTimeStamp" type="XAdESTimeStampType"/>
<xsd:any namespace="##other"/>
</xsd:choice>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End UnsignedSignatureProperties-->
<!-- Start UnsignedDataObjectProperties-->
<xsd:element name="UnsignedDataObjectProperties" type="UnsignedDataObjectPropertiesType"/>
<xsd:complexType name="UnsignedDataObjectPropertiesType">
<xsd:sequence>
<xsd:element name="UnsignedDataObjectProperty" type="AnyType" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End UnsignedDataObjectProperties-->
<!-- Start QualifyingPropertiesReference-->
<xsd:element name="QualifyingPropertiesReference" type="QualifyingPropertiesReferenceType"/>
<xsd:complexType name="QualifyingPropertiesReferenceType">
<xsd:attribute name="URI" type="xsd:anyURI" use="required"/>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End QualifyingPropertiesReference-->
<!-- End container types -->
<!-- Start SigningTime element -->
<xsd:element name="SigningTime" type="xsd:dateTime"/>
<!-- End SigningTime element -->
<!-- Start SigningCertificate -->
<xsd:element name="SigningCertificate" type="CertIDListType"/>
<xsd:complexType name="CertIDListType">
<xsd:sequence>
<xsd:element name="Cert" type="CertIDType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CertIDType">
<xsd:sequence>
<xsd:element name="CertDigest" type="DigestAlgAndValueType"/>
<xsd:element name="IssuerSerial" type="ds:X509IssuerSerialType"/>
</xsd:sequence>
<xsd:attribute name="URI" type="xsd:anyURI" use="optional"/>
</xsd:complexType>
<xsd:complexType name="DigestAlgAndValueType">
<xsd:sequence>
<xsd:element ref="ds:DigestMethod"/>
<xsd:element ref="ds:DigestValue"/>
</xsd:sequence>
</xsd:complexType>
<!-- End SigningCertificate -->
<!-- Start SignaturePolicyIdentifier -->
<xsd:element name="SignaturePolicyIdentifier" type="SignaturePolicyIdentifierType"/>
<xsd:complexType name="SignaturePolicyIdentifierType">
<xsd:choice>
<xsd:element name="SignaturePolicyId" type="SignaturePolicyIdType"/>
<xsd:element name="SignaturePolicyImplied"/>
</xsd:choice>
</xsd:complexType>
<xsd:complexType name="SignaturePolicyIdType">
<xsd:sequence>
<xsd:element name="SigPolicyId" type="ObjectIdentifierType"/>
<xsd:element ref="ds:Transforms" minOccurs="0"/>
<xsd:element name="SigPolicyHash" type="DigestAlgAndValueType"/>
<xsd:element name="SigPolicyQualifiers" type="SigPolicyQualifiersListType" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="SigPolicyQualifiersListType">
<xsd:sequence>
<xsd:element name="SigPolicyQualifier" type="AnyType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="SPURI" type="xsd:anyURI"/>
<xsd:element name="SPUserNotice" type="SPUserNoticeType"/>
<xsd:complexType name="SPUserNoticeType">
<xsd:sequence>
<xsd:element name="NoticeRef" type="NoticeReferenceType" minOccurs="0"/>
<xsd:element name="ExplicitText" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="NoticeReferenceType">
<xsd:sequence>
<xsd:element name="Organization" type="xsd:string"/>
<xsd:element name="NoticeNumbers" type="IntegerListType"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="IntegerListType">
<xsd:sequence>
<xsd:element name="int" type="xsd:integer" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<!-- End SignaturePolicyIdentifier -->
<!-- Start CounterSignature -->
<xsd:element name="CounterSignature" type="CounterSignatureType"/>
<xsd:complexType name="CounterSignatureType">
<xsd:sequence>
<xsd:element ref="ds:Signature"/>
</xsd:sequence>
</xsd:complexType>
<!-- End CounterSignature -->
<!-- Start DataObjectFormat -->
<xsd:element name="DataObjectFormat" type="DataObjectFormatType"/>
<xsd:complexType name="DataObjectFormatType">
<xsd:sequence>
<xsd:element name="Description" type="xsd:string" minOccurs="0"/>
<xsd:element name="ObjectIdentifier" type="ObjectIdentifierType" minOccurs="0"/>
<xsd:element name="MimeType" type="xsd:string" minOccurs="0"/>
<xsd:element name="Encoding" type="xsd:anyURI" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="ObjectReference" type="xsd:anyURI" use="required"/>
</xsd:complexType>
<!-- End DataObjectFormat -->
<!-- Start CommitmentTypeIndication -->
<xsd:element name="CommitmentTypeIndication" type="CommitmentTypeIndicationType"/>
<xsd:complexType name="CommitmentTypeIndicationType">
<xsd:sequence>
<xsd:element name="CommitmentTypeId" type="ObjectIdentifierType"/>
<xsd:choice>
<xsd:element name="ObjectReference" type="xsd:anyURI" maxOccurs="unbounded"/>
<xsd:element name="AllSignedDataObjects"/>
</xsd:choice>
<xsd:element name="CommitmentTypeQualifiers" type="CommitmentTypeQualifiersListType" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CommitmentTypeQualifiersListType">
<xsd:sequence>
<xsd:element name="CommitmentTypeQualifier" type="AnyType" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<!-- End CommitmentTypeIndication -->
<!-- Start SignatureProductionPlace -->
<xsd:element name="SignatureProductionPlace" type="SignatureProductionPlaceType"/>
<xsd:complexType name="SignatureProductionPlaceType">
<xsd:sequence>
<xsd:element name="City" type="xsd:string" minOccurs="0"/>
<xsd:element name="StateOrProvince" type="xsd:string" minOccurs="0"/>
<xsd:element name="PostalCode" type="xsd:string" minOccurs="0"/>
<xsd:element name="CountryName" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<!-- End SignatureProductionPlace -->
<!-- Start SignerRole -->
<xsd:element name="SignerRole" type="SignerRoleType"/>
<xsd:complexType name="SignerRoleType">
<xsd:sequence>
<xsd:element name="ClaimedRoles" type="ClaimedRolesListType" minOccurs="0"/>
<xsd:element name="CertifiedRoles" type="CertifiedRolesListType" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="ClaimedRolesListType">
<xsd:sequence>
<xsd:element name="ClaimedRole" type="AnyType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CertifiedRolesListType">
<xsd:sequence>
<xsd:element name="CertifiedRole" type="EncapsulatedPKIDataType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<!-- End SignerRole -->
<xsd:element name="AllDataObjectsTimeStamp" type="XAdESTimeStampType"/>
<xsd:element name="IndividualDataObjectsTimeStamp" type="XAdESTimeStampType"/>
<xsd:element name="SignatureTimeStamp" type="XAdESTimeStampType"/>
<!-- Start CompleteCertificateRefs -->
<xsd:element name="CompleteCertificateRefs" type="CompleteCertificateRefsType"/>
<xsd:complexType name="CompleteCertificateRefsType">
<xsd:sequence>
<xsd:element name="CertRefs" type="CertIDListType"/>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End CompleteCertificateRefs -->
<!-- Start CompleteRevocationRefs-->
<xsd:element name="CompleteRevocationRefs" type="CompleteRevocationRefsType"/>
<xsd:complexType name="CompleteRevocationRefsType">
<xsd:sequence>
<xsd:element name="CRLRefs" type="CRLRefsType" minOccurs="0"/>
<xsd:element name="OCSPRefs" type="OCSPRefsType" minOccurs="0"/>
<xsd:element name="OtherRefs" type="OtherCertStatusRefsType" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<xsd:complexType name="CRLRefsType">
<xsd:sequence>
<xsd:element name="CRLRef" type="CRLRefType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CRLRefType">
<xsd:sequence>
<xsd:element name="DigestAlgAndValue" type="DigestAlgAndValueType"/>
<xsd:element name="CRLIdentifier" type="CRLIdentifierType" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CRLIdentifierType">
<xsd:sequence>
<xsd:element name="Issuer" type="xsd:string"/>
<xsd:element name="IssueTime" type="xsd:dateTime"/>
<xsd:element name="Number" type="xsd:integer" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="URI" type="xsd:anyURI" use="optional"/>
</xsd:complexType>
<xsd:complexType name="OCSPRefsType">
<xsd:sequence>
<xsd:element name="OCSPRef" type="OCSPRefType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="OCSPRefType">
<xsd:sequence>
<xsd:element name="OCSPIdentifier" type="OCSPIdentifierType"/>
<xsd:element name="DigestAlgAndValue" type="DigestAlgAndValueType" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="ResponderIDType">
<xsd:choice>
<xsd:element name="ByName" type="xsd:string"/>
<xsd:element name="ByKey" type="xsd:base64Binary"/>
</xsd:choice>
</xsd:complexType>
<xsd:complexType name="OCSPIdentifierType">
<xsd:sequence>
<xsd:element name="ResponderID" type="ResponderIDType"/>
<xsd:element name="ProducedAt" type="xsd:dateTime"/>
</xsd:sequence>
<xsd:attribute name="URI" type="xsd:anyURI" use="optional"/>
</xsd:complexType>
<xsd:complexType name="OtherCertStatusRefsType">
<xsd:sequence>
<xsd:element name="OtherRef" type="AnyType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<!-- End CompleteRevocationRefs-->
<xsd:element name="AttributeCertificateRefs" type="CompleteCertificateRefsType"/>
<xsd:element name="AttributeRevocationRefs" type="CompleteRevocationRefsType"/>
<xsd:element name="SigAndRefsTimeStamp" type="XAdESTimeStampType"/>
<xsd:element name="RefsOnlyTimeStamp" type="XAdESTimeStampType"/>
<!-- Start CertificateValues -->
<xsd:element name="CertificateValues" type="CertificateValuesType"/>
<xsd:complexType name="CertificateValuesType">
<xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:element name="EncapsulatedX509Certificate" type="EncapsulatedPKIDataType"/>
<xsd:element name="OtherCertificate" type="AnyType"/>
</xsd:choice>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End CertificateValues -->
<!-- Start RevocationValues-->
<xsd:element name="RevocationValues" type="RevocationValuesType"/>
<xsd:complexType name="RevocationValuesType">
<xsd:sequence>
<xsd:element name="CRLValues" type="CRLValuesType" minOccurs="0"/>
<xsd:element name="OCSPValues" type="OCSPValuesType" minOccurs="0"/>
<xsd:element name="OtherValues" type="OtherCertStatusValuesType" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<xsd:complexType name="CRLValuesType">
<xsd:sequence>
<xsd:element name="EncapsulatedCRLValue" type="EncapsulatedPKIDataType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="OCSPValuesType">
<xsd:sequence>
<xsd:element name="EncapsulatedOCSPValue" type="EncapsulatedPKIDataType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="OtherCertStatusValuesType">
<xsd:sequence>
<xsd:element name="OtherValue" type="AnyType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<!-- End RevocationValues-->
<xsd:element name="AttrAuthoritiesCertValues" type="CertificateValuesType"/>
<xsd:element name="AttributeRevocationValues" type="RevocationValuesType"/>
<xsd:element name="ArchiveTimeStamp" type="XAdESTimeStampType"/>
</xsd:schema>
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://uri.etsi.org/01903/v1.3.2#" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://uri.etsi.org/01903/v1.3.2#" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" elementFormDefault="qualified">
<xsd:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd"/>
<!-- Start auxiliary types definitions: AnyType, ObjectIdentifierType,
EncapsulatedPKIDataType and containers for time-stamp tokens -->
<!-- Start AnyType -->
<xsd:element name="Any" type="AnyType"/>
<xsd:complexType name="AnyType" mixed="true">
<xsd:sequence minOccurs="0" maxOccurs="unbounded">
<xsd:any namespace="##any" processContents="lax"/>
</xsd:sequence>
<xsd:anyAttribute namespace="##any"/>
</xsd:complexType>
<!-- End AnyType -->
<!-- Start ObjectIdentifierType-->
<xsd:element name="ObjectIdentifier" type="ObjectIdentifierType"/>
<xsd:complexType name="ObjectIdentifierType">
<xsd:sequence>
<xsd:element name="Identifier" type="IdentifierType"/>
<xsd:element name="Description" type="xsd:string" minOccurs="0"/>
<xsd:element name="DocumentationReferences" type="DocumentationReferencesType" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="IdentifierType">
<xsd:simpleContent>
<xsd:extension base="xsd:anyURI">
<xsd:attribute name="Qualifier" type="QualifierType" use="optional"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
<xsd:simpleType name="QualifierType">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="OIDAsURI"/>
<xsd:enumeration value="OIDAsURN"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="DocumentationReferencesType">
<xsd:sequence maxOccurs="unbounded">
<xsd:element name="DocumentationReference" type="xsd:anyURI"/>
</xsd:sequence>
</xsd:complexType>
<!-- End ObjectIdentifierType-->
<!-- Start EncapsulatedPKIDataType-->
<xsd:element name="EncapsulatedPKIData" type="EncapsulatedPKIDataType"/>
<xsd:complexType name="EncapsulatedPKIDataType">
<xsd:simpleContent>
<xsd:extension base="xsd:base64Binary">
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
<xsd:attribute name="Encoding" type="xsd:anyURI" use="optional"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
<!-- End EncapsulatedPKIDataType -->
<!-- Start time-stamp containers types -->
<!-- Start GenericTimeStampType -->
<xsd:element name="Include" type="IncludeType"/>
<xsd:complexType name="IncludeType">
<xsd:attribute name="URI" type="xsd:anyURI" use="required"/>
<xsd:attribute name="referencedData" type="xsd:boolean" use="optional"/>
</xsd:complexType>
<xsd:element name="ReferenceInfo" type="ReferenceInfoType"/>
<xsd:complexType name="ReferenceInfoType">
<xsd:sequence>
<xsd:element ref="ds:DigestMethod"/>
<xsd:element ref="ds:DigestValue"/>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
<xsd:attribute name="URI" type="xsd:anyURI" use="optional"/>
</xsd:complexType>
<xsd:complexType name="GenericTimeStampType" abstract="true">
<xsd:sequence>
<xsd:choice minOccurs="0">
<xsd:element ref="Include" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="ReferenceInfo" maxOccurs="unbounded"/>
</xsd:choice>
<xsd:element ref="ds:CanonicalizationMethod" minOccurs="0"/>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="EncapsulatedTimeStamp" type="EncapsulatedPKIDataType"/>
<xsd:element name="XMLTimeStamp" type="AnyType"/>
</xsd:choice>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End GenericTimeStampType -->
<!-- Start XAdESTimeStampType -->
<xsd:element name="XAdESTimeStamp" type="XAdESTimeStampType"/>
<xsd:complexType name="XAdESTimeStampType">
<xsd:complexContent>
<xsd:restriction base="GenericTimeStampType">
<xsd:sequence>
<xsd:element ref="Include" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="ds:CanonicalizationMethod" minOccurs="0"/>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="EncapsulatedTimeStamp" type="EncapsulatedPKIDataType"/>
<xsd:element name="XMLTimeStamp" type="AnyType"/>
</xsd:choice>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
<!-- End XAdESTimeStampType -->
<!-- Start OtherTimeStampType -->
<xsd:element name="OtherTimeStamp" type="OtherTimeStampType"/>
<xsd:complexType name="OtherTimeStampType">
<xsd:complexContent>
<xsd:restriction base="GenericTimeStampType">
<xsd:sequence>
<xsd:element ref="ReferenceInfo" maxOccurs="unbounded"/>
<xsd:element ref="ds:CanonicalizationMethod" minOccurs="0"/>
<xsd:choice>
<xsd:element name="EncapsulatedTimeStamp" type="EncapsulatedPKIDataType"/>
<xsd:element name="XMLTimeStamp" type="AnyType"/>
</xsd:choice>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
<!-- End OtherTimeStampType -->
<!-- End time-stamp containers types -->
<!-- End auxiliary types definitions-->
<!-- Start container types -->
<!-- Start QualifyingProperties -->
<xsd:element name="QualifyingProperties" type="QualifyingPropertiesType"/>
<xsd:complexType name="QualifyingPropertiesType">
<xsd:sequence>
<xsd:element name="SignedProperties" type="SignedPropertiesType" minOccurs="0"/>
<xsd:element name="UnsignedProperties" type="UnsignedPropertiesType" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="Target" type="xsd:anyURI" use="required"/>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End QualifyingProperties -->
<!-- Start SignedProperties-->
<xsd:element name="SignedProperties" type="SignedPropertiesType"/>
<xsd:complexType name="SignedPropertiesType">
<xsd:sequence>
<xsd:element name="SignedSignatureProperties" type="SignedSignaturePropertiesType" minOccurs="0"/>
<xsd:element name="SignedDataObjectProperties" type="SignedDataObjectPropertiesType" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End SignedProperties-->
<!-- Start UnsignedProperties-->
<xsd:element name="UnsignedProperties" type="UnsignedPropertiesType"/>
<xsd:complexType name="UnsignedPropertiesType">
<xsd:sequence>
<xsd:element name="UnsignedSignatureProperties" type="UnsignedSignaturePropertiesType" minOccurs="0"/>
<xsd:element name="UnsignedDataObjectProperties" type="UnsignedDataObjectPropertiesType" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End UnsignedProperties-->
<!-- Start SignedSignatureProperties-->
<xsd:element name="SignedSignatureProperties" type="SignedSignaturePropertiesType"/>
<xsd:complexType name="SignedSignaturePropertiesType">
<xsd:sequence>
<xsd:element name="SigningTime" type="xsd:dateTime" minOccurs="0"/>
<xsd:element name="SigningCertificate" type="CertIDListType" minOccurs="0"/>
<xsd:element name="SignaturePolicyIdentifier" type="SignaturePolicyIdentifierType" minOccurs="0"/>
<xsd:element name="SignatureProductionPlace" type="SignatureProductionPlaceType" minOccurs="0"/>
<xsd:element name="SignerRole" type="SignerRoleType" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End SignedSignatureProperties-->
<!-- Start SignedDataObjectProperties-->
<xsd:element name="SignedDataObjectProperties" type="SignedDataObjectPropertiesType"/>
<xsd:complexType name="SignedDataObjectPropertiesType">
<xsd:sequence>
<xsd:element name="DataObjectFormat" type="DataObjectFormatType" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="CommitmentTypeIndication" type="CommitmentTypeIndicationType" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="AllDataObjectsTimeStamp" type="XAdESTimeStampType" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="IndividualDataObjectsTimeStamp" type="XAdESTimeStampType" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End SignedDataObjectProperties-->
<!-- Start UnsignedSignatureProperties-->
<xsd:element name="UnsignedSignatureProperties" type="UnsignedSignaturePropertiesType"/>
<xsd:complexType name="UnsignedSignaturePropertiesType">
<xsd:choice maxOccurs="unbounded">
<xsd:element name="CounterSignature" type="CounterSignatureType"/>
<xsd:element name="SignatureTimeStamp" type="XAdESTimeStampType"/>
<xsd:element name="CompleteCertificateRefs" type="CompleteCertificateRefsType"/>
<xsd:element name="CompleteRevocationRefs" type="CompleteRevocationRefsType"/>
<xsd:element name="AttributeCertificateRefs" type="CompleteCertificateRefsType"/>
<xsd:element name="AttributeRevocationRefs" type="CompleteRevocationRefsType"/>
<xsd:element name="SigAndRefsTimeStamp" type="XAdESTimeStampType"/>
<xsd:element name="RefsOnlyTimeStamp" type="XAdESTimeStampType"/>
<xsd:element name="CertificateValues" type="CertificateValuesType"/>
<xsd:element name="RevocationValues" type="RevocationValuesType"/>
<xsd:element name="AttrAuthoritiesCertValues" type="CertificateValuesType"/>
<xsd:element name="AttributeRevocationValues" type="RevocationValuesType"/>
<xsd:element name="ArchiveTimeStamp" type="XAdESTimeStampType"/>
<xsd:any namespace="##other"/>
</xsd:choice>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End UnsignedSignatureProperties-->
<!-- Start UnsignedDataObjectProperties-->
<xsd:element name="UnsignedDataObjectProperties" type="UnsignedDataObjectPropertiesType"/>
<xsd:complexType name="UnsignedDataObjectPropertiesType">
<xsd:sequence>
<xsd:element name="UnsignedDataObjectProperty" type="AnyType" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End UnsignedDataObjectProperties-->
<!-- Start QualifyingPropertiesReference-->
<xsd:element name="QualifyingPropertiesReference" type="QualifyingPropertiesReferenceType"/>
<xsd:complexType name="QualifyingPropertiesReferenceType">
<xsd:attribute name="URI" type="xsd:anyURI" use="required"/>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End QualifyingPropertiesReference-->
<!-- End container types -->
<!-- Start SigningTime element -->
<xsd:element name="SigningTime" type="xsd:dateTime"/>
<!-- End SigningTime element -->
<!-- Start SigningCertificate -->
<xsd:element name="SigningCertificate" type="CertIDListType"/>
<xsd:complexType name="CertIDListType">
<xsd:sequence>
<xsd:element name="Cert" type="CertIDType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CertIDType">
<xsd:sequence>
<xsd:element name="CertDigest" type="DigestAlgAndValueType"/>
<xsd:element name="IssuerSerial" type="ds:X509IssuerSerialType"/>
</xsd:sequence>
<xsd:attribute name="URI" type="xsd:anyURI" use="optional"/>
</xsd:complexType>
<xsd:complexType name="DigestAlgAndValueType">
<xsd:sequence>
<xsd:element ref="ds:DigestMethod"/>
<xsd:element ref="ds:DigestValue"/>
</xsd:sequence>
</xsd:complexType>
<!-- End SigningCertificate -->
<!-- Start SignaturePolicyIdentifier -->
<xsd:element name="SignaturePolicyIdentifier" type="SignaturePolicyIdentifierType"/>
<xsd:complexType name="SignaturePolicyIdentifierType">
<xsd:choice>
<xsd:element name="SignaturePolicyId" type="SignaturePolicyIdType"/>
<xsd:element name="SignaturePolicyImplied"/>
</xsd:choice>
</xsd:complexType>
<xsd:complexType name="SignaturePolicyIdType">
<xsd:sequence>
<xsd:element name="SigPolicyId" type="ObjectIdentifierType"/>
<xsd:element ref="ds:Transforms" minOccurs="0"/>
<xsd:element name="SigPolicyHash" type="DigestAlgAndValueType"/>
<xsd:element name="SigPolicyQualifiers" type="SigPolicyQualifiersListType" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="SigPolicyQualifiersListType">
<xsd:sequence>
<xsd:element name="SigPolicyQualifier" type="AnyType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="SPURI" type="xsd:anyURI"/>
<xsd:element name="SPUserNotice" type="SPUserNoticeType"/>
<xsd:complexType name="SPUserNoticeType">
<xsd:sequence>
<xsd:element name="NoticeRef" type="NoticeReferenceType" minOccurs="0"/>
<xsd:element name="ExplicitText" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="NoticeReferenceType">
<xsd:sequence>
<xsd:element name="Organization" type="xsd:string"/>
<xsd:element name="NoticeNumbers" type="IntegerListType"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="IntegerListType">
<xsd:sequence>
<xsd:element name="int" type="xsd:integer" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<!-- End SignaturePolicyIdentifier -->
<!-- Start CounterSignature -->
<xsd:element name="CounterSignature" type="CounterSignatureType"/>
<xsd:complexType name="CounterSignatureType">
<xsd:sequence>
<xsd:element ref="ds:Signature"/>
</xsd:sequence>
</xsd:complexType>
<!-- End CounterSignature -->
<!-- Start DataObjectFormat -->
<xsd:element name="DataObjectFormat" type="DataObjectFormatType"/>
<xsd:complexType name="DataObjectFormatType">
<xsd:sequence>
<xsd:element name="Description" type="xsd:string" minOccurs="0"/>
<xsd:element name="ObjectIdentifier" type="ObjectIdentifierType" minOccurs="0"/>
<xsd:element name="MimeType" type="xsd:string" minOccurs="0"/>
<xsd:element name="Encoding" type="xsd:anyURI" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="ObjectReference" type="xsd:anyURI" use="required"/>
</xsd:complexType>
<!-- End DataObjectFormat -->
<!-- Start CommitmentTypeIndication -->
<xsd:element name="CommitmentTypeIndication" type="CommitmentTypeIndicationType"/>
<xsd:complexType name="CommitmentTypeIndicationType">
<xsd:sequence>
<xsd:element name="CommitmentTypeId" type="ObjectIdentifierType"/>
<xsd:choice>
<xsd:element name="ObjectReference" type="xsd:anyURI" maxOccurs="unbounded"/>
<xsd:element name="AllSignedDataObjects"/>
</xsd:choice>
<xsd:element name="CommitmentTypeQualifiers" type="CommitmentTypeQualifiersListType" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CommitmentTypeQualifiersListType">
<xsd:sequence>
<xsd:element name="CommitmentTypeQualifier" type="AnyType" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<!-- End CommitmentTypeIndication -->
<!-- Start SignatureProductionPlace -->
<xsd:element name="SignatureProductionPlace" type="SignatureProductionPlaceType"/>
<xsd:complexType name="SignatureProductionPlaceType">
<xsd:sequence>
<xsd:element name="City" type="xsd:string" minOccurs="0"/>
<xsd:element name="StateOrProvince" type="xsd:string" minOccurs="0"/>
<xsd:element name="PostalCode" type="xsd:string" minOccurs="0"/>
<xsd:element name="CountryName" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<!-- End SignatureProductionPlace -->
<!-- Start SignerRole -->
<xsd:element name="SignerRole" type="SignerRoleType"/>
<xsd:complexType name="SignerRoleType">
<xsd:sequence>
<xsd:element name="ClaimedRoles" type="ClaimedRolesListType" minOccurs="0"/>
<xsd:element name="CertifiedRoles" type="CertifiedRolesListType" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="ClaimedRolesListType">
<xsd:sequence>
<xsd:element name="ClaimedRole" type="AnyType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CertifiedRolesListType">
<xsd:sequence>
<xsd:element name="CertifiedRole" type="EncapsulatedPKIDataType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<!-- End SignerRole -->
<xsd:element name="AllDataObjectsTimeStamp" type="XAdESTimeStampType"/>
<xsd:element name="IndividualDataObjectsTimeStamp" type="XAdESTimeStampType"/>
<xsd:element name="SignatureTimeStamp" type="XAdESTimeStampType"/>
<!-- Start CompleteCertificateRefs -->
<xsd:element name="CompleteCertificateRefs" type="CompleteCertificateRefsType"/>
<xsd:complexType name="CompleteCertificateRefsType">
<xsd:sequence>
<xsd:element name="CertRefs" type="CertIDListType"/>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End CompleteCertificateRefs -->
<!-- Start CompleteRevocationRefs-->
<xsd:element name="CompleteRevocationRefs" type="CompleteRevocationRefsType"/>
<xsd:complexType name="CompleteRevocationRefsType">
<xsd:sequence>
<xsd:element name="CRLRefs" type="CRLRefsType" minOccurs="0"/>
<xsd:element name="OCSPRefs" type="OCSPRefsType" minOccurs="0"/>
<xsd:element name="OtherRefs" type="OtherCertStatusRefsType" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<xsd:complexType name="CRLRefsType">
<xsd:sequence>
<xsd:element name="CRLRef" type="CRLRefType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CRLRefType">
<xsd:sequence>
<xsd:element name="DigestAlgAndValue" type="DigestAlgAndValueType"/>
<xsd:element name="CRLIdentifier" type="CRLIdentifierType" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CRLIdentifierType">
<xsd:sequence>
<xsd:element name="Issuer" type="xsd:string"/>
<xsd:element name="IssueTime" type="xsd:dateTime"/>
<xsd:element name="Number" type="xsd:integer" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="URI" type="xsd:anyURI" use="optional"/>
</xsd:complexType>
<xsd:complexType name="OCSPRefsType">
<xsd:sequence>
<xsd:element name="OCSPRef" type="OCSPRefType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="OCSPRefType">
<xsd:sequence>
<xsd:element name="OCSPIdentifier" type="OCSPIdentifierType"/>
<xsd:element name="DigestAlgAndValue" type="DigestAlgAndValueType" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="ResponderIDType">
<xsd:choice>
<xsd:element name="ByName" type="xsd:string"/>
<xsd:element name="ByKey" type="xsd:base64Binary"/>
</xsd:choice>
</xsd:complexType>
<xsd:complexType name="OCSPIdentifierType">
<xsd:sequence>
<xsd:element name="ResponderID" type="ResponderIDType"/>
<xsd:element name="ProducedAt" type="xsd:dateTime"/>
</xsd:sequence>
<xsd:attribute name="URI" type="xsd:anyURI" use="optional"/>
</xsd:complexType>
<xsd:complexType name="OtherCertStatusRefsType">
<xsd:sequence>
<xsd:element name="OtherRef" type="AnyType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<!-- End CompleteRevocationRefs-->
<xsd:element name="AttributeCertificateRefs" type="CompleteCertificateRefsType"/>
<xsd:element name="AttributeRevocationRefs" type="CompleteRevocationRefsType"/>
<xsd:element name="SigAndRefsTimeStamp" type="XAdESTimeStampType"/>
<xsd:element name="RefsOnlyTimeStamp" type="XAdESTimeStampType"/>
<!-- Start CertificateValues -->
<xsd:element name="CertificateValues" type="CertificateValuesType"/>
<xsd:complexType name="CertificateValuesType">
<xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:element name="EncapsulatedX509Certificate" type="EncapsulatedPKIDataType"/>
<xsd:element name="OtherCertificate" type="AnyType"/>
</xsd:choice>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End CertificateValues -->
<!-- Start RevocationValues-->
<xsd:element name="RevocationValues" type="RevocationValuesType"/>
<xsd:complexType name="RevocationValuesType">
<xsd:sequence>
<xsd:element name="CRLValues" type="CRLValuesType" minOccurs="0"/>
<xsd:element name="OCSPValues" type="OCSPValuesType" minOccurs="0"/>
<xsd:element name="OtherValues" type="OtherCertStatusValuesType" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<xsd:complexType name="CRLValuesType">
<xsd:sequence>
<xsd:element name="EncapsulatedCRLValue" type="EncapsulatedPKIDataType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="OCSPValuesType">
<xsd:sequence>
<xsd:element name="EncapsulatedOCSPValue" type="EncapsulatedPKIDataType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="OtherCertStatusValuesType">
<xsd:sequence>
<xsd:element name="OtherValue" type="AnyType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<!-- End RevocationValues-->
<xsd:element name="AttrAuthoritiesCertValues" type="CertificateValuesType"/>
<xsd:element name="AttributeRevocationValues" type="RevocationValuesType"/>
<xsd:element name="ArchiveTimeStamp" type="XAdESTimeStampType"/>
</xsd:schema>

View File

@ -1,15 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://uri.etsi.org/01903/v1.4.1#" xmlns="http://uri.etsi.org/01903/v1.4.1#" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xades="http://uri.etsi.org/01903/v1.3.2#" elementFormDefault="qualified">
<xsd:import namespace="http://uri.etsi.org/01903/v1.3.2#" schemaLocation="http://uri.etsi.org/01903/v1.3.2/XAdES.xsd"/>
<!-- Start CertificateValues -->
<xsd:element name="TimeStampValidationData" type="ValidationDataType"/>
<xsd:complexType name="ValidationDataType">
<xsd:sequence>
<xsd:element ref="xades:CertificateValues" minOccurs="0"/>
<xsd:element ref="xades:RevocationValues" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
<xsd:attribute name="URI" type="xsd:anyURI" use="optional"/>
</xsd:complexType>
<xsd:element name="ArchiveTimeStamp" type="xades:XAdESTimeStampType"/>
</xsd:schema>
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://uri.etsi.org/01903/v1.4.1#" xmlns="http://uri.etsi.org/01903/v1.4.1#" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xades="http://uri.etsi.org/01903/v1.3.2#" elementFormDefault="qualified">
<xsd:import namespace="http://uri.etsi.org/01903/v1.3.2#" schemaLocation="http://uri.etsi.org/01903/v1.3.2/XAdES.xsd"/>
<!-- Start CertificateValues -->
<xsd:element name="TimeStampValidationData" type="ValidationDataType"/>
<xsd:complexType name="ValidationDataType">
<xsd:sequence>
<xsd:element ref="xades:CertificateValues" minOccurs="0"/>
<xsd:element ref="xades:RevocationValues" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
<xsd:attribute name="URI" type="xsd:anyURI" use="optional"/>
</xsd:complexType>
<xsd:element name="ArchiveTimeStamp" type="xades:XAdESTimeStampType"/>
</xsd:schema>

View File

@ -1,50 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
====================================================================
-->
<xb:config xmlns:xb="http://xml.apache.org/xmlbeans/2004/02/xbean/config">
<xb:namespace uri="urn:schemas-microsoft-com:office:office">
<xb:package>com.microsoft.schemas.office.office</xb:package>
</xb:namespace>
<xb:namespace uri="urn:schemas-microsoft-com:office:excel">
<xb:package>com.microsoft.schemas.office.excel</xb:package>
</xb:namespace>
<xb:namespace uri="urn:schemas-microsoft-com:office:word">
<xb:package>com.microsoft.schemas.office.word</xb:package>
</xb:namespace>
<xb:namespace uri="urn:schemas-microsoft-com:office:powerpoint">
<xb:package>com.microsoft.schemas.office.powerpoint</xb:package>
</xb:namespace>
<xb:namespace uri="urn:schemas-microsoft-com:vml">
<xb:package>com.microsoft.schemas.vml</xb:package>
</xb:namespace>
<xb:namespace uri="http://schemas.openxmlformats.org/markup-compatibility/2006">
<xb:package>com.microsoft.schemas.compatibility</xb:package>
</xb:namespace>
<xb:namespace uri="urn:schemas-poi-apache-org:vmldrawing">
<xb:package>org.apache.poi.schemas.vmldrawing</xb:package>
</xb:namespace>
<?xml version="1.0" encoding="UTF-8"?>
<!--
====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
====================================================================
-->
<xb:config xmlns:xb="http://xml.apache.org/xmlbeans/2004/02/xbean/config">
<xb:namespace uri="urn:schemas-microsoft-com:office:office">
<xb:package>com.microsoft.schemas.office.office</xb:package>
</xb:namespace>
<xb:namespace uri="urn:schemas-microsoft-com:office:excel">
<xb:package>com.microsoft.schemas.office.excel</xb:package>
</xb:namespace>
<xb:namespace uri="urn:schemas-microsoft-com:office:word">
<xb:package>com.microsoft.schemas.office.word</xb:package>
</xb:namespace>
<xb:namespace uri="urn:schemas-microsoft-com:office:powerpoint">
<xb:package>com.microsoft.schemas.office.powerpoint</xb:package>
</xb:namespace>
<xb:namespace uri="urn:schemas-microsoft-com:vml">
<xb:package>com.microsoft.schemas.vml</xb:package>
</xb:namespace>
<xb:namespace uri="http://schemas.openxmlformats.org/markup-compatibility/2006">
<xb:package>com.microsoft.schemas.compatibility</xb:package>
</xb:namespace>
<xb:namespace uri="urn:schemas-poi-apache-org:vmldrawing">
<xb:package>org.apache.poi.schemas.vmldrawing</xb:package>
</xb:namespace>
</xb:config>

View File

@ -1,562 +0,0 @@
<xsd:schema attributeFormDefault="qualified" blockDefault="#all" elementFormDefault="qualified"
targetNamespace="http://schemas.microsoft.com/office/word/2010/wordml"
xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
xmlns:w06="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
xmlns:od06st="http://schemas.openxmlformats.org/officeDocument/2006/sharedTypes"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.microsoft.com/office/word/2010/wordml">
<xsd:complexType name="CT_LongHexNumber">
<xsd:attribute name="val" type="w06:ST_LongHexNumber" use="required"/>
</xsd:complexType>
<xsd:simpleType name="ST_OnOff">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="true"/>
<xsd:enumeration value="false"/>
<xsd:enumeration value="0"/>
<xsd:enumeration value="1"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="CT_OnOff">
<xsd:attribute name="val" type="ST_OnOff"/>
</xsd:complexType>
<xsd:element name="docId" type="CT_LongHexNumber"/>
<xsd:element name="conflictMode" type="CT_OnOff"/>
<xsd:attributeGroup name="AG_Parids">
<xsd:attribute name="paraId" type="w06:ST_LongHexNumber"/>
<xsd:attribute name="textId" type="w06:ST_LongHexNumber"/>
</xsd:attributeGroup>
<xsd:attribute name="anchorId" type="w06:ST_LongHexNumber"/>
<xsd:attribute name="noSpellErr" type="od06st:ST_OnOff"/>
<xsd:element name="customXmlConflictInsRangeStart" type="w06:CT_TrackChange"/>
<xsd:element name="customXmlConflictInsRangeEnd" type="w06:CT_Markup"/>
<xsd:element name="customXmlConflictDelRangeStart" type="w06:CT_TrackChange"/>
<xsd:element name="customXmlConflictDelRangeEnd" type="w06:CT_Markup"/>
<xsd:group name="EG_RunLevelConflicts">
<xsd:sequence>
<xsd:element name="conflictIns" type="w06:CT_RunTrackChange" minOccurs="0"/>
<xsd:element name="conflictDel" type="w06:CT_RunTrackChange" minOccurs="0"/>
</xsd:sequence>
</xsd:group>
<xsd:group name="EG_Conflicts">
<xsd:choice>
<xsd:element name="conflictIns" type="w06:CT_TrackChange" minOccurs="0"/>
<xsd:element name="conflictDel" type="w06:CT_TrackChange" minOccurs="0"/>
</xsd:choice>
</xsd:group>
<xsd:complexType name="CT_Percentage">
<xsd:attribute name="val" type="a:ST_Percentage" use="required"/>
</xsd:complexType>
<xsd:complexType name="CT_PositiveFixedPercentage">
<xsd:attribute name="val" type="a:ST_PositiveFixedPercentage" use="required"/>
</xsd:complexType>
<xsd:complexType name="CT_PositivePercentage">
<xsd:attribute name="val" type="a:ST_PositivePercentage" use="required"/>
</xsd:complexType>
<xsd:simpleType name="ST_SchemeColorVal">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="bg1"/>
<xsd:enumeration value="tx1"/>
<xsd:enumeration value="bg2"/>
<xsd:enumeration value="tx2"/>
<xsd:enumeration value="accent1"/>
<xsd:enumeration value="accent2"/>
<xsd:enumeration value="accent3"/>
<xsd:enumeration value="accent4"/>
<xsd:enumeration value="accent5"/>
<xsd:enumeration value="accent6"/>
<xsd:enumeration value="hlink"/>
<xsd:enumeration value="folHlink"/>
<xsd:enumeration value="dk1"/>
<xsd:enumeration value="lt1"/>
<xsd:enumeration value="dk2"/>
<xsd:enumeration value="lt2"/>
<xsd:enumeration value="phClr"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="ST_RectAlignment">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="none"/>
<xsd:enumeration value="tl"/>
<xsd:enumeration value="t"/>
<xsd:enumeration value="tr"/>
<xsd:enumeration value="l"/>
<xsd:enumeration value="ctr"/>
<xsd:enumeration value="r"/>
<xsd:enumeration value="bl"/>
<xsd:enumeration value="b"/>
<xsd:enumeration value="br"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="ST_PathShadeType">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="shape"/>
<xsd:enumeration value="circle"/>
<xsd:enumeration value="rect"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="ST_LineCap">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="rnd"/>
<xsd:enumeration value="sq"/>
<xsd:enumeration value="flat"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="ST_PresetLineDashVal">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="solid"/>
<xsd:enumeration value="dot"/>
<xsd:enumeration value="sysDot"/>
<xsd:enumeration value="dash"/>
<xsd:enumeration value="sysDash"/>
<xsd:enumeration value="lgDash"/>
<xsd:enumeration value="dashDot"/>
<xsd:enumeration value="sysDashDot"/>
<xsd:enumeration value="lgDashDot"/>
<xsd:enumeration value="lgDashDotDot"/>
<xsd:enumeration value="sysDashDotDot"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="ST_PenAlignment">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="ctr"/>
<xsd:enumeration value="in"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="ST_CompoundLine">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="sng"/>
<xsd:enumeration value="dbl"/>
<xsd:enumeration value="thickThin"/>
<xsd:enumeration value="thinThick"/>
<xsd:enumeration value="tri"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="CT_RelativeRect">
<xsd:attribute name="l" use="optional" type="a:ST_Percentage"/>
<xsd:attribute name="t" use="optional" type="a:ST_Percentage"/>
<xsd:attribute name="r" use="optional" type="a:ST_Percentage"/>
<xsd:attribute name="b" use="optional" type="a:ST_Percentage"/>
</xsd:complexType>
<xsd:group name="EG_ColorTransform">
<xsd:choice>
<xsd:element name="tint" type="CT_PositiveFixedPercentage"/>
<xsd:element name="shade" type="CT_PositiveFixedPercentage"/>
<xsd:element name="alpha" type="CT_PositiveFixedPercentage"/>
<xsd:element name="hueMod" type="CT_PositivePercentage"/>
<xsd:element name="sat" type="CT_Percentage"/>
<xsd:element name="satOff" type="CT_Percentage"/>
<xsd:element name="satMod" type="CT_Percentage"/>
<xsd:element name="lum" type="CT_Percentage"/>
<xsd:element name="lumOff" type="CT_Percentage"/>
<xsd:element name="lumMod" type="CT_Percentage"/>
</xsd:choice>
</xsd:group>
<xsd:complexType name="CT_SRgbColor">
<xsd:sequence>
<xsd:group ref="EG_ColorTransform" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="val" type="od06st:ST_HexColorRGB" use="required"/>
</xsd:complexType>
<xsd:complexType name="CT_SchemeColor">
<xsd:sequence>
<xsd:group ref="EG_ColorTransform" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="val" type="ST_SchemeColorVal" use="required"/>
</xsd:complexType>
<xsd:group name="EG_ColorChoice">
<xsd:choice>
<xsd:element name="srgbClr" type="CT_SRgbColor"/>
<xsd:element name="schemeClr" type="CT_SchemeColor"/>
</xsd:choice>
</xsd:group>
<xsd:complexType name="CT_Color">
<xsd:sequence>
<xsd:group ref="EG_ColorChoice"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CT_GradientStop">
<xsd:sequence>
<xsd:group ref="EG_ColorChoice"/>
</xsd:sequence>
<xsd:attribute name="pos" type="a:ST_PositiveFixedPercentage" use="required"/>
</xsd:complexType>
<xsd:complexType name="CT_GradientStopList">
<xsd:sequence>
<xsd:element name="gs" type="CT_GradientStop" minOccurs="2" maxOccurs="10"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CT_LinearShadeProperties">
<xsd:attribute name="ang" type="a:ST_PositiveFixedAngle" use="optional"/>
<xsd:attribute name="scaled" type="ST_OnOff" use="optional"/>
</xsd:complexType>
<xsd:complexType name="CT_PathShadeProperties">
<xsd:sequence>
<xsd:element name="fillToRect" type="CT_RelativeRect" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="path" type="ST_PathShadeType" use="optional"/>
</xsd:complexType>
<xsd:group name="EG_ShadeProperties">
<xsd:choice>
<xsd:element name="lin" type="CT_LinearShadeProperties"/>
<xsd:element name="path" type="CT_PathShadeProperties"/>
</xsd:choice>
</xsd:group>
<xsd:complexType name="CT_SolidColorFillProperties">
<xsd:sequence>
<xsd:group ref="EG_ColorChoice" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CT_GradientFillProperties">
<xsd:sequence>
<xsd:element name="gsLst" type="CT_GradientStopList" minOccurs="0"/>
<xsd:group ref="EG_ShadeProperties" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:group name="EG_FillProperties">
<xsd:choice>
<xsd:element name="noFill" type="w06:CT_Empty"/>
<xsd:element name="solidFill" type="CT_SolidColorFillProperties"/>
<xsd:element name="gradFill" type="CT_GradientFillProperties"/>
</xsd:choice>
</xsd:group>
<xsd:complexType name="CT_PresetLineDashProperties">
<xsd:attribute name="val" type="ST_PresetLineDashVal" use="optional"/>
</xsd:complexType>
<xsd:group name="EG_LineDashProperties">
<xsd:choice>
<xsd:element name="prstDash" type="CT_PresetLineDashProperties"/>
</xsd:choice>
</xsd:group>
<xsd:complexType name="CT_LineJoinMiterProperties">
<xsd:attribute name="lim" type="a:ST_PositivePercentage" use="optional"/>
</xsd:complexType>
<xsd:group name="EG_LineJoinProperties">
<xsd:choice>
<xsd:element name="round" type="w06:CT_Empty"/>
<xsd:element name="bevel" type="w06:CT_Empty"/>
<xsd:element name="miter" type="CT_LineJoinMiterProperties"/>
</xsd:choice>
</xsd:group>
<xsd:simpleType name="ST_PresetCameraType">
<xsd:restriction base="xsd:token">
<xsd:enumeration value="legacyObliqueTopLeft"/>
<xsd:enumeration value="legacyObliqueTop"/>
<xsd:enumeration value="legacyObliqueTopRight"/>
<xsd:enumeration value="legacyObliqueLeft"/>
<xsd:enumeration value="legacyObliqueFront"/>
<xsd:enumeration value="legacyObliqueRight"/>
<xsd:enumeration value="legacyObliqueBottomLeft"/>
<xsd:enumeration value="legacyObliqueBottom"/>
<xsd:enumeration value="legacyObliqueBottomRight"/>
<xsd:enumeration value="legacyPerspectiveTopLeft"/>
<xsd:enumeration value="legacyPerspectiveTop"/>
<xsd:enumeration value="legacyPerspectiveTopRight"/>
<xsd:enumeration value="legacyPerspectiveLeft"/>
<xsd:enumeration value="legacyPerspectiveFront"/>
<xsd:enumeration value="legacyPerspectiveRight"/>
<xsd:enumeration value="legacyPerspectiveBottomLeft"/>
<xsd:enumeration value="legacyPerspectiveBottom"/>
<xsd:enumeration value="legacyPerspectiveBottomRight"/>
<xsd:enumeration value="orthographicFront"/>
<xsd:enumeration value="isometricTopUp"/>
<xsd:enumeration value="isometricTopDown"/>
<xsd:enumeration value="isometricBottomUp"/>
<xsd:enumeration value="isometricBottomDown"/>
<xsd:enumeration value="isometricLeftUp"/>
<xsd:enumeration value="isometricLeftDown"/>
<xsd:enumeration value="isometricRightUp"/>
<xsd:enumeration value="isometricRightDown"/>
<xsd:enumeration value="isometricOffAxis1Left"/>
<xsd:enumeration value="isometricOffAxis1Right"/>
<xsd:enumeration value="isometricOffAxis1Top"/>
<xsd:enumeration value="isometricOffAxis2Left"/>
<xsd:enumeration value="isometricOffAxis2Right"/>
<xsd:enumeration value="isometricOffAxis2Top"/>
<xsd:enumeration value="isometricOffAxis3Left"/>
<xsd:enumeration value="isometricOffAxis3Right"/>
<xsd:enumeration value="isometricOffAxis3Bottom"/>
<xsd:enumeration value="isometricOffAxis4Left"/>
<xsd:enumeration value="isometricOffAxis4Right"/>
<xsd:enumeration value="isometricOffAxis4Bottom"/>
<xsd:enumeration value="obliqueTopLeft"/>
<xsd:enumeration value="obliqueTop"/>
<xsd:enumeration value="obliqueTopRight"/>
<xsd:enumeration value="obliqueLeft"/>
<xsd:enumeration value="obliqueRight"/>
<xsd:enumeration value="obliqueBottomLeft"/>
<xsd:enumeration value="obliqueBottom"/>
<xsd:enumeration value="obliqueBottomRight"/>
<xsd:enumeration value="perspectiveFront"/>
<xsd:enumeration value="perspectiveLeft"/>
<xsd:enumeration value="perspectiveRight"/>
<xsd:enumeration value="perspectiveAbove"/>
<xsd:enumeration value="perspectiveBelow"/>
<xsd:enumeration value="perspectiveAboveLeftFacing"/>
<xsd:enumeration value="perspectiveAboveRightFacing"/>
<xsd:enumeration value="perspectiveContrastingLeftFacing"/>
<xsd:enumeration value="perspectiveContrastingRightFacing"/>
<xsd:enumeration value="perspectiveHeroicLeftFacing"/>
<xsd:enumeration value="perspectiveHeroicRightFacing"/>
<xsd:enumeration value="perspectiveHeroicExtremeLeftFacing"/>
<xsd:enumeration value="perspectiveHeroicExtremeRightFacing"/>
<xsd:enumeration value="perspectiveRelaxed"/>
<xsd:enumeration value="perspectiveRelaxedModerately"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="CT_Camera">
<xsd:attribute name="prst" use="required" type="ST_PresetCameraType"/>
</xsd:complexType>
<xsd:complexType name="CT_SphereCoords">
<xsd:attribute name="lat" type="a:ST_PositiveFixedAngle" use="required"/>
<xsd:attribute name="lon" type="a:ST_PositiveFixedAngle" use="required"/>
<xsd:attribute name="rev" type="a:ST_PositiveFixedAngle" use="required"/>
</xsd:complexType>
<xsd:simpleType name="ST_LightRigType">
<xsd:restriction base="xsd:token">
<xsd:enumeration value="legacyFlat1"/>
<xsd:enumeration value="legacyFlat2"/>
<xsd:enumeration value="legacyFlat3"/>
<xsd:enumeration value="legacyFlat4"/>
<xsd:enumeration value="legacyNormal1"/>
<xsd:enumeration value="legacyNormal2"/>
<xsd:enumeration value="legacyNormal3"/>
<xsd:enumeration value="legacyNormal4"/>
<xsd:enumeration value="legacyHarsh1"/>
<xsd:enumeration value="legacyHarsh2"/>
<xsd:enumeration value="legacyHarsh3"/>
<xsd:enumeration value="legacyHarsh4"/>
<xsd:enumeration value="threePt"/>
<xsd:enumeration value="balanced"/>
<xsd:enumeration value="soft"/>
<xsd:enumeration value="harsh"/>
<xsd:enumeration value="flood"/>
<xsd:enumeration value="contrasting"/>
<xsd:enumeration value="morning"/>
<xsd:enumeration value="sunrise"/>
<xsd:enumeration value="sunset"/>
<xsd:enumeration value="chilly"/>
<xsd:enumeration value="freezing"/>
<xsd:enumeration value="flat"/>
<xsd:enumeration value="twoPt"/>
<xsd:enumeration value="glow"/>
<xsd:enumeration value="brightRoom"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="ST_LightRigDirection">
<xsd:restriction base="xsd:token">
<xsd:enumeration value="tl"/>
<xsd:enumeration value="t"/>
<xsd:enumeration value="tr"/>
<xsd:enumeration value="l"/>
<xsd:enumeration value="r"/>
<xsd:enumeration value="bl"/>
<xsd:enumeration value="b"/>
<xsd:enumeration value="br"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="CT_LightRig">
<xsd:sequence>
<xsd:element name="rot" type="CT_SphereCoords" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="rig" type="ST_LightRigType" use="required"/>
<xsd:attribute name="dir" type="ST_LightRigDirection" use="required"/>
</xsd:complexType>
<xsd:simpleType name="ST_BevelPresetType">
<xsd:restriction base="xsd:token">
<xsd:enumeration value="relaxedInset"/>
<xsd:enumeration value="circle"/>
<xsd:enumeration value="slope"/>
<xsd:enumeration value="cross"/>
<xsd:enumeration value="angle"/>
<xsd:enumeration value="softRound"/>
<xsd:enumeration value="convex"/>
<xsd:enumeration value="coolSlant"/>
<xsd:enumeration value="divot"/>
<xsd:enumeration value="riblet"/>
<xsd:enumeration value="hardEdge"/>
<xsd:enumeration value="artDeco"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="CT_Bevel">
<xsd:attribute name="w" type="a:ST_PositiveCoordinate" use="optional"/>
<xsd:attribute name="h" type="a:ST_PositiveCoordinate" use="optional"/>
<xsd:attribute name="prst" type="ST_BevelPresetType" use="optional"/>
</xsd:complexType>
<xsd:simpleType name="ST_PresetMaterialType">
<xsd:restriction base="xsd:token">
<xsd:enumeration value="legacyMatte"/>
<xsd:enumeration value="legacyPlastic"/>
<xsd:enumeration value="legacyMetal"/>
<xsd:enumeration value="legacyWireframe"/>
<xsd:enumeration value="matte"/>
<xsd:enumeration value="plastic"/>
<xsd:enumeration value="metal"/>
<xsd:enumeration value="warmMatte"/>
<xsd:enumeration value="translucentPowder"/>
<xsd:enumeration value="powder"/>
<xsd:enumeration value="dkEdge"/>
<xsd:enumeration value="softEdge"/>
<xsd:enumeration value="clear"/>
<xsd:enumeration value="flat"/>
<xsd:enumeration value="softmetal"/>
<xsd:enumeration value="none"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="CT_Glow">
<xsd:sequence>
<xsd:group ref="EG_ColorChoice"/>
</xsd:sequence>
<xsd:attribute name="rad" use="optional" type="a:ST_PositiveCoordinate"/>
</xsd:complexType>
<xsd:complexType name="CT_Shadow">
<xsd:sequence>
<xsd:group ref="EG_ColorChoice"/>
</xsd:sequence>
<xsd:attribute name="blurRad" use="optional" type="a:ST_PositiveCoordinate"/>
<xsd:attribute name="dist" use="optional" type="a:ST_PositiveCoordinate"/>
<xsd:attribute name="dir" use="optional" type="a:ST_PositiveFixedAngle"/>
<xsd:attribute name="sx" use="optional" type="a:ST_Percentage"/>
<xsd:attribute name="sy" use="optional" type="a:ST_Percentage"/>
<xsd:attribute name="kx" use="optional" type="a:ST_FixedAngle"/>
<xsd:attribute name="ky" use="optional" type="a:ST_FixedAngle"/>
<xsd:attribute name="algn" use="optional" type="ST_RectAlignment"/>
</xsd:complexType>
<xsd:complexType name="CT_Reflection">
<xsd:attribute name="blurRad" use="optional" type="a:ST_PositiveCoordinate"/>
<xsd:attribute name="stA" use="optional" type="a:ST_PositiveFixedPercentage"/>
<xsd:attribute name="stPos" use="optional" type="a:ST_PositiveFixedPercentage"/>
<xsd:attribute name="endA" use="optional" type="a:ST_PositiveFixedPercentage"/>
<xsd:attribute name="endPos" use="optional" type="a:ST_PositiveFixedPercentage"/>
<xsd:attribute name="dist" use="optional" type="a:ST_PositiveCoordinate"/>
<xsd:attribute name="dir" use="optional" type="a:ST_PositiveFixedAngle"/>
<xsd:attribute name="fadeDir" use="optional" type="a:ST_PositiveFixedAngle"/>
<xsd:attribute name="sx" use="optional" type="a:ST_Percentage"/>
<xsd:attribute name="sy" use="optional" type="a:ST_Percentage"/>
<xsd:attribute name="kx" use="optional" type="a:ST_FixedAngle"/>
<xsd:attribute name="ky" use="optional" type="a:ST_FixedAngle"/>
<xsd:attribute name="algn" use="optional" type="ST_RectAlignment"/>
</xsd:complexType>
<xsd:complexType name="CT_FillTextEffect">
<xsd:sequence>
<xsd:group ref="EG_FillProperties" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CT_TextOutlineEffect">
<xsd:sequence>
<xsd:group ref="EG_FillProperties" minOccurs="0"/>
<xsd:group ref="EG_LineDashProperties" minOccurs="0"/>
<xsd:group ref="EG_LineJoinProperties" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="w" use="optional" type="a:ST_LineWidth"/>
<xsd:attribute name="cap" use="optional" type="ST_LineCap"/>
<xsd:attribute name="cmpd" use="optional" type="ST_CompoundLine"/>
<xsd:attribute name="algn" use="optional" type="ST_PenAlignment"/>
</xsd:complexType>
<xsd:complexType name="CT_Scene3D">
<xsd:sequence>
<xsd:element name="camera" type="CT_Camera"/>
<xsd:element name="lightRig" type="CT_LightRig"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CT_Props3D">
<xsd:sequence>
<xsd:element name="bevelT" type="CT_Bevel" minOccurs="0"/>
<xsd:element name="bevelB" type="CT_Bevel" minOccurs="0"/>
<xsd:element name="extrusionClr" type="CT_Color" minOccurs="0"/>
<xsd:element name="contourClr" type="CT_Color" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="extrusionH" type="a:ST_PositiveCoordinate" use="optional"/>
<xsd:attribute name="contourW" type="a:ST_PositiveCoordinate" use="optional"/>
<xsd:attribute name="prstMaterial" type="ST_PresetMaterialType" use="optional"/>
</xsd:complexType>
<xsd:group name="EG_RPrTextEffects">
<xsd:sequence>
<xsd:element name="glow" minOccurs="0" type="CT_Glow"/>
<xsd:element name="shadow" minOccurs="0" type="CT_Shadow"/>
<xsd:element name="reflection" minOccurs="0" type="CT_Reflection"/>
<xsd:element name="textOutline" minOccurs="0" type="CT_TextOutlineEffect"/>
<xsd:element name="textFill" minOccurs="0" type="CT_FillTextEffect"/>
<xsd:element name="scene3d" minOccurs="0" type="CT_Scene3D"/>
<xsd:element name="props3d" minOccurs="0" type="CT_Props3D"/>
</xsd:sequence>
</xsd:group>
<xsd:simpleType name="ST_Ligatures">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="none"/>
<xsd:enumeration value="standard"/>
<xsd:enumeration value="contextual"/>
<xsd:enumeration value="historical"/>
<xsd:enumeration value="discretional"/>
<xsd:enumeration value="standardContextual"/>
<xsd:enumeration value="standardHistorical"/>
<xsd:enumeration value="contextualHistorical"/>
<xsd:enumeration value="standardDiscretional"/>
<xsd:enumeration value="contextualDiscretional"/>
<xsd:enumeration value="historicalDiscretional"/>
<xsd:enumeration value="standardContextualHistorical"/>
<xsd:enumeration value="standardContextualDiscretional"/>
<xsd:enumeration value="standardHistoricalDiscretional"/>
<xsd:enumeration value="contextualHistoricalDiscretional"/>
<xsd:enumeration value="all"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="CT_Ligatures">
<xsd:attribute name="val" type="ST_Ligatures" use="required"/>
</xsd:complexType>
<xsd:simpleType name="ST_NumForm">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="default"/>
<xsd:enumeration value="lining"/>
<xsd:enumeration value="oldStyle"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="CT_NumForm">
<xsd:attribute name="val" type="ST_NumForm" use="required"/>
</xsd:complexType>
<xsd:simpleType name="ST_NumSpacing">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="default"/>
<xsd:enumeration value="proportional"/>
<xsd:enumeration value="tabular"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="CT_NumSpacing">
<xsd:attribute name="val" type="ST_NumSpacing" use="required"/>
</xsd:complexType>
<xsd:complexType name="CT_StyleSet">
<xsd:attribute name="id" type="od06st:ST_UnsignedDecimalNumber" use="required"/>
<xsd:attribute name="val" type="ST_OnOff" use="optional"/>
</xsd:complexType>
<xsd:complexType name="CT_StylisticSets">
<xsd:sequence minOccurs="0">
<xsd:element name="styleSet" minOccurs="0" maxOccurs="unbounded" type="CT_StyleSet"/>
</xsd:sequence>
</xsd:complexType>
<xsd:group name="EG_RPrOpenType">
<xsd:sequence>
<xsd:element name="ligatures" minOccurs="0" type="CT_Ligatures"/>
<xsd:element name="numForm" minOccurs="0" type="CT_NumForm"/>
<xsd:element name="numSpacing" minOccurs="0" type="CT_NumSpacing"/>
<xsd:element name="stylisticSets" minOccurs="0" type="CT_StylisticSets"/>
<xsd:element name="cntxtAlts" minOccurs="0" type="CT_OnOff"/>
</xsd:sequence>
</xsd:group>
<xsd:element name="discardImageEditingData" type="CT_OnOff"/>
<xsd:element name="defaultImageDpi" type="CT_DefaultImageDpi"/>
<xsd:complexType name="CT_DefaultImageDpi">
<xsd:attribute name="val" type="w06:ST_DecimalNumber" use="required"/>
</xsd:complexType>
<xsd:element name="entityPicker" type="w06:CT_Empty"/>
<xsd:complexType name="CT_SdtCheckboxSymbol">
<xsd:attribute name="font" type="od06st:ST_String"/>
<xsd:attribute name="val" type="w06:ST_ShortHexNumber"/>
</xsd:complexType>
<xsd:complexType name="CT_SdtCheckbox">
<xsd:sequence>
<xsd:element name="checked" type="CT_OnOff" minOccurs="0"/>
<xsd:element name="checkedState" type="CT_SdtCheckboxSymbol" minOccurs="0"/>
<xsd:element name="uncheckedState" type="CT_SdtCheckboxSymbol" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="checkbox" type="CT_SdtCheckbox"/>
</xsd:schema>

View File

@ -22,8 +22,8 @@ sourceSets {
}
dependencies {
api 'net.bytebuddy:byte-buddy:1.18.5'
api 'net.bytebuddy:byte-buddy-agent:1.18.5'
api 'net.bytebuddy:byte-buddy:1.14.9'
api 'net.bytebuddy:byte-buddy-agent:1.14.9'
api "org.apache.xmlbeans:xmlbeans:${xmlbeansVersion}"
}
@ -36,27 +36,27 @@ java {
}
}
tasks.register('compileJava9', JavaCompile) {
task compileJava9(type: JavaCompile) {
dependsOn 'compileJava'
javaCompiler = javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(Math.max(11, jdkVersion))
}
sourceCompatibility = 11
targetCompatibility = 11
sourceCompatibility = 1.9
targetCompatibility = 1.9
destinationDirectory = file(JAVA9_OUT + VERSIONS9)
source = file(JAVA9_SRC)
classpath = files()
doFirst {
options.compilerArgs = [
'--patch-module', "${MODULE_NAME}=${sourceSets.main.output.classesDirs.asPath}",
'--module-path', sourceSets.main.compileClasspath.asPath
'--patch-module', "${MODULE_NAME}=${sourceSets.main.output.classesDirs.asPath}",
'--module-path', sourceSets.main.compileClasspath.asPath
]
}
}
jar {
destinationDirectory = file("../build/dist/maven/${base.archivesName.get()}")
destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}")
manifest {
attributes (

View File

@ -25,6 +25,7 @@ import java.lang.instrument.Instrumentation;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;
import java.security.ProtectionDomain;
import java.util.HashSet;
@ -77,7 +78,7 @@ public class OOXMLLiteAgent {
private static final Set<Integer> hashes = new HashSet<>();
static void load(String path) throws IOException {
logPath = Path.of(path);
logPath = Paths.get(path);
if (Files.exists(logPath)) {
try (Stream<String> stream = Files.lines(logPath)) {
stream.forEach((s) -> hashes.add(s.hashCode()));
@ -108,7 +109,7 @@ public class OOXMLLiteAgent {
}
void load(String path) throws IOException {
this.logPath = Path.of(path);
this.logPath = Paths.get(path);
if (Files.exists(this.logPath)) {
try (Stream<String> stream = Files.lines(this.logPath)) {
stream.forEach((s) -> hashes.add(s.hashCode()));

View File

@ -1,3 +1,5 @@
import java.util.regex.Pattern
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@ -15,10 +17,8 @@
limitations under the License.
==================================================================== */
import java.util.regex.Pattern
final String BEANS_SRC = layout.buildDirectory.dir('generated-sources').get().asFile.absolutePath
final String BEANS_RES = layout.buildDirectory.dir('generated-resources').get().asFile.absolutePath
final String BEANS_SRC = "${buildDir}/generated-sources"
final String BEANS_RES = "${buildDir}/generated-resources"
sourceSets {
main {
@ -43,7 +43,7 @@ final Pattern MODULE_REGEX = ~'\\.jar$'
final List MAIN_MODULE_PATH = sourceSets.main.runtimeClasspath.findAll{ it.path =~ MODULE_REGEX }.collect{ it.parent }.unique()
final String OOXML_LITE_REPORT = '../src/resources/ooxml-lite-report'
tasks.register('generateModuleInfo') {
task generateModuleInfo() {
File fileIn = file("${OOXML_LITE_REPORT}.clazz")
File fileOut = file("src/main/java9/module-info.java")
@ -55,8 +55,8 @@ tasks.register('generateModuleInfo') {
// generate module-info based on exported classes
String exports = fileIn.
collect { " exports ${it.replaceAll('[/\\\\][^/\\\\]+$', '').replaceAll('[/\\\\]', '.')};" }.
findAll { !(it =~ /\.impl;$/) }.unique().sort().join('\n')
collect { " exports ${it.replaceAll('[/\\\\][^/\\\\]+$', '').replaceAll('[/\\\\]', '.')};" }.
findAll { !(it =~ /\.impl;$/) }.unique().sort().join('\n')
String content = header + '\n' + exports + '\n}'
if (fileOut.text != content) {
@ -65,19 +65,19 @@ tasks.register('generateModuleInfo') {
}
}
tasks.register('compileOoxmlLite', Copy) {
task compileOoxmlLite(type: Copy) {
dependsOn 'generateModuleInfo', ':poi-ooxml-full:generate_beans', ':poi-ooxml-full:compileJava'
// This task is currently always executed, because gradle thinks files with two dollar signs
// (as in AlternateContentDocument$AlternateContent$Choice.class) are always stale
// copy re-/sources to modules own directory to pacify IntelliJ, which doesn't like the same source dir in multiple modules
from(project(':poi-ooxml-full').layout.buildDirectory.asFile) {
from(project(':poi-ooxml-full').buildDir) {
include 'generated-sources/**'
include 'generated-resources/**'
include 'classes/java/main/**'
}
into(layout.buildDirectory.asFile)
into(buildDir)
}
compileJava {
@ -93,21 +93,21 @@ task compileJava9(type: JavaCompile, dependsOn: 'compileJava') {
javaCompiler = javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(Math.max(11, jdkVersion))
}
sourceCompatibility = 11
targetCompatibility = 11
sourceCompatibility = 1.9
targetCompatibility = 1.9
destinationDirectory = file(JAVA9_OUT + VERSIONS9)
source = file(JAVA9_SRC)
classpath = files()
doFirst {
options.compilerArgs = [
'--patch-module', "${MODULE_NAME}=${project(':poi-ooxml-full').sourceSets.main.output.asPath}",
'--module-path', files(MAIN_MODULE_PATH).asPath
'--patch-module', "${MODULE_NAME}=${project(':poi-ooxml-full').sourceSets.main.output.asPath}",
'--module-path', files(MAIN_MODULE_PATH).asPath
]
}
}
jar {
destinationDirectory = file("../build/dist/maven/${base.archivesName.get()}")
destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}")
doFirst {
File clazzFile = file("${OOXML_LITE_REPORT}.clazz")
@ -124,7 +124,7 @@ jar {
}
// ignore second module-info.class from poi-ooxml-full
// duplicatesStrategy = DuplicatesStrategy.EXCLUDE
// duplicatesStrategy = 'exclude'
includeEmptyDirs = false
manifest {

View File

@ -35,7 +35,6 @@ ctcustomshowlist3419type
ctcustomxmlblockd3c1type
ctdatarefsb753type
ctdiagramc1cctype
ctdocumentbasedf5ctype
cteastasianlayout0841type
ctednposd4a3type
cteqarr9667type
@ -97,7 +96,6 @@ ctwebpublishobjects30d8type
ctwrapthrough8b4etype
ctwraptightae95type
ctwraptopbottom5e13type
fonts7aa2doctype
lockedcanvaselement
polylineelement
relationships93b3doctype
@ -128,4 +126,3 @@ ststrokelinestylea509type
sttargetscreensize4357type
stverticalanchor22cctype
stwrapside6d02type
wsdrd172doctype

View File

@ -28,6 +28,7 @@ configurations {
exclude group: 'xml-apis', module: 'xml-apis'
}
broken
tests
javadocs
}
@ -58,23 +59,18 @@ dependencies {
api project(':poi-ooxml-full')
api project(path: ':poi-ooxml-full', configuration: 'archives')
// Can be very useful in local testing to comment out the 2 poi-ooxml-full lines above
// and uncomment the line below to use a pre-built version of poi-ooxml-full.
// Try to use the last release version of poi-ooxml-full. You might be unlucky if
// recent unreleased changes in poi-ooxml-full are needed.
// api "org.apache.poi:poi-ooxml-full:5.5.1"
api "org.apache.xmlbeans:xmlbeans:${xmlbeansVersion}"
api "org.apache.commons:commons-compress:${commonsCompressVersion}"
api "commons-io:commons-io:${commonsIoVersion}"
api 'com.github.virtuald:curvesapi:1.08'
api 'org.apache.commons:commons-collections4:4.5.0'
api "org.apache.logging.log4j:log4j-api:${log4jVersion}"
api 'org.apache.commons:commons-collections4:4.4'
signingImplementation "org.apache.santuario:xmlsec:${xmlSecVersion}"
signingImplementation 'org.apache.santuario:xmlsec:3.0.3'
signingImplementation "org.bouncycastle:bcpkix-jdk18on:${bouncyCastleVersion}"
signingImplementation "org.bouncycastle:bcutil-jdk18on:${bouncyCastleVersion}"
rendersignImplementation "org.apache.santuario:xmlsec:${xmlSecVersion}"
rendersignImplementation 'org.apache.santuario:xmlsec:3.0.3'
rendersignImplementation "org.bouncycastle:bcpkix-jdk18on:${bouncyCastleVersion}"
rendersignImplementation "org.bouncycastle:bcutil-jdk18on:${bouncyCastleVersion}"
@ -93,10 +89,6 @@ dependencies {
exclude group: 'xalan', module: 'xalan'
exclude group: 'xml-apis', module: 'xml-apis'
}
renderImplementation("org.apache.xmlgraphics:batik-script:${batikVersion}") {
exclude group: 'xalan', module: 'xalan'
exclude group: 'xml-apis', module: 'xml-apis'
}
rendersignImplementation "org.apache.pdfbox:pdfbox:${pdfboxVersion}"
rendersignImplementation "de.rototor.pdfbox:graphics2d:${graphics2dVersion}"
@ -113,10 +105,7 @@ dependencies {
exclude group: 'xalan', module: 'xalan'
exclude group: 'xml-apis', module: 'xml-apis'
}
rendersignImplementation("org.apache.xmlgraphics:batik-script:${batikVersion}") {
exclude group: 'xalan', module: 'xalan'
exclude group: 'xml-apis', module: 'xml-apis'
}
if (!NO_SCRATCHPAD) {
testImplementation project(':poi-scratchpad')
@ -125,69 +114,79 @@ dependencies {
testImplementation project(path:':poi', configuration:'tests')
testImplementation project(path:':poi-ooxml-lite-agent', configuration: 'archives')
testRuntimeOnly "org.apiguardian:apiguardian-api:${apiGuardianVersion}"
testImplementation 'org.xmlunit:xmlunit-core:2.11.0'
testImplementation 'org.xmlunit:xmlunit-core:2.9.1'
testImplementation 'org.reflections:reflections:0.10.2'
testImplementation 'org.openjdk.jmh:jmh-core:1.36'
testImplementation 'org.openjdk.jmh:jmh-generator-annprocess:1.36'
testImplementation 'com.google.guava:guava:33.5.0-jre'
testImplementation 'com.google.guava:guava:32.1.1-jre'
testImplementation 'org.tukaani:xz:1.9'
testImplementation 'com.github.rzymek:opczip:1.2.0'
// prevent slf4j warnings coming from xmlsec -> slf4j-api 1.7.x dependency
// see https://logging.apache.org/log4j/2.x/log4j-slf4j-impl/
testImplementation "org.apache.logging.log4j:log4j-slf4j2-impl:${log4jVersion}"
testImplementation 'org.slf4j:slf4j-simple:2.0.17'
testImplementation 'org.slf4j:slf4j-simple:2.0.9'
broken("org.apache.xmlgraphics:batik-script:${batikVersion}"){
exclude group: 'xalan', module: 'xalan'
exclude group: 'xml-apis', module: 'xml-apis'
}
javadocs project(':poi')
javadocs project(':poi-scratchpad')
}
final String MODULE_NAME = 'org.apache.poi.ooxml'
final Pattern MODULE_NOT_REGEX = ~'(poi[/\\\\][^/\\\\]+$)'
final Pattern MODULE_NOT_REGEX = ~'(poi[/\\\\][^/\\\\]+$|batik-script)'
final Pattern MODULE_REGEX = ~'\\.jar$'
final List MAIN_MODULE_PATH = sourceSets.main.runtimeClasspath.findAll{ it.path =~ MODULE_REGEX }.collect{ it.parent }.unique()
final List TEST_MODULE_PATH = sourceSets.test.runtimeClasspath.findAll{ it.path =~ MODULE_REGEX && !(it.path =~ MODULE_NOT_REGEX) }.collect{ it.parent }.unique()
final List TEST_MODULE_PATH = sourceSets.test.runtimeClasspath.findAll{ it.path =~ MODULE_REGEX && !(it.path =~ MODULE_NOT_REGEX) }.collect{ it.parent }.unique() + files("build/brokenJars")
final String OOXML_LITE_AGENT = "../build/dist/maven/poi-ooxml-lite-agent/poi-ooxml-lite-agent-${project.version}.jar"
final String OOXML_LITE_REPORT = '../src/resources/ooxml-lite-report'
final String OOXML_LITE_INCLUDES = "^(com/microsoft/schemas|org/(etsi|openxmlformats|w3/)|org/apache/poi/schemas)"
tasks.register('compileJava9', JavaCompile) {
compileJava {
dependsOn 'fixBatik', 'cleanupBatik'
}
task compileJava9(type: JavaCompile) {
dependsOn 'compileJava', ':poi:jar'
javaCompiler = javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(Math.max(11, jdkVersion))
}
sourceCompatibility = 11
targetCompatibility = 11
sourceCompatibility = 1.9
targetCompatibility = 1.9
destinationDirectory = file(JAVA9_OUT + VERSIONS9)
source = file(JAVA9_SRC)
classpath = files()
options.compilerArgs = [
'--patch-module', "${MODULE_NAME}=${sourceSets.main.output.classesDirs.asPath}",
'--module-path', files(MAIN_MODULE_PATH).asPath
'--patch-module', "${MODULE_NAME}=${sourceSets.main.output.classesDirs.asPath}",
'--module-path', files(MAIN_MODULE_PATH).asPath
]
}
tasks.register('compileTest9', JavaCompile) {
task compileTest9(type: JavaCompile) {
dependsOn 'compileTestJava', ':poi:testJar'
javaCompiler = javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(Math.max(11, jdkVersion))
}
sourceCompatibility = 11
targetCompatibility = 11
sourceCompatibility = 1.9
targetCompatibility = 1.9
destinationDirectory = file(TEST9_OUT + VERSIONS9)
source = file(TEST9_SRC)
options.compilerArgs = [
'--patch-module', "${MODULE_NAME}=${(sourceSets.main.output.classesDirs + sourceSets.test.output.classesDirs).asPath}",
'--module-path', files(TEST_MODULE_PATH).asPath
'--patch-module', "${MODULE_NAME}=${(sourceSets.main.output.classesDirs + sourceSets.test.output.classesDirs).asPath}",
'--module-path', files(TEST_MODULE_PATH).asPath
]
classpath = files()
}
jar {
destinationDirectory = file("../build/dist/maven/${base.archivesName.get()}")
destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}")
manifest {
attributes('Automatic-Module-Name': MODULE_NAME, 'Multi-Release': 'true')
@ -197,11 +196,11 @@ jar {
// Create a separate jar for test-code to depend on it in other projects
// See http://stackoverflow.com/questions/5144325/gradle-test-dependency
task testJar(type: Jar, dependsOn: testClasses) {
destinationDirectory = file("../build/dist/maven/${base.archivesName.get()}-tests")
destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}-tests")
setArchiveClassifier 'tests'
// ignore second module-info.class from main
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
duplicatesStrategy = 'exclude'
from sourceSets.test.output + sourceSets.main.output
@ -210,16 +209,35 @@ task testJar(type: Jar, dependsOn: testClasses) {
}
}
// based on https://github.com/moditect/moditect-gradle-plugin/issues/12
task fixBatik(type: Zip) {
ant.mkdir(dir: "${buildDir}/brokenJars")
archiveFileName = "batik-script-${batikVersion}.jar"
destinationDirectory = file("${buildDir}/brokenJars")
from zipTree(configurations.broken.files.find{ f -> f.name.startsWith("batik-script") })
filesMatching("**/org.apache.batik.script.InterpreterFactory") {
it.filter{ it2 -> it2.contains("Rhino") ? "#" + it2 : it2 }
}
}
task cleanupBatik(type: Delete) {
// remove older files to avoid build failures because of duplicate modules
delete fileTree("${buildDir}/brokenJars/").matching {
include "*.jar"
exclude "batik*-${batikVersion}.jar"
}
}
javadoc {
failOnError = true
doFirst {
options {
addBooleanOption('html5', true)
if (jdkVersion > 8) addBooleanOption('html5', true)
links 'https://poi.apache.org/apidocs/dev/'
if (jdkVersion >= 23) links 'https://docs.oracle.com/en/java/javase/23/docs/api/' else links 'https://docs.oracle.com/en/java/javase/11/docs/api/'
links 'https://docs.oracle.com/javase/8/docs/api/'
use = true
splitIndex = true
source = "11"
source = "1.8"
classpath += configurations.javadocs.files
}
}
@ -250,6 +268,9 @@ test {
dependsOn { testJar }
systemProperties['junit.jupiter.execution.parallel.enabled'] = 'true'
if (jdkVersion == 8) {
systemProperties['sun.java2d.renderer'] = 'sun.java2d.marlin.MarlinRenderingEngine'
}
if (NO_SCRATCHPAD) {
useJUnitPlatform {
@ -259,12 +280,16 @@ test {
doFirst {
jvmArgs += [
'-Xverify:all',
'-XX:ErrorFile=../build/hs_err_pid%p.log',
"-javaagent:${OOXML_LITE_AGENT}=${OOXML_LITE_REPORT}|${OOXML_LITE_INCLUDES}",
'--add-modules', MODULE_NAME,
'--module-path', '../build/dist/maven/poi-ooxml-tests' + File.pathSeparator + files(TEST_MODULE_PATH).asPath,
"-Xverify:all",
"-XX:ErrorFile=../build/hs_err_pid%p.log",
"-javaagent:${OOXML_LITE_AGENT}=${OOXML_LITE_REPORT}|${OOXML_LITE_INCLUDES}"
]
if (jdkVersion > 8) {
jvmArgs += [
'--add-modules', MODULE_NAME,
'--module-path', '../build/dist/maven/poi-ooxml-tests' + File.pathSeparator + files(TEST_MODULE_PATH).asPath,
]
}
}
}

View File

@ -155,7 +155,7 @@ public abstract class POIXMLDocument extends POIXMLDocumentPart implements Close
* @return the document's embedded files
*
* @throws OpenXML4JException if the embedded parts can't be determined
* @since 4.0.0
* @since POI 4.0.0
*/
public abstract List<PackagePart> getAllEmbeddedParts() throws OpenXML4JException;

View File

@ -23,11 +23,10 @@ import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.poi.logging.PoiLogManager;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.openxml4j.exceptions.OpenXML4JException;
import org.apache.poi.openxml4j.exceptions.PartAlreadyExistsException;
@ -39,13 +38,13 @@ import org.apache.poi.openxml4j.opc.PackageRelationshipCollection;
import org.apache.poi.openxml4j.opc.PackageRelationshipTypes;
import org.apache.poi.openxml4j.opc.PackagingURIHelper;
import org.apache.poi.openxml4j.opc.TargetMode;
import org.apache.poi.util.IOUtils;
import org.apache.poi.util.Internal;
import org.apache.poi.xddf.usermodel.chart.XDDFChart;
import org.apache.poi.xssf.usermodel.XSSFRelation;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.apache.poi.xwpf.usermodel.XWPFRelation;
import org.apache.xmlbeans.XmlException;
/**
* Represents an entry of a OOXML package.
@ -54,13 +53,12 @@ import org.apache.xmlbeans.XmlException;
* </p>
*/
public class POIXMLDocumentPart {
private static final Logger LOG = PoiLogManager.getLogger(POIXMLDocumentPart.class);
private static final Logger LOG = LogManager.getLogger(POIXMLDocumentPart.class);
private String coreDocumentRel = PackageRelationshipTypes.CORE_DOCUMENT;
private PackagePart packagePart;
private POIXMLDocumentPart parent;
private final Map<String, RelationPart> relations = new LinkedHashMap<>();
private final Map<String, ReferenceRelationship> referenceRelationships = new LinkedHashMap<>();
private boolean isCommitted = false;
/**
@ -168,7 +166,7 @@ public class POIXMLDocumentPart {
*
* @param part - The package part that holds xml data representing this sheet.
* @see #read(POIXMLFactory, Map)
* @since 3.14-Beta1
* @since POI 3.14-Beta1
*/
public POIXMLDocumentPart(PackagePart part) {
this(null, part);
@ -181,7 +179,7 @@ public class POIXMLDocumentPart {
* @param parent - Parent part
* @param part - The package part that holds xml data representing this sheet.
* @see #read(POIXMLFactory, Map)
* @since 3.14-Beta1
* @since POI 3.14-Beta1
*/
public POIXMLDocumentPart(POIXMLDocumentPart parent, PackagePart part) {
this.packagePart = part;
@ -233,14 +231,9 @@ public class POIXMLDocumentPart {
}
/**
* Returns the list of child relations for this POIXMLDocumentPart.
*
* <p>
* Since POI 5.3.0, Reference Relationships are stored separately from other child relations.
* </p>
* Returns the list of child relations for this POIXMLDocumentPart
*
* @return child relations
* @see #getReferenceRelationships() for reference relationships (e.g. hyperlinks)
*/
public final List<RelationPart> getRelationParts() {
List<RelationPart> l = new ArrayList<>(relations.values());
@ -259,7 +252,7 @@ public class POIXMLDocumentPart {
*/
public final POIXMLDocumentPart getRelationById(String id) {
RelationPart rp = getRelationPartById(id);
return rp == null ? null : rp.getDocumentPart();
return (rp == null) ? null : rp.getDocumentPart();
}
/**
@ -647,56 +640,38 @@ public class POIXMLDocumentPart {
// scan breadth-first, so parent-relations are hopefully the shallowest element
for (PackageRelationship rel : rels) {
if (Objects.equals(rel.getRelationshipType(), PackageRelationshipTypes.HYPERLINK_PART)) {
referenceRelationships.put(rel.getId(), new HyperlinkRelationship(this, rel.getTargetURI(), rel.getTargetMode() == TargetMode.EXTERNAL, rel.getId()));
} else {
if (rel.getTargetMode() == TargetMode.INTERNAL) {
URI uri = rel.getTargetURI();
if (rel.getTargetMode() == TargetMode.INTERNAL) {
URI uri = rel.getTargetURI();
// check for internal references (e.g. '#Sheet1!A1')
PackagePartName relName;
if (uri.getRawFragment() != null) {
relName = PackagingURIHelper.createPartName(uri.getPath());
} else {
relName = PackagingURIHelper.createPartName(uri);
}
final PackagePart p = packagePart.getPackage().getPart(relName);
if (p == null) {
LOG.atError().log("Skipped invalid entry {}", rel.getTargetURI());
continue;
}
POIXMLDocumentPart childPart = context.get(p);
if (childPart == null) {
try {
childPart = factory.createDocumentPart(this, p);
} catch (POIXMLException e) {
if (e.getCause() instanceof XmlException
&& XSSFRelation.CHART.getRelation().equals(rel.getRelationshipType())) {
// https://github.com/apache/poi/pull/982
// only allow this skipping event for charts
// we need to be careful about not catching every exception here because
// issues like zip bomb exceptions need to thrown and not ignored
LOG.atWarn().log("Skipped unsupported part: {}", e.getMessage());
continue;
} else {
throw e;
}
}
//here we are checking if part is embedded and excel then set it to chart class
//so that at the time to writing we can also write updated embedded part
if (this instanceof XDDFChart && childPart instanceof XSSFWorkbook) {
((XDDFChart) this).setWorkbook((XSSFWorkbook) childPart);
}
childPart.parent = this;
// already add child to context, so other children can reference it
context.put(p, childPart);
readLater.add(childPart);
}
addRelation(rel, childPart);
// check for internal references (e.g. '#Sheet1!A1')
PackagePartName relName;
if (uri.getRawFragment() != null) {
relName = PackagingURIHelper.createPartName(uri.getPath());
} else {
relName = PackagingURIHelper.createPartName(uri);
}
final PackagePart p = packagePart.getPackage().getPart(relName);
if (p == null) {
LOG.atError().log("Skipped invalid entry {}", rel.getTargetURI());
continue;
}
POIXMLDocumentPart childPart = context.get(p);
if (childPart == null) {
childPart = factory.createDocumentPart(this, p);
//here we are checking if part if embedded and excel then set it to chart class
//so that at the time to writing we can also write updated embedded part
if (this instanceof XDDFChart && childPart instanceof XSSFWorkbook) {
((XDDFChart) this).setWorkbook((XSSFWorkbook) childPart);
}
childPart.parent = this;
// already add child to context, so other children can reference it
context.put(p, childPart);
readLater.add(childPart);
}
addRelation(rel, childPart);
}
}
@ -759,63 +734,6 @@ public class POIXMLDocumentPart {
part.onDocumentRead();
}
/**
* Remove the reference relationship to the specified part in this package.
*
* @param relId the part which is to be removed
* @return true, if the relation was removed
* @since 5.3.0
*/
public final boolean removeReferenceRelationship(String relId) {
ReferenceRelationship existing = referenceRelationships.remove(relId);
if (existing != null) {
packagePart.removeRelationship(relId);
return true;
}
return false;
}
/**
* Get the reference relationship with the specified id.
*
* @param relId the relation id
* @return the reference relationship or {@code null} if not found
* @since 5.3.0
*/
public final ReferenceRelationship getReferenceRelationship(String relId) {
return referenceRelationships.get(relId);
}
/**
* Create a new reference relationship for this POIXMLDocumentPart.
*
* @param uri the URI of the target part
* @param isExternal true, if the target is an external resource
* @param relId the relation id
* @return the created reference relationship
* @since 5.3.0
*/
public final HyperlinkRelationship createHyperlink(URI uri, boolean isExternal, String relId) {
packagePart.addRelationship(uri, isExternal ? TargetMode.EXTERNAL : TargetMode.INTERNAL,
PackageRelationshipTypes.HYPERLINK_PART, relId);
HyperlinkRelationship hyperlink = new HyperlinkRelationship(this, uri, isExternal, relId);
referenceRelationships.put(relId, hyperlink);
return hyperlink;
}
/**
* Returns an unmodifiable list of reference relationships for this POIXMLDocumentPart.
*
* @return reference relationships
* @since 5.3.0
* @see #getRelationParts() for child relations
*/
public final List<ReferenceRelationship> getReferenceRelationships() {
List<ReferenceRelationship> list = new ArrayList<>(referenceRelationships.values());
return Collections.unmodifiableList(list);
}
/**
* Retrieves the core document part
*
@ -828,7 +746,7 @@ public class POIXMLDocumentPart {
if (coreRel != null) {
PackagePart pp = pkg.getPart(coreRel);
if (pp == null) {
pkg.revert();
IOUtils.closeQuietly(pkg);
throw new POIXMLException("OOXML file structure broken/invalid - core document '" + coreRel.getTargetURI() + "' not found.");
}
return pp;
@ -836,16 +754,16 @@ public class POIXMLDocumentPart {
coreRel = pkg.getRelationshipsByType(PackageRelationshipTypes.STRICT_CORE_DOCUMENT).getRelationship(0);
if (coreRel != null) {
pkg.revert();
IOUtils.closeQuietly(pkg);
throw new POIXMLException("Strict OOXML isn't currently supported, please see bug #57699");
}
pkg.revert();
IOUtils.closeQuietly(pkg);
throw new POIXMLException("OOXML file structure broken/invalid - no core document found!");
} catch (POIXMLException e) {
throw e;
} catch (RuntimeException e) {
pkg.revert();
IOUtils.closeQuietly(pkg);
throw new POIXMLException("OOXML file structure broken/invalid", e);
}
}

View File

@ -19,7 +19,7 @@ package org.apache.poi.ooxml;
/**
* Indicates a generic OOXML error.
*/
public final class POIXMLException extends RuntimeException {
public final class POIXMLException extends RuntimeException{
/**
* Create a new {@code POIXMLException} with no
* detail message.

View File

@ -18,8 +18,8 @@ package org.apache.poi.ooxml;
import java.io.IOException;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.poi.logging.PoiLogManager;
import org.apache.poi.ooxml.POIXMLRelation.PackagePartConstructor;
import org.apache.poi.ooxml.POIXMLRelation.ParentPartConstructor;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
@ -31,7 +31,7 @@ import org.apache.xmlbeans.XmlException;
* Defines a factory API that enables sub-classes to create instances of <code>POIXMLDocumentPart</code>
*/
public abstract class POIXMLFactory {
private static final Logger LOGGER = PoiLogManager.getLogger(POIXMLFactory.class);
private static final Logger LOGGER = LogManager.getLogger(POIXMLFactory.class);
/**
* Create a POIXMLDocumentPart from existing package part and relation. This method is called
@ -75,7 +75,7 @@ public abstract class POIXMLFactory {
* @param relationshipType the relationship type of the descriptor
* @return the descriptor or null if type is unknown
*
* @since 3.14-Beta1
* @since POI 3.14-Beta1
*/
protected abstract POIXMLRelation getDescriptor(String relationshipType);
@ -104,7 +104,7 @@ public abstract class POIXMLFactory {
*
* @throws POIXMLException if the relations are erroneous or the part is not related
*
* @since 3.14-Beta1
* @since POI 3.14-Beta1
*/
protected PackageRelationship getPackageRelationship(POIXMLDocumentPart parent, PackagePart part) {
try {

View File

@ -316,11 +316,11 @@ public class POIXMLProperties {
public void setLastPrinted(String date) throws InvalidFormatException {
part.setLastPrintedProperty(date);
}
/** @since 3.15 beta 3 */
/** @since POI 3.15 beta 3 */
public String getLastModifiedByUser() {
return part.getLastModifiedByProperty().orElse(null);
}
/** @since 3.15 beta 3 */
/** @since POI 3.15 beta 3 */
public void setLastModifiedByUser(String user) {
part.setLastModifiedByProperty(user);
}
@ -349,7 +349,7 @@ public class POIXMLProperties {
/**
* Sets the version property.
* @param version property value
* @since 5.2.3
* @since POI 5.2.3
*/
public void setVersion(String version) {
part.setVersionProperty(version);
@ -358,7 +358,7 @@ public class POIXMLProperties {
/**
* Returns the version property value.
* @return version property (can be null)
* @since 5.2.3
* @since POI 5.2.3
*/
public String getVersion() {
return part.getVersionProperty().orElse(null);
@ -399,7 +399,7 @@ public class POIXMLProperties {
}
return null;
}
/** @since 4.1.1 */
/** @since POI 4.1.1 */
public void setTemplate(String template) {
props.getProperties().setTemplate(template);
}
@ -409,7 +409,7 @@ public class POIXMLProperties {
}
return null;
}
/** @since 4.1.1 */
/** @since POI 4.1.1 */
public void setManager(String manager) {
props.getProperties().setManager(manager);
}
@ -419,7 +419,7 @@ public class POIXMLProperties {
}
return null;
}
/** @since 4.1.1 */
/** @since POI 4.1.1 */
public void setCompany(String company) {
props.getProperties().setCompany(company);
}
@ -429,7 +429,7 @@ public class POIXMLProperties {
}
return null;
}
/** @since 4.1.1 */
/** @since POI 4.1.1 */
public void setPresentationFormat(String presentationFormat) {
props.getProperties().setPresentationFormat(presentationFormat);
}
@ -439,7 +439,7 @@ public class POIXMLProperties {
}
return null;
}
/** @since 4.1.1 */
/** @since POI 4.1.1 */
public void setApplication(String application) {
props.getProperties().setApplication(application);
}
@ -449,7 +449,7 @@ public class POIXMLProperties {
}
return null;
}
/** @since 4.1.1 */
/** @since POI 4.1.1 */
public void setAppVersion(String appVersion) {
props.getProperties().setAppVersion(appVersion);
}
@ -460,7 +460,7 @@ public class POIXMLProperties {
}
return -1;
}
/** @since 4.1.1 */
/** @since POI 4.1.1 */
public void setPages(int pages) {
props.getProperties().setPages(pages);
}
@ -470,7 +470,7 @@ public class POIXMLProperties {
}
return -1;
}
/** @since 4.1.1 */
/** @since POI 4.1.1 */
public void setWords(int words) {
props.getProperties().setWords(words);
}
@ -480,7 +480,7 @@ public class POIXMLProperties {
}
return -1;
}
/** @since 4.1.1 */
/** @since POI 4.1.1 */
public void setCharacters(int characters) {
props.getProperties().setCharacters(characters);
}
@ -490,7 +490,7 @@ public class POIXMLProperties {
}
return -1;
}
/** @since 4.1.1 */
/** @since POI 4.1.1 */
public void setCharactersWithSpaces(int charactersWithSpaces) {
props.getProperties().setCharactersWithSpaces(charactersWithSpaces);
}
@ -500,7 +500,7 @@ public class POIXMLProperties {
}
return -1;
}
/** @since 4.1.1 */
/** @since POI 4.1.1 */
public void setLines(int lines) {
props.getProperties().setLines(lines);
}
@ -510,7 +510,7 @@ public class POIXMLProperties {
}
return -1;
}
/** @since 4.1.1 */
/** @since POI 4.1.1 */
public void setParagraphs(int paragraphs) {
props.getProperties().setParagraphs(paragraphs);
}
@ -520,7 +520,7 @@ public class POIXMLProperties {
}
return -1;
}
/** @since 4.1.1 */
/** @since POI 4.1.1 */
public void setSlides(int slides) {
props.getProperties().setSlides(slides);
}
@ -530,7 +530,7 @@ public class POIXMLProperties {
}
return -1;
}
/** @since 4.1.1 */
/** @since POI 4.1.1 */
public void setNotes(int notes) {
props.getProperties().setNotes(notes);
}
@ -540,7 +540,7 @@ public class POIXMLProperties {
}
return -1;
}
/** @since 4.1.1 */
/** @since POI 4.1.1 */
public void setTotalTime(int totalTime) {
props.getProperties().setTotalTime(totalTime);
}
@ -550,7 +550,7 @@ public class POIXMLProperties {
}
return -1;
}
/** @since 4.1.1 */
/** @since POI 4.1.1 */
public void setHiddenSlides(int hiddenSlides) {
props.getProperties().setHiddenSlides(hiddenSlides);
}
@ -560,7 +560,7 @@ public class POIXMLProperties {
}
return -1;
}
/** @since 4.1.1 */
/** @since POI 4.1.1 */
public void setMMClips(int mmClips) {
props.getProperties().setMMClips(mmClips);
}
@ -571,7 +571,7 @@ public class POIXMLProperties {
}
return null;
}
/** @since 4.1.1 */
/** @since POI 4.1.1 */
public void setHyperlinkBase(String hyperlinkBase) {
props.getProperties().setHyperlinkBase(hyperlinkBase);
}

View File

@ -20,8 +20,8 @@ import java.io.IOException;
import java.io.InputStream;
import java.util.Iterator;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.poi.logging.PoiLogManager;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.openxml4j.opc.PackagePart;
import org.apache.poi.openxml4j.opc.PackagePartName;
@ -51,7 +51,7 @@ public abstract class POIXMLRelation {
POIXMLDocumentPart init(POIXMLDocumentPart parent, PackagePart part) throws IOException, XmlException;
}
private static final Logger LOGGER = PoiLogManager.getLogger(POIXMLRelation.class);
private static final Logger LOGGER = LogManager.getLogger(POIXMLRelation.class);
/**
* Describes the content stored in a part.

View File

@ -43,9 +43,6 @@ public class POIXMLTypeLoader {
DEFAULT_XML_OPTIONS.setCharacterEncoding("UTF-8");
DEFAULT_XML_OPTIONS.setDisallowDocTypeDeclaration(true);
DEFAULT_XML_OPTIONS.setEntityExpansionLimit(1);
DEFAULT_XML_OPTIONS.setLoadStripProcinsts(true);
DEFAULT_XML_OPTIONS.setLoadStripComments(true);
// JAXP is used for parsing
// so only user code using XmlObject/XmlToken.Factory.parse
// directly can bypass the entity check, which is probably unlikely (... and not within our responsibility :))
@ -71,8 +68,6 @@ public class POIXMLTypeLoader {
map.put(MS_EXCEL_URN, "x");
map.put(MS_WORD_URN, "w10");
map.put(MS_VML_URN, "v");
map.put("http://schemas.microsoft.com/office/word/2010/wordml", "w14");
map.put("http://schemas.microsoft.com/office/word/2012/wordml", "w15");
map.put("http://schemas.microsoft.com/office/drawing/2012/chart", "c15");
DEFAULT_XML_OPTIONS.setSaveSuggestedPrefixes(Collections.unmodifiableMap(map));
}

View File

@ -1,79 +0,0 @@
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
package org.apache.poi.ooxml;
import org.apache.poi.openxml4j.opc.PackageRelationship;
import org.apache.poi.openxml4j.opc.TargetMode;
import java.net.URI;
/**
* Defines a reference relationship. A reference relationship can be internal or external.
*
* @since 5.3.0
*/
public abstract class ReferenceRelationship {
private POIXMLDocumentPart container;
private final String relationshipType;
private final boolean external;
private final String id;
private final URI uri;
protected ReferenceRelationship(POIXMLDocumentPart container, PackageRelationship packageRelationship) {
if (packageRelationship == null) {
throw new IllegalArgumentException("packageRelationship");
}
this.container = container;
this.relationshipType = packageRelationship.getRelationshipType();
this.uri = packageRelationship.getTargetURI();
this.external = packageRelationship.getTargetMode() == TargetMode.EXTERNAL;
this.id = packageRelationship.getId();
}
protected ReferenceRelationship(POIXMLDocumentPart container, URI targetUri, boolean isExternal, String relationshipType, String id) {
if (targetUri == null) {
throw new NullPointerException("targetUri cannot be null");
}
this.container = container;
this.relationshipType = relationshipType;
this.uri = targetUri;
this.id = id;
this.external = isExternal;
}
public POIXMLDocumentPart getContainer() {
return container;
}
public String getRelationshipType() {
return relationshipType;
}
public boolean isExternal() {
return external;
}
public String getId() {
return id;
}
public URI getUri() {
return uri;
}
}

View File

@ -119,7 +119,7 @@ public final class POIXMLExtractorFactory implements ExtractorProvider {
* Clears the setting for this thread made by {@link #setThreadPrefersEventExtractors(boolean) }
*
* @see #setThreadPrefersEventExtractors(boolean)
* @since 5.2.4
* @since POI 5.2.4
*/
public static void removeThreadPrefersEventExtractorsSetting() {
ExtractorFactory.removeThreadPrefersEventExtractorsSetting();

View File

@ -73,14 +73,14 @@ public class POIXMLPropertiesTextExtractor implements POIXMLTextExtractor {
}
private void appendDateIfPresent(StringBuilder text, String thing, Optional<Date> value) {
if (value.isEmpty()) {
if (!value.isPresent()) {
return;
}
appendIfPresent(text, thing, dateFormat.format(value.get()));
}
private void appendIfPresent(StringBuilder text, String thing, Optional<String> value) {
if (value.isEmpty()) {
if (!value.isPresent()) {
return;
}
appendIfPresent(text, thing, value.get());

View File

@ -32,10 +32,11 @@ import org.apache.poi.openxml4j.opc.PackagePartName;
import org.apache.poi.openxml4j.opc.PackageProperties;
import org.apache.poi.openxml4j.opc.PackageRelationship;
import org.apache.poi.openxml4j.opc.PackageRelationshipCollection;
import org.apache.poi.openxml4j.opc.PackageRelationshipTypes;
import org.apache.poi.openxml4j.opc.PackagingURIHelper;
import org.apache.poi.openxml4j.opc.TargetMode;
import org.apache.poi.openxml4j.opc.internal.InvalidZipException;
import org.apache.poi.util.IOUtils;
import org.apache.poi.util.Removal;
/**
* Provides handy methods to work with OOXML packages
@ -46,7 +47,6 @@ public final class PackageHelper {
* @param stream The InputStream to read from - which is closed when it is read
* @return OPCPackage
* @throws IOException If reading data from the stream fails
* @throws POIXMLException If the stream is not a valid OPC package
*/
public static OPCPackage open(InputStream stream) throws IOException {
return open(stream, true);
@ -57,17 +57,12 @@ public final class PackageHelper {
* @param closeStream whether to close the stream
* @return OPCPackage
* @throws IOException If reading data from the stream fails
* @throws POIXMLException If the stream is not a valid OPC package
* @since 5.2.0
* @since POI 5.2.0
*/
public static OPCPackage open(InputStream stream, boolean closeStream) throws IOException {
try {
return OPCPackage.open(stream, closeStream);
} catch (InvalidFormatException e) {
final Throwable cause = e.getCause();
if (cause instanceof InvalidZipException) {
throw (InvalidZipException) cause;
}
} catch (InvalidFormatException e){
throw new POIXMLException(e);
} finally {
if (closeStream) {
@ -76,6 +71,50 @@ public final class PackageHelper {
}
}
/**
* Clone the specified package.
*
* @param pkg the package to clone
* @param file the destination file
* @return the cloned package
* @deprecated this method is not used internally and creates temp files that are not well handled
*/
@Deprecated
@Removal(version = "6.0.0")
public static OPCPackage clone(OPCPackage pkg, File file) throws OpenXML4JException, IOException {
String path = file.getAbsolutePath();
try (OPCPackage dest = OPCPackage.create(path)) {
PackageRelationshipCollection rels = pkg.getRelationships();
for (PackageRelationship rel : rels) {
PackagePart part = pkg.getPart(rel);
PackagePart part_tgt;
if (rel.getRelationshipType().equals(PackageRelationshipTypes.CORE_PROPERTIES)) {
copyProperties(pkg.getPackageProperties(), dest.getPackageProperties());
continue;
}
dest.addRelationship(part.getPartName(), rel.getTargetMode(), rel.getRelationshipType());
part_tgt = dest.createPart(part.getPartName(), part.getContentType());
try (
InputStream in = part.getInputStream();
OutputStream out = part_tgt.getOutputStream()
) {
IOUtils.copy(in, out);
}
if (part.hasRelationships()) {
copy(pkg, part, dest, part_tgt);
}
}
}
//the temp file will be deleted when JVM terminates
new File(path).deleteOnExit();
return OPCPackage.open(path);
}
/**
* Recursively copy package parts to the destination package
*/

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