Sample Code for Configuring Unicorn and Fortis
Most of the examples of using Unicorn and Fortis are out of date as of May 2017. Here's some sample code (t4 templates) that should work.
AssemblyReferences.tt
<#@ Assembly Name="$(SolutionDir)\packages\Fortis.3.5.0.1\lib\net45\Fortis.dll" #>
<#@ Assembly Name="$(SolutionDir)\packages\Sitecore.Kernel.8.2.160729\lib\NET452\Sitecore.Kernel.dll" #>
<#@ assembly name="$(SolutionDir)\lib\Transitus.Rainbow.dll" #>
<#@ assembly name="$(SolutionDir)\lib\Rainbow.dll" #>
<#@ assembly name="$(SolutionDir)\lib\Rainbow.Storage.Yaml.dll" #>
Model.tt
<#@ template debug="true" hostSpecific="true" #>
<#@ output extension=".cs" #>
<#@ include file="AssemblyReferences.tt" #>
<#@ assembly Name="System.Core" #>
<#@ assembly Name="System.Windows.Forms" #>
<#@ import namespace="System" #>
<#@ import namespace="System.IO" #>
<#@ import namespace="System.Diagnostics" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="Microsoft.VisualStudio.TextTemplating" #>
<#@ import namespace="System.Collections" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ import namespace="System.Text.RegularExpressions" #>
<#@ import namespace="System.Globalization" #>
<#@ import namespace="Transitus.Rainbow" #>
<#@ assembly name="EnvDTE" #>
<#@ import namespace="EnvDTE" #>
/*
*
* Generated at <#= DateTime.Now #>
*/
<#
var stopwatch = Stopwatch.StartNew();
string solutionsPath = this.Host.ResolveAssemblyReference("$(SolutionDir)");
var folderDeserializer = TransitusProvider.FolderDeserializer;
var templateFactory = TransitusProvider.TemplateFactory;
var myFolder = solutionsPath;
var directories = new List<string>
{
myFolder + @"src\Feature\Cta\serialization",
myFolder + @"src\Feature\Navigation\serialization",
myFolder + @"src\Feature\Blog\serialization",
myFolder + @"src\Foundation\Multisite\serialization",
myFolder + @"src\Foundation\RenderingDatasource\serialization",
myFolder + @"src\Foundation\Search\serialization",
myFolder + @"src\Foundation\Serialization\serialization",
myFolder + @"src\Foundation\CoreFields\serialization",
myFolder + @"src\Project\Templates\serialization\Bonfire.Templates",
myFolder + @"src\Foundation\Presentation\serialization\Presentation.Templates",
myFolder + @"src\Project\Templates\serialization"
};
//var directories = new List<string>
//{
// myFolder + @"src"
//};
var folders = new List<string>();
foreach(var d in directories)
{
folders.AddRange(Directory.GetDirectories(d, "*", SearchOption.AllDirectories).ToList());
}
var items = new List<IItem>();
foreach (var folder in folders)
{
var deserializedItems = Transitus.Rainbow.TransitusProvider.FolderDeserializer.Deserialize(folder);
items.AddRange(deserializedItems);
}
var templates = Transitus.Rainbow.TransitusProvider.TemplateFactory.Create(items).GroupBy(i => i.Id).Select(grp => grp.First()).ToList();
#>
<#
foreach (var template in templates)
{
#>
#region <#= template.Name #>
namespace <#= FullNamespace(template.Path) #>
{
using System;
using System.Collections.Generic;
using Sitecore.Data.Items;
using Sitecore.ContentSearch;
using Sitecore.ContentSearch.Linq.Common;
using Fortis.Model;
using Fortis.Model.Fields;
using Fortis.Providers;
using Fortis.Model.RenderingParameters;
/// <summary>
/// <para>Template interface</para>
/// <para>Template: <#= template.Name #></para>
/// <para>ID: <#= template.Id.ToUpper() #></para>
/// <para><#= template.Path #></para>
/// </summary>
[TemplateMapping("<#= template.Id.ToUpper() #>", "<#= GetTemplateMappingType(false, true) #>")]
public partial interface <#= InterfaceName(template.Name) #> : <#= GetBaseTemplateInterface(false) #> <#
foreach (var baseTemplate in template.BaseTemplates.GroupBy(x => x.Id).Select(grp => grp.First()).ToList())
{
if (baseTemplate != null)
{
#>, <#= FullNamespace(baseTemplate.Path) + "." + InterfaceName(baseTemplate.Name) #><#
}
}
#>
{
<#
foreach(var field in template.LocalFields.GroupBy(x => x.Id).Select(grp => grp.First()).ToList())
{
#>
/// <summary>
/// <para>Template: <#= template.Name #></para><para>Field: <#= TitleCase(field.Name) #></para><para>Data type: <#= field.TypeName #></para>
/// </summary>
<# if (!isRenderingParametersTemplate && IsSupportedSearchFieldType(field.TypeName)) { #>
[IndexField("<#= field.Name.Replace(" ", "_").ToLowerInvariant() + GetFieldTypeSearchAffix(field.TypeName) #>")]
<# } #>
<#= GetFieldWrapperTypeInterface(field.TypeName) #> <#= ClassName(field.Name) == TitleCase(field.Name) ? TitleCase(field.Name + "Field") : TitleCase(field.Name) #> { get; }
<# if (!isRenderingParametersTemplate && IsSupportedSearchFieldType(field.TypeName)) { #>
/// <summary>
/// <para>Template: <#= template.Name #></para><para>Field: <#= TitleCase(field.Name) #></para><para>Data type: <#= field.TypeName #></para>
/// </summary>
[IndexField("<#= field.Name.Replace(" ", "_").ToLowerInvariant() #>")]
<# } #>
<#= GetReturnType(GetFieldWrapperType(field.TypeName)) #> <#= TitleCase(field.Name) #>Value { get; }
<#
} // for
#>
} // interface
/// <summary>
/// <para>Template class</para><para><#= template.Path #></para>
/// </summary>
[PredefinedQuery("TemplateId", ComparisonType.Equal, "<#= template.Id.ToUpper() #>", typeof(Guid))]
[TemplateMapping("<#= template.Id.ToUpper() #>", "<#= GetTemplateMappingType(isRenderingParametersTemplate, false) #>")]
public partial class <#= ClassName(template.Name) #> : <#= GetBaseTemplateClass(isRenderingParametersTemplate) #>, <#= InterfaceName(template.Name) #>
{
<# if (!isRenderingParametersTemplate) { #>
private Item _item = null;
public <#= ClassName(template.Name) #>(ISpawnProvider spawnProvider) : base(null, spawnProvider) { }
public <#= ClassName(template.Name) #>(Guid id, ISpawnProvider spawnProvider) : base(id, spawnProvider) { }
public <#= ClassName(template.Name) #>(Guid id, Dictionary<string, object> lazyFields, ISpawnProvider spawnProvider) : base(id, lazyFields, spawnProvider) { }
<# } #>
public <#= ClassName(template.Name) #>(<#= GetConstructorParameters(isRenderingParametersTemplate) #>, ISpawnProvider spawnProvider) : base(<#= GetBaseConstructorParameters(isRenderingParametersTemplate) #>, spawnProvider)
{
<# if (!isRenderingParametersTemplate) { #>
_item = item;
<# } #>
}
<#
foreach(var field in template.CombinedFields.GroupBy(x => x.Id).Select(grp => grp.First()).ToList())
{
#>
/// <summary><para>Template: <#= template.Name #></para><para>Field: <#= TitleCase(field.Name) #></para><para>Data type: <#= field.TypeName #></para></summary>
<# if (!isRenderingParametersTemplate && IsSupportedSearchFieldType(field.TypeName)) { #>
[IndexField("<#= field.Name.Replace(" ", "_").ToLowerInvariant() + GetFieldTypeSearchAffix(field.TypeName) #>")]
<# } #>
public virtual <#= GetFieldWrapperTypeInterface(field.TypeName) #> <#= ClassName(field.Name) == TitleCase(field.Name) ? TitleCase(field.Name + "Field") : TitleCase(field.Name) #>
{
<# if (isRenderingParametersTemplate) { #>
get { return (Fortis.Model.RenderingParameters.Fields.<#= GetFieldWrapperType(field.TypeName) #>)GetField("<#= field.Name #>", "<#= field.TypeName.ToLower() #>"); }
<# } else { #>
get { return GetField<<#= GetFieldWrapperType(field.TypeName) #>>("<#= field.Name #>"<# if (IsSupportedSearchFieldType(field.TypeName)) { #>, "<#= field.Name.Replace(" ", "_").ToLowerInvariant() + GetFieldTypeSearchAffix(field.TypeName) #>"<# } #>); }
<# } #>
}
/// <summary><para>Template: <#= template.Name #></para><para>Field: <#= TitleCase(field.Name) #></para><para>Data type: <#= field.TypeName #></para></summary>
<# if (!isRenderingParametersTemplate && IsSupportedSearchFieldType(field.TypeName)) { #>
[IndexField("<#= field.Name.Replace(" ", "_").ToLowerInvariant() #>")]
<# } #>
public <#= GetReturnType(GetFieldWrapperType(field.TypeName)) #> <#= TitleCase(field.Name) #>Value
{
get { return <#= ClassName(field.Name) == TitleCase(field.Name) ? TitleCase(field.Name + "Field") : TitleCase(field.Name) #>.Value; }
}
<#
} // for
#>
} // class
} // namespace
#endregion
<#
}
#>
<#
stopwatch.Stop();
#>
// Generated in <#= stopwatch.ElapsedMilliseconds #>ms
<#
bool IsSolr = false;
string SitecoreSystemTemplatePath = "/sitecore/templates/System/";
string ClientTemplatePath = "/sitecore/templates/User Defined/";
string BaseNamespace = "Fortis.Model";
string RelativeNameSpaceUserDefined = "Bonfire";
string BaseRenderingParametersTemplateId = "{E13DB450-F493-42D5-B1C1-536A57AED2A6}";
#>
<#+
public string GetFieldSearchKey(string fieldKey, string fieldTypeKey)
{
return fieldKey.Replace(" ", "_").ToLowerInvariant() + GetFieldTypeSearchAffix(fieldTypeKey);
}
public string RelativeNamespace(string templatePath)
{
var relativeNamespace = string.Empty;
string featureName = string.Empty;
try {
featureName = templatePath.Split('/')[4];
}
catch(Exception) { }
if (templatePath.StartsWith(SitecoreSystemTemplatePath))
{
relativeNamespace = "ScSystem";
}
else if (templatePath.StartsWith("/sitecore/templates/Feature"))
{
relativeNamespace = "Feature." + featureName;
}
else if(templatePath.StartsWith("/sitecore/templates/Foundation"))
{
relativeNamespace = "Foundation." + featureName;
}
else if(templatePath.StartsWith("/sitecore/templates/Project"))
{
relativeNamespace = "Project." + featureName;
}
else
{
relativeNamespace = "Ignite";
}
return relativeNamespace;
}
public string FullNamespace(string templatePath)
{
return BaseNamespace + ".Templates." + RelativeNamespace(templatePath);
}
public string ClassName(string name)
{
return TitleCase(name);
}
public string InterfaceName(string name)
{
return "I" + TitleCase(name);
}
public string TitleCase(string name)
{
name = Regex.Replace(name, "([a-z](?=[A-Z])|[A-Z](?=[A-Z][a-z]))", "$1 ");
name = CultureInfo.InvariantCulture.TextInfo.ToTitleCase(name);
name = Regex.Replace(name, @"[^a-zA-Z0-9]", String.Empty);
var firstChar = 0;
if (int.TryParse(name.Substring(0, 1), out firstChar))
{
var numberToWord = string.Empty;
switch(firstChar)
{
case 0:
numberToWord = "Zero";
break;
case 1:
numberToWord = "One";
break;
case 2:
numberToWord = "Two";
break;
case 3:
numberToWord = "Three";
break;
case 4:
numberToWord = "Four";
break;
case 5:
numberToWord = "Five";
break;
case 6:
numberToWord = "Six";
break;
case 7:
numberToWord = "Seven";
break;
case 8:
numberToWord = "Eight";
break;
case 9:
numberToWord = "Nine";
break;
}
name = numberToWord + name.Remove(0, 1);
}
return name;
}
public string GetReturnType(string fieldType)
{
switch (fieldType)
{
case "BooleanFieldWrapper":
case "IBooleanFieldWrapper":
return "bool";
case "DateTimeFieldWrapper":
case "IDateTimeFieldWrapper":
return "DateTime";
case "ListFieldWrapper":
case "IListFieldWrapper":
return "IEnumerable<Guid>";
case "IntegerFieldWrapper":
case "IIntegerFieldWrapper":
return "long";
case "NumberFieldWrapper":
case "INumberFieldWrapper":
return "float";
case "HighPrecisionNumberFieldWrapper":
case "IHighPrecisionNumberFieldWrapper":
return "decimal";
case "LinkFieldWrapper":
case "ILinkFieldWrapper":
return "string";
default:
return "string";
}
}
public bool IsSupportedSearchFieldType(string typeName)
{
switch (typeName.ToLower())
{
case "checkbox":
case "date":
case "datetime":
case "checklist":
case "treelist":
case "treelist with search":
case "treelistex":
case "multilist":
case "multilist with search":
case "droplink":
case "droptree":
case "general link":
case "general link with search":
case "text":
case "single-line text":
case "multi-line text":
case "rich text":
case "number":
case "high precision number":
case "integer":
case "tags":
return true;
default:
return false;
}
}
public string GetFieldTypeSearchAffix(string typeName)
{
return "";
/*
var affix = "FieldWrapper";
switch (typeName.ToLower())
{
case "checkbox":
affix = "_b";
break;
case "date":
case "datetime":
affix = "_tdt";
break;
case "checklist":
case "treelist":
case "treelist with search":
case "treelistex":
case "multilist":
case "multilist with search":
case "tags":
affix = "_sm";
break;
case "droplink":
case "droptree":
affix = "_s";
break;
case "general link":
case "general link with search":
case "text":
case "single-line text":
case "multi-line text":
case "rich text":
affix = "_t";
break;
case "number":
case "high precision number":
affix = "_tf";
break;
case "integer":
affix = "_tl";
break;
default:
throw new Exception("No mapping for " + typeName);
}
return affix;
*/
}
public string GetFieldWrapperTypeInterface(string typeName)
{
return "I" + GetFieldWrapperType(typeName);
}
public string GetFieldWrapperType(string typeName)
{
var wrapperType = "FieldWrapper";
switch (typeName.ToLower())
{
case "checkbox":
wrapperType = "BooleanFieldWrapper";
break;
case "image":
wrapperType = "ImageFieldWrapper";
break;
case "file":
wrapperType = "FileFieldWrapper";
break;
case "date":
case "datetime":
wrapperType = "DateTimeFieldWrapper";
break;
case "checklist":
case "treelist":
case "treelist with search":
case "treelistex":
case "multilist":
case "multilist with search":
case "tags":
wrapperType = "ListFieldWrapper";
break;
case "droplink":
case "droptree":
case "internal link with search":
wrapperType = "LinkFieldWrapper";
break;
case "general link":
case "general link with search":
wrapperType = "GeneralLinkFieldWrapper";
break;
case "text":
case "single-line text":
case "multi-line text":
wrapperType = "TextFieldWrapper";
break;
case "rich text":
wrapperType = "RichTextFieldWrapper";
break;
case "number":
wrapperType = "NumberFieldWrapper";
break;
case "high precision number":
wrapperType = "HighPrecisionNumberFieldWrapper";
break;
case "integer":
wrapperType = "IntegerFieldWrapper";
break;
default:
wrapperType = "TextFieldWrapper";
break;
}
return wrapperType;
}
public string GetTemplateMappingType(bool isRenderingParametersTemplate, bool isInterface)
{
return (isInterface ? "Interface" : string.Empty) + (isRenderingParametersTemplate ? "RenderingParameter" : isInterface ? "Map" : string.Empty);
}
public string GetConstructorParameters(bool isRenderingParametersTemplate)
{
return (isRenderingParametersTemplate ? "Dictionary<string, string> " : "Item ") + GetBaseConstructorParameters(isRenderingParametersTemplate);
}
public string GetBaseConstructorParameters(bool isRenderingParametersTemplate)
{
return isRenderingParametersTemplate ? "parameters" : "item";
}
public string GetBaseTemplateInterface(bool isRenderingParametersTemplate)
{
return InterfaceName(GetBaseTemplateClass(isRenderingParametersTemplate));
}
public string GetBaseTemplateClass(bool isRenderingParametersTemplate)
{
return isRenderingParametersTemplate ? "RenderingParameterWrapper" : "CustomItemWrapper";
}
#>
<#+
bool IsSolr = false;
string SitecoreSystemTemplatePath = "/sitecore/templates/System/";
string ClientTemplatePath = "/sitecore/templates/User Defined/";
string BaseNamespace = "Fortis.Model";
string RelativeNameSpaceUserDefined = "BonfireWeb";
string BaseRenderingParametersTemplateId = "{E13DB450-F493-42D5-B1C1-536A57AED2A6}";
bool isRenderingParametersTemplate = false;
#>
ICustomItemWrapper
namespace Fortis.Model
{
public interface ICustomItemWrapper : IItemWrapper
{
}
}
CustomItemWrapper
namespace Fortis.Model
{
using System;
using System.Collections.Generic;
using Fortis.Providers;
using Sitecore.Data.Items;
public class CustomItemWrapper : ItemWrapper, ICustomItemWrapper
{
public CustomItemWrapper(ISpawnProvider spawnProvider) : base(spawnProvider)
{
}
public CustomItemWrapper(Item item, ISpawnProvider spawnProvider) : base(item, spawnProvider)
{
}
public CustomItemWrapper(Guid id, ISpawnProvider spawnProvider) : base(id, spawnProvider)
{
}
public CustomItemWrapper(Guid id, Dictionary<string, object> lazyFields, ISpawnProvider spawnProvider) : base(id, lazyFields, spawnProvider)
{
}
}
}
ICustomItemFactory
namespace Fortis.Model
{
public interface ICustomItemFactory : IItemFactory
{
}
}
CustomItemFactory
namespace Fortis.Model
{
using Fortis.Providers;
public class CustomItemFactory : ItemFactory, ICustomItemFactory
{
public CustomItemFactory(IContextProvider contextProvider, ISpawnProvider spawnProvider)
: base(contextProvider, spawnProvider)
{
}
}
}
FortisRenderingParameters
#region _StylesParameter
using System;
using System.Collections.Generic;
using Fortis.Model.Fields;
using Fortis.Model.Templates.RenderingParameters.Foundation.Presentation;
using Fortis.Providers;
using Sitecore.ContentSearch;
using Sitecore.ContentSearch.Linq.Common;
using Sitecore.Data.Items;
using LinkFieldWrapper = Fortis.Model.RenderingParameters.Fields.LinkFieldWrapper;
using ListFieldWrapper = Fortis.Model.RenderingParameters.Fields.ListFieldWrapper;
using Fortis.Model.RenderingParameters;
namespace Fortis.Model.Templates.RenderingParameters.Foundation.Presentation
{
/// <summary>
/// <para>Template interface</para>
/// <para>Template: _StylesParameter</para>
/// <para>ID: {8C239FD8-AB06-434D-8075-6199D006AF48}</para>
/// <para>/sitecore/templates/Foundation/Presentation/RenderingParameters/_StylesParameter</para>
/// </summary>
[TemplateMapping("{8C239FD8-AB06-434D-8075-6199D006AF48}", "InterfaceRenderingParameter")]
public partial interface IStylesParameter : IRenderingParameterWrapper
{
/// <summary>
/// <para>Template: _StylesParameter</para><para>Field: ComponentStyle</para><para>Data type: Multilist</para>
/// </summary>
[IndexField("componentstyle")]
IListFieldWrapper ComponentStyleField { get; }
/// <summary>
/// <para>Template: _StylesParameter</para><para>Field: ComponentStyle</para><para>Data type: Multilist</para>
/// </summary>
[IndexField("componentstyle")]
IEnumerable<Guid> ComponentStyleValue { get; }
} // interface
/// <summary>
/// <para>Template class</para><para>/sitecore/templates/Foundation/Presentation/RenderingParameters/_StylesParameter</para>
/// </summary>
[PredefinedQuery("TemplateId", ComparisonType.Equal, "{8C239FD8-AB06-434D-8075-6199D006AF48}", typeof(Guid))]
[TemplateMapping("{8C239FD8-AB06-434D-8075-6199D006AF48}", "RenderingParameter")]
public partial class StylesParameter : RenderingParameterWrapper, IStylesParameter
{
private Item _item = null;
public StylesParameter(Dictionary<string, string> parameters, ISpawnProvider spawnProvider)
: base(parameters, spawnProvider)
{
}
/// <summary><para>Template: _StylesParameter</para><para>Field: ComponentStyle</para><para>Data type: Multilist</para></summary>
[IndexField("componentstyle")]
public virtual IListFieldWrapper ComponentStyleField
{
get { return (ListFieldWrapper)GetField("ComponentStyle", "componentstyle"); }
}
/// <summary><para>Template: _StylesParameter</para><para>Field: ComponentStyle</para><para>Data type: Multilist</para></summary>
[IndexField("componentstyle")]
public IEnumerable<Guid> ComponentStyleValue
{
get { return ComponentStyleField.Value; }
}
} // class
} // namespace
#endregion
#region RenderingParameters_Cta
namespace Fortis.Model.Templates.RenderingParameters.Feature.Cta
{
/// <summary>
/// <para>Template interface</para>
/// <para>Template: RenderingParameters_Cta</para>
/// <para>ID: {F668F086-38A0-4F68-A228-6D4A69D88929}</para>
/// <para>/sitecore/templates/Feature/Cta/RenderingParameters/RenderingParameters_Cta</para>
/// </summary>
[TemplateMapping("{F668F086-38A0-4F68-A228-6D4A69D88929}", "InterfaceMap")]
public interface IRenderingParametersCta : IRenderingParameterWrapper, IStylesParameter
{
} // interface
/// <summary>
/// <para>Template class</para><para>/sitecore/templates/Feature/Cta/RenderingParameters/RenderingParameters_Cta</para>
/// </summary>
[PredefinedQuery("TemplateId", ComparisonType.Equal, "{F668F086-38A0-4F68-A228-6D4A69D88929}", typeof(Guid))]
[TemplateMapping("{F668F086-38A0-4F68-A228-6D4A69D88929}", "RenderingParameter")]
public class RenderingParametersCta : RenderingParameterWrapper, IRenderingParametersCta
{
private Item _item = null;
public RenderingParametersCta(Dictionary<string, string> parameters, ISpawnProvider spawnProvider)
: base(parameters, spawnProvider)
{
}
/// <summary><para>Template: RenderingParameters_Cta</para><para>Field: ComponentStyle</para><para>Data type: Multilist</para></summary>
[IndexField("componentstyle")]
public virtual IListFieldWrapper ComponentStyleField
{
get { return (ListFieldWrapper)GetField("ComponentStyle", "componentstyle"); }
}
/// <summary><para>Template: RenderingParameters_Cta</para><para>Field: ComponentStyle</para><para>Data type: Multilist</para></summary>
[IndexField("componentstyle")]
public IEnumerable<Guid> ComponentStyleValue
{
get { return ComponentStyleField.Value; }
}
} // class
} // namespace
#endregion
#region RenderingParameters_Cta_CaseStudy
namespace Fortis.Model.Templates.RenderingParameters.Feature.CtaRendering
{
/// <summary>
/// <para>Template interface</para>
/// <para>Template: RenderingParameters_Cta_CaseStudy</para>
/// <para>ID: {6E85FA21-9163-4F66-A05E-DE94B51F840F}</para>
/// <para>/sitecore/templates/Feature/Cta/RenderingParameters/RenderingParameters_Cta_CaseStudy</para>
/// </summary>
[TemplateMapping("{6E85FA21-9163-4F66-A05E-DE94B51F840F}", "InterfaceRenderingParameter")]
public partial interface IRenderingParametersCtaCaseStudy : IRenderingParameterWrapper, IStylesParameter
{
/// <summary>
/// <para>Template: RenderingParameters_Cta_CaseStudy</para><para>Field: CtaViewType</para><para>Data type: Droplink</para>
/// </summary>
[IndexField("ctaviewtype")]
ILinkFieldWrapper CtaViewTypeField { get; }
/// <summary>
/// <para>Template: RenderingParameters_Cta_CaseStudy</para><para>Field: CtaViewType</para><para>Data type: Droplink</para>
/// </summary>
[IndexField("ctaviewtype")]
string CtaViewTypeValue { get; }
} // interface
/// <summary>
/// <para>Template class</para><para>/sitecore/templates/Feature/Cta/RenderingParameters/RenderingParameters_Cta_CaseStudy</para>
/// </summary>
[PredefinedQuery("TemplateId", ComparisonType.Equal, "{6E85FA21-9163-4F66-A05E-DE94B51F840F}", typeof(Guid))]
[TemplateMapping("{6E85FA21-9163-4F66-A05E-DE94B51F840F}", "RenderingParameter")]
public partial class RenderingParametersCtaCaseStudy : RenderingParameterWrapper, IRenderingParametersCtaCaseStudy
{
private Item _item = null;
public RenderingParametersCtaCaseStudy(Dictionary<string, string> parameters, ISpawnProvider spawnProvider)
: base(parameters, spawnProvider)
{
}
/// <summary><para>Template: RenderingParameters_Cta_CaseStudy</para><para>Field: CtaViewType</para><para>Data type: Droplink</para></summary>
[IndexField("ctaviewtype")]
public virtual ILinkFieldWrapper CtaViewTypeField
{
get
{
return (Fortis.Model.RenderingParameters.Fields.LinkFieldWrapper)GetField("CtaViewType", "droplink");
}
}
/// <summary><para>Template: RenderingParameters_Cta_CaseStudy</para><para>Field: CtaViewType</para><para>Data type: Droplink</para></summary>
[IndexField("ctaviewtype")]
public string CtaViewTypeValue
{
get { return CtaViewTypeField.Value; }
}
/// <summary><para>Template: RenderingParameters_Cta</para><para>Field: ComponentStyle</para><para>Data type: Multilist</para></summary>
[IndexField("componentstyle")]
public virtual IListFieldWrapper ComponentStyleField
{
get { return (ListFieldWrapper)GetField("ComponentStyle", "componentstyle"); }
}
/// <summary><para>Template: RenderingParameters_Cta</para><para>Field: ComponentStyle</para><para>Data type: Multilist</para></summary>
[IndexField("componentstyle")]
public IEnumerable<Guid> ComponentStyleValue
{
get { return ComponentStyleField.Value; }
}
} // class
} // namespace
#endregion
Packages.Config
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Fortis" version="3.5.0.1" targetFramework="net452" />
<package id="Fortis.Search.Solr" version="1.0.0.1" targetFramework="net452" />
<package id="HtmlAgilityPack" version="1.4.6" targetFramework="net452" />
<package id="Lucene.Net" version="3.0.3" targetFramework="net452" />
<package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="1.0.0" targetFramework="net452" />
<package id="Microsoft.Extensions.DependencyInjection" version="1.0.0" targetFramework="net452" />
<package id="Microsoft.Extensions.DependencyInjection.Abstractions" version="1.0.0" targetFramework="net452" />
<package id="Microsoft.Net.Compilers" version="1.0.0" targetFramework="net452" developmentDependency="true" />
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net452" />
<package id="Rainbow" version="1.4.0" targetFramework="net452" />
<package id="Rainbow.Core" version="1.4.0" targetFramework="net452" />
<package id="Rainbow.Storage.Yaml" version="1.4.0" targetFramework="net452" />
<package id="SharpZipLib" version="0.86.0" targetFramework="net452" />
<package id="Sitecore.Abstractions" version="8.2.160729" targetFramework="net452" developmentDependency="true" />
<package id="Sitecore.ContentSearch" version="8.2.160729" targetFramework="net452" developmentDependency="true" />
<package id="Sitecore.ContentSearch.Linq" version="8.2.160729" targetFramework="net452" developmentDependency="true" />
<package id="Sitecore.Kernel" version="8.2.160729" targetFramework="net452" developmentDependency="true" />
<package id="Sitecore.Logging" version="8.2.160729" targetFramework="net452" developmentDependency="true" />
<package id="Sitecore.Logging.Client" version="8.2.160729" targetFramework="net452" developmentDependency="true" />
<package id="Sitecore.NVelocity" version="8.2.160729" targetFramework="net452" developmentDependency="true" />
<package id="Sitecore.Zip" version="8.2.160729" targetFramework="net452" developmentDependency="true" />
<package id="System.Collections" version="4.0.11" targetFramework="net452" />
<package id="System.Collections.Concurrent" version="4.0.12" targetFramework="net452" />
<package id="System.ComponentModel" version="4.0.1" targetFramework="net452" />
<package id="System.Diagnostics.Debug" version="4.0.11" targetFramework="net452" />
<package id="System.Globalization" version="4.0.11" targetFramework="net452" />
<package id="System.Linq" version="4.1.0" targetFramework="net452" />
<package id="System.Linq.Expressions" version="4.1.0" targetFramework="net452" />
<package id="System.Reflection" version="4.1.0" targetFramework="net452" />
<package id="System.Resources.ResourceManager" version="4.0.1" targetFramework="net452" />
<package id="System.Runtime.Extensions" version="4.1.0" targetFramework="net452" />
<package id="System.Threading" version="4.0.11" targetFramework="net452" />
<package id="System.Threading.Tasks" version="4.0.11" targetFramework="net452" />
</packages>