Preview of Apple Keynote files?

Has anyone been able to get a preview renditions of Apple Keynote files in WebUI? It seems like it should be possible as LibreOffice can open .key files, and there seems to be a converter in the Nuxeo code. However, upon importer of a .key file there is no preview. It would be nice to have a PDF conversion as a preview (similar to what happens with PowerPoint). Should this be built-in, or what would be needed to achieve this?

https://github.com/nuxeo/nuxeo/blob/2387c0ba417810c3b68fd8d51795b46cdee6f579/modules/platform/nuxeo-platform-convert/src/main/java/org/nuxeo/ecm/platform/convert/plugins/IWork2PDFConverter.java

0 votes

2 answers

108 views

ANSWER



Hello,

If Libreoffice can open and preview keynote files, then you should be able to make a contribution to https://explorer.nuxeo.com/nuxeo/site/distribution/server-10.10/viewExtensionPoint/org.nuxeo.ecm.core.convert.service.ConversionServiceImpl–converter and add the Keyfile mime type in the Libreoffice converter. I haven't tested it but that's the idea;

Regards

0 votes



Thanks for this. I was able to add the mime type to the converter extension point as you mentioned, but I also had to add it to the MimeTypePreviewer so that a preview would be created. https://explorer.nuxeo.com/nuxeo/site/distribution/server-10.10/viewExtensionPoint/org.nuxeo.ecm.platform.preview.adapter.PreviewAdapterManagerComponent--MimeTypePreviewer

Also exploring this to create previews for other Office Types that aren't supported (xlsm, etc). Looks good so far, so I appreciate the guidance.

08/07/2020

BTW, Keynote files conversions won't look that great unless using a relatively new version of LibreOffice (probably 6.4.x). May want to test against the version of LibreOffice before making these changes.
09/09/2020


Here is the XML extension I made for this (it seems to work well-enough, but if anyone notices errors/improvements please comment).

<extension point="MimeTypePreviewer" target="org.nuxeo.ecm.platform.preview.adapter.PreviewAdapterManagerComponent">
<documentation>
Added mime-types for additional Office formats and Apple iWork formats.
</documentation>

<previewer class="org.nuxeo.ecm.platform.preview.adapter.OfficePreviewer">
<!-- Microsoft Word -->
<pattern>application/msword</pattern>
<pattern>application/vnd.ms-word.document.macroEnabled.12</pattern>
<pattern>application/vnd.ms-word.template.macroEnabled.12</pattern>
<pattern>application/vnd.openxmlformats-officedocument.wordprocessingml.document</pattern>
<pattern>application/vnd.openxmlformats-officedocument.wordprocessingml.template</pattern>
<!-- Microsoft Excel) -->
<pattern>application/vnd.ms-excel</pattern>
<pattern>application/vnd.ms-excel.addin.macroEnabled.12</pattern>
<pattern>application/vnd.ms-excel.sheet.binary.macroEnabled.12</pattern>
<pattern>application/vnd.ms-excel.sheet.macroEnabled.12</pattern>
<pattern>application/vnd.ms-excel.template.macroEnabled.12</pattern>
<pattern>application/vnd.openxmlformats-officedocument.spreadsheetml.sheet</pattern>
<pattern>application/vnd.openxmlformats-officedocument.spreadsheetml.template</pattern>
<!-- Microsoft PowerPoint -->
<pattern>application/vnd.ms-powerpoint</pattern>
<pattern>application/vnd.ms-powerpoint.addin.macroEnabled.12</pattern>
<pattern>application/vnd.ms-powerpoint.presentation.macroEnabled.12</pattern>
<pattern>application/vnd.ms-powerpoint.slideshow.macroEnabled.12</pattern>
<pattern>application/vnd.ms-powerpoint.template.macroEnabled.12</pattern>
<pattern>application/vnd.openxmlformats-officedocument.presentationml.presentation</pattern>
<pattern>application/vnd.openxmlformats-officedocument.presentationml.slideshow</pattern>
<pattern>application/vnd.openxmlformats-officedocument.presentationml.template</pattern>
<!-- Apple iWork (Keynote, Pages, Numbers) -->
<pattern>application/vnd.apple.keynote</pattern>
<pattern>application/vnd.apple.numbers</pattern>
<pattern>application/vnd.apple.pages</pattern>
<pattern>application/x-iwork-keynote-sffkey</pattern>
<pattern>application/x-iwork-numbers-sffnumbers</pattern>
<pattern>application/x-iwork-pages-sffpages</pattern>
<!-- OpenOffice.org 1.x documents -->
<pattern>application/vnd.sun.xml.writer</pattern>
<pattern>application/vnd.sun.xml.writer.template</pattern>
<pattern>application/vnd.sun.xml.impress</pattern>
<pattern>application/vnd.sun.xml.impress.template</pattern>
<pattern>application/vnd.sun.xml.calc</pattern>
<pattern>application/vnd.sun.xml.calc.template</pattern>
<pattern>application/vnd.sun.xml.draw</pattern>
<pattern>application/vnd.sun.xml.draw.template</pattern>
<!-- OpenOffice.org 2.x documents -->
<pattern>application/vnd.oasis.opendocument.spreadsheet</pattern>
<pattern>application/vnd.oasis.opendocument.spreadsheet-template</pattern>
<pattern>application/vnd.oasis.opendocument.text</pattern>
<pattern>application/vnd.oasis.opendocument.text-template</pattern>
<pattern>application/vnd.oasis.opendocument.presentation</pattern>
<pattern>application/vnd.oasis.opendocument.presentation-template</pattern>
<pattern>application/vnd.oasis.opendocument.graphics</pattern>
<pattern>application/vnd.oasis.opendocument.graphics-template</pattern>
<!-- WordPerfect -->
<pattern>application/wordperfect</pattern>
</previewer>
</extension>


<extension point="converter" target="org.nuxeo.ecm.core.convert.service.ConversionServiceImpl">
<documentation>
Added mime-types for additional Office formats and Apple iWork formats.
</documentation>

<converter class="org.nuxeo.ecm.platform.convert.plugins.LibreOfficeConverter" name="any2pdf">
<destinationMimeType>application/pdf</destinationMimeType>

<!-- Microsoft Word -->
<sourceMimeType>application/msword</sourceMimeType>
<sourceMimeType>application/vnd.ms-word.document.macroEnabled.12</sourceMimeType>
<sourceMimeType>application/vnd.ms-word.template.macroEnabled.12</sourceMimeType>
<sourceMimeType>application/vnd.openxmlformats-officedocument.wordprocessingml.document</sourceMimeType>
<sourceMimeType>application/vnd.openxmlformats-officedocument.wordprocessingml.template</sourceMimeType>
<!-- Microsoft Excel) -->
<sourceMimeType>application/vnd.ms-excel</sourceMimeType>
<sourceMimeType>application/vnd.ms-excel.addin.macroEnabled.12</sourceMimeType>
<sourceMimeType>application/vnd.ms-excel.sheet.binary.macroEnabled.12</sourceMimeType>
<sourceMimeType>application/vnd.ms-excel.sheet.macroEnabled.12</sourceMimeType>
<sourceMimeType>application/vnd.ms-excel.template.macroEnabled.12</sourceMimeType>
<sourceMimeType>application/vnd.openxmlformats-officedocument.spreadsheetml.sheet</sourceMimeType>
<sourceMimeType>application/vnd.openxmlformats-officedocument.spreadsheetml.template</sourceMimeType>
<!-- Microsoft PowerPoint -->
<sourceMimeType>application/vnd.ms-powerpoint</sourceMimeType>
<sourceMimeType>application/vnd.ms-powerpoint.addin.macroEnabled.12</sourceMimeType>
<sourceMimeType>application/vnd.ms-powerpoint.presentation.macroEnabled.12</sourceMimeType>
<sourceMimeType>application/vnd.ms-powerpoint.slideshow.macroEnabled.12</sourceMimeType>
<sourceMimeType>application/vnd.ms-powerpoint.template.macroEnabled.12</sourceMimeType>
<sourceMimeType>application/vnd.openxmlformats-officedocument.presentationml.presentation</sourceMimeType>
<sourceMimeType>application/vnd.openxmlformats-officedocument.presentationml.slideshow</sourceMimeType>
<sourceMimeType>application/vnd.openxmlformats-officedocument.presentationml.template</sourceMimeType>
<!-- Apple iWork (Keynote, Pages, Numbers) -->
<sourceMimeType>application/vnd.apple.keynote</sourceMimeType>
<sourceMimeType>application/vnd.apple.numbers</sourceMimeType>
<sourceMimeType>application/vnd.apple.pages</sourceMimeType>
<sourceMimeType>application/x-iwork-keynote-sffkey</sourceMimeType>
<sourceMimeType>application/x-iwork-numbers-sffnumbers</sourceMimeType>
<sourceMimeType>application/x-iwork-pages-sffpages</sourceMimeType>
<!-- OpenOffice.org 1.x documents -->
<sourceMimeType>application/vnd.sun.xml.writer</sourceMimeType>
<sourceMimeType>application/vnd.sun.xml.writer.template</sourceMimeType>
<sourceMimeType>application/vnd.sun.xml.impress</sourceMimeType>
<sourceMimeType>application/vnd.sun.xml.impress.template</sourceMimeType>
<sourceMimeType>application/vnd.sun.xml.calc</sourceMimeType>
<sourceMimeType>application/vnd.sun.xml.calc.template</sourceMimeType>
<sourceMimeType>application/vnd.sun.xml.draw</sourceMimeType>
<sourceMimeType>application/vnd.sun.xml.draw.template</sourceMimeType>
<!-- OpenOffice.org 2.x documents -->
<sourceMimeType>application/vnd.oasis.opendocument.spreadsheet</sourceMimeType>
<sourceMimeType>application/vnd.oasis.opendocument.spreadsheet-template</sourceMimeType>
<sourceMimeType>application/vnd.oasis.opendocument.text</sourceMimeType>
<sourceMimeType>application/vnd.oasis.opendocument.text-template</sourceMimeType>
<sourceMimeType>application/vnd.oasis.opendocument.presentation</sourceMimeType>
<sourceMimeType>application/vnd.oasis.opendocument.presentation-template</sourceMimeType>
<sourceMimeType>application/vnd.oasis.opendocument.graphics</sourceMimeType>
<sourceMimeType>application/vnd.oasis.opendocument.graphics-template</sourceMimeType>
<!-- WordPerfect -->
<sourceMimeType>application/wordperfect</sourceMimeType>

<parameters>
<parameter name="CommandLineName">soffice</parameter>
<parameter name="format">pdf</parameter>
</parameters>
</converter>

<converter class="org.nuxeo.ecm.platform.thumbnail.converter.AnyToThumbnailConverter" name="anyToThumbnail">
<destinationMimeType>image/png</destinationMimeType>

<!-- Images -->
<sourceMimeType>application/pdf</sourceMimeType>
<sourceMimeType>image/jpeg</sourceMimeType>
<sourceMimeType>image/png</sourceMimeType>
<sourceMimeType>image/gif</sourceMimeType>
<!-- Text -->
<sourceMimeType>text/xml</sourceMimeType>
<sourceMimeType>text/html</sourceMimeType>
<sourceMimeType>text/plain</sourceMimeType>
<sourceMimeType>text/rtf</sourceMimeType>
<sourceMimeType>text/csv</sourceMimeType>
<sourceMimeType>text/tsv</sourceMimeType>
<!-- Microsoft Word -->
<sourceMimeType>application/msword</sourceMimeType>
<sourceMimeType>application/vnd.ms-word.document.macroEnabled.12</sourceMimeType>
<sourceMimeType>application/vnd.ms-word.template.macroEnabled.12</sourceMimeType>
<sourceMimeType>application/vnd.openxmlformats-officedocument.wordprocessingml.document</sourceMimeType>
<sourceMimeType>application/vnd.openxmlformats-officedocument.wordprocessingml.template</sourceMimeType>
<!-- Microsoft Excel) -->
<sourceMimeType>application/vnd.ms-excel</sourceMimeType>
<sourceMimeType>application/vnd.ms-excel.addin.macroEnabled.12</sourceMimeType>
<sourceMimeType>application/vnd.ms-excel.sheet.binary.macroEnabled.12</sourceMimeType>
<sourceMimeType>application/vnd.ms-excel.sheet.macroEnabled.12</sourceMimeType>
<sourceMimeType>application/vnd.ms-excel.template.macroEnabled.12</sourceMimeType>
<sourceMimeType>application/vnd.openxmlformats-officedocument.spreadsheetml.sheet</sourceMimeType>
<sourceMimeType>application/vnd.openxmlformats-officedocument.spreadsheetml.template</sourceMimeType>
<!-- Microsoft PowerPoint -->
<sourceMimeType>application/vnd.ms-powerpoint</sourceMimeType>
<sourceMimeType>application/vnd.ms-powerpoint.addin.macroEnabled.12</sourceMimeType>
<sourceMimeType>application/vnd.ms-powerpoint.presentation.macroEnabled.12</sourceMimeType>
<sourceMimeType>application/vnd.ms-powerpoint.slideshow.macroEnabled.12</sourceMimeType>
<sourceMimeType>application/vnd.ms-powerpoint.template.macroEnabled.12</sourceMimeType>
<sourceMimeType>application/vnd.openxmlformats-officedocument.presentationml.presentation</sourceMimeType>
<sourceMimeType>application/vnd.openxmlformats-officedocument.presentationml.slideshow</sourceMimeType>
<sourceMimeType>application/vnd.openxmlformats-officedocument.presentationml.template</sourceMimeType>
<!-- Apple iWork (Keynote, Pages, Numbers) -->
<sourceMimeType>application/vnd.apple.keynote</sourceMimeType>
<sourceMimeType>application/vnd.apple.numbers</sourceMimeType>
<sourceMimeType>application/vnd.apple.pages</sourceMimeType>
<sourceMimeType>application/x-iwork-keynote-sffkey</sourceMimeType>
<sourceMimeType>application/x-iwork-numbers-sffnumbers</sourceMimeType>
<sourceMimeType>application/x-iwork-pages-sffpages</sourceMimeType>
<!-- OpenOffice.org 1.x documents -->
<sourceMimeType>application/vnd.sun.xml.writer</sourceMimeType>
<sourceMimeType>application/vnd.sun.xml.writer.template</sourceMimeType>
<sourceMimeType>application/vnd.sun.xml.impress</sourceMimeType>
<sourceMimeType>application/vnd.sun.xml.impress.template</sourceMimeType>
<sourceMimeType>application/vnd.sun.xml.calc</sourceMimeType>
<sourceMimeType>application/vnd.sun.xml.calc.template</sourceMimeType>
<sourceMimeType>application/vnd.sun.xml.draw</sourceMimeType>
<sourceMimeType>application/vnd.sun.xml.draw.template</sourceMimeType>
<!-- OpenOffice.org 2.x documents -->
<sourceMimeType>application/vnd.oasis.opendocument.spreadsheet</sourceMimeType>
<sourceMimeType>application/vnd.oasis.opendocument.spreadsheet-template</sourceMimeType>
<sourceMimeType>application/vnd.oasis.opendocument.text</sourceMimeType>
<sourceMimeType>application/vnd.oasis.opendocument.text-template</sourceMimeType>
<sourceMimeType>application/vnd.oasis.opendocument.presentation</sourceMimeType>
<sourceMimeType>application/vnd.oasis.opendocument.presentation-template</sourceMimeType>
<sourceMimeType>application/vnd.oasis.opendocument.graphics</sourceMimeType>
<sourceMimeType>application/vnd.oasis.opendocument.graphics-template</sourceMimeType>
<!-- WordPerfect -->
<sourceMimeType>application/wordperfect</sourceMimeType>

</converter>

</extension>
0 votes