office

Last modified by Lucas Charpentier on 2026/10/27 10:29

Audit

Macro ID
office
Source
XS
Type
Generator
Classification reason

Status
Reviewed
Criteria version
15.20
XWiki version
18.8.0
Audit date
2026-10-19
Auditor
Compared macros
include display

Sources

Where to gather the information the criteria are checked against, see Gather the sources.

SourceWhat it givesUsed forWhere
DocumentationParameters, default values and examples, including the most common exampleL2, L3, and the criteria measured with the most common examplehttps://extensions.xwiki.org/xwiki/bin/view/Extension/Office%20Macro
Source codeHow the macro declares its parameters and content: types, groups, features, advanced and hidden flags, constraints, content type, inline supportC4, C5, C7, C8, C9, C13, E4, E6https://github.com/xwiki/xwiki-platform/tree/master/xwiki-platform-core/xwiki-platform-office/xwiki-platform-office-macro
Macro descriptorWhat the Edit Macro dialog is built from, on design.xwiki.orgD1, D2, C1 to C9, E4Descriptor, list of macros with their categories
TranslationsThe name, description and parameter names in each languageD1, D2, D4, C1l10n.xwiki.org
Uses in XWiki pagesHow XWiki itself uses the macro, a realistic example when the documentation has noneL3, C2, C3, C6, C8, C9Search the xwiki organization on GitHub
Compared macrosThe audits of the macros of the same typeL1, D3include, display
Other sources specific to this macro
  • OfficeMacroIT: how the macro is used and tested with an office server
CriterionResultNotes
D1 wordingOK
D2 summaryOKthe description says what the macro adds, but only speaks of attachments, while the reference parameter also views a remote file, like url:http://host.com/file.doc .
D3 categoryOK
D4 quick-actionKO"office", "Office Document Viewer", the French "Liseuse de Document Office" and the synonym "document" give the macro first in the Quick Actions menu, and "viewer" gives it second, after PDF Viewer. The synonyms "word", "spreadsheet", "presentation", "powerpoint" and "excel" do not find it: "word" gives Success Box, the others give nothing.
L1 consistencyKOcompared with include and display, the generators that also show the content of a target. Both declare their target as a required Reference feature, so Quick Actions opens the Edit Macro dialog with the target field to fill. Office declares no mandatory parameter, see C7 of reference, so Quick Actions inserts {{office/}} right away, which renders an error box. None of the three has content, and their defaults are comparable.
L2 doc-parametersKOthe parameters are documented only on the legacy extensions.xwiki.org page, https://extensions.xwiki.org/xwiki/bin/view/Extension/Office%20Macro, not in the new documentation. Its parameter table marks both reference and attachment as not optional, while the macro declares neither as mandatory and needs only one of them, and it describes filterStyles as filtering "all non-essential styles" where the macro filters the in-line CSS styles. No example shows the most common call, without filterStyles: every example sets filterStyles="false", see C8 of filterStyles.
L3 doc-exampleOKthe first example of the documentation, {{office reference="file.doc" filterStyles="false"/}} , covers the most common use, viewing an office attachment of the current page. Every example of the page turns style filtering off, while the macro and its description recommend filtering, and the calls of the macro in XWiki itself, like {{office attachment="ppt_test.ppt"/}} , keep the default. The audit uses it without that parameter: {{office reference="file.doc"/}} . On a fresh XWiki Standard it renders the office server error, a prerequisite the documentation states under Prerequisites.
I1 patternOKlike children, the reference generator, Quick Actions inserts the macro without a dialog, and the Insert Macro dialog opens an Edit Macro dialog whose fields are all optional. Unlike children, the result is an error box, see I2.
I2 zero-configKOQuick Actions inserts {{office/}} with no dialog, and the Edit Macro dialog submitted with the default values inserts the same: both render an error box in the editor and in view mode. On a fresh XWiki Standard it is the office server error, which only an administrator can fix; with a server, the source code gives "You must specify the 'reference' parameter pointing to the office file to display." The user is never asked for the file before seeing an error.
I3 instantN/A
I4 cursorN/A
I5 focusOKno parameter is mandatory, so the measure is met, but the focus is on the Filter Styles checkbox, and the Reference picker, the file the macro needs, comes second, see C8 of filterStyles.
E1 wysiwygKOon a fresh XWiki Standard the example shows the same office server error box in the editor and in view mode, and the rendering of a real document could not be compared without an office server. The converted document is too heavy to render in the editor anyway: the macro should show an edit-mode replacement that says which file it views.
E2 errorsKOinvalid values are accepted silently. {{office reference="file.doc" filterStyles="maybe"/}} reaches the execution of the macro, so "maybe" is read as false, with no message. On a fresh XWiki Standard, every invalid value, like {{office reference="missing.png"/}} , gives the office server error, which says nothing about the value; with a server, the source code wraps any failure to view the file in "Failed to view office attachment.", which names no parameter.
E3 nestingKOin a list item and in a table cell, like * {{office reference="file.doc"/}} , the macro is inline and renders "The [office] macro is a standalone macro and it cannot be used inline." in the editor and in view mode. In a box it renders as at the top level, with the office server error. The macro has no content, so the second half of the measure does not apply.
E4 inline-supportOKthe macro declares no inline support, and its output, a converted document with paragraphs, tables or slide images, cannot be inline.
E5 emptyN/A
E6 inplaceN/A

Parameters

ParameterC1 clarityC2 mandatoryC3 defaultsC4 input-assistanceC5 groupsC6 orderC7 alternativesC8 advancedC9 technicalC13 constraintsNotes
attachmentN/AOKN/AN/AN/AN/AKON/AOKN/A

C7: see reference: shown as a separate optional field, not as an alternative of the file to view.

C9: deprecated, hidden from the Edit Macro dialog unless the macro already sets it, then labelled "(Deprecated)".

filterStylesOKOKOKOKOKOKN/AKOOKN/A

C1: CSS and HTML are technical terms, but OK for a styling option, and the description states the effect: "Office content is usually better integrated in the host wiki page when styles are filtered."

C8: not advanced, while it does not change what the macro does, only how the result is styled, and the calls of XWiki itself keep the default. Every example of the documentation sets it, to false, which the documentation should do less often, see L2.

referenceOKOKOKOKOKOKKOOKOKN/A

C1: "Reference" is a technical name, but the description explains it, with examples of the accepted values. The English description has a typo, "Use an resource string reference", and the French one is not translated.

C3: no default, and none makes sense: the field opens on its placeholder "Select or upload an office file", like the Page picker of include.

C4: a picker that lists the office files, lets the user upload one, finds an office attachment of another page by its name, like "report" for report.odt on another page, and accepts a typed reference.

C6: the Filter Styles checkbox comes first and gets the focus, and the file to view comes second. Not counted here: marking filterStyles as advanced, see its C8, puts the file first.

C7: reference and the deprecated attachment are alternative ways to give the file, and the macro fails when neither is set, but they are not declared as a required feature. The dialog marks nothing as required, and when an existing call sets attachment, like {{office attachment="file.doc"/}} , Reference and Attachment appear as two separate optional fields. Include and display group their target in a required Reference feature.

Other notes

The office macro needs an office server, which a fresh XWiki Standard does not start: every call, valid or not, renders "Failed to execute the [office] macro. Cause: [The wiki needs to be connected to an office server in order to view office files. Ask your administrator to configure such a server.]" in the editor and in view mode. The audit records what such a user sees. With no office server, the actual rendering of a document could not be checked for E1, E2 and E4, and the messages E2 would give once a server is connected are taken from the source code.

KOs and tickets

Every KO needs a ticket covering it, see Report the KOs. One ticket can cover several KOs. Known issues filed for this macro are suggested in italics: link them as existing tickets when they cover the KO.

KOCriterionExisting ticketsNew tickets
D4D4 quick-actionXWIKI-25444
L1L1 consistencyXWIKI-25507
L2L2 doc-parametersXINFRA-525
I2I2 zero-configXWIKI-25507
E1E1 wysiwygXWIKI-25537
E2E2 errorsXCOMMONS-3847 (partial), XRENDERING-823 (partial), XWIKI-25507 (partial)
E3E3 nestingXWIKI-23501
C7:attachmentC7 alternatives, attachmentXWIKI-25507
C8:filterStylesC8 advanced, filterStylesXWIKI-25491
C7:referenceC7 alternatives, referenceXWIKI-25507
Success

Every KO is covered by a ticket.

Tickets

TicketOriginKOs coveredKOs partly covered
XWIKI-23501ExistingE3
XCOMMONS-3847NewE2
XRENDERING-823NewE2
XWIKI-25444NewD4
XWIKI-25491NewC8:filterStyles
XWIKI-25507NewL1 I2 C7:reference C7:attachmentE2
XINFRA-525NewL2
XWIKI-25537NewE1

Known issues of this macro

IssueTitleStatusCriteria
XWIKI-23503'Submit' button is active although no document is uploaded in the Office Document Viewer MacroClosedC2

68 more known issues affect every macro: see the Known issues.

Get Connected