Content Picker Microsoft Office 365 Configuration

The Wedia Content Picker Office helps to pick assets from Office 365 applications like Word, Powerpoint, Excel and to reuse them in your Office documents.
The configuration of the Wedia Content Picker Office follows the same logic as the one made for the Content-Picker CMS (see https://crossmedia.atlassian.net/wiki/pages/createpage.action?spaceKey=WD&title=Configuration%20of%20the%20asset-picker&linkCreation=true&fromPageId=2094530586 ) as it is a specialization of it.

This article explains how to configure the specific parts of the Content Picker Office.

Aliases

It is recommended to store your settings in a distinct folder inside src/wedia-plugin-template/res/ and set it up for your office picker like below :

// Office picker configuration (addin) "portal@picker@office": "_portal@savencia@$_picker@$_officepicker@$savencia-office-picker", "portal@picker@office@$mobile_device": "_portal@savencia@$_picker@$_officepicker@$savencia-office-picker@$mobile_device",

In this example, the configuration is stored inside the folder src/wedia-plugin-template/res/savencia-office-picker. It is applied on top of a portal configuration (here _portal@savencia), a picker configuration (_picker), and then _officepicker.

The _officepicker folder (src/wedia-plugin-template/res/_officepicker) is the portal’s base configuration for Office Content Picker. So this folder applies a standard configuration to transform the content picker into an Office Content Picker.

Actions of items

The main actions for Office Picker (as of version 2021.5.0) are :

  • Integrate into Office

  • Integrate into Office without Background

To configure those items' actions, the file src/wedia-plugin-template/res/officepicker/dam/explore/items/.js should be overridden.

For example :

// eslint-disable-next-line func-names module.exports = function (config) { return { ...config, actions: [ 'damOfficeIntegrateInBase64', // Integrate 'damOfficeIntegrateStrippedBackgroundInBase64', // Integrate without background 'damPreview', // Preview action ], }; };
Illustration of actions

 

It is possible since version 2021.3.0 to choose which variations to include with the Content Picker Office. The entry points to configure those variations returned by the damOfficeIntegrateInBase64 and damOfficeIntegrateStrippedBackgroundInBase64 actions are respectively : src/wedia-plugin-template/res/_portal/variations/office.json and src/wedia-plugin-template/res/_portal/variations/office-stripped.json

The variation stripped_background on which is based the background removal is not returned by default. To retrieve it for your assets, you’ll have to :

  • Set parameter evp.ia.activated of plugin WXM_DAMDY to true

  • Ask ESAAS (or whoever has the rights ) to add the option ‘CanRemoveBg’ inside the EVP settings of the environment.

You can test if the variation is returned by using the following URL :
https://your_server/api/wedia/dam/variations/an_asset_uuid

How to test in a local environment

The configuration of the Office Content Picker can be tested through the following URL :
http://localhost:9000/office-asset-picker/ (with the ending “/“).

HTTP Safety Headers

An important step of the office content picker is to configure the HTTP Safety Headers.
This can be done through the administration page of your environment.

HTTP Safety Headers in Admin

 

 

You can create there the two rules needed for the rewritten rules used by the Office Content Picker :

  • /office-picker/

  • /office-picker/office-asset-picker.html

 

To use the Office 365 Content Picker, you must make sure that :

  • REST API: JWTCookieSameSite option must be set to none

  • in the HTTP SECURITY HEADERS options: make sure that in the Framed options, the xframedOptions.enabled is set to uncheck for the following URLs :

    • /office-picker/office-asset-picker.html

Manifest File

To install the Office Content Picker inside your Office applications, you’ll need to set up the manifest.xml that will be used by the Office 365 Administrator to install the Content Picker.

Examples can be found inside the portal’s folder: samples/office-picker-config-sample. An adaptation of certain project-specific information is needed before the deployment. Steps are described at the beginning of the proposed samples.

A concrete example made for SAVENCIA can be found here: https://bitbucket.org/wediaproduct/savencia-portal/src/3709350a407de70fce3d1d7436c24f88256668d9/samples/office-picker-config-sample/manifest-pp-savencia.xml?at=sav%2Fmaster

Installation inside Office Applications

To have access to the Office Content Picker once the manifest file has been configured, you’ll need to install the Wedia Add-in in your Office 365 Tenant.
The installation process is described in those 2 pages :

  1. Installing the Office 365 Content Picker in your Office 365 tenant

  2. Wedia Office 365 Content Picker

Â