Office365 Integration (Pro)

Last modified by Administrator on 2024/02/21 00:01

Office365 Integration (Pro)

Search OneDrive documents directly from XWiki. Embed Office 365 documents into XWiki pages using their URL. The app can be purchased individually or part of the XWiki Pro package. Try it free.

azuredroits1.png
CategoryApplication
Active Installs27
Rating
0 Votes
LicenseGNU Lesser General Public License 2.1
Minimal XWiki version supportedXWiki 13.10
SourcesIssues

This macro connects XWiki to Office 365, allowing to display and to search for office documents from OneDrive inside XWiki. It also allows the display of documents that would come from a Microsoft account including Sharepoint. See below examples of usages of the three included features.

Macro embed via URL

A first option to embed an Office 365 file would be by URL. This way of embedding does not require OAuth credentials to connect XWiki to your Microsoft Office 365 account. 

To embed you just need to copy the URL that is displayed when you view or edit an Office document on the Microsoft Office 365 account. On the page where you want to embed the document, insert the Office365 Viewer macro and add the copied URL in the dedicated field. An iframe is used to embed the chosen file. You can also set width and height parameters of the iframe.

This is how the inserted Office365 Viewer macro looks when editing the page in wiki mode or when editing the page using WYSIWYG, but while in Source mode, with the URL of the pptx file from an Office365 account that includes Sharepoint:

{{office365 url="https://xwikidev-my.sharepoint.com/personal/office365_xwikidev_onmicrosoft_com/_layouts/15/WopiFrame.aspx?sourcedoc=%7BD5A1847B-742D-42EB-980F-4964A21E4F05%7D&file=XWikiKeyMessages2017.pptx&action=default" width="100%" height="800" /}}

This is the result of embedding a Sharepoint pptx file using the URL in the inserted Office365 Viewer macro:

office365macroembed1.png

Macro embed via Search

You can embed via the Search box feature an Office 365 document from your online OneDrive (from an Office 365 account that does not include Sharepoint). Before trying this feature, make sure to set the OAuth credentials for this to work (see the installation page for instructions).  

After that, go on the page where you want to display the Office document from your online OneDrive. Then, edit the page, insert the Office365 Viewer macro without any parameter and a search box will show up.  

In the search box of the inserted Office365 Viewer macro, search the name of a known document from the OneDrive and then choose the document to embed. Once you embed the document, you will see on the top right two discrete links: "Change" and "View" . 

This is how the inserted Office365 Viewer macro looks when editing the page in wiki mode or when editing the page using WYSIWYG, but while in Source mode:

{{office365 /}}

This is the search result of the word "xwiki" from our test of the search feature:

office365macroembed2.png

OneDrive search inside XWiki

Once you have setup the OAuth credentials, you can also extend the XWiki search with OneDrive results using the following steps:

  • Activate the search UI extension in the Office 365 configuration in the XWiki Administration > Other > Office365 section.
  • Add the UI Extension point to the SolrSearchMacros page (see How to add the UI Extension For the Solr Search instructions below) 

A box with OneDrive results will be included on the SOLR search screen of XWiki.

office365search1.png

How to add the UI Extension For the Solr Search

A UI Extension point needs to be added until XWIKI-14205 is integrated in XWiki.

To add the extension point locate the macro #\displaySearchForm in the page Main.SolrSearchMacros and add the following foreach/end block after it:

    #displaySearchForm()
    #foreach ($extension in $services.uix.getExtensions("org.xwiki.platform.search.widget"))
{{html clean=false}}
$services.rendering.render($extension.execute(), 'xhtml/1.0')
{{/html}}
    #end
    #if ($text != '')

Limitations

  • Only the Office formats (Word, Excel, Powerpoint) can be embedded. PDF files cannot be embedded because Office 365 does not provide an embed URL.
  • Sharepoint documents can be embedded by URL but not searched.

External Resources

FAQ

How to insert the "Office365 Macro"?

  • Create a new wiki page
  • Click on "+" > "Other Macros" on the editor bar
  • Search for "office"
  • Select the "Office365 Viewer" and click "Submit" (no settings filled in)
  • Click to "Save and View" the wiki page

How to fill in the "Tenant Name" and "Client ID"?

The tenant and client information are available on the "Overview" section from Azure Portal: Note that the tenant-ID is not the domain-name.

What to select for the "Implicit grant" section on the Azure Portal?

To configure the Office365 Integration "ID Tokens" should be selected on the Azure Portal.

 

Installation Steps

This paid extensions requires XWiki 13.10 or above. In order to install the extension, follow the next steps inside your XWiki instance (on cloud or on premise).

Navigate to the Extension Manager

In the Applications Panel click on "More Applications..." and then "Install new applications...". Alternatively navigate directly to the Administration and select the "Extensions" section.

step1.png

Install the Extension

Search for the extension you wish to install and use the Install button to install it.

step2.png

Get a License

Navigate to the "Licenses" section of the Administration, fill your details, look for the extension you just installed in the live table and click the buttons to get a trial license or to buy a license.

step3.png

Install the License

If you have selected a trial license then you're good and there's nothing else to do. Your trial license is automatically installed.

However if you've selected to buy a license you'll be redirected to a page to perform the payment. At the end you need to come back to the "Licenses" administration section and click on the "Check for Updates" button. This will download and apply the license you bought.

Use the Extension

Start using the Extension! Refer to the extension's documentation to know how to use it.

Installing Paid Apps on Subwikis

If you want to install an application on the whole farm (main wiki + subwikis), you can do so directly from the main wiki’s Extension Manager, as seen below:

step4.png

Extensions can also be installed only on a particular subwiki by global admins. Subwiki admins will not be able to install these extensions due to their limited rights.

To configure the extension to be able to use the other features, you will need to get OAuth2 credentials:

Create Office 365 OAuth Credentials

You will need to register the application and create credentials on the Azure Portal. It might be necessary to be an admin in the organization when doing this step.

Here are the instructions to get an Application ID (clientid), create a password (secret) and set the redirect URI (https://[your domain]]/xwiki/bin/view/Office365/OAuth):

  • Go to "Azure Services>App Registrations" to register the XWiki app

RegisterApp.png

  • Go to the Authentication section and click to "Add a platform" 
  • Fill in the Redirect URI http://<server>/xwiki/bin/view/Office365/OAuth:

RegiterRedirectURL.png

  • Under Implicit grant select ID-tokens and click Save

ImplicitGrant.png

  • Add Permissions for the Graph API:

AddPermissions.png

  • All needed Permissions:

AllPermissions.png

  • Go to "Certificates and Secrets" and generate a New Client Secret. Copy the secret to the Office365 app administration section (have in mind the secret will not be displayed again on the Azure Portal, you will have to generate a new one).

ClientSecret.png

Enter the credentials in XWiki Administration

Copy the Tenant ID and the Client ID from the Azure Portal registered app Overview page and also the Secret Value from the newly generated client secret. Paste those in the dedicated fields in the XWiki Administration, the Other section, Office365 tab.

Start using the Office365 Integration (Pro) application using the instructions in the Documentation section. You can also find usage examples on the Description section.

Options

The price is per year and varies depending on the support level and the number of users.

Support / Users 10 25 50 100 250 500 1000 2500 5000 10000 20000
Silver
Office365 Integration (Pro) is part of the XWiki Pro package. Purchasing this package you will benefit from more extensions at a better price. Check the full offer in XWiki Pro!

Benefits

What do you get when you purchase an XWiki extension?

1 year license

By purchasing an XWiki extension license, you'll benefit from it during one year.

Free updates

You benefit from all the extension updates during one year. You are always up to date.

Support included

If you are facing an issue, you can reach the XWiki support. Our team is always available to help.

How to Buy

To buy, install this extension from inside your XWiki instance and follow the instructions.

Release notes

v1.11.3

Upgrades:

  • #31 Upgrade Licensor dependency to version 1.25

v1.11.2

Upgrades:

  • #28 Upgrade Licensor dependency to version 1.24.3

v1.11.1

Bugs fixed:

  • 25# The Office365 application cannot be installed with OpenID Connect version > 2.0.0

v1.11

Improvements:

20# Microsoft app registration not available anymore

Tasks done:

24# Upgrade parent to 13.10-3

Upgraded licensing version to 1.24.1.

v1.10

Bugs fixed:
#19 "Failed to execute the [groovy] macro" error which prevents users to login with the application

Upgrade Licensor dependency to 1.22.1
Upgrade ShowHide macro dependency to 2.0.2
Upgrade Macro PDF Viewer dependency to 2.4

v1.9.1

Update the PDF Viewer dependency version to 2.3.3
Update the Licensing dependency version to 1.22

v1.9

#18 Update the minimal supported version to XWiki 11.10.
Update the Licensing dependency to version 1.20
Update the PDF Viewer dependency version to 2.3

v1.7

#14:Bypass trusted domain check when using redirect API

v1.6

Bugs fixed:

#13: Groovy class syntax can cause compatibility issue with extension "Wiki Link URL Normalizer".

 

v1.5

Bugs fixed:

#6: Cannot connect to Office365 using the Azure Portal (AADSTS50011: The reply URL specified in the request does not match the reply URLs).

v1.4

Update the Licensing dependency to version 1.16.
Update the PDF Viewer Macro dependency to version 2.1.

v1.3.10

Update the Licensing dependency to version 1.14.4.

v1.3.9

Update the Licensing dependency to version 1.14.3.
Update the PDF Viewer Macro dependency to version 2.0.2.

v1.3.8

Update the Licensing dependency to version 1.14.1.

v1.3.7

Update the Licensing dependency to version 1.13.8.
Update the PDF Viewer Macro dependency to version 1.9.4.

v1.3.6

Update the Licensing dependency to version 1.13.4.

v1.3.5

Update the Licensing dependency to version 1.13.3
Update the PDF Viewer Macro dependency to version 1.9.2.

v1.3.4

Update the Licensing dependency to version 1.13.2.
Update the PDF Viewer Macro dependency to version 1.9.1.

v1.3.3

Update the Licensing dependency to version 1.13.
Update the PDF Viewer Macro dependency to version 1.8.3.

v1.3.2

Update the Licensing dependency to version 1.12.2.

v1.3.1

Update the Licensing dependency to version 1.12.1.
Update the PDF Viewer Macro dependency to version 1.8.1.
Bugs fixed:
#4 The admin configuration section is not accessible to users.

v1.3

Update the Licensing dependency to version 1.8.
Update the PDF Viewer Macro dependency to version 1.8.
Display a message when there is no valid license.

v1.2

Initial paid version.

Extension details

This information is only displayed to Administrators. Your users can't see this tab.

License

  • GNU Lesser General Public License 2.1

Sources

Issues

Type

  • xar

Developed by

Compatibility

  • Requires XWiki 13.10 or above.

Installable with the Extension Manager

Dependencies

  • com.xwiki.licensing:application-licensing-licensor-api 1.25
  • com.microsoft.azure:adal4j 1.6.7
  • net.minidev:json-smart 2.4.11
  • org.xwiki.contrib.showhide:showhide-macro 2.0.2
  • com.xwiki.pdfviewer:macro-pdfviewer-ui 2.4
XWiki SAS Copyright © 2024