In Blogs, Mavention Make, Techblog

With Mavention Make you can provision SharePoint sites based on a template. This template can be a single XML file or a playlist XML file. With the playlist feature you can execute several XML files. However, there are some requirements to execute a playlist successfully.

Playlist

There are two major advantages to use a playlist. First, you can execute multiple XML template files sequentially. This way you can split up your complete template when it gets too big to maintain or you need some dependencies created first (think about Lookup fields referencing an existing list). Second, you can mix and match both PnP OfficeDev and Make templates. Make supports some features that PnP doesn’t and vica versa. An example of a playlist:

<?xml version="1.0" encoding="utf-8" ?>
<Configurator 
  xmlns="http://schemas.mavention.com/SharePoint/Apps/SiteConfigurator">
  <Providers>
    <Provider NodeName="Playlist" Class="Mavention.SharePoint.SiteConfigurator.Providers.PlaylistProvider" Assembly="Mavention.SharePoint.SiteConfigurator"/>
  </Providers>
  <Playlist>
    <Files>
      <ConfigurationFile FileName="configuration-main.xml" FileType="Make" />
      <ConfigurationFile FileName="configuration-navigation.xml" FileType="Make" />
    </Files>
  </Playlist>
</Configurator>

Parameters

When creating a template you can use parameters. E.g. the Url or Title for the site to be created. You don’t want it to be hard-coded in your template.

<Configurator xmlns="http://schemas.mavention.com/SharePoint/Apps/SiteConfigurator">
  <Providers>
    <Provider NodeName="Site" Class="Mavention.SharePoint.SiteConfigurator.Providers.SiteProvider" Assembly="Mavention.SharePoint.SiteConfigurator, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a43c589e76ba4e3d" />
  </Providers>
  <Site Url="{url}" Title="{title}" OwnerLogin="{owner}" LCID="1033" Template="STS#0">
    <RootWeb Url="/" Title="{title}" Template="STS#0" LCID="1033">
      <Properties>
        <Property Name="WebTemplate">Mavention.Project.Demo</Property>
      </Properties>
    </RootWeb>
  </Site>
</Configurator>

In above example the {url} is a parameter and the value 1033 for LCID (Language) is hard-coded.

When it comes to using a playlist, some parameters are mandatory otherwise you’ll end up with an error in the logs:

[05/18/2018 12:15:04 > ce1389: INFO] 2018-05-18T12:15:04.3377335+00:00      1844d66c-d76a-4739-9be9-01f17fbcb5f2      Information      Executing playlist
[05/18/2018 12:15:04 > ce1389: INFO] 2018-05-18T12:15:04.4161083+00:00      1844d66c-d76a-4739-9be9-01f17fbcb5f2      Error      The given key was not present in the dictionary.
[05/18/2018 12:15:04 > ce1389: INFO] 2018-05-18T12:15:04.6228511+00:00      1844d66c-d76a-4739-9be9-01f17fbcb5f2      Information      Request status update: Error occurred

These mandatory parameters are:

  • url
  • title
  • owner

Good luck and have fun creating playlists!

Vul je zoekopdracht in.