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 class TextTokenFragment(string textToken) : IStringFragment, IReferenceMap | |
{ | |
public static readonly Guid ClassId = new("B50376E7-7850-4FEC-8211-CA603A43B907"); | |
public static readonly string Class = "text-token"; | |
public static readonly string TextTokenAttributeName = "data-text-token"; | |
public string TextToken { get; } = textToken.Trim('"'); | |
public string ReplaceText { get; set; } |
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 class TextTokenFragmentElementHandler : IFragmentElementHandler | |
{ | |
public bool ParseElement(FragmentParserContext context, ElementFragment element) | |
{ | |
if (element is { HasAttributes: true, Token: ElementToken.Span } && FragmentHandlerHelper.ContainsClassId(element, TextTokenFragment.ClassId)) | |
{ | |
var textTokenAttribute = element.Attributes[TextTokenFragment.TextTokenAttributeName]; | |
var token = new TextTokenFragment(textTokenAttribute.UnquotedValue); | |
context.FlushBufferedHtml(); | |
context.ResultFragments.Add(token); |
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 class CleaningContentSerializer : IContentApiSerializer | |
{ | |
public CleaningContentSerializer(IContentApiSerializer defaultSerializer) | |
{ | |
DefaultSerializer = defaultSerializer; | |
} | |
public string MediaType => DefaultSerializer.MediaType; | |
public Encoding Encoding => DefaultSerializer.Encoding; | |
private IContentApiSerializer DefaultSerializer { get; } | |
public string Serialize(object value) |
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
/** interface for ContentLanguage coming from episerver content delivery api */ | |
export interface ContentLanguage { | |
/** the link to the this langauge version of the current content */ | |
link: string; | |
/** the localized displayName for the language */ | |
displayName: string; | |
/** the ISO name for the language */ | |
name: string; | |
} |
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 class ContentTypeCodeGenerator | |
{ | |
private static readonly IDictionary<Type, Func<Type, PropertyInfo, string>> TypeMappings = CreateTypeMapping(); | |
private static readonly IEnumerable<string> KeyWords = new[] { "Url" }; | |
public ContentTypeCodeGenerator(string filePath) | |
{ | |
FilePath = filePath ?? throw new ArgumentNullException(nameof(filePath)); | |
} | |
private ILogger Logger { get; } = Log.ForContext<ContentTypeCodeGenerator>(); | |
public string FilePath { get; } |
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 class AbContentAreaPropertyModel : ContentAreaPropertyModel | |
{ | |
private readonly Injected<IDisplayOptionService> _injectedDisplayOptionService; | |
public AbContentAreaPropertyModel(EPiServer.SpecializedProperties.PropertyContentArea propertyContentArea, bool excludePersonalizedContent) : base(propertyContentArea, excludePersonalizedContent) | |
{ | |
} | |
public AbContentAreaPropertyModel(EPiServer.SpecializedProperties.PropertyContentArea propertyContentArea, bool excludePersonalizedContent, EPiServer.ContentApi.Core.ContentLoaderService contentLoaderService, EPiServer.ContentApi.Core.Serialization.IContentModelMapper contentModelMapper, EPiServer.Security.IContentAccessEvaluator accessEvaluator, EPiServer.ContentApi.Core.Security.ISecurityPrincipal principalAccessor) : base(propertyContentArea, excludePersonalizedContent, contentLoaderService, contentModelMapper, accessEvaluator, principalAccessor) | |
{ | |
} | |
public AbContentAreaPropertyModel(EPiServer.SpecializedProperties.PropertyContentAr |
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
[ModuleDependency(typeof(ContentApiCmsInitialization))] | |
public class ContentDeliveryApiInitialization : IConfigurableModule | |
{ | |
public void ConfigureContainer(ServiceConfigurationContext context) | |
{ | |
context.Services.Configure<ContentApiConfiguration>(config => | |
{ | |
config.Default() | |
.SetMinimumRoles(string.Empty) | |
.SetFlattenPropertyModel(true) |