Skip to content

Instantly share code, notes, and snippets.

View arjancornelissen's full-sized avatar

Arjan Cornelissen arjancornelissen

View GitHub Profile
@arjancornelissen
arjancornelissen / AzureDockerMySQLWebSite.json
Created January 5, 2016 17:33
Blog Move Blog from SP to WP
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"mysqlPassword": {
"type": "securestring",
"metadata": {
"description": "Root password password for the MySQL database."
}
},
@arjancornelissen
arjancornelissen / Deploy-DockerVM.ps1
Created January 5, 2016 17:35
Blog Move Blog from SP to WP PowerShell
New-AzureRmResourceGroupDeployment -ResourceGroupName <resourcegroupname> -TemplateFile .\AzureDockerMySQLWebSite.json -TemplateParameterFile .\AzureDockerMySQLWebSite.parameters.json
@arjancornelissen
arjancornelissen / mmfield.xml
Created January 10, 2016 16:07
Content type with Managed Metadata field
<Field
ID="{6D1E6DA9-9114-43E8-994F-C6D34DCC13DF}"
Name="Documenttype"
DisplayName="Document type"
Type="TaxonomyFieldType"
Required="false"
ShowField="Term1033"
Group="Site Columns">
<Customization>
<ArrayOfProperty>
@arjancornelissen
arjancornelissen / mmNoteField.xml
Created January 10, 2016 16:08
Content type with Managed Metadata note field
<Field Type="Note"
DisplayName="Document type_0"
StaticName="DocumenttypeHTField0"
Name="DocumenttypeTaxHTField0"
ID="{018D3722-B2F1-4F9E-A863-0F89AD81DCAC}"
ShowInViewForms="FALSE"
Required="FALSE"
Hidden="TRUE"
CanToggleHidden="TRUE"
RowOrdinal="0" />
@arjancornelissen
arjancornelissen / mmContentType.xml
Created January 10, 2016 16:09
Content type with Managed Metadata Content Type
<FieldRef ID="{f3b0adf9-c1a2-4b02-920d-943fba4b3611}" DisplayName="Taxonomy Catch All Column" Required="FALSE" Hidden="TRUE" Name="TaxCatchAll" Sealed="TRUE" Sortable="FALSE" />
<FieldRef ID="{8f6b6dd8-9357-4019-8172-966fcd502ed2}" DisplayName="Taxonomy Catch All Column1" Required="FALSE" Hidden="TRUE" Name="TaxCatchAllLabel" ReadOnly="TRUE" Sealed="TRUE" Sortable="FALSE" />
@arjancornelissen
arjancornelissen / mmFeatureReceiver01.cs
Created January 10, 2016 16:11
Content type with Managed Metadata Feature receiver01
SetTaxonomyField(site, new Guid("{6D1E6DA9-9114-43E8-994F-C6D34DCC13DF}"), "DMS", "Documenttypen", string.Empty);
@arjancornelissen
arjancornelissen / mmSetTaxonomyField.cs
Last active January 10, 2016 16:12
Content type with Managed Metadata Feature receiver02
/// <summary>
/// Set the correct values for an Managed Metadata field
/// </summary>
/// <param name="site"><see cref="SPSite"/> object</param>
/// <param name="fieldId"><see cref="GUID"/> from the field to be updated</param>
/// <param name="Termstore">Name of the Term Store</param>
/// <param name="TermGroup">Name of the Term Group</param>
/// <param name="Termset">Name of the Term set</param>
private void SetTaxonomyField(SPSite site, Guid fieldId, string TermGroup, string Termset, string Term)
{
@arjancornelissen
arjancornelissen / mmGroupExtension.cs
Created January 10, 2016 16:13
Content type with Managed Metadata Feature receiver03
/// <summary>
/// Extension to search for a groupName
/// </summary>
public static class GroupExtension
{
/// <summary>
/// Search for the Group by its name
/// </summary>
/// <param name="groupCollection">The group collection to search in</param>
/// <param name="name">The name to search for</param>
@arjancornelissen
arjancornelissen / mmTermExtension.cs
Created January 10, 2016 16:15
Content type with Managed Metadata Feature receiver04
/// <summary>
/// Extension to search for a term in a Termset
/// </summary>
public static class TermExtension
{
/// <summary>
/// Search for the term by its path
/// </summary>
/// <param name="termset">The Termset where this path should be under</param>
/// <param name="path">The path to the term fron the Termset</param>
<Field Type='Geolocation' DisplayName='Geolocation' Name='geolocation' />