Currently, there are only a handful of example programs using HWPF and XWPF available. They can be found in svn in the examples section, under - HWPF + HWPF and - XWPF. + XWPF. Both HWPF and XWPF have fairly high levels of unit test coverage, which provides examples of using the various areas of functionality of both modules. These can be found in svn, under - HWPF + HWPF and - XWPF. + XWPF. Contributions of more examples, whether inspired by the unit tests or not, would be most welcomed!
diff --git a/publish/components/document/quick-guide-xwpf.html b/publish/components/document/quick-guide-xwpf.html index c344c483bb..d977946c00 100644 --- a/publish/components/document/quick-guide-xwpf.html +++ b/publish/components/document/quick-guide-xwpf.html @@ -356,9 +356,9 @@ document.Further Examples
For now, there are a limited number of XWPF examples in the - Examples Package. + Examples Package. Beyond those, the best source of additional examples is in the unit - tests. + tests. Browse the XWPF unit tests.
diff --git a/publish/components/document/quick-guide.html b/publish/components/document/quick-guide.html index 2fa1244e8c..68ad463cef 100644 --- a/publish/components/document/quick-guide.html +++ b/publish/components/document/quick-guide.html @@ -291,7 +291,7 @@ document.write("Last Published: " + document.lastModified);Overview
-HWPF is still in early development. It is in the
+ HWPF is still in early development. It is in the
scratchpad section of the SVN. You will need to ensure you
either have a recent SVN checkout, or a recent SVN nightly build
(including the scratchpad jar!)
Further Examples
For now, the best source of additional examples is in the unit - tests. + tests. Browse the HWPF unit tests.
diff --git a/publish/components/hmef/index.html b/publish/components/hmef/index.html index a86e22a5ca..6919869163 100644 --- a/publish/components/hmef/index.html +++ b/publish/components/hmef/index.html @@ -317,8 +317,8 @@ document.write("Last Published: " + document.lastModified);To get a feel for the contents of a file, and to track down where data of interest is stored, HMEF comes with - HMEFDumper + HMEFDumper to print out the contents of the file.
Type 8 has 7 2 byte unsigned ints, then a pair of 4 byte unsigned ints for each entry.
Type 12 holds hyperlinks, and is very much more complex. - See org.apache.poi.hpbf.model.qcbits.QCPLCBit + See org.apache.poi.hpbf.model.qcbits.QCPLCBit for our best guess as to how the contents match up.
There is an example MSG textual renderer, which shows how to access the common parts such as sender, subject, message body and examples. This is in the - HSMF examples area + HSMF examples area of SVN. You may also wish to look at the unit tests for more use guides.
For signing: - bcpkix-jdk18on, - bcprov-jdk18on, - xmlsec, + bcpkix-jdk18on, + bcprov-jdk18on, + xmlsec, slf4j-api
Small sample programs using the POI API are available in the - src/examples - (viewvc) directory of the source distribution. + src/examples + (viewvc) directory of the source distribution.
All of the examples are included in POI distributions as a poi-examples artifact. @@ -762,7 +762,7 @@ document.write("Last Published: " + document.lastModified);
See POI Ruby Bindings and other code in the - poi-contrib module + poi-contrib module
Subversion
- The POI-Ruby module sits under the POI Subversion - (viewvc). Running make + The POI-Ruby module sits under the POI Subversion + (viewvc). Running make inside that directory will create a loadable ruby extension poi4r.so in the release subdirectory. Tests are in the tests/ subdirectory, and should be run from the poi-ruby directory. Please read the tests to figure out the usage.
diff --git a/publish/components/poifs/how-to.html b/publish/components/poifs/how-to.html index 2529d9dfb7..eccf248429 100644 --- a/publish/components/poifs/how-to.html +++ b/publish/components/poifs/how-to.html @@ -1220,7 +1220,7 @@ document.write("Last Published: " + document.lastModified);For an example of an in-place change to one stream within a file, you can see the example - + org/apache/poi/hpsf/examples/ModifyDocumentSummaryInformation.java diff --git a/publish/components/slideshow/index.html b/publish/components/slideshow/index.html index aaa8287257..eaeb039200 100644 --- a/publish/components/slideshow/index.html +++ b/publish/components/slideshow/index.html @@ -311,8 +311,8 @@ document.write("Last Published: " + document.lastModified);
For rendering slideshow (HSLF/XSLF), WMF, EMF and EMF+ pictures, POI provides an utility class - + PPTX2PNG:
This page offers a short introduction into the XSLF API. More examples can be found in the - XSLF Examples - in the POI SVN repository. + XSLF Examples + in the POI Git repository.
All sample source is available in SVN +
All sample source is available in SVN
In addition, there are a handful of HSSF only and @@ -399,7 +399,7 @@ document.write("Last Published: " + document.lastModified);
Business Plan
-The BusinessPlan +
The BusinessPlan application creates a sample business plan with three phases, weekly iterations and time highlighting. Demonstrates advanced cell formatting (number and date formats, alignments, fills, borders) and various settings for organizing data in a sheet (freezed panes, grouped rows).
@@ -407,28 +407,28 @@ document.write("Last Published: " + document.lastModified);
Calendar
-The Calendar +
The Calendar demo creates a multi sheet calendar. Each month is on a separate sheet.

Loan Calculator
-The LoanCalculator +
The LoanCalculator demo creates a simple loan calculator. Demonstrates advance usage of cell formulas and named ranges.

Timesheet
-The Timesheet +
The Timesheet demo creates a weekly timesheet with automatic calculation of total hours. Demonstrates advance usage of cell formulas.

Conditional Formats
-The ConditionalFormats +
The ConditionalFormats demo is a collection of short examples showing what you can do with Excel conditional formatting in POI:
-
@@ -454,52 +454,52 @@ document.write("Last Published: " + document.lastModified);
Formula Examples
-The CalculateMortgage +
The CalculateMortgage example demonstrates a simple user-defined function to calculate principal and interest.
-The CheckFunctionsSupported +
The CheckFunctionsSupported example shows how to test what functions and formulas aren't supported from a given file.
-The SettingExternalFunction +
The SettingExternalFunction example demonstrates how to use externally provided (third-party) formula add-ins.
-The UserDefinedFunctionExample +
The UserDefinedFunctionExample example demonstrates how to invoke a User Defined Function for a given Workbook instance using POI's UDFFinder implementation.
Add Dimensioned Image
-The AddDimensionedImage +
The AddDimensionedImage example demonstrates how to add an image to a worksheet and set that images size to a specific number of millimetres irrespective of the width of the columns or height of the rows.
Aligned Cells
-The AligningCells +
The AligningCells example demonstrates how various alignment options work.
Cell Style Details
-The CellStyleDetails +
The CellStyleDetails example demonstrates how to read excel styles for cells.
Linked Dropdown Lists
-The LinkedDropDownLists +
The LinkedDropDownLists example demonstrates one technique that may be used to create linked or dependent drop down lists.
Common SS Performance Test
-The SSPerformanceTest +
The SSPerformanceTest example provides a way to create simple example files of varying sizes, and to calculate how long they take. Useful for benchmarking your system, and to also test if slow performance is due to Apache POI itself or to your own code.
ToHtml
-The ToHtml +
The ToHtml example shows how to display a spreadsheet in HTML using the classes for spreadsheet display.
ToCSV
-The ToCSV +
The ToCSV example demonstrates one way to convert an Excel spreadsheet into a CSV file.
HSSF-only Examples
All the HSSF-only examples can be found in - SVN + SVN
- -CellComments +CellComments
- -HyperlinkFormula +HyperlinkFormula
- -EventExample +EventExample
- -OfficeDrawingWithGraphics +OfficeDrawingWithGraphics
- -CreateDateCells +CreateDateCells
- -NewWorkbook +NewWorkbook
- -EmeddedObjects +EmeddedObjects
- -Hyperlinks +Hyperlinks
- -OfficeDrawing +OfficeDrawing
- -HSSFReadWrite +HSSFReadWrite
- -NewSheet +NewSheet
- -SplitAndFreezePanes +SplitAndFreezePanes
- -InCellLists +InCellLists
- -RepeatingRowsAndColumns +RepeatingRowsAndColumns
- -MergedCells +MergedCells
- -CellTypes +CellTypes
- -ZoomSheet +ZoomSheet
- -ReadWriteWorkbook +ReadWriteWorkbook
- -CreateCells +CreateCells
- -Alignment +Alignment
- -FrillsAndFills +FrillsAndFills
- -AddDimensionedImage +AddDimensionedImage
- -Borders +Borders
- -NewLinesInCells +NewLinesInCells
- -WorkingWithFonts +WorkingWithFonts
- -BigExample +BigExample
- -Outlines +Outlines
- -XLS2CSVmra +XLS2CSVmra
XSSF-only Examples
All the XSSF-only examples can be found in - SVN + SVN
- -CellComments +CellComments
- -HeadersAndFooters +HeadersAndFooters
- -CreateUserDefinedDataFormats +CreateUserDefinedDataFormats
- -CreatePivotTable +CreatePivotTable
- -CreatePivotTable2 +CreatePivotTable2
- -FillsAndColors +FillsAndColors
- -WorkingWithBorders +WorkingWithBorders
- -BigGridDemo +BigGridDemo
- -CreateTable +CreateTable
- -CalendarDemo +CalendarDemo
- -AligningCells +AligningCells
- -SplitAndFreezePanes +SplitAndFreezePanes
- -WorkingWithPageSetup +WorkingWithPageSetup
- -WorkingWithPictures +WorkingWithPictures
- -MergingCells +MergingCells
- -CustomXMLMapping +CustomXMLMapping
- -SelectedSheet +SelectedSheet
- -EmbeddedObjects +EmbeddedObjects
- -WorkbookProperties +WorkbookProperties
- -NewLinesInCells +NewLinesInCells
- -Outlining +Outlining
- -CreateCell +CreateCell
- -IterateCells +IterateCells
- -BarChart +BarChart
- -BarAndLineChart +BarAndLineChart
- -LineChart +LineChart
- -ScatterChart +ScatterChart
- -WorkingWithFonts +WorkingWithFonts
- -HyperlinkExample +HyperlinkExample
- -ShiftRows +ShiftRows
- -WorkingWithRichText +WorkingWithRichText
- -FitSheetToOnePage +FitSheetToOnePage
- -HybridStreaming +HybridStreaming
- -Outlining (SXSSF output) +Outlining (SXSSF output)
- -DeferredGeneration (SXSSF output) +DeferredGeneration (SXSSF output)
- -SavePasswordProtectedXlsx (SXSSF output) +SavePasswordProtectedXlsx (SXSSF output)
- -XLSX2CSV (streaming read) +XLSX2CSV (streaming read)
- -FromHowTo (streaming read) +FromHowTo (streaming read)
Consider the mortgage-calculation.xls +
Consider the mortgage-calculation.xls file found in the Examples (link broken / file is missing). This sheet is shown below:

An example of this can be seen in -org.apache.poi.hssf.usermodel.examples.HSSFReadWrite.
+org.apache.poi.hssf.usermodel.examples.HSSFReadWrite.Event API (HSSF Only)
The event API is newer than the User API. It is intended for intermediate @@ -1218,7 +1218,7 @@ some of the rows or cells. It can be found at /poi-examples/src/main/java/org/apache/poi/examples/hssf/eventusermodel/XLS2CSVmra.java, and may be called on the command line, or from within your own code. The latest version is always available from -subversion. +subversion.
@@ -1250,7 +1250,7 @@ The latest version is always available from file, which you will then pass to SAX.
This example shows how to get at a single known sheet, or at all sheets in the file. It is based on the example in - svn + svn poi-examples/src/main/java/org/apache/poi/examples/xssf/eventusermodel/FromHowTo.java
An example is also provided +
An example is also provided showing how to combine the user API and the SAX API by doing a streaming parse of larger worksheets and a traditional user-model parse of the rest of a workbook.
diff --git a/publish/components/spreadsheet/limitations.html b/publish/components/spreadsheet/limitations.html index 5f1bcf74ab..7421d3bf9b 100644 --- a/publish/components/spreadsheet/limitations.html +++ b/publish/components/spreadsheet/limitations.html @@ -328,7 +328,7 @@ document.write("Last Published: " + document.lastModified);See more examples on Excel conditional formatting in - ConditionalFormats.java + ConditionalFormats.java
That is it! Now you can create Java code and register it, allowing your POI based appliction to run spreadsheets that previously were inaccessible.
-This example can be found in the poi-examples/src/main/java/org/apache/poi/examples/ss/formula folder in the source.
+This example can be found in the poi-examples/src/main/java/org/apache/poi/examples/ss/formula folder in the source.
diff --git a/publish/devel/guidelines.html b/publish/devel/guidelines.html index 9174898a62..83cb12f9f6 100644 --- a/publish/devel/guidelines.html +++ b/publish/devel/guidelines.html @@ -340,7 +340,7 @@ document.write("Last Published: " + document.lastModified); Ideally, patches should be submitted early and often. This is for two key reasons. Firstly, it's much easier to review smaller patches than large ones. This means that smaller patches are much more likely - to be applied to SVN in a timely fashion. Secondly, by sending in your + to be applied to Git in a timely fashion. Secondly, by sending in your patches earlier rather than later, it's much easier to get feedback on your coding and direction. If you've missed an easier way to do something, or are duplicating some (probably hidden) existing code, or taking things diff --git a/publish/devel/index.html b/publish/devel/index.html index 8e0a5fb407..32c44e91e4 100644 --- a/publish/devel/index.html +++ b/publish/devel/index.html @@ -311,7 +311,7 @@ document.write("Last Published: " + document.lastModified); First make sure that Java is set up properly and that you can execute the 'javac' executable in your shell.
- Next, open Eclipse and create either a local SVN repository, or a copy of the Git repository, + Next, open Eclipse and create a copy of the Git repository, and import the project into Eclipse.
diff --git a/publish/devel/subversion.html b/publish/devel/subversion.html index bdef7e5d32..491b008965 100644 --- a/publish/devel/subversion.html +++ b/publish/devel/subversion.html @@ -221,23 +221,13 @@ document.write("Last Published: " + document.lastModified); version control page.
-Apache POI uses Subversion as its version control system, - but also has a read-only git mirror -
--NOTE: When checking out a subproject using - subversion, either perform a sparse checkout or check out - the trunk or a single branch or tag to avoid filling up - your hard-disk and wasting bandwidth. +
Apache POI uses Git as its version control system. We switch from Subversion to Git + in July 2025.
-
-
- For read only access to the latest Apache POI code, please use - https://svn.apache.org/repos/asf/poi/trunk/ - - -
- To browse the svn repository in your web browser, please use - ViewVC +
- For access to the latest Apache POI code, please use + https://github.com/apache/poi/tree/trunk/
Git access to POI sources
- The master source repository for Apache POI is the Subversion - one listed above. To support those users and developers who prefer - to use the Git tooling, read-only access to the POI source tree is - also available via Git. The Git mirrors normally track SVN to - within a few minutes. + The trunk source repository for Apache POI is in gitbox.apache.org. + The GitHub mirror can be used to access the repo too (https://github.com/apache/poi). + You can create PRs and issues using GitHub, if you like.
-- The official read-only Git repository for Apache POI is available - from git.apache.org/ . - The Git Clone URL is: git://git.apache.org/poi.git - and Https Clone URL: https://git.apache.org/poi.git . - Please see the Git at - Apache page for more details on the service. -
-- In addition to the git.apache.org - repository, changes are also mirrored in near-realtime to GitHub. - The GitHub repository is available at - https://github.com/apache/poi . - Please note that the GitHub repository is read-only, but pull requests sent - to it will result in an email being sent to the mailing list. A Git-formatted - patch added to Bugzilla is generally preferred though, as it can be tracked - along with all the other contributions. Please see the - contribution guidelines for more - information on getting involved in the project.
-Using Git via the SVN-Git bridge
-General information
-- Git provides a nice functionality "git-svn" which allows to read the history - of a Subversion repository and convert it into a full Git repository. This - will keep information from the SVN revisions so that the Git repository can - be updated with newer revisions from Subversion as well as allowing to push - commits from Git "upstream" into the Subversion repository. See the - - official documentation for more details. -
- -Set up the repository
-- The git-svn functionality is provided as a set of sub-commands to - "git svn". To start retrieving information from SVN and create the - initial Git repository run the following command: - -
-- Running without --revision from:HEAD will run for a long time and will retrieve the full version history of - the Subversion repository. If you need more repository history, change the from revision to an - earlier release or omit the --revision - specifier altogether. -
-
- When this finishes you have a Git repository whose "master" branch
- mirrors the SVN "trunk".
-
- From here you can use the full power of Git, i.e. quick branching,
- rebasing, merging, ...
-
- See below for some common usage hints.
-
Fetching newer SVN revisions
-- In order to fetch the latest SVN revisions, you need to "rebase" onto - the SVN trunk: -
-- This will fetch the latest changes from Subversion and will rebase - the master-branch onto them. -
- -Pushing Git commits to Subversion
-- The following command will push all changes on master back to - Subversion: -
-- Note that usually all commits on master will be sent to Subversion - in one go, so it's similar to a "push" to another Git repository. - - The dcommit may fail if there are newer revisions in Subversion, you - will need to run a git svn rebase first in this case. -
- -General usage guidelines
-- Although you can use the full power of Git, there are a few - things that work well and some things that will get you into - trouble: -
-- You should not develop on master, rather use some branching - concept where you do work on sub-branches and only merge/cherry-pick the - changes that are ready for being sent upstream. - It seems to work better to constantly rebase changes onto the - master branch as this will keep the history clean compared to - the SVN repository and will avoid sending useless "Merge" commits to - Subversion. -
-- You can keep some changes that are only useful locally by using - two branches that are rebased onto each other. E.g. - something like the following has proven to work well: -
-- When things are ready in the workbranch do a -
-- to get all the finished commits onto master as preparation for pushing them upstream. - - Then you can git svn dcommit to send the changes upstream - and a git svn rebase to get master updated with the newly - created SVN revisions. - - Finally do the following to update both branches onto the new SVN head -
-- Sounds like too much work? Put these steps into a small script and all - this will become a simple poiupdate to get all branches - rebased onto HEAD from Subversion. -
Code metrics
+Code metrics
Code quality reports for Apache POI are available on the diff --git a/publish/encryption.html b/publish/encryption.html index b6efb6d7ea..6cdae4f10a 100644 --- a/publish/encryption.html +++ b/publish/encryption.html @@ -568,7 +568,7 @@ document.write("Last Published: " + document.lastModified); default dependencies:
-
-
- BouncyCastle bcpkix, bcprov and bcutil (tested against 1.80) +
- BouncyCastle bcpkix, bcprov and bcutil (tested against 1.81)
- Apache Santuario "xmlsec" (tested against 3.0.5) @@ -581,7 +581,7 @@ document.write("Last Published: " + document.lastModified); depend on supporting services and although the code is adopted, the integration is not well tested ... please support us on integration (testing) with timestamp and revocation (OCSP) services. -
Further test examples can be found in the corresponding test class.
+Further test examples can be found in the corresponding test class.
If you want to use a hash algorithm with 64 bytes (currently only applies to SHA512), a base64 "feature" in xmlsec leads to line breaks in the digest values, which won't be accepted by Office. To workaround this, you @@ -823,7 +823,7 @@ document.write("Last Published: " + document.lastModified);
The code example, written by PJ Fanning, modifies the behavior of SXSSFWorkbook to extract an OOXML spreadsheet zipped container and write the contents to disk using AES encryption.
-See SXSSFWorkbookWithCustomZipEntrySource.java +
See SXSSFWorkbookWithCustomZipEntrySource.java and other files that are needed for this example.
Apache POI ships with a few programs and a few example programs, which can be used to do some basic performance checks. For testing file generation, the class to use is in the examples package, - SSPerformanceTest - (viewvc). + SSPerformanceTest + (viewvc). Run SSPerformanceTest with arguments of the writing type (HSSF, XSSF or SXSSF), the number rows, the number of columns, and if the file should be saved. If you can't run that with 50,000 rows and 50 columns @@ -514,11 +514,11 @@ case HSSFCell.CELL_TYPE_NUMERIC: (and ideally all 3 in less than that!), then the problem is with your environment.
Next, use the example program - ToCSV - (viewvc) + ToCSV + (viewvc) to try reading the file in with HSSF or XSSF. Related is - XLSX2CSV - (viewvc), + XLSX2CSV + (viewvc), which uses SAX parsing for .xlsx. Run this against both your problem file, and a simple one generated by SSPerformanceTest of the same size. If this is slow, then there could be an Apache POI problem with how the file is being @@ -546,7 +546,7 @@ case HSSFCell.CELL_TYPE_NUMERIC: the common parts. Use the sources off poi-ooxml-full for the lite version, which is available from Maven Central - ask your favourite Maven mirror for the poi-ooxml-full-*-sources jar. Alternately, if you download - the POI source distribution (or checkout from SVN) and build, Ant will + the POI source distribution (or checkout from Git) and build, Ant will automatically compile it for you to generate the source and binary poi-ooxml-full jars.

