Office Macro

Version 25.1 by Marius Dumitru Florea on 2019/06/18 13:27
Warning: For security reasons, the document is displayed in restricted mode as it is not the current version. There may be differences and errors due to this.

cogDisplays the content of an office attachment as HTML inside the current document
TypeJAR
Category
Developed by

XWiki Development Team

Rating
0 Votes
LicenseGNU Lesser General Public License 2.1
Bundled With

XWiki Enterprise, XWiki Standard

Compatibility

XWiki Enterprise >= 2.5 Milestone 2

Description

Usage

From Wiki Syntax

{{office reference="file.doc" filterStyles="false"/}}
{{office reference="attach:file.doc" filterStyles="false"/}}
{{office reference="url:http://host.com/some/external/file.doc" filterStyles="false"/}}
{{office attachment="file.doc" filterStyles="false"/}}

From WYSIWYG Editor

When inserting or editing the macro call from the WYSIWYG editor there's a picker to help you select or upload the office file to view.

Failed to execute the [velocity] macro. Cause: [Nested scripts are not allowed. Current Script Macro [velocity] (source [extensions:ExtensionCode.ExtensionSheet]) is executed inside Script Macro [velocity] (source [extensions:ExtensionCode.ExtensionSheet])]. Click on this message for details.

Parameters

NameOptionalAllowed valuesDefault valueDescription
attachmentnoa valid attachment reference The name of the attachment to display. Deprecated since 5.4.6 and 6.2.2, use reference instead.
referencenoa valid resource reference or a valid attachment reference Since 5.4.6 and 6.2.2 The reference of the attachment to display. The supported resources are URLs (url:) and attachments (attach:). If no reference type or an unknown reference type is provided it's parsed as attachment reference.
filterStylesyestrue/falsetrueWhether to filter out all non-essential styles from the parsed content

Examples

Displays an office attachment defined as an attachment in another page:

{{office attachment="[email protected]" filterStyles="false"/}}

Screenshots

Starting with XWiki Enterprise 3.0 Milestone 3, Office Macro uses the Gallery Macro to display office presentations:

presentation.png

Configuration

The office macro uses the office server to convert presentation slides into images. By default these images are not very large. If you want to configure the image dimensions and other stuff you'll have to copy document-formats.js from the jodconverter jar to WEB-INF/classes and edit it. For instance, if you want the slide images to have 1024px width you have to change this line:

"PRESENTATION": {"FilterName": "impress_html_Export"},

with

"PRESENTATION": {"FilterName": "impress_html_Export", "FilterData": {"Width": 1024}},

You can also control the compression level / quality of the generated images:

"PRESENTATION": {"FilterName": "impress_html_Export", "FilterData": {"Quality": 90, "Width": 1024}},

Prerequisites & Installation Instructions

The OpenOffice Server needs to be configured and started in order for this macro to work. See the prerequisites for the Office Importer Application for instructions.

Tags: office
    

Get Connected