Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-25208

hardcoded blacklisted mime types list prevents customizations in nuxeo-diff

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 7.10, 8.10, 9.10, 10.1
    • Fix Version/s: 10.3
    • Component/s: Diff
    • Release Notes Summary:
      The blacklisted MIME types for HTML preview are configurable.
    • Tags:
    • Backlog priority:
      500
    • Upgrade notes:
      Hide

      Deprecated ContentDiffHelper#getHtmlConversionBlackListedMimeTypes.

      Added:

      org.nuxeo.ecm.diff.content.MimeTypesDescriptor
      org.nuxeo.ecm.diff.content.MimeTypeDescriptor
      ContentDiffAdapterManager#getHtmlConversionBlacklistedMimeTypes()
      

      Added the htmlConversionBlacklistedMimeTypes extension point to the org.nuxeo.ecm.diff.content.adapter.ContentDiffAdapterManagerComponent component:

        <extension-point
          name="htmlConversionBlacklistedMimeTypes">
          <documentation>
            @since 10.10
      
            Allows to contribute the list of blacklisted mime types for HTML
            conversion.
      
            By default, contributing a list merges its mime types
            with the existing ones.
            To remove a mime type, use enabled=false.
            <code>
              <extension
                target="org.nuxeo.ecm.diff.content.adapter.ContentDiffAdapterManagerComponent"
                point="htmlConversionBlacklistedMimeTypes">
                <mimeTypes>
                  <mimeType>application/msword</mimeType>
                  <mimeType>application/rtf</mimeType>
                  <mimeType enabled="false">application/pdf</mimeType>
                </mimeTypes>
              </extension>
            </code>
      
            To override the whole list, use override="true".
            <code>
              <extension
                target="org.nuxeo.ecm.diff.content.adapter.ContentDiffAdapterManagerComponent"
                point="htmlConversionBlacklistedMimeTypes">
                <mimeTypes override="true">
                  <mimeType>application/msword</mimeType>
                </mimeTypes>
              </extension>
            </code>
          </documentation>
          <object
            class="org.nuxeo.ecm.diff.content.MimeTypesDescriptor" />
        </extension-point>
      
      Show
      Deprecated ContentDiffHelper#getHtmlConversionBlackListedMimeTypes . Added: org.nuxeo.ecm.diff.content.MimeTypesDescriptor org.nuxeo.ecm.diff.content.MimeTypeDescriptor ContentDiffAdapterManager#getHtmlConversionBlacklistedMimeTypes() Added the htmlConversionBlacklistedMimeTypes extension point to the org.nuxeo.ecm.diff.content.adapter.ContentDiffAdapterManagerComponent component: <extension-point name= "htmlConversionBlacklistedMimeTypes" > <documentation> @since 10.10 Allows to contribute the list of blacklisted mime types for HTML conversion. By default , contributing a list merges its mime types with the existing ones. To remove a mime type, use enabled= false . <code> <extension target= "org.nuxeo.ecm.diff.content.adapter.ContentDiffAdapterManagerComponent" point= "htmlConversionBlacklistedMimeTypes" > <mimeTypes> <mimeType>application/msword</mimeType> <mimeType>application/rtf</mimeType> <mimeType enabled= " false " >application/pdf</mimeType> </mimeTypes> </extension> </code> To override the whole list, use override= " true " . <code> <extension target= "org.nuxeo.ecm.diff.content.adapter.ContentDiffAdapterManagerComponent" point= "htmlConversionBlacklistedMimeTypes" > <mimeTypes override= " true " > <mimeType>application/msword</mimeType> </mimeTypes> </extension> </code> </documentation> <object class= "org.nuxeo.ecm.diff.content.MimeTypesDescriptor" /> </extension-point>
    • Sprint:
      nxfit 10.10.1
    • Story Points:
      3

      Description

      Problem: The following method has hardcoded value:
      https://github.com/nuxeo/nuxeo-diff/blob/master/nuxeo-diff-content/src/main/java/org/nuxeo/ecm/diff/content/ContentDiffHelper.java#L241

      Impact: This prevents to use other comparison tools like PDFCompare because the widget content_diff_links_widget_template.xhtml does not display the diff button in this case.

      Expected behavior: The list should be configurable
      through a contribution to allow add/removal of blacklisted mime types.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day, 1 hour
                1d 1h

                  PagerDuty

                  Error rendering 'com.pagerduty.jira-server-plugin:PagerDuty'. Please contact your Jira administrators.