Interface OfficeViewerScriptService

  • All Superinterfaces:
    org.xwiki.script.service.ScriptService
    All Known Implementing Classes:
    DefaultOfficeViewerScriptService

    @Role
    public interface OfficeViewerScriptService
    extends org.xwiki.script.service.ScriptService
    Exposes utility methods for viewing office attachments in server-side scripts.
    Since:
    2.5M2
    Version:
    $Id: bfecb721fbed02bf1ea2979c27f7028a5cdf951d $
    • Method Detail

      • view

        String view​(org.xwiki.model.reference.AttachmentReference attachmentReference)
        Builds a XHTML representation of the specified office attachment.
        Parameters:
        attachmentReference - reference to the office attachment to be viewed
        Returns:
        a XHTML representation of the specified office attachment or null if an error occurs
      • view

        String view​(org.xwiki.model.reference.AttachmentReference attachmentReference,
                    Map<String,​String> parameters)
        Builds a XHTML representation of the specified office attachment.
        Parameters:
        attachmentReference - reference to the office attachment to be viewed
        parameters - view parameters specific to the underlying OfficeResourceViewer implementation
        Returns:
        a XHTML representation of the specified office attachment or null if an error occurs
      • getCaughtException

        Exception getCaughtException()
        Returns:
        the exception caught during the last office attachment view on the current execution, or null if no exception has been thrown
      • isMimeTypeSupported

        boolean isMimeTypeSupported​(String mimeType)
        Checks if a given mime type is supported for viewing.
        Parameters:
        mimeType - a mime type
        Returns:
        true if the specified mime type can be viewed, false otherwise