Changes for page Office365 Application

Last modified by Ludovic Dubost on 2017/12/04 00:05

From version 6.2
edited by Ludovic Dubost
on 2017/04/14 18:16
To version 7.1
edited by Ludovic Dubost
on 2017/04/14 18:25
Change comment: There is no comment for this version

Summary

Details

ExtensionCode.ExtensionClass[0]
Description
... ... @@ -1,1 +1,36 @@
1 1  Integration of Office365 in XWiki
2 +
3 +This macro connects XWiki to Office365, allowing to display office documents from OneDrive inside XWiki. It allows to search for OneDrive documents on the XWiki search page.
4 +
5 +== Limitations ==
6 +
7 +* Only Office formats (Word, Excel, Powerpoint) can be embedded. PDF cannot because Office 365 does not provide an embed URL.
8 +* Sharepoint documents can be embedded by URL but not searched.
9 +
10 +== Macro embed via URL ==
11 +
12 +First you can embed an Office 365 documents by URL. This way of embedding does not require OAuth credentials to connect XWiki. To embed you just need to get the URL that is displayed when you view or edit an Office document on Office 365. An iframe is used to embed. You can also set width and height parameters of the iframe.
13 +
14 +{{code}}
15 +{{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" /}}
16 +{{/code}}
17 +
18 +{{image reference="office365macroembed1.png" width="800" /}}
19 +
20 +== Macro embed via Search ==
21 +
22 +You can embed via search. Just insert the office365 macro without any parameter and a search box will show up. You need to set OAuth credentials in the configuration for this to work (see configuration). You search and then choose the document to embed. To links ("change" and "view" are displayed to allow to change the embed document or view the document on Office365).
23 +
24 +{{code}}
25 +{{office365 /}}
26 +{{/code}}
27 +
28 +{{image reference="office365macroembed2.png" width="800" /}}
29 +
30 +== OneDrive search inside XWiki ==
31 +
32 +If you setup OAuth credentials, activate the search UI extension in the Office 365 configuration in the XWiki administration and add the UI Extension point to the SolrSearchMacros page (see installation instructions) you will see a box showing up on the SOLR search screen of XWiki when searching. This box shows OneDrive results.
33 +
34 +{{image reference="office365search1.png" width="800" /}}
35 +
36 +{{image reference="office365search2.png" width="800" /}}
Prerequisites & Additional Installation Instructions
... ... @@ -1,0 +1,35 @@
1 +
2 +To configure the extension to be able to use the other features, you will need to get OAuth2 credentials:
3 +
4 +== Create Office 365 OAuth Credentials
5 +
6 +You will need to create credentials on Office 365/Azure AD. This can be done either in Azure AD or on this [[microsoft app registration web site>>url:https://apps.dev.microsoft.com/]]. It might be necessary to be an admin in the organization
7 +
8 +It is necessary to get an Application ID (clientid), create a password (secret)
9 +and set the redirect URI ({{{ http://[your domain]]/xwiki/bin/view/Office365/OAuth (or https) }}})
10 +
11 +image:office365config.png
12 +
13 +Permissions need to be set on the Graph API like below:
14 +
15 +image:permissions.png
16 +
17 +== Enter the credentials in XWiki Administration ==
18 +
19 +You will need to enter your credentials and your tenant ID (either yourorg.onmicrosoft.com or the full ID) in the Office365 section of the XWiki Administration.
20 +
21 +== Add the UI Extension point to the Main.SolrSearchMacro page ==
22 +
23 +A UI Extension point needs to be added until {{jira url="http://jira.xwiki.org" style="enum"}}XWIKI-14205{{/jira}} is integrated in XWiki.
24 +
25 +To add the extension point locate #\displaySearchForm in the page Main.SolrSearchMacros and add the foreach/end block after it:
26 +
27 +{{code}}
28 + #displaySearchForm()
29 + #foreach ($extension in $services.uix.getExtensions("org.xwiki.platform.search.widget"))
30 +{{html clean=false}}
31 +$services.rendering.render($extension.execute(), 'xhtml/1.0')
32 +{{/html}}
33 + #end
34 + #if ($text != '')
35 +{{/code}}

Get Connected