This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| '''''''''''''''''''''''''''''''''''''' | |
| ' APRIL FOOLS! | |
| ' | |
| ' For serious fun, go grab a copy of the Razor Mediator and enjoy the power of .Net and a close to TOM API! | |
| ' https://code.google.com/p/razor-mediator-4-tridion/ | |
| ''''''''''''''''''''''''''''''''''''''' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| string endpointName = "netTcp_2013"; | |
| SessionAwareCoreServiceClient client = new SessionAwareCoreServiceClient(endpointName); | |
| client.Impersonate(System.Web.HttpContext.Current.User.Identity.Name); | |
| // Actions- Publish a page, create Component, etc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="utf-8" ?> | |
| <configuration> | |
| <appSettings> | |
| <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"/> | |
| </appSettings> | |
| </configuration> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
NewerOlder