This file contains 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"?> | |
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> | |
<metadata> | |
<id>OneNorth.TDSProjectMerge.Sample</id> | |
<version>0.0.1</version> | |
<title /> | |
<authors>One North</authors> | |
<description>Sample TDS Project Merge .nuspec file</description> | |
<projectUrl>https://github.com/onenorth/tds-project-merge</projectUrl> | |
</metadata> |
This file contains 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($installPath, $toolsPath, $package, $project) | |
[Reflection.Assembly]::LoadFile($toolsPath + "\OneNorth.TDSProjectMerge.dll") | |
try { | |
$tdsProject = Get-TDSProject("Master") | |
if ($tdsProject) { | |
Merge-TDSProject $tdsProject $installPath "TDS.Master" "TDS.Master.scproj" | |
} |
This file contains 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
function Get-TDSProject([string]$type) { | |
$matchString = "." + $type.ToLower() | |
$solution = Get-Interface $dte.Solution ([EnvDTE80.Solution2]) | |
foreach ($project in $solution.Projects) { | |
if (($project.Kind -eq "{caa73bb0-ef22-4d79-a57e-df67b3ba9c80}") -and ($project.Name.ToLower().EndsWith($matchString))) { | |
return $project | |
} | |
if (($project.Project.ProjectType -eq "TDS Project") -and ($project.Name.ToLower().EndsWith($matchString))) { | |
return $project | |
} |
This file contains 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
function Merge-TDSProject($tdsProject, [string]$installPath, [string]$sourceFolder, [string]$sourceProject) { | |
$contentProject = $installPath + "\" + $sourceFolder + "\" + $sourceProject | |
Write-Host "Merging $($contentProject) into TDS project at: $($tdsProject.FullName)" | |
$merger = New-Object OneNorth.TDSProjectMerge.MergeTask | |
$merger.MergeProjects($tdsProject.FullName, $contentProject) | |
$sourceFiles = $installPath + "\" + $sourceFolder | |
$targetFiles = [System.IO.Path]::GetDirectoryName($tdsProject.FullName) |
This file contains 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
Sitecore.Data.Fields.FileField file = item.Fields[<FieldName>]; | |
if (file != null) | |
{ | |
var mediaItem = file.MediaItem; | |
... | |
} |
This file contains 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
public static List<Price> ReadPrices(MediaItem mediaItem) | |
{ | |
var prices = new List<Price>(); | |
using (var stream = mediaItem.GetMediaStream()) | |
{ | |
using (TextReader reader = new StreamReader(stream)) | |
{ | |
var csv = new CsvReader(reader); | |
while (csv.Read()) |
This file contains 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 static List<Price> _prices; | |
private static string _pricesRevision; | |
private static readonly object _lock = new object(); | |
public static List<Price> GetPrices(MediaItem mediaItem) | |
{ | |
var revision = mediaItem.Statistics.Revision; | |
if (revision != _pricesRevision) | |
{ |
This file contains 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
<script> | |
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | |
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), | |
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) | |
})(window,document,'script','//www.google-analytics.com/analytics.js','ga'); | |
ga('create', 'UA-XXXXXXXX-Y', 'auto'); | |
ga('send', 'pageview'); | |
</script> |
This file contains 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
<script> | |
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | |
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), | |
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) | |
})(window,document,'script','//www.google-analytics.com/analytics.js','ga'); | |
ga('create', 'UA-41806526-2', 'auto'); | |
ga('set', 'title', document.title + ' | {4e8d0e01-15a1-47da-ab59-57c704caf1ed}'); | |
ga('send', 'pageview'); |
This file contains 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
namespace OneNorth.SocialSort.Configuration | |
{ | |
public class Settings : ISettings | |
{ | |
public string GoogleAnalyticsProfileId | |
{ | |
get { return Sitecore.Configuration.Settings.GetSetting("OneNorth.SocialSort.GoogleAnalytics.ProfileId", ""); } | |
} | |
public string GoogleAnalyticsServiceAccountEmail |
OlderNewer