Uploaded image for project: 'FOP'
  1. FOP
  2. FOP-2472

Allow to clear the hyphenation tree cache at runtime

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Done
    • Affects Version/s: 1.1
    • Fix Version/s: 2.2
    • Component/s: None
    • Labels:

      Description

      I suggest adding the following method (or similar) to the org.apache.fop.hyphenation.Hyphenator class.

      I had to hack FOP and create a custom build for myself, because I need to alter and reload the hyphenation files at runtime.
      The use case is, that I have a web application that allows editors - on an admin page - to add hyphenation exceptions on-the-fly. In that case the hyphenation pattern files are re-created including the new exceptions, but need to be reloaded by FOP. The below worked for me, please consider adding to the trunk.

      Hyphenator.java
      /**
        * Clear the hyphenation tree cache, in case the underlying data files have changed at runtime.
        */
      public static synchronized void clearHyphenationTreeCache()
      {
        hTreeCache = new HyphenationTreeCache();
      }
      

        Attachments

          Activity

            People

            • Assignee:
              adelmelle Andreas L. Delmelle
              Reporter:
              marc82ch Marc Wiest
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 0.5h
                0.5h
                Remaining:
                Remaining Estimate - 0.5h
                0.5h
                Logged:
                Time Spent - Not Specified
                Not Specified