Geeks With Blogs
Mark Jones

One of the major areas developed for v2 of the SharePoint Action Framework (SAF) is its ability to integrate tightly with Msbuild. In order to get SAF working, you simply need to reference the Msbuild Saf task - which can be referenced like this :

<UsingTask AssemblyName="Collaboris.Saf, Version=2.0.0.0, Culture=neutral, PublicKeyToken=182db3eac6a9e195" TaskName="Collaboris.Saf.Adapters.MSBuild.SAF" />

You may also choose to create a couple of targets (one for the Undo and one for the Do) - like this - but this is optional.

<Target Name="Do">
  <SAF MacroPaths="@(Macros)" ProcessMode="Do" ContinueOnError="false" />
</Target>
<Target Name="Undo">
  <SAF MacroPaths="@(Macros)" ProcessMode="Undo" ContinueOnError="false" />

<Target>

Now this is setup, you then need to create a few item groups where all the properties can be passed to.

<ItemGroup>
    <Macros Include="Collaboris.Saf.Actions.Wss.Web.CreateWeb.macroTemplate">
      <disabledo>false</disabledo>
      <disableundo>false</disableundo>
      <description>New Web created by SAF</description>
      <lcid>1033</lcid>
      <overwrite>true</overwrite>
      <template>STS#0</template>
      <title>New Web title</title>
      <url>NewWeb</url>
      <useuniqueperms>false</useuniqueperms>
      <webname>New Web name</webname>
      <id>{47B640DD-64A9-493b-8445-789FC0D05FF1}</id>
      <stopondoexception>true</stopondoexception>
      <stoponundoexception>true</stoponundoexception>
      <Url>http://localhost:4422</Url>
      <InstanceId>{156E17A5-A7BA-4e1f-8A48-1BC341A7C658}</InstanceId>
    </Macros>
  </ItemGroup>

For a more detailed walkthrough, please take a look at 'How to run a Macro from MSBuild '. You will find an example of how to call every SAF action in the documentation which can be accessed at here.

Posted on Thursday, February 18, 2010 9:23 PM | Back to top


Comments on this post: Automating SharePoint configuration with MSBuild and SAF

# re: Automating SharePoint configuration with MSBuild and SAF
Requesting Gravatar...
I agree, great share, thank you!
Left by collier d'ambre on Jan 25, 2011 11:21 PM

Your comment:
 (will show your gravatar)


Copyright © SAF | Powered by: GeeksWithBlogs.net