KeyView 24.4
KeyView XML Export SDK Java Programming Guide

# Understand the Subfile Hierarchy

When you extract a container file, the paths or relationships between the subfiles might be irrelevant. For example, you might want to filter the subfiles contained in a ZIP archive, but you might not care about the file and folder structure.

KeyView provides information that enables you to recreate the hierarchy, for those use cases where it is important. You can use the hierarchy to recreate the directory structure in a file system, or to process documents according to their relationship to each other. For example, if you use KeyView as part of a search engine, the hierarchical information could be used to enable your users to search a document's parent or siblings within the container. In addition, when a document is returned to the user, the parent, sibling, or child documents could be returned as recommendations.

To obtain information about the position of a subfile in the hierarchy, call `extGetSubFileInfo`, which returns an object of the `ExtSubFileInfo` class. Then, use the `getParentIndex()` and `getChildArray()` methods to identify the subfile’s parent and children. You might need to call `extGetSubFileInfo` for multiple subfiles to reconstruct the entire hierarchy.

When KeyView returns the parent index `-1`, this indicates that the subfile has no parent and is at the root level within its container.

## Example

You might extract a PST file that contains five subfiles. The following diagram shows the available hierarchy information for each subfile:

Using this information, you can recreate the hierarchy shown in the following diagram.

## Create a Root Node

If you are programming with the C or Java API, you can instruct KeyView to create an artificial root node at the top of the hierarchy. This artificial root node is an internal object, and may be extracted to disk as a directory called `root`. Its index number is `0`.

To create a root node

- Call `setCreateRootNode` on the `ExtOpenDocConfig` class that you pass to the `extOpenDocument` method. When you request a root node, the return value of the `getNumSubFiles` method (on the `ExtMainFileInfo` object) increases by one. For example, a Microsoft Word document with three embedded OLE objects has `4` subfiles when the root node is enabled, rather than `3`.

Copyright 1997-2024 Open Text
Version 24.4 | Last updated September 2024

Send documentation feedback

Close

Send documentation feedback

To send feedback using your default email client, open an email window.

Otherwise, send your feedback and the information below to MFI-swpdl.idoldocsfeedback@opentext.com.

We appreciate your feedback!

Product: IDOL KeyView 24.4

Topic Title: Understand the Subfile Hierarchy