Package com.xmlmind.w2x.processor

## Class WebHelpStep

- java.lang.Object
- - com.xmlmind.w2x.processor.ProcessStep
  - - com.xmlmind.w2x.processor.SplitStep
    - - com.xmlmind.w2x.processor.WebHelpStep

-     public class WebHelpStep
      extends SplitStep

  This processing step is used to convert input XHTML+CSS document (typically created using a `ConvertStep`) or input semantic XHTML document (typically created using a `EditStep` running "`w2x:xed/main.xed`") to a Web Help. The Web Help "compiler" being used here is XMLmind Web Help Compiler.

  The outline level used to split the input XHTML+CSS document is specified by parameter `step_name.split-before-level`. This outline level is an integer between 0 and 8 inclusive. Default outline level is 0.

  The save file of the Web Help "main" is specified by parameter `step_name.out-file`.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `protected static class` | `WebHelpStep.EntryElement` |

    - ### Nested classes/interfaces inherited from class com.xmlmind.w2x.processor.SplitStep

      `SplitStep.Part`

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected static Name` | `ANCHOR_NAME` |
    `protected static String` | `DOCUMENT_READY` |
    `protected static Name` | `ENTRY_NAME` |
    `protected static Name` | `INDEX_NAME` |
    `protected static Name` | `MERGE_AND_SORT_NAME` |
    `protected static PrefixEntry[]` | `PREFIX_ENTRIES` |
    `protected static Name` | `REF_NAME` |
    `protected static Name` | `SEE_NAME` |
    `protected static Name` | `TERM_NAME` |
    `protected static Name` | `TITLE_NAME` |
    `protected static Name` | `TOC_NAME` |
    `protected static Namespace` | `WHC_NS` |
    `protected static String` | `WINDOW_ONLOAD` |

    - ### Fields inherited from class com.xmlmind.w2x.processor.SplitStep

      `COLS_ATTR, FRAME_ELEM, FRAMESET_ELEM, SCROLLING_ATTR, TOC_CSS`

    - ### Fields inherited from class com.xmlmind.w2x.processor.ProcessStep

      `stepName`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `WebHelpStep​(String stepName)` | Constructs a WebHelpStep having specified name.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected void` | `compileWebHelp​(List<SplitStep.Part> parts, File tocFile, File indexFile, Map<String,​String> parameters, ProgressMonitor monitor)` |
    `protected Document` | `createPartTemplate​(Document xhtmlDoc)` |
    `protected static boolean` | `isDebug​(ProgressMonitor monitor)` |
    `protected void` | `linkIndexTerm​(Element entry, String[] parentTerms, Map<String,​WebHelpStep.EntryElement> fullTermToEntry, Map<String,​WebHelpStep.EntryElement> simpleTermToEntry, Map<String,​Element[]> textToSee)` |
    `protected void` | `linkIndexTerms​(List<Element> indexEntries)` |
    `protected File` | `newOutFile​(File file, int partNum)` |
    `void` | `process​(Object[] state, Map<String,​String> parameters, int[] stepCounter, ProgressMonitor monitor)` | Execute this processing step.
    `protected void` | `processIndexTerms​(Element tree, String partHref, boolean strict, List<Element> indexEntries)` |
    `protected Element[]` | `processIndexTerms​(List<SplitStep.Part> parts)` |
    `protected void` | `saveDocument​(Document doc, boolean indent, String encoding, File file, ProgressMonitor monitor)` |
    `protected void` | `saveIndex​(Element[] indexEntries, String lang, File file, ProgressMonitor monitor)` |
    `protected void` | `saveTOC​(List<SplitStep.Part> parts, boolean omitTOCRoot, File file, ProgressMonitor monitor)` |
    `protected Element` | `toIndexEntry​(Element indexTerm, String id, String partHref)` |
    `protected Document` | `toTOC​(List<SplitStep.Part> parts, boolean omitTOCRoot)` |

    - ### Methods inherited from class com.xmlmind.w2x.processor.SplitStep

      `addPart, collectCounters, collectIds, collectNotes, copyNotes, copyNotes2, createCharsetMeta, createFrameset, createTOCStyle, creatingFile, deleteNotes, findById, findCharset, findCharsetMeta, findNotes, findParentPart, findTitle, fixLinks, getAllText, getBoxFirstChildElement, getOutlineLevel, isNote, isNoteRef, isNoteSeparator, newOutFile, parseCounterPI, parseCounterReset, processCounters, processLinks, processNotes, processNotes2, processParts, resetCounters, saveParts, setNotes, splitDocument, toTOC, useSameChunk`

    - ### Methods inherited from class com.xmlmind.w2x.processor.ProcessStep

      `debugParameters, equals, getAllParameters, getBooleanParameter, getFileParameter, getIntParameter, getParameter, getURLParameter, hashCode, illegalState, joinAllParameters, missingParameter, parameterName, progress, toString, urlOrFile`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### WHC_NS

          protected static final Namespace WHC_NS

    - #### PREFIX_ENTRIES

          protected static final PrefixEntry[] PREFIX_ENTRIES

    - #### TOC_NAME

          protected static final Name TOC_NAME

    - #### ENTRY_NAME

          protected static final Name ENTRY_NAME

    - #### TITLE_NAME

          protected static final Name TITLE_NAME

    - #### INDEX_NAME

          protected static final Name INDEX_NAME

    - #### MERGE_AND_SORT_NAME

          protected static final Name MERGE_AND_SORT_NAME

    - #### TERM_NAME

          protected static final Name TERM_NAME

    - #### ANCHOR_NAME

          protected static final Name ANCHOR_NAME

    - #### SEE_NAME

          protected static final Name SEE_NAME

    - #### REF_NAME

          protected static final Name REF_NAME

    - #### WINDOW_ONLOAD

          protected static final String WINDOW_ONLOAD

      See Also:
        Constant Field Values

    - #### DOCUMENT_READY

          protected static final String DOCUMENT_READY

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### WebHelpStep

          public WebHelpStep​(String stepName)

      Constructs a WebHelpStep having specified name.

  - ### Method Detail

    - #### process

          public void process​(Object[] state,
                              Map<String,​String> parameters,
                              int[] stepCounter,
                              ProgressMonitor monitor)
                       throws Exception

      Description copied from class: `SplitStep`
      Execute this processing step.

      `state[0]` contains:

      - Before this method is executed: an XHTML+CSS document (typically created using a `ConvertStep`).
      - After this method is executed: the save file containing the frameset.
      Overrides:
        `process` in class `SplitStep`
      Parameters:
        `state` - contains the current state of processing: a `Document` or a `File`.

        This object is used as the input of this step and thus, is processed by this step.

        After its execution, this method generally updates the `state` array with a new `Document` or `File` to pass the result/output of this step to the next step.

        `parameters` - all the parameters passed to the `Processor` owning and thus executing this process step.

        Parameters which are relevant to this processing step are prefixed with "``ProcessStep.stepName`.`".

        `stepCounter` - contains the rank of previously executed processing step. Must be incremented by this method.
        `monitor` - used to monitor the progress of the processing steps

        Invoking convenience method `ProcessStep.progress(java.lang.String, int[], com.xmlmind.util.ProgressMonitor)` suffices to make good use of both `monitor` and `stepCounter`.

      Throws:
        `Exception` - if for any reason, this method fails

    - #### createPartTemplate

          protected Document createPartTemplate​(Document xhtmlDoc)
                                         throws Exception

      Overrides:
        `createPartTemplate` in class `SplitStep`
      Throws:
        `Exception`

    - #### newOutFile

          protected File newOutFile​(File file,
                                    int partNum)

      Overrides:
        `newOutFile` in class `SplitStep`

    - #### processIndexTerms

          protected Element[] processIndexTerms​(List<SplitStep.Part> parts)

    - #### processIndexTerms

          protected void processIndexTerms​(Element tree,
                                           String partHref,
                                           boolean strict,
                                           List<Element> indexEntries)

    - #### toIndexEntry

          protected Element toIndexEntry​(Element indexTerm,
                                         String id,
                                         String partHref)

    - #### linkIndexTerms

          protected void linkIndexTerms​(List<Element> indexEntries)

    - #### linkIndexTerm

          protected void linkIndexTerm​(Element entry,
                                       String[] parentTerms,
                                       Map<String,​WebHelpStep.EntryElement> fullTermToEntry,
                                       Map<String,​WebHelpStep.EntryElement> simpleTermToEntry,
                                       Map<String,​Element[]> textToSee)

    - #### saveDocument

          protected void saveDocument​(Document doc,
                                      boolean indent,
                                      String encoding,
                                      File file,
                                      ProgressMonitor monitor)
                               throws CanceledException,
                                      IOException

      Overrides:
        `saveDocument` in class `SplitStep`
      Throws:
        `CanceledException`
        `IOException`

    - #### saveTOC

          protected void saveTOC​(List<SplitStep.Part> parts,
                                 boolean omitTOCRoot,
                                 File file,
                                 ProgressMonitor monitor)
                          throws CanceledException,
                                 IOException

      Throws:
        `CanceledException`
        `IOException`

    - #### toTOC

          protected Document toTOC​(List<SplitStep.Part> parts,
                                   boolean omitTOCRoot)

    - #### saveIndex

          protected void saveIndex​(Element[] indexEntries,
                                   String lang,
                                   File file,
                                   ProgressMonitor monitor)
                            throws CanceledException,
                                   IOException

      Throws:
        `CanceledException`
        `IOException`

    - #### compileWebHelp

          protected void compileWebHelp​(List<SplitStep.Part> parts,
                                        File tocFile,
                                        File indexFile,
                                        Map<String,​String> parameters,
                                        ProgressMonitor monitor)
                                 throws Exception

      Throws:
        `Exception`

    - #### isDebug

          protected static final boolean isDebug​(ProgressMonitor monitor)