Skip to content

Instantly share code, notes, and snippets.

View rcurlette's full-sized avatar

Robert Curlette rcurlette

View GitHub Profile
rcurlette / UpdateMMCompMetadataXml.cs
Created May 24, 2018 08:11
Tridion Update Multimedia Component Metadata XML using Core Service
View UpdateMMCompMetadataXml.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
using Tridion.ContentManager.CoreService.Client;
namespace FixMMCompMetadataField
rcurlette / json_net_sample.cs
Last active January 24, 2018 15:26
Json.Net Code Sample
View json_net_sample.cs
// get our JSON objects
dynamic jsonObject = JObject.Parse(jsonContent);
dynamic metaPage = jsonObject.MetadataFields;
// check if property exists in the JSON
if (metaPage.Property("contact") == null)
dynamic contact = GetContact(sgMetadataFields);
if(contact != null)
View List-iis-sites
Import-Module WebAdministration
$logfile = "$PSScriptRoot\Sites_$(get-date -format `"yyyyMMdd_hhmmsstt`").log"
#this is our logging function, it must appear above the code where you are trying to use it.
#note there is a technique to get around needing this at the top, read the blog post to find out more...
function log($message, $color)
View Migrate-Sites-ToWeb8-IIS
# .\UpgradeSitesToWeb8.ps1 -discoveryServiceUrl "http://someserver:8882/discovery.svc" -csvSiteFile D:\SiteTest.csv -verbose
#Upgrade each site
rcurlette / VBScriptMediator
Created April 1, 2015 12:49
VBScript Mediator
View VBScriptMediator
' For serious fun, go grab a copy of the Razor Mediator and enjoy the power of .Net and a close to TOM API!
rcurlette / GetTridionPublishTargets
Created January 20, 2015 09:32
View GetTridionPublishTargets
private List<TridionItem> GetPublishTargets(string publicationUri, SessionAwareCoreServiceClient client)
List<TridionItem> pubTargetList = new List<TridionItem>();
var pubTargets = client.GetSystemWideList(new PublicationTargetsFilterData());
foreach (PublicationTargetData pubTargetdata in pubTargets)
PublicationTargetData target = (PublicationTargetData)client.Read(pubTargetdata.Id, new ReadOptions());
LinkToPublicationData[] pubDataItems = target.Publications;
foreach (LinkToPublicationData publicationData in pubDataItems)
rcurlette / CoreServiceImpersonation
Created January 20, 2015 08:36
View CoreServiceImpersonation
string endpointName = "netTcp_2013";
SessionAwareCoreServiceClient client = new SessionAwareCoreServiceClient(endpointName);
// Actions- Publish a page, create Component, etc
rcurlette / EventSystem.dll.config
Last active August 29, 2015 14:13
Sample EventSystem.dll.config
View EventSystem.dll.config
<?xml version="1.0" encoding="utf-8" ?>
<add key="ConnectionString" value="Server=ServerX;Database=DbX;User Id=User;Password=pw123"/>
<add key="PublicationConfigComponentWebdavUrl" value="/webdav/002%20Web/Building%20Blocks/System/SystemComponents/PublicationConfigSettings%20DEFAULT.xml"/>
rcurlette / TridionEventSystemAppConfigHelper
Last active August 29, 2015 14:13
Tridion Event System app.config helpers
View TridionEventSystemAppConfigHelper
using System;
using System.Configuration;
using System.Reflection;
using System.Runtime.Caching;
namespace Tridion.EventSystem
/// <summary>
/// Configuration file should be named the same as the Event System DLL with '.config' at the end.
/// ie. TridionEventSystem.dll.config
rcurlette / OrmLiteExample.SqlServer
Last active August 29, 2015 14:12
ServiceStack ORMLite SqlServer example
View OrmLiteExample.SqlServer
using ServiceStack.DataAnnotations;
using ServiceStack.OrmLite;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1