Wiki source code of Parse and analyze a package
Last modified by Raphaël Jakse on 2026/03/23 11:35
Hide last authors
| author | version | line-number | content |
|---|---|---|---|
| |
1.1 | 1 | Confluence XML exposes its component in charge of parsing and analyzing confluence exports. It can be used independently by using component ##org.xwiki.contrib.confluence.filter.input.ConfluenceXMLPackage##: |
| 2 | |||
| 3 | {{code language="java"}} | ||
| |
2.1 | 4 | @Inject |
| 5 | private Provider<ConfluenceXMLPackage> confluencePackageProvider; | ||
| |
1.1 | 6 | |
| |
2.1 | 7 | public void analyze() |
| 8 | { | ||
| 9 | // Create a new instance of ConfluenceXMLPackage component | ||
| 10 | ConfluenceXMLPackage confluencePackage = this.confluencePackageProvider.get(); | ||
| |
1.1 | 11 | |
| |
2.1 | 12 | // Parse the packaged located on the file system (but support any org.xwiki.filter.input.InputSource which lead to a zip content or a directory) |
| 13 | confluencePackage.read(new DefaultFileInputSource(new File("path/to/the/confluencepackage.xml.zip"))); | ||
| |
1.1 | 14 | |
| |
2.1 | 15 | // Call the various getters of ConfluenceXMLPackage |
| 16 | } | ||
| |
1.1 | 17 | {{/code}} |