How to map custom fields from SharePoint Document Libraries to Sitecore


Description

The current implementation of Sitecore SharePoint Integration Framework does not synchronize custom SharePoint fields for SharePoint Document Library items that contain blob data.

This tutorial contains information on how to implement this functionality if there is only a single SharePoint integration item per Sitecore solution.

Solution

This tutorial describes how to configure synchronization of custom SharePoint fields for PDF media type. Other media types can be configured in a similar way.

Prerequisites:

Scenario:

  1. Disable SharePoint Integration Framework (rename the App_Config\Include\Sharepoint.config file to Sharepoint.disabled).
  2. Remove all descendants of the integration item.
  3. Create a custom unversioned PDF media template:
    /sitecore/templates/Sharepoint/Media/<Integration Name>/unversioned/Pdf
    It should inherit the default unversioned PDF template
    /sitecore/templates/System/Media/Unversioned/Pdf
    and the template that was generated while creating SharePoint Integration
    /sitecore/templates/Sharepoint/Item Level Integration/Sharepoint Integration Items/<Integration Name>
  4. Create a custom versioned PDF media template:
    /sitecore/templates/Sharepoint/Media/<Integration Name>/versioned/Pdf
    It should inherit the default versioned PDF template
    /sitecore/templates/System/Media/Versioned/Pdf
    and the template that was generated while creating SharePoint Integration
    /sitecore/templates/Sharepoint/Item Level Integration/Sharepoint Integration Items/<Integration Name>
  5. Create a configuration file
    App_Config\Include\SharePoint.Media.<Integration Name>.config
    with the following contents
    <configuration>
    <sitecore>
    <mediaLibrary>
    <mediaTypes>
    <mediaType extensions="pdf">
    <sharedTemplate>Sharepoint/Media/<Integration Name>/unversioned/Pdf</sharedTemplate>
    <versionedTemplate>Sharepoint/Media/<Integration Name>/versioned/Pdf</versionedTemplate>
    </mediaType>
    </mediaTypes>
    </mediaLibrary>
    </sitecore>
    </configuration>
  6. Enable SharePoint Integration Framework (rename the Sharepoint.disabled file to Sharepoint.config)