public class ZapTocMerger
extends javax.help.UniteAppendMerge
An UniteAppendMerge
that takes into account the "tocid" attribute of the "tocitem"
elements to do the merging. The "tocid" attribute is used to facilitate the merging of the TOC
with internationalised helpsets. The node names and targets do not provide enough information to
do a safe merging. The name might not be the same (when it is translated) and the target is not
present in all nodes. In those cases a "tocid" attribute is set to unambiguously identify those
nodes.
The merge depends on the information provided by the "tocitem" elements and if they use or not the "tocid" attribute.
First the nodes are compared to check if they have the same "tocid" and merged if they have.
Otherwise and for backward compatibility with helpsets that still do not use the attribute
"tocid" a forced merge is performed if some predefined requirements are met. The requirements are
as follow:
TOC_IDS_FORCE_MERGE_MAP
);
ForceMergeRequirement
) of the map of forced merges;
If none of the aforementioned merges are performed the actual merging will be done as defined
by UniteAppendMerge
.
UniteAppendMerge
,
ZapTocItem
,
ZapTocView
,
TOC_IDS_FORCE_MERGE_MAP
,
ZapTocMerger.ForceMergeRequirement
Modifier and Type | Class and Description |
---|---|
static class |
ZapTocMerger.ForceMergeRequirement
The
ForceMergeRequirement class contains the requirements to do a forced merging. |
Modifier and Type | Field and Description |
---|---|
static Map<String,ZapTocMerger.ForceMergeRequirement> |
TOC_IDS_FORCE_MERGE_MAP
A map containing the requirements to do forced merging.
|
Constructor and Description |
---|
ZapTocMerger(javax.help.NavigatorView master,
javax.help.NavigatorView slave) |
Modifier and Type | Method and Description |
---|---|
static void |
mergeNodeChildren(TreeNode node)
Merge Node Children.
|
static void |
mergeNodes(TreeNode master,
TreeNode slave)
Merge Nodes.
|
TreeNode |
processMerge(TreeNode node)
Processes unite-append merge
|
public static final Map<String,ZapTocMerger.ForceMergeRequirement> TOC_IDS_FORCE_MERGE_MAP
The map key corresponds to the attribute "tocid" of the "tocitem" elements as defined in the toc.xml file. The value has the requirements that should be met to actually do the merging.
public ZapTocMerger(javax.help.NavigatorView master, javax.help.NavigatorView slave)
public TreeNode processMerge(TreeNode node)
processMerge
in class javax.help.UniteAppendMerge
node
- The master nodepublic static void mergeNodes(TreeNode master, TreeNode slave)
master
- The master node to merge withslave
- The node to merge into the masterpublic static void mergeNodeChildren(TreeNode node)
node
- The parent node from which the children are merged