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; |
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; |
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); |
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 = ..., |
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 = ..., |
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) |
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> |
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" |
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; |
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