Platform Explorer / Nuxeo Platform LTS 2015 7.10

Component org.nuxeo.ecm.platform.preview.adapter.PreviewAdapterManagerComponent

Implementation

Javadoc: org.nuxeo.ecm.platform.preview.adapter.PreviewAdapterManagerComponent

Services

Extension points

Contributions

XML source

<?xml version="1.0"?>
<component name="org.nuxeo.ecm.platform.preview.adapter.PreviewAdapterManagerComponent">
  <implementation
    class="org.nuxeo.ecm.platform.preview.adapter.PreviewAdapterManagerComponent" />

  <documentation>
    @author Thierry Delprat (td@nuxeo.com)
  </documentation>

  <service>
    <provide
      interface="org.nuxeo.ecm.platform.preview.adapter.PreviewAdapterManager" />
  </service>

  <extension-point name="AdapterFactory">
    <documentation>
    @author Thierry Delprat (td@nuxeo.com)
    </documentation>
    <object
      class="org.nuxeo.ecm.platform.preview.adapter.AdapterFactoryDescriptor" />
  </extension-point>

  <extension-point name="MimeTypePreviewer">
    <documentation>
      Allows to contribute default implementation of preview according to the mime type.
    </documentation>
    <object class="org.nuxeo.ecm.platform.preview.adapter.MimeTypePreviewerDescriptor"/>
  </extension-point>

  <extension-point name="blobPostProcessor">
    <documentation>
      Allows to contribute post processor to preview blobs after they got retrieved.
    </documentation>
    <object class="org.nuxeo.ecm.platform.preview.adapter.BlobPostProcessorDescriptor"/>
  </extension-point>

</component>

Documentation

  • 5.4.0-I20101018_1103
  • 5.4.2
  • 5.3.1
  • 5.3.2
  • 5.6
  • 5.3.2-SNAPSHOT
  • 5.4.0.1
  • 5.5
  • 5.4.2-HF05
  • 5.4.1
  • 5.4.0
  • 5.7-I20130322_1136

The nuxeo-platform-preview addon provides services, transformers and adapters to generate HTML previews from of a Nuxeo DocumentModel.

The preview addon is composed of several layers:

UI part

Adds a Preview tab that displays the preview inside an IFRAME.

Transformer part

The Preview addon contributes transformers that are dedicated to generating HTML out of most file formats.

Service and Adapters

The Preview addon includes services that allow you to define PreviewAdapters for each type of Document. These adapters are responsible for defining how the preview will be generated:

  • define the field§ used for preview

Because a Nuxeo document contains a lot of different fields, the adapter must determine what are the default fields used to generate the preview.

  • define how preview is generated

Basically preview can be generated using some transformers or using some fields that already contains pre-generated HTML preview

The services provided by the Preview addon let you configure the PreviewAdapter depending on your document types and manage some cache for transformer based previews.

REST Binding

The preview addon includes a restlet.

This restlet provides a RESTful access to the preview service. This means that you can retrieve the preview of a document by just using a simple GET URL.

Preview URLs have this form :

http://{server}:{port}/nuxeo/restAPI/preview/{document_uuid}/{previewfield}/

where:

  • document_uuid

is the the document uuid that is already present in all Nuxeo urls

  • previewfield

is the xpath of the field that should be used as main file for the preview

Depending on the underlying adapter implementation, this field may or may not be relevant. Use ’default’ to let the adapter implementation choose the right field for you.

Please note that the last / is important. As HTML preview can contain nested images, the base URL must end with a /. The Restlet system handles a cache to avoid refetching the preview data at each call.