View ConfigureActionFilters.cs
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
using Headless.ItemService; | |
using Sitecore.Pipelines; | |
using System.Web.Http; | |
namespace Headless | |
{ | |
public class ConfigureActionFilters | |
{ | |
private HttpConfiguration configuration; | |
private RestrictDatabaseActionFilter actionFilter; |
View SitecoreHelperExtension.cs
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
using Sitecore.Mvc.Helpers; | |
using Sitecore.Mvc.Pipelines; | |
using Sitecore.Mvc.Pipelines.Response.RenderRendering; | |
using Sitecore.Mvc.Presentation; | |
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Web; |
View gist:b2e78cbb93c75b78c4b5
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
// Use the async execute | |
var asyncController = controller as IAsyncController; | |
Task.Factory.FromAsync(asyncController.BeginExecute, asyncController.EndExecute, PageContext.Current.RequestContext, null).Wait(); | |
// The old way (sync) | |
//(controller as IController).Execute(PageContext.Current.RequestContext); |
View gist:0d4dc5bf1d7c05189ccc
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
app.SetDefaultSignInAsAuthenticationType(WsFederationAuthenticationDefaults.AuthenticationType); | |
app.UseCookieAuthentication( | |
new CookieAuthenticationOptions | |
{ | |
AuthenticationType = | |
WsFederationAuthenticationDefaults.AuthenticationType | |
}); | |
app.UseWsFederationAuthentication(new WsFederationAuthenticationOptions | |
{ | |
MetadataAddress = ..., |
View gist:d39b23e24843ba66e5eb
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
app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType); | |
app.UseCookieAuthentication(new CookieAuthenticationOptions()); | |
//use OpenId | |
app.UseOpenIdConnectAuthentication( | |
new OpenIdConnectAuthenticationOptions | |
{ | |
ClientId = ..., | |
Authority = ..., |
View ItemServiceConsoler.cs
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
using System; | |
using System.Net; | |
using System.Net.Http; | |
using System.Text; | |
namespace ItemServiceConsoler | |
{ | |
class Program | |
{ | |
static void Main(string[] args) |
View gist:89a99902e6e797134635
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
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> | |
<sitecore> | |
<contentSearch> | |
<indexConfigurations> | |
<!-- Un-comment out the config for Lucene or SOLR for your project --> | |
<defaultLuceneIndexConfiguration> | |
<indexDocumentPropertyMapper> |
View gist:c718a70852e7bc3dcb25
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
<Target Name="Write_AssemblyRefs_TT" BeforeTargets="TransformOnBuild"> | |
<!-- A message for all to enjoy! --> | |
<WriteLinesToFile File="@(MyTextFile)" | |
Lines="<# /* AUTOGENERATED BY MSBUILD and Kern Herskind Nightingale */ #>" | |
Overwrite="true" | |
Encoding="Unicode" /> | |
<!-- Output all assembly references with a HintPath --> | |
<WriteLinesToFile File="@(MyTextFile)" | |
Lines="<#@ assembly name="$(ProjectDir)%(Reference.HintPath)" #>" | |
Overwrite="false" |
View LuceneDocumentTypeMapper.cs
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
using Fortis; | |
using Fortis.Model; | |
using Sitecore.ContentSearch; | |
using Sitecore.ContentSearch.Linq.Methods; | |
using Sitecore.ContentSearch.Security; | |
using Sitecore.Data; |
View ArticleViewRendering.cshtml
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
@using Sitecore.Mvc.Presentation | |
@using Sitecore.Mvc | |
@model RenderingModel | |
@{ | |
Layout = null; | |
Sitecore.Context.Items["twitter:title"] = Model.Item["title"] | |
Sitecore.Context.Items["twitter:description"] = Model.Item["description"] | |
} | |
<h1>@Html.Sitecore().Field("title")</h1> | |
@Html.Sitecore().Field("text") |
NewerOlder