Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-7625

Improve DefaultMessageBundlesLoader class

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Neutral
    • None
    • None
    • None

    Description

      Hi,

       

      We recently ran into an issue when loading properties files from our services module. We have a properties file that has some legacy values that contain html markup. The markup has class attributes, but the DefaultMessageBundlesLoader class uses JSOUP to scrub any markup in values based on the internal Whitelist. Example of markup value is:

      fund.tools.productComparison.ytdNav = YTD  <span class="pull-right">(NAV)</span>

       

      We wanted to change the whitelisting behavior, but how this class is defined it has a few problems:

       

      1. It is a concrete class defined as singleton w/ no interface, so to override the default behavior you have to extend the concrete class
      2. The getMessages method is package protected, so if you do extend this class it does you no good, because your overridden method will not be used
      3. Since everything in the class is private, you basically have to cp/paste all the code and still extend the concrete class

       

      What would be nice is if the class implements interface and allows you to either have the whitelist configurable from subclasses and/or allow JSOUP behavior turned off via jcr

       

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

              Unassigned Unassigned
              jshankle John Shankle
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:

                Checklists

                  Task DoD