Uploaded image for project: 'Hippo CMS'
  1. Hippo CMS
  2. CMS-8638

Consolidate and merge functionality of the RichTextModel and ChildFacetUuidsModel

    XMLWordPrintable

Details

    Description

      The refactoring and solution of CMS7-1610 for the ChildFacetUuidsModel introduced a second HtmlCleaner instance and processing of html fields besides the (optional) processing by the HtmlCleanerPlugin.
      This is not a desirable situation as CMS7-8616 already showed:

      • html parsing and rewriting is now done twice
      • the ChildFacetUuidsModel uses a none configurable (hard-coded) HtmlCleaner, which may not by aligned with the HtmlCleanerPlugin

      After thorough discussion the following solution has been decided to resolve this:

      • use a single HtmlCleaner instance, as configured through the HtmlCleanerPlugin repository configuration
      • this requires that the HtmlCleanerPlugin service always is used: if for a field the htmlcleaner.id is configured empty (null), then use and fallback to the 'default' org.hippoecm.frontend.plugins.richtext.IHtmlCleanerService
        but (then) with whitelisting filtering disabled
      • the HtmlCleanerService will also get a new optional configuration property to enable/disable whitelisting explicitely (default true) which is useful and needed to support two or more HtmlCleanerService instances
      • the RichTextModel will be refactored to get a ChildFacetUuidsModel optionally injected (instead of being wrapped by one)
      • the RichTextModel will get an instantiated HtmlCleaner from the HtmlCleanerPlugin and create a TagNode from the html text with it
      • this html TagNode then will first be passed into the ChildFacetUuidsModel (not used for the CKEditorPropertyPlugin) instead of the html text, which can modify it as needed
      • thereafter the html TagNode will be passed into the HtmlCleanerPlugin to do (optional) whitelist filtering and the final serializing to a html string value

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              adouma Ate Douma
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 2 weeks
                  2w
                  Remaining:
                  Remaining Estimate - 2 weeks
                  2w
                  Logged:
                  Time Spent - Not Specified
                  Not Specified