Synchronise Content Types
Ensures that a child content type has the same columns (fields) as the parent content type.
| Reference Information |
| Release Status : |
Stable |
| Alias Name : |
Action.SynchroniseContentTypes |
| Full Reference Name : |
Collaboris.Saf.Actions.Wss.ContentType.SynchroniseContentTypes |
| Assembly Name : |
Collaboris.Saf.Actions.Wss |
| Remarks : |
This action is often necessary where content types have been manually amended in the GUI.
The content types to be synchronised must be set as 'Available' in the target web. |
| Undo Implementation? : |
This action has no Undo implementation.
|
| Download Samples for SynchroniseContentTypes : |
Collaboris.Saf.Actions.Wss.ContentType.SynchroniseContentTypes.zip |
| Download Samples for ALL Actions : |
AllSamples.zip |
| Properties |
| Name |
Description |
Example Value |
Output |
Required |
| DisableDo |
Boolean. Determines whether to disable the 'Do' on the Action. If 'DisableDo' is set to 'True' then the action will be skipped.
|
false
|
false
|
false
|
| DisableUndo |
Boolean. Determines whether to disable the 'Undo' on the Action. If 'DisableUndo' is set to 'True' then the action will be skipped.
|
false
|
false
|
false
|
| EntityList |
Defines an array of
Collaboris.Saf.Actions.Wss.Entities.ContentTypeInfo.
Note : Entities are the method in which parameters can be supplied to the Action. Many instances of an entity can be passed in. (Please see the XML examples to understand how to configure an entity with values).
|
Please refer to the documented types for samples.
|
false
|
false
|
| ID |
Guid. A unique identifier for the instance of the action. If an ID is not supplied then SAF will create a new one.
|
{47B640DD-64A9-493b-8445-789FC0D05FF1}
|
false
|
true
|
| StopOnDoException |
Boolean. A bool indicating whether to stop processing if an exception is encountered during the 'Do' operation of the Action.
|
true
|
false
|
false
|
| StopOnUndoException |
Boolean. A bool indicating whether to stop processing if an exception is encountered during the 'Undo' operation of the Action.
|
true
|
false
|
false
|
SynchroniseContentTypes Examples
This example illustrates how to call a Templated Macro from an MSBuild project. (Please see the 'Templated Macro' tab.)
<?xml version="1.0" encoding="utf-8"?>
<!-- Defines a 'SAF Macro' containiing 'Actions' to be run on 'Do' and 'Undo' -->
<!-- Please visit http://www.collaboris.co.uk/Saf/Doc/default.html for more information. -->
<Project DefaultTargets="Do" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask AssemblyName="Collaboris.Saf, Version=2.0.0.0, Culture=neutral, PublicKeyToken=182db3eac6a9e195" TaskName="Collaboris.Saf.Adapters.MSBuild.SAF" />
<ItemGroup>
<Macros Include="Collaboris.Saf.Actions.Wss.ContentType.SynchroniseContentTypes.macroTemplate">
<disabledo>false</disabledo>
<disableundo>false</disableundo>
<contenttypegroupname>
</contenttypegroupname>
<contenttypename>Article Page</contenttypename>
<excludesystemtypes>false</excludesystemtypes>
<removecolumns>false</removecolumns>
<reportfilename>c:\temp\ContentTypesReport.txt</reportfilename>
<reportonlymode>false</reportonlymode>
<verbosereporting>false</verbosereporting>
<copyproperties>false</copyproperties>
<id>{47B640DD-64A9-493b-8445-789FC0D05FF1}</id>
<stopondoexception>true</stopondoexception>
<stoponundoexception>true</stoponundoexception>
<Url>http://localhost:4422</Url>
<InstanceId>{{AC47BA86-4457-4447-8144-397623B8711D}}</InstanceId>
</Macros>
</ItemGroup>
<Target Name="Do">
<SAF MacroPaths="@(Macros)" ProcessMode="Do" ContinueOnError="false" />
</Target>
<Target Name="Undo">
<SAF MacroPaths="@(Macros)" ProcessMode="Undo" ContinueOnError="false" />
</Target>
</Project>
This example illustrates how to create a macro directly with values inserted.
<?xml version="1.0" encoding="utf-8"?>
<objects xmlns="http://www.springframework.net" default-lazy-init="true">
<object id="MacroToProcess" type="Macro">
<constructor-arg name="templateid" value="{07f80ab5-b59a-4f3a-80e9-97c73c686361}" />
<constructor-arg name="actions">
<list element-type="IAction">
<object id="SynchroniseContentTypes12" type="Action.SynchroniseContentTypes" lazy-init="true">
<property name="DisableDo" value="false" />
<property name="DisableUndo" value="false" />
<property name="EntityList">
<object id="ContentTypeInfo7b" type="Entity.ContentTypeInfo" lazy-init="true">
<property name="ContentTypeGroupName" value="" />
<property name="ContentTypeName" value="Article Page" />
<property name="ExcludeSystemTypes" value="false" />
<property name="RemoveColumns" value="false" />
<property name="ReportFileName" value="c:\temp\ContentTypesReport.txt" />
<property name="ReportOnlyMode" value="false" />
<property name="VerboseReporting" value="false" />
<property name="CopyProperties" value="false" />
</object>
</property>
<property name="ID" value="{47B640DD-64A9-493b-8445-789FC0D05FF1}" />
<property name="StopOnDoException" value="true" />
<property name="StopOnUndoException" value="true" />
</object>
</list>
</constructor-arg>
</object>
</objects>
This example illustrates how to create the Macro as a template, (so that it can be called via MSBuild or a Feature).
<?xml version="1.0" encoding="utf-8"?>
<objects xmlns="http://www.springframework.net" default-lazy-init="true">
<object id="MacroToProcess" type="Macro">
<constructor-arg name="templateid" value="{e440c683-a7f3-4280-afea-7752b2e2e60d}" />
<constructor-arg name="actions">
<list element-type="IAction">
<object id="SynchroniseContentTypes66" type="Action.SynchroniseContentTypes" lazy-init="true">
<property name="DisableDo" expression="Func.Eval('${disabledo}')" />
<property name="DisableUndo" expression="Func.Eval('${disableundo}')" />
<property name="EntityList">
<object id="ContentTypeInfo8a" type="Entity.ContentTypeInfo" lazy-init="true">
<property name="ContentTypeGroupName" expression="Func.Eval('${contenttypegroupname}')" />
<property name="ContentTypeName" expression="Func.Eval('${contenttypename}')" />
<property name="ExcludeSystemTypes" expression="Func.Eval('${excludesystemtypes}')" />
<property name="RemoveColumns" expression="Func.Eval('${removecolumns}')" />
<property name="ReportFileName" expression="Func.Eval('${reportfilename}')" />
<property name="ReportOnlyMode" expression="Func.Eval('${reportonlymode}')" />
<property name="VerboseReporting" expression="Func.Eval('${verbosereporting}')" />
<property name="CopyProperties" expression="Func.Eval('${copyproperties}')" />
</object>
</property>
<property name="ID" expression="Func.Eval('${id}')" />
<property name="StopOnDoException" expression="Func.Eval('${stopondoexception}')" />
<property name="StopOnUndoException" expression="Func.Eval('${stoponundoexception}')" />
</object>
</list>
</constructor-arg>
</object>
</objects>
This example illustrates how to call a Templated Macro from a Feature Receiver. (Please see the 'Templated Macro' tab).
<?xml version="1.0" encoding="utf-8"?>
<Feature Id="{AC47BA86-4457-4447-8144-397623B8711D}" Title="SAF Sample Feature - 'Action.SynchroniseContentTypes'" Description="Sample Feature illustrating how to call and run 'SynchroniseContentTypes' from a SAF Macro." Version="12.0.0.0" Hidden="FALSE" Scope="Web" DefaultResourceFile="core" xmlns="http://schemas.microsoft.com/sharepoint/" ReceiverAssembly="Collaboris.Saf, Version=2.0.0.0, Culture=neutral, PublicKeyToken=182db3eac6a9e195" ReceiverClass="Collaboris.Saf.Adapters.SafFeatureReceiver">
<Properties>
<!-- Defines a SAF Macro containiing Actions to be run on Do and Undo -->
<!-- Please visit http://www.collaboris.co.uk/Saf/Doc/default.html for more information. -->
<Property Key="MacroFile" Value="Collaboris.Saf.Actions.Wss.ContentType.SynchroniseContentTypes.macroTemplate" />
<Property Key="InstanceId" Value="{AC47BA86-4457-4447-8144-397623B8711D}" />
<Property Key="disabledo" Value="false" />
<Property Key="disableundo" Value="false" />
<Property Key="contenttypegroupname" Value="" />
<Property Key="contenttypename" Value="Article Page" />
<Property Key="excludesystemtypes" Value="false" />
<Property Key="removecolumns" Value="false" />
<Property Key="reportfilename" Value="c:\temp\ContentTypesReport.txt" />
<Property Key="reportonlymode" Value="false" />
<Property Key="verbosereporting" Value="false" />
<Property Key="copyproperties" Value="false" />
<Property Key="id" Value="{47B640DD-64A9-493b-8445-789FC0D05FF1}" />
<Property Key="stopondoexception" Value="true" />
<Property Key="stoponundoexception" Value="true" />
<!-- You can also define your own properties to be resolved by PlaceHolders in the Macro ... <Property Key="YourKey" Value="YourValue" /> -->
</Properties>
</Feature>
This example illustrates how to call a Templated Macro from a custom Saf StsAdm Command. (Please see the 'Templated Macro' tab).
REM Defines a SAF Macro containiing Actions to be run on Do and/or Undo
REM Please visit http://www.collaboris.co.uk/Projects/SafWiki/SAF_WIKI/Contents_Page.aspx for more information.
REM IMPORTANT! If this macro needs a SharePoint context please amend the '-url http://localhost:4422' argument (below).
REM
REM If the macro DOESN'T require a SharePoint context, simply remove the '-url http://localhost:4422' argument.
SET STSADM=C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\bin\stsadm.exe
"%STSADM%" -o saf-run -macrofile Collaboris.Saf.Actions.Wss.ContentType.SynchroniseContentTypes.macroTemplate -mode "do" -url http://localhost:4422 -disabledo "false" -disableundo "false" -contenttypegroupname "" -contenttypename "Article Page" -excludesystemtypes "false" -removecolumns "false" -reportfilename "c:\temp\ContentTypesReport.txt" -reportonlymode "false" -verbosereporting "false" -copyproperties "false" -id "{47B640DD-64A9-493b-8445-789FC0D05FF1}" -stopondoexception "true" -stoponundoexception "true"