Class | Line # | Actions | |||||
---|---|---|---|---|---|---|---|
XDOMOfficeDocumentSplitter | 36 | 0 | - | 0 | 0 |
1 | /* | |
2 | * See the NOTICE file distributed with this work for additional | |
3 | * information regarding copyright ownership. | |
4 | * | |
5 | * This is free software; you can redistribute it and/or modify it | |
6 | * under the terms of the GNU Lesser General Public License as | |
7 | * published by the Free Software Foundation; either version 2.1 of | |
8 | * the License, or (at your option) any later version. | |
9 | * | |
10 | * This software is distributed in the hope that it will be useful, | |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | * Lesser General Public License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Lesser General Public | |
16 | * License along with this software; if not, write to the Free | |
17 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | |
18 | * 02110-1301 USA, or see the FSF site: http://www.fsf.org. | |
19 | */ | |
20 | package org.xwiki.officeimporter.splitter; | |
21 | ||
22 | import java.util.Map; | |
23 | ||
24 | import org.xwiki.component.annotation.Role; | |
25 | import org.xwiki.model.reference.DocumentReference; | |
26 | import org.xwiki.officeimporter.OfficeImporterException; | |
27 | import org.xwiki.officeimporter.document.XDOMOfficeDocument; | |
28 | ||
29 | /** | |
30 | * Component responsible for splitting office imports. | |
31 | * | |
32 | * @version $Id: 7bfe7f17f6f201b1e3562b740a7cd32311e2d2cf $ | |
33 | * @since 2.1M1 | |
34 | */ | |
35 | @Role | |
36 | public interface XDOMOfficeDocumentSplitter | |
37 | { | |
38 | /** | |
39 | * Splits an {@link XDOMOfficeDocument} into multiple {@link XDOMOfficeDocument} instances using the provided | |
40 | * heading levels as boundaries. The naming Criterion and the base name determines the target wiki pages for the | |
41 | * newly split documents. | |
42 | * | |
43 | * @param xdomOfficeDocument {@link XDOMOfficeDocument} to be split | |
44 | * @param headingLevelsToSplit heading levels (1..6) to be used as boundaries. The split process is recursive, if | |
45 | * there are multiple heading levels specified, the original document will be split from the highest heading | |
46 | * level ({@code lowest value >= 1}) first and then the resulting office documents will be re-split from the | |
47 | * next highest heading level | |
48 | * @param namingCriterionHint naming criterion to be used when producing target page names for the newly split | |
49 | * documents. Currently three schemes are supported: | |
50 | * <ul> | |
51 | * <li>headingNames - Uses the first heading name as target document name</li> | |
52 | * <li>mainPageNameAndHeading - Base document name followed by heading name</li> | |
53 | * <li>mainPageNameAndNumbering - Base document name followed by index</li> | |
54 | * </ul> | |
55 | * @param baseDocumentReference base (root) page name to be used when generating target page names for child (newly | |
56 | * split) documents | |
57 | * @return a map of page descriptors vs xdom office documents. Each page descriptor describes the target wiki page | |
58 | * name for the corresponding xdom office document | |
59 | * @throws OfficeImporterException if an error occurs while splitting | |
60 | * @since 2.2M1 | |
61 | */ | |
62 | Map<TargetDocumentDescriptor, XDOMOfficeDocument> split(XDOMOfficeDocument xdomOfficeDocument, | |
63 | int[] headingLevelsToSplit, String namingCriterionHint, DocumentReference baseDocumentReference) | |
64 | throws OfficeImporterException; | |
65 | } |