Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-95566

Document conversion requires UI configuration regardless of OSGi config file

    Details

    • Type: Bug
    • Status: Closed
    • Resolution: No Longer Reproducible
    • Affects Version/s: 7.1.3 CE GA4, 7.1.X, 7.2.0 RC2
    • Fix Version/s: 7.1.X, 7.2.X, Master
    • Component/s: Portal Configuration
    • Labels:
      None

      Description

      Since the release of Liferay 7.1, Document conversion broke in some places if one tries to set its configuration via an OSGi config file.

      It seems that DocumentConversionUtil is not able to catch the configuration in time during the boot process.

      The following lines seem to be responsible:

      https://github.com/liferay/liferay-portal/blob/7.1.x/portal-kernel/src/com/liferay/document/library/kernel/document/conversion/DocumentConversionUtil.java

      	private static volatile DocumentConversion _documentConversion =
      		ServiceProxyFactory.newServiceTrackedInstance(
      			DocumentConversion.class, DocumentConversionUtil.class,
      			"_documentConversion", false);
      

      Expected behavior:
      Updates on OpenOfficeConfiguration should cause DocumentConversionUtil to behave like DocumentConversionImpl; thus, an instance booting with the file com.liferay.document.library.document.conversion.internal.configuration.OpenOfficeConfiguration.config should be able to enable the service.

      Observed behavior:

      • Setting the OSGi configuration* only inside the OSGi* config file has no effect on the Util class.
      • Components that use the OSGi reference instead of ServiceProxyFactory behave as expected.
      • The UI, can reflect that the server was enable but executing on Groovy script area a call for the Util class will point that the conversion is not enabled.
      • Changes on the UI have no effect, only if reset to default first.
      • File previews are not generated.

      Reproducing:

      1. With a new instance, set configs/com.liferay.document.library.document.conversion.internal.configuration.OpenOfficeConfiguration.config to enable the server connection
      2. Execute the following script:
      import com.liferay.document.library.kernel.document.conversion.DocumentConversionUtil
      import com.liferay.portal.kernel.util.MimeTypesUtil
      
      println(DocumentConversionUtil.isEnabled())
      

        Attachments

          Activity

            People

            Assignee:
            sharry.shi Sharry Shi
            Reporter:
            victorlima02 Victor de Lima Soares
            Participants of an Issue:
            Recent user:
            Sharry Shi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              2 years, 5 weeks, 2 days ago

                Packages

                Version Package
                7.1.X
                7.2.X
                Master