Converting Folio Flat File(.FFF) to HTML/XML format

I am converting .FFF file(attached with it's definition file too(.DEF)) to .HTML using this tool available in github text But when I use the package I face some errors to convert it into .HTML/.XML file. These two files are generated when I follow the procedure mentioned in the readme file. output folder

Within the log file the following error is shown:-

Exporting resources...
Exception in thread "main" java.io.IOException: Infobase CPACHB is present in set, but root record is missing from lucene index.
    at folioxml.export.plugins.ResolveHyperlinks.loadAnalyzerFromLucene(ResolveHyperlinks.java:53)
    at folioxml.export.plugins.ResolveHyperlinks.loadAnalyzers(ResolveHyperlinks.java:59)
    at folioxml.export.plugins.ResolveHyperlinks.beginInfobaseSet(ResolveHyperlinks.java:87)
    at folioxml.export.InfobaseSetVisitor.complete(InfobaseSetVisitor.java:69)
    at folioxml.export.ExportRunner.Export(ExportRunner.java:130)
    at folioxml.command.Main.run(Main.java:70)
    at folioxml.command.Main.main(Main.java:40)

And within the highslide folder these files are generated as shown in below picture:- highslide folder

I have attached my config.yaml file

myconfig:
    export_xml: true #Creates a single XML file with all the content (excluding the 
    stylesheet, images, and logs)  (default=true)
    skip_normal_records: false # affects xml only - only writes out hierarchy
    affecting levels, in order to make a shorter file. (default=false)
    nest_file_elements: true # affects XML only - Disables nested syntax for <file> 
    elements in xml, uses flat structure. Nesting uses same hierarchy as folio. 
    (default=true)
    indent_xml: true #Indentation can introduce undesired visual 
    artificacts/spacing, and should only be used for human consumption. 
    (default=true)

    export_inventory: true # Lowers performance - tracks unique elements in memory, 
    generates a textual report at the end. (default=true)

    export_hidden_text: true # Halves performance. Writes out a log of text that 
    would be hidden by the generated CSS (either via display:none or zero-contrast 
    coloring). (default=true)

    resolve_jump_links: false # Disable fixing up jump links (default=true)
    resolve_query_links: false # Disable simulating queries and linking them to the 
    first result. If this and resolve_jump_links are false, no Lucene index is 
    required. (default=true)

    export_html: true # Exports lots of browsable HTML files according to the 
    splitting and naming rules. (default=true)
    use_highslide: true #affects both XML and HTML. Required for popups/notes to 
    keep working. (default=true)
    add_nav_links: true #html only # Adds prev/next links at the beginning and end 
    of each HTML generated. (default=true)

    faux_tabs: false # Enable faux tabs (default=false)
    faux_tabs_window_min: 80 # We have to deal with centered and right-aligned 
    tabs.
    faux_tabs_window_max: 120 # These provide the default and maximum (character 
    count) bounds with which to simulate them.

    # Here we can manually map broken URLs (and cross-infobase links) to new places
    # link_mapper:
    #   urls:
    #     'C:\Files\Data.pdf': "https://othersite/data"

    #   infobases:
    #     'C:\Files\Other.NFO': "http://othersite/other"
    #     'C:\Files\Other2.NFO': "http://othersite/other2"

    #This is how we trash stuff we don't care about
    # pull: # log_pulled_elements.txt and log_dropped_elements.txt are created
    #   program_links: true
    #   menu_links: true
    #   drop_notes: false # It can be cleaner to drop notes/popups than preserve 
    them with highslide & javascript. Dropped data is logged.
    #   drop_popups: false # When use_highslide is false, the popups would 
    otherwise be invalid HTML
    #   ole_objects: false
    #   metafile_objects: false
    #   links_to_infobases:
    #     - 'C:\Files\Obsolete.NFO'
    #     - 'C:\Files\Obsolete2.NFO'

    #You must convert all your infobases that link to each other at once, otherwise 
    those links will not be preserved.
    #In addition, unique IDs will overlap between infobases converted separately, 
    causing potential issues in your final data store.
    infobases:
    - id: CPACHB
      path: "files/CPACHB.FFF"
      # aliases:
      #   - 'C:\files\CPACHB.NFO'
    # - id: info_b
    #   path: "files/info_b.FFF"
    #   aliases:
    #     - 'C:\files\info_b.NFO'

    #Structure affects how we split the infobase into parts and identify those 
    parts.
    # We can specify a custom provider class

    structure_class: "folioxml.export.structure.IdSlugProvider"
    structure_class_params: ["null", "null", 0, 0, 1]

    #structure_class_params: String levelRegex, String splitOnFieldName, Integer 
    idKind, Integer root_index, Integer start_index

    # levelRegex lets us split based on predefined folio levels like "Heading 
    1|Heading 2"
    # splitOnFieldName lets us split whenever a record contains the given field.
    # idKind values
    # 0 (heading-based slugs), 1 (integers), 2 (nested integers 2.3.1), 3 (guids), 
    or 4 (folio IDs). Schemes 5-9 use the contents of splitOnFieldName and fall 
    back to 0-4 if missing or non-unique.
    # root_index and start_index are used for idKinds 2 and 3 (as well as 7 and 8, 
    of course).

    asset_start_index: 1 #What index do we start with for asset IDs.

    #Only set this to true if you also set export_locations: images: url to a 
    template that can respond based on numeric ID instead of filename. See 
    AssetInventory.xml
    asset_use_index_in_url: false

    export_locations:
    default:
      path: "files/export/{id}-{stamp}/{input}" #Used for text, xml files, css, and 
    logs
    image:
      path: files/export/{input} #Adjust this to represent the absolute path where 
    the static images will be stored. Control {input} with asset_use_index_in_url
    luceneindex:
      path: "files/indexes/myconfig/" #Just a temp directory.
    html:
      path: "files/export/{id}-{stamp}/html/{input}.html" #Adjust this to represent 
    the final hosted location of your HTML pages, as an absolute path. Adjust 
    idKind to change {input}

Please help me to convert these files to XML/HTML Folio Flat File

I also tried running js file inside the highslide folder ie node highslide-with-html.js but faced with this error:- uaVersion: /Trident/4.0/.test(navigator.userAgent) ? 8 : ^

ReferenceError: navigator is not defined

Upvotes: 0

Views: 55

Answers (0)

Related Questions