Skip to content

Instantly share code, notes, and snippets.

View rcurlette's full-sized avatar

Robert Curlette rcurlette

View GitHub Profile
@rcurlette
rcurlette / UpdateMMCompMetadataXml.cs
Created May 24, 2018 08:11
Tridion Update Multimedia Component Metadata XML using Core Service
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
rcurlette / json_net_sample.cs
Last active January 24, 2018 15:26
Json.Net Code Sample
// 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)
{
Import-Module WebAdministration
if(!$web8Files)
{
$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)
param
(
[Parameter(Mandatory=$true)][string]$discoveryServiceUrl,
[Parameter(Mandatory=$true)][string]$csvSiteFile
)
#
# .\UpgradeSitesToWeb8.ps1 -discoveryServiceUrl "http://someserver:8882/discovery.svc" -csvSiteFile D:\SiteTest.csv -verbose
#Upgrade each site
@rcurlette
rcurlette / tridion-gui-extension-installer.ps1
Created December 11, 2013 06:48
Tridion GUI Extension Installer in PowerShell
write-output "/***
* _____ _ _ _____ ______ _ _ _____ _ _ _
* / ____| | | |_ _| | ____| | | (_) |_ _| | | | | |
* | | __| | | | | | | |__ __ _| |_ ___ _ __ ___ _ ___ _ __ | | _ __ ___| |_ __ _| | | ___ _ __
* | | |_ | | | | | | | __| \ \/ / __/ _ \ '_ \/ __| |/ _ \| '_ \ | | | '_ \/ __| __/ _` | | |/ _ \ '__|
* | |__| | |__| |_| |_ | |____ > <| || __/ | | \__ \ | (_) | | | | _| |_| | | \__ \ || (_| | | | __/ |
* \_____|\____/|_____| |______/_/\_\\__\___|_| |_|___/_|\___/|_| |_| |_____|_| |_|___/\__\__,_|_|_|\___|_|
*
*
"
@rcurlette
rcurlette / TridionWorkflowHelpers
Created November 20, 2013 20:27
Tridion Workflow Helpers using Core Service
using System;
using System.Collections.Generic;
using System.Web;
using FlowPub.Model;
using Tridion.ContentManager.CoreService.Client;
using System.Configuration;
namespace FlowPub.Tridion
{
public class WorkflowHelper
@rcurlette
rcurlette / Default.aspx
Last active December 19, 2015 13:39
Signalr4Tridion test page for confirming the Signalr Server, and especially the URL of the server, are working correct.
<html>
<head>
<script src="Scripts/jquery-1.6.4.js" type="text/javascript"></script>
<script src="Scripts/jquery.signalR-1.1.2.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
var connection = $.connection('/channel');
connection.received(function (data) {
$('#messages').prepend('<li>' + data + '</li>');
@rcurlette
rcurlette / MessageCenterChannel.cs
Created July 10, 2013 05:55
Signalr4Tridion PersistentConnection for the SignalR server
using System;
using Microsoft.AspNet.SignalR;
using System.Threading.Tasks;
namespace Signalr4Tridion.SignalrServer
{
public class MessageCenterChannel : PersistentConnection
{
protected override Task OnReceived(IRequest request, string connectionId, string data)
{
@rcurlette
rcurlette / PublishNotificationHandler.cs
Last active December 19, 2015 13:39
C# Tridion Event System code for sending messages to the MessageCenter using the Signalr4Tridion GUI Extension
using System;
using Microsoft.AspNet.SignalR.Client;
using Tridion.ContentManager;
using Tridion.ContentManager.ContentManagement;
using Tridion.ContentManager.Extensibility;
using Tridion.ContentManager.Extensibility.Events;
using Tridion.ContentManager.Publishing;
namespace EventSystemSignalr
{
@rcurlette
rcurlette / Signalr4TridionEnableExtension.config
Created July 10, 2013 05:36
Code to add to the Tridion System.config to enable the Signalr4Tridion GUI Extension
<editor name="Signalr4TridionMC">
<installpath>C:\Program Files (x86)\Tridion\web\WebUI\Editors\Signalr4TridionMC</installpath>
<configuration>Signalr4TridionMC.config</configuration>
<vdir>Signalr4TridionMC</vdir>
</editor>