├── src
├── TcbInternetSolutions.Vulcan.Core
│ ├── releasenotes.txt
│ ├── readme.md
│ ├── IVulcanContentHit.cs
│ ├── VulcanIgnoreAttribute.cs
│ ├── IVulcanIndexer.cs
│ ├── VulcanSearchableAttribute.cs
│ ├── IVulcanSearchHitDescription.cs
│ ├── Internal
│ │ ├── IVulcanFeature.cs
│ │ ├── IVulcanFeatureCacheScope.cs
│ │ ├── IVulcanContentIndexerWithCacheClearing.cs
│ │ ├── VulcanFeatureCacheScope.cs
│ │ └── AppConfigurationHelper.cs
│ ├── IVulcanSearchable.cs
│ ├── IVulcanIndexingModifier.cs
│ ├── IVulcanMediaReader.cs
│ ├── IVulcanContentIndexer.cs
│ ├── IVulcanConnectionSettings.cs
│ ├── IVulcanConnectionPoolFactory.cs
│ ├── IVulcanModfiySerializerSettings.cs
│ ├── IVulcanConditionalContentIndexInstruction.cs
│ ├── IVulcanContentAncestorLoader.cs
│ ├── Extensions
│ │ ├── CultureExtensions.cs
│ │ ├── StringExtensions.cs
│ │ ├── QueryContainerExtensions.cs
│ │ ├── TypeExtensions.cs
│ │ ├── FieldExtensions.cs
│ │ ├── UserExtensions.cs
│ │ └── ContentAreaExtensions.cs
│ ├── Resources
│ │ └── LanguageFiles
│ │ │ └── Vulcan_en.xml
│ ├── Implementation
│ │ ├── DefaultVulcanBytesToStringConverter.cs
│ │ ├── VulcanSearchHit.cs
│ │ ├── VulcanSynonym.cs
│ │ ├── DefaultVulcanIndexContentJobSettings.cs
│ │ ├── DefaultVulcanModifySerializerSettings.cs
│ │ ├── VulcanCreateIndexCustomizer.cs
│ │ ├── VulcanConditionalContentIndexInstruction.cs
│ │ ├── VulcanIndexingModifierArgs.cs
│ │ ├── VulcanCmsContentAncestorLoader.cs
│ │ ├── VulcanConnectionPoolFactory.cs
│ │ ├── VulcanIndexClearJob.cs
│ │ ├── VulcanSearchContentLoader.cs
│ │ ├── VulcanContentHit.cs
│ │ ├── VulcanApplicationSettings.cs
│ │ ├── VulcanPipelineSelector.cs
│ │ ├── VulcanSearchHitList.cs
│ │ ├── VulcanCmsIndexer.cs
│ │ ├── VulcanMediaReader.cs
│ │ ├── Converters
│ │ │ └── ContentReferenceConverter.cs
│ │ ├── VulcanCmsIndexingModifier.cs
│ │ └── VulcanClientConnectionSettings.cs
│ ├── IVulcanByteToStringConverter.cs
│ ├── IVulcanPipelineInstaller.cs
│ ├── IVulcanIndexingModifierArgs.cs
│ ├── IVulcanPipeline.cs
│ ├── IVulcanPipelineSelector.cs
│ ├── IVulcanSearchContentLoader.cs
│ ├── IVulcanIndexContentJobSettings.cs
│ ├── Initialization
│ │ └── RegisterImplementations.cs
│ ├── IVulcanCreateIndexCustomizer.cs
│ ├── IVulcanApplicationSettings.cs
│ ├── IVulcanCustomizer.cs
│ ├── IVulcanPocoIndexer.cs
│ ├── IVulcanPocoIndexingJob.cs
│ ├── VulcanPocoIndexingJobBase.cs
│ ├── VulcanFieldConstants.cs
│ ├── TcbInternetSolutions.Vulcan.Core.csproj
│ ├── IVulcanClient.cs
│ └── IVulcanHandler.cs
├── TcbInternetSolutions.Vulcan.UI
│ ├── releasenotes.txt
│ ├── readme.md
│ ├── TcbInternetSolutions.Vulcan.UI
│ │ ├── module.config
│ │ ├── Views
│ │ │ ├── Shared
│ │ │ │ └── Layouts
│ │ │ │ │ └── _epi.cshtml
│ │ │ └── web.config
│ │ └── Scripts
│ │ │ └── DijitRegistry.js
│ ├── Controllers
│ │ ├── Base
│ │ │ └── BaseController.cs
│ │ ├── VulcanApiController.cs
│ │ └── HomeController.cs
│ ├── web.config.install.xdt
│ ├── web.config.uninstall.xdt
│ ├── Models
│ │ └── ViewModels
│ │ │ └── HomeViewModel.cs
│ ├── Support
│ │ ├── RegisterRoutes.cs
│ │ └── Helper.cs
│ └── TcbInternetSolutions.Vulcan.UI.csproj
├── TcbInternetSolutions.Vulcan.Commerce
│ ├── releasenotes.txt
│ ├── Initialization
│ │ └── RegisterImplementations.cs
│ ├── VulcanCommerceIndexer.cs
│ ├── VulcanFieldHelper.cs
│ ├── VulcanCommerceContentSynchronization.cs
│ ├── Extensions
│ │ └── PriceExtensions.cs
│ ├── VulcanCatalogSearchProvider.cs
│ ├── TcbInternetSolutions.Vulcan.Commerce.csproj
│ ├── VulcanPriceReindexTrigger.cs
│ └── VulcanCommerceContentAncestorLoader.cs
├── TcbInternetSolutions.Vulcan.AttachmentIndexer
│ ├── releasenotes.txt
│ ├── IVulcanAttachmentInspector.cs
│ ├── web.config.install.xdt
│ ├── IVulcanAttachmentIndexerSettings.cs
│ ├── Implementation
│ │ ├── VulcanAttachmentPipeline.cs
│ │ ├── VulcanAttachmentInspector.cs
│ │ ├── VulcanAttachmentIndexerSettings.cs
│ │ └── VulcanAttachmentPipelineInstaller.cs
│ ├── packages.config
│ ├── TcbInternetSolutions.Vulcan.AttachmentIndexer.csproj
│ ├── readme.md
│ └── VulcanAttachmentIndexModifier.cs
├── TcbInternetSolutions.Vulcan.Core.SearchProviders
│ ├── releasenotes.txt
│ ├── Extensions
│ │ └── SearchProviderExtensions.cs
│ ├── TcbInternetSolutions.Vulcan.Core.SearchProviders.csproj
│ ├── VulcanPageSearchProvider.cs
│ ├── VulcanBlockSearchProvider.cs
│ └── VulcanMediaSearchProvider.cs
├── TcbInternetSolutions.Vulcan.Commerce.GoogleProductFeed
│ ├── releasenotes.txt
│ ├── IGoogleProductFeedService.cs
│ ├── GoogleProductFeedDefault.cs
│ ├── GoogleProductFeedEntry.cs
│ ├── IGoogleProductFeed.cs
│ ├── GoogleProductFeedController.cs
│ ├── TcbInternetSolutions.Vulcan.Commerce.GoogleProductFeed.csproj
│ └── GoogleProductFeedService.cs
├── TcbInternetSolutions.Vulcan.Commerce.SearchProviders
│ ├── releasenotes.txt
│ └── TcbInternetSolutions.Vulcan.Commerce.SearchProviders.csproj
└── targets
│ ├── AddReleaseNotes.targets
│ ├── AddReadMeMarkdown.targets
│ ├── CommonBuild.props
│ └── ZipEpiserverModule.targets
├── appveyor.yml
├── .nuget
└── NuGet.Config
├── License.txt
├── README.md
├── .gitignore
└── TcbInternetSolutions.Vulcan.sln
/src/TcbInternetSolutions.Vulcan.Core/releasenotes.txt:
--------------------------------------------------------------------------------
1 | Support for Epi Commerce 13.
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.UI/releasenotes.txt:
--------------------------------------------------------------------------------
1 | Support for Epi Commerce 13.
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.Commerce/releasenotes.txt:
--------------------------------------------------------------------------------
1 | Support for Epi Commerce 13.
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.AttachmentIndexer/releasenotes.txt:
--------------------------------------------------------------------------------
1 | Support for Epi Commerce 13.
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.Core.SearchProviders/releasenotes.txt:
--------------------------------------------------------------------------------
1 | Support for Epi Commerce 13.
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.Commerce.GoogleProductFeed/releasenotes.txt:
--------------------------------------------------------------------------------
1 | Support for Epi Commerce 13.
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.Commerce.SearchProviders/releasenotes.txt:
--------------------------------------------------------------------------------
1 | Support for Epi Commerce 13.
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.UI/readme.md:
--------------------------------------------------------------------------------
1 | # TcbInternetSolutions.Vulcan.UI Read Me
2 |
3 | Adds Vulan section in Episerver UI.
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.Core/readme.md:
--------------------------------------------------------------------------------
1 | # TcbInternetSolutions.Vulcan.Core Read Me
2 |
3 | Supports net461+ and netstandard2.0+ Episerver projects.
--------------------------------------------------------------------------------
/appveyor.yml:
--------------------------------------------------------------------------------
1 | image: Visual Studio 2017
2 | configuration: Release
3 | platform: Any CPU
4 | before_build:
5 | - cmd: nuget restore
6 | build:
7 | verbosity: minimal
8 | after_test:
9 | - cmd: dotnet pack --output ..\..\
10 | artifacts:
11 | - path: '*.nupkg'
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.UI/TcbInternetSolutions.Vulcan.UI/module.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.Core/IVulcanContentHit.cs:
--------------------------------------------------------------------------------
1 | using EPiServer.Core;
2 |
3 | namespace TcbInternetSolutions.Vulcan.Core
4 | {
5 | ///
6 | /// Vulcan content hit
7 | ///
8 | public interface IVulcanContentHit : IContent { }
9 | }
10 |
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.Core/VulcanIgnoreAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace TcbInternetSolutions.Vulcan.Core
4 | {
5 | ///
6 | /// Allows property to be ignored by vulcan indexer
7 | ///
8 | [AttributeUsage(AttributeTargets.Property)]
9 | public class VulcanIgnoreAttribute : Attribute { }
10 | }
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.Core/IVulcanIndexer.cs:
--------------------------------------------------------------------------------
1 | namespace TcbInternetSolutions.Vulcan.Core
2 | {
3 | ///
4 | /// Vulcan indexer contract
5 | ///
6 | public interface IVulcanIndexer
7 | {
8 | ///
9 | /// Indexer name
10 | ///
11 | string IndexerName { get; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.Core/VulcanSearchableAttribute.cs:
--------------------------------------------------------------------------------
1 | namespace TcbInternetSolutions.Vulcan.Core
2 | {
3 | using System;
4 |
5 | ///
6 | /// Allows properties to be indexed in custom search field
7 | ///
8 | [AttributeUsage(AttributeTargets.Property)]
9 | public class VulcanSearchableAttribute : Attribute { }
10 | }
11 |
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.Core/IVulcanSearchHitDescription.cs:
--------------------------------------------------------------------------------
1 | namespace TcbInternetSolutions.Vulcan.Core
2 | {
3 | ///
4 | /// Search hit description
5 | ///
6 | public interface IVulcanSearchHitDescription
7 | {
8 | ///
9 | /// Search hit description
10 | ///
11 | string VulcanSearchDescription { get; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.Core/Internal/IVulcanFeature.cs:
--------------------------------------------------------------------------------
1 | namespace TcbInternetSolutions.Vulcan.Core.Internal
2 | {
3 | ///
4 | /// Feature flag to preview new functionality
5 | ///
6 | public interface IVulcanFeature
7 | {
8 | ///
9 | /// Determines if feature is enabled, mainly used around previewing new functionality
10 | ///
11 | bool Enabled { get; }
12 | }
13 | }
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.Core/IVulcanSearchable.cs:
--------------------------------------------------------------------------------
1 | namespace TcbInternetSolutions.Vulcan.Core
2 | {
3 | ///
4 | /// Used to determine if content is searchable on front-end searches
5 | ///
6 | public interface IVulcanSearchable
7 | {
8 | ///
9 | /// Used to determine if content is searchable on front-end searches
10 | ///
11 | bool IsSearchable { get; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.Core/Internal/IVulcanFeatureCacheScope.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace TcbInternetSolutions.Vulcan.Core.Internal
4 | {
5 | ///
6 | /// Feature flag for testing cache scoping
7 | ///
8 | public interface IVulcanFeatureCacheScope : IVulcanFeature
9 | {
10 | ///
11 | /// Scope cache duration
12 | ///
13 | TimeSpan CacheDuration { get; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/.nuget/NuGet.Config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.UI/Controllers/Base/BaseController.cs:
--------------------------------------------------------------------------------
1 | using System.Web.Mvc;
2 | using TcbInternetSolutions.Vulcan.Core;
3 |
4 | namespace TcbInternetSolutions.Vulcan.UI.Controllers.Base
5 | {
6 | public abstract class BaseController : Controller
7 | {
8 | protected BaseController(IVulcanHandler vulcanHandler)
9 | {
10 | VulcanHandler = vulcanHandler;
11 | }
12 |
13 | public IVulcanHandler VulcanHandler { get; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.Core/IVulcanIndexingModifier.cs:
--------------------------------------------------------------------------------
1 | namespace TcbInternetSolutions.Vulcan.Core
2 | {
3 | ///
4 | /// Index modifier
5 | ///
6 | public interface IVulcanIndexingModifier
7 | {
8 | ///
9 | /// Process modifier and flush customization to stream
10 | ///
11 | ///
12 | void ProcessContent(IVulcanIndexingModifierArgs modifierArgs);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.Core/IVulcanMediaReader.cs:
--------------------------------------------------------------------------------
1 | using EPiServer.Core;
2 |
3 | namespace TcbInternetSolutions.Vulcan.Core
4 | {
5 | ///
6 | /// Converts mediadata to byte array
7 | ///
8 | public interface IVulcanMediaReader
9 | {
10 | ///
11 | /// Converts given media data to byte array
12 | ///
13 | ///
14 | ///
15 | byte[] ReadToEnd(MediaData media);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.Core/IVulcanContentIndexer.cs:
--------------------------------------------------------------------------------
1 | namespace TcbInternetSolutions.Vulcan.Core
2 | {
3 | using EPiServer.Core;
4 | using System.Collections.Generic;
5 |
6 | ///
7 | /// Indexer for Episerver content
8 | ///
9 | public interface IVulcanContentIndexer : IVulcanIndexer
10 | {
11 | ///
12 | /// Root reference to index descendents
13 | ///
14 | ///
15 | KeyValuePair GetRoot();
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.Core/IVulcanConnectionSettings.cs:
--------------------------------------------------------------------------------
1 | using Nest;
2 |
3 | namespace TcbInternetSolutions.Vulcan.Core
4 | {
5 | ///
6 | /// Vulcan connection settings
7 | ///
8 | public interface IVulcanClientConnectionSettings
9 | {
10 | ///
11 | /// Index name
12 | ///
13 | string Index { get; }
14 |
15 | ///
16 | /// Connection settings
17 | ///
18 | ConnectionSettings ConnectionSettings { get; }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.Core/IVulcanConnectionPoolFactory.cs:
--------------------------------------------------------------------------------
1 | using Elasticsearch.Net;
2 |
3 | namespace TcbInternetSolutions.Vulcan.Core
4 | {
5 | ///
6 | /// Creates Elasticsearch connection pools
7 | ///
8 | public interface IVulcanConnectionPoolFactory
9 | {
10 | ///
11 | /// Create connection pool given url
12 | ///
13 | ///
14 | ///
15 | IConnectionPool CreateConnectionPool(string vulcanUrl);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.Core/IVulcanModfiySerializerSettings.cs:
--------------------------------------------------------------------------------
1 | using Nest;
2 | using Newtonsoft.Json;
3 |
4 | namespace TcbInternetSolutions.Vulcan.Core
5 | {
6 | ///
7 | /// Provides access to modify serialization settings
8 | ///
9 | public interface IVulcanModfiySerializerSettings
10 | {
11 | ///
12 | /// Modifier for serializer settings
13 | ///
14 | void Modifier(JsonSerializerSettings jsonSerializerSettings, IConnectionSettingsValues connectionSettingsValues);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.AttachmentIndexer/IVulcanAttachmentInspector.cs:
--------------------------------------------------------------------------------
1 | using EPiServer.Core;
2 |
3 | namespace TcbInternetSolutions.Vulcan.AttachmentIndexer
4 | {
5 | ///
6 | /// Determines if attachment can be indexed
7 | ///
8 | public interface IVulcanAttachmentInspector
9 | {
10 | ///
11 | /// Determines if given mediadata is indexable
12 | ///
13 | ///
14 | ///
15 | bool AllowIndexing(MediaData media);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.Core/IVulcanConditionalContentIndexInstruction.cs:
--------------------------------------------------------------------------------
1 | using EPiServer.Core;
2 |
3 | namespace TcbInternetSolutions.Vulcan.Core
4 | {
5 | ///
6 | /// Determines if content can be indexed
7 | ///
8 | public interface IVulcanConditionalContentIndexInstruction
9 | {
10 | ///
11 | /// Determines if content can be indexed
12 | ///
13 | ///
14 | ///
15 | bool AllowContentIndexing(IContent objectToIndex);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.Core/IVulcanContentAncestorLoader.cs:
--------------------------------------------------------------------------------
1 | using EPiServer.Core;
2 | using System.Collections.Generic;
3 |
4 | namespace TcbInternetSolutions.Vulcan.Core
5 | {
6 | ///
7 | /// Indexing modifier that supports ancestors
8 | ///
9 | public interface IVulcanContentAncestorLoader
10 | {
11 | ///
12 | /// Gets ancestors for given content
13 | ///
14 | ///
15 | ///
16 | IEnumerable GetAncestors(IContent content);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.AttachmentIndexer/web.config.install.xdt:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.Core/Extensions/CultureExtensions.cs:
--------------------------------------------------------------------------------
1 | using System.Globalization;
2 |
3 | namespace TcbInternetSolutions.Vulcan.Core.Extensions
4 | {
5 | ///
6 | /// Culture extensions
7 | ///
8 | public static class CultureExtensions
9 | {
10 | ///
11 | /// Gets name from cultureinfo
12 | ///
13 | ///
14 | ///
15 | public static string GetCultureName(this CultureInfo culture) => culture.Equals(CultureInfo.InvariantCulture) ? "invariant" : culture.Name;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.Core/Resources/LanguageFiles/Vulcan_en.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Vulcan Pages
8 |
9 |
10 | Vulcan Blocks
11 |
12 |
13 | Vulcan Files
14 |
15 |
16 | Vulcan Products
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.Core/Extensions/StringExtensions.cs:
--------------------------------------------------------------------------------
1 | namespace TcbInternetSolutions.Vulcan.Core.Extensions
2 | {
3 | ///
4 | /// Vulcan string extesions
5 | ///
6 | public static class StringExtensions
7 | {
8 | ///
9 | /// Escapes given string as valid JSON, important, this will add escaped quotes
10 | ///
11 | ///
12 | ///
13 | public static string JsonEscapeString(this string s)
14 | {
15 | return Newtonsoft.Json.JsonConvert.ToString(s);
16 | }
17 | }
18 | }
--------------------------------------------------------------------------------
/src/targets/AddReleaseNotes.targets:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | releasenotes.txt
5 | $([System.IO.File]::ReadAllText($(ReleaseNotesPath)))
6 | $(ReleaseNotes)
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.Core/Implementation/DefaultVulcanBytesToStringConverter.cs:
--------------------------------------------------------------------------------
1 | namespace TcbInternetSolutions.Vulcan.Core.Implementation
2 | {
3 | using EPiServer.ServiceLocation;
4 |
5 | ///
6 | /// Default implementation does nothing
7 | ///
8 | [ServiceConfiguration(typeof(IVulcanBytesToStringConverter), Lifecycle = ServiceInstanceScope.Singleton)]
9 | public class DefaultVulcanBytesToStringConverter : IVulcanBytesToStringConverter
10 | {
11 | string IVulcanBytesToStringConverter.ConvertToString(byte[] bytes, string mimeType)
12 | {
13 | return string.Empty;
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.Core/Internal/IVulcanContentIndexerWithCacheClearing.cs:
--------------------------------------------------------------------------------
1 | namespace TcbInternetSolutions.Vulcan.Core.Internal
2 | {
3 | ///
4 | /// Indexer that can clear cache, temporary until full migration of using cache scoping
5 | ///
6 | public interface IVulcanContentIndexerWithCacheClearing : IVulcanContentIndexer
7 | {
8 | ///
9 | /// Clear cache every X items
10 | ///
11 | int ClearCacheItemInterval { get; }
12 |
13 | ///
14 | /// Clears any cache - so keeping performance high
15 | ///
16 | void ClearCache();
17 | }
18 | }
--------------------------------------------------------------------------------
/src/targets/AddReadMeMarkdown.targets:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | false
5 |
6 |
7 |
10 |
11 |
12 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.Core/IVulcanByteToStringConverter.cs:
--------------------------------------------------------------------------------
1 | namespace TcbInternetSolutions.Vulcan.Core
2 | {
3 | ///
4 | /// Converts byte array to string, default implementation does nothing, to override use an IConfigurableModule with a ModuleDependency on ServiceConfiguration
5 | ///
6 | public interface IVulcanBytesToStringConverter
7 | {
8 | ///
9 | /// Converts bytes to string
10 | ///
11 | ///
12 | ///
13 | ///
14 | string ConvertToString(byte[] bytes, string mimeType);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.UI/web.config.install.xdt:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.UI/web.config.uninstall.xdt:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.Core/IVulcanPipelineInstaller.cs:
--------------------------------------------------------------------------------
1 | namespace TcbInternetSolutions.Vulcan.Core
2 | {
3 | ///
4 | /// Installs a pipeline on Epi initialization
5 | ///
6 | public interface IVulcanPipelineInstaller
7 | {
8 | ///
9 | /// Name/Id of pipeline, must match an IVulcanPipeline
10 | ///
11 | string Id { get; }
12 |
13 | ///
14 | /// Exectutes put pipeline and any other tasks needed, may throw exceptions if setup doesn't meet requirements
15 | ///
16 | ///
17 | ///
18 | void Install(IVulcanClient vulcanClient);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.Commerce.GoogleProductFeed/IGoogleProductFeedService.cs:
--------------------------------------------------------------------------------
1 | using EPiServer.Commerce.Catalog.ContentTypes;
2 | using System;
3 |
4 | namespace TcbInternetSolutions.Vulcan.Commerce.GoogleProductFeed
5 | {
6 | public interface IGoogleProductFeedService
7 | {
8 | IGoogleProductFeed CreateFeed(string urlSegment) where T : VariationContent;
9 |
10 | IGoogleProductFeed CreateFeed(string urlSegment) where TGoogleProductFeed : IGoogleProductFeed, new() where TVariationContent : VariationContent;
11 |
12 | IGoogleProductFeed GetFeed() where T : VariationContent;
13 |
14 | IGoogleProductFeed GetFeed(Type type);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.Commerce.GoogleProductFeed/GoogleProductFeedDefault.cs:
--------------------------------------------------------------------------------
1 | using EPiServer.Commerce.Catalog.ContentTypes;
2 | using EPiServer.Framework;
3 | using EPiServer.Framework.Initialization;
4 |
5 | namespace TcbInternetSolutions.Vulcan.Commerce.GoogleProductFeed
6 | {
7 | [InitializableModule]
8 | [ModuleDependency(typeof(EPiServer.Web.InitializationModule))]
9 | public class GoogleProductFeedDefault : IInitializableModule
10 | {
11 | public void Initialize(InitializationEngine context)
12 | {
13 | context.Locate.Advanced.GetInstance().CreateFeed("Default");
14 | }
15 |
16 | public void Uninitialize(InitializationEngine context)
17 | {
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.Core/IVulcanIndexingModifierArgs.cs:
--------------------------------------------------------------------------------
1 | using EPiServer.Core;
2 | using System.Collections.Generic;
3 |
4 | namespace TcbInternetSolutions.Vulcan.Core
5 | {
6 | ///
7 | /// Arguments used to modify indexing
8 | ///
9 | public interface IVulcanIndexingModifierArgs
10 | {
11 | ///
12 | /// Content Instance
13 | ///
14 | IContent Content { get; }
15 |
16 | ///
17 | /// Matched pipeline Id or null
18 | ///
19 | string PipelineId { get; }
20 |
21 | ///
22 | /// Additional items to serialize for item
23 | ///
24 | IDictionary AdditionalItems { get; }
25 | }
26 | }
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.Core/Implementation/VulcanSearchHit.cs:
--------------------------------------------------------------------------------
1 | namespace TcbInternetSolutions.Vulcan.Core.Implementation
2 | {
3 | ///
4 | /// Vulcan search hit
5 | ///
6 | public class VulcanSearchHit
7 | {
8 | ///
9 | /// Id
10 | ///
11 | public virtual object Id { get; set; }
12 |
13 | ///
14 | /// Summary
15 | ///
16 | public virtual string Summary { get; set; }
17 |
18 | ///
19 | /// Title
20 | ///
21 | public virtual string Title { get; set; }
22 |
23 | ///
24 | /// Url
25 | ///
26 | public virtual string Url { get; set; }
27 | }
28 | }
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.Core/Implementation/VulcanSynonym.cs:
--------------------------------------------------------------------------------
1 | namespace TcbInternetSolutions.Vulcan.Core.Implementation
2 | {
3 | ///
4 | /// Vulcan synonym
5 | ///
6 | public class VulcanSynonym
7 | {
8 | ///
9 | /// Language name
10 | ///
11 | public string Language { get; set; }
12 |
13 | ///
14 | /// Term
15 | ///
16 | public string Term { get; set; }
17 |
18 | ///
19 | /// Synonym list
20 | ///
21 | public string[] Synonyms { get; set; }
22 |
23 | ///
24 | /// Bi-directional
25 | ///
26 | public bool BiDirectional { get; set; }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.Core/Implementation/DefaultVulcanIndexContentJobSettings.cs:
--------------------------------------------------------------------------------
1 | using EPiServer.ServiceLocation;
2 |
3 | namespace TcbInternetSolutions.Vulcan.Core.Implementation
4 | {
5 | ///
6 | /// Default Index job settings
7 | ///
8 | [ServiceConfiguration(typeof(IVulcanIndexContentJobSettings), Lifecycle = ServiceInstanceScope.Singleton)]
9 | public class DefaultVulcanIndexContentJobSettings : IVulcanIndexContentJobSettings
10 | {
11 | bool IVulcanIndexContentJobSettings.EnableParallelIndexers => false;
12 |
13 | bool IVulcanIndexContentJobSettings.EnableParallelContent => false;
14 |
15 | bool IVulcanIndexContentJobSettings.EnableAlwaysUp => false;
16 |
17 | int IVulcanIndexContentJobSettings.ParallelDegree => 4;
18 | }
19 | }
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.Core/IVulcanPipeline.cs:
--------------------------------------------------------------------------------
1 | using EPiServer.Core;
2 |
3 | namespace TcbInternetSolutions.Vulcan.Core
4 | {
5 | ///
6 | /// Elastic Search Pipeline
7 | ///
8 | public interface IVulcanPipeline
9 | {
10 | ///
11 | /// Pipeline name, no spaces or special characters please
12 | ///
13 | string Id { get; }
14 |
15 | ///
16 | /// Sort to determine pipeline, highest wins
17 | ///
18 | int SortOrder { get; }
19 |
20 | ///
21 | /// Determines if content needs a pipeline
22 | ///
23 | ///
24 | ///
25 | bool IsMatch(IContent content);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.Core/Implementation/DefaultVulcanModifySerializerSettings.cs:
--------------------------------------------------------------------------------
1 | using EPiServer.ServiceLocation;
2 | using Nest;
3 | using Newtonsoft.Json;
4 |
5 | namespace TcbInternetSolutions.Vulcan.Core.Implementation
6 | {
7 | ///
8 | /// Enables EscapeHtml for string escaping
9 | ///
10 | [ServiceConfiguration(typeof(IVulcanModfiySerializerSettings), Lifecycle = ServiceInstanceScope.Singleton)]
11 | public class DefaultVulcanModifySerializerSettings : IVulcanModfiySerializerSettings
12 | {
13 |
14 | void IVulcanModfiySerializerSettings.Modifier(JsonSerializerSettings jsonSerializerSettings, IConnectionSettingsValues connectionSettingsValues)
15 | {
16 | jsonSerializerSettings.StringEscapeHandling = StringEscapeHandling.EscapeHtml;
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/targets/CommonBuild.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | $(APPVEYOR_BUILD_NUMBER)
5 | $(APPVEYOR_REPO_BRANCH)
6 | $(APPVEYOR_REPO_COMMIT)
7 |
8 |
9 | $(BUILD_BUILDNUMBER)
10 | $(BUILD_SOURCEVERSION)
11 | $(BUILD_SOURCEBRANCHNAME)
12 |
13 | $([System.DateTime]::Now.ToString(yyyy))
14 |
15 |
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.Core/IVulcanPipelineSelector.cs:
--------------------------------------------------------------------------------
1 | using EPiServer.Core;
2 |
3 | namespace TcbInternetSolutions.Vulcan.Core
4 | {
5 | ///
6 | /// Responsible for examining content to find a pipeline for indexing
7 | ///
8 | public interface IVulcanPipelineSelector
9 | {
10 | ///
11 | /// Returns a pipeline or null if a pipeline doesn't match the content
12 | ///
13 | ///
14 | ///
15 | IVulcanPipeline GetPipelineForContent(IContent content);
16 |
17 | ///
18 | /// Returns a pipeline for given ID, used during custom serialization
19 | ///
20 | ///
21 | ///
22 | IVulcanPipeline GetPipelineById(string id);
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.Core/IVulcanSearchContentLoader.cs:
--------------------------------------------------------------------------------
1 | using EPiServer.Core;
2 | using System.Collections.Generic;
3 |
4 | namespace TcbInternetSolutions.Vulcan.Core
5 | {
6 | ///
7 | /// Loads content for Vulcan scheduled job
8 | ///
9 | public interface IVulcanSearchContentLoader
10 | {
11 | ///
12 | /// Gets all ContentReference of items to index.
13 | ///
14 | ///
15 | ///
16 | IEnumerable GetSearchContentReferences(IVulcanContentIndexer contentIndexer);
17 |
18 | ///
19 | /// Loads content by given content reference.
20 | ///
21 | ///
22 | ///
23 | IContent GetContent(ContentReference contentLink);
24 | }
25 | }
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.Core/IVulcanIndexContentJobSettings.cs:
--------------------------------------------------------------------------------
1 | namespace TcbInternetSolutions.Vulcan.Core
2 | {
3 | ///
4 | /// Settings for the Indexing scheduled job
5 | ///
6 | public interface IVulcanIndexContentJobSettings
7 | {
8 | ///
9 | /// Parallel looping on indexers
10 | ///
11 | bool EnableParallelIndexers { get; }
12 |
13 | ///
14 | /// Parallel looping on content
15 | ///
16 | bool EnableParallelContent { get; }
17 |
18 | ///
19 | /// Always up on indexing
20 | ///
21 | bool EnableAlwaysUp { get; }
22 |
23 | ///
24 | /// How much parallel allowed? Defaults to 4, will likely be 4 threads. Set to -1 to allow to grab everything.
25 | ///
26 | int ParallelDegree { get; }
27 | }
28 | }
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.Commerce/Initialization/RegisterImplementations.cs:
--------------------------------------------------------------------------------
1 | using EPiServer.Framework;
2 | using EPiServer.Framework.Initialization;
3 | using EPiServer.ServiceLocation;
4 | using TcbInternetSolutions.Vulcan.Core;
5 |
6 | namespace TcbInternetSolutions.Vulcan.Commerce.Initialization
7 | {
8 | ///
9 | /// Registers implementations to DI container
10 | ///
11 | [ModuleDependency(typeof(Core.Initialization.RegisterImplementations))]
12 | public class RegisterImplementations : IConfigurableModule
13 | {
14 | void IConfigurableModule.ConfigureContainer(ServiceConfigurationContext context)
15 | {
16 | context.Services.AddSingleton();
17 | }
18 |
19 | void IInitializableModule.Initialize(InitializationEngine context) { }
20 |
21 | void IInitializableModule.Uninitialize(InitializationEngine context) { }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.Core/Initialization/RegisterImplementations.cs:
--------------------------------------------------------------------------------
1 | using EPiServer.Framework;
2 | using EPiServer.Framework.Initialization;
3 | using EPiServer.ServiceLocation;
4 |
5 | namespace TcbInternetSolutions.Vulcan.Core.Initialization
6 | {
7 | ///
8 | /// Registers implementations to DI container
9 | ///
10 | [ModuleDependency(typeof(ServiceContainerInitialization))]
11 | public class RegisterImplementations : IConfigurableModule
12 | {
13 | void IConfigurableModule.ConfigureContainer(ServiceConfigurationContext context)
14 | {
15 | // hack: using manual registration as scheduled job doesn't inject otherwise
16 | context.Services.AddSingleton();
17 | }
18 |
19 | void IInitializableModule.Initialize(InitializationEngine context) { }
20 |
21 | void IInitializableModule.Uninitialize(InitializationEngine context) { }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.Core/IVulcanCreateIndexCustomizer.cs:
--------------------------------------------------------------------------------
1 | namespace TcbInternetSolutions.Vulcan.Core
2 | {
3 | using Nest;
4 | using System;
5 |
6 | ///
7 | /// Used to customize
8 | ///
9 | public interface IVulcanCreateIndexCustomizer
10 | {
11 | ///
12 | /// Null by default, but can be used to setup shards, replicas, anaylzers, etc for the index.
13 | ///
14 | Func CustomizeIndex { get; }
15 |
16 | ///
17 | /// Trims not analyzed fields to avoid errors, should never be above 10922, default is 256
18 | /// See https://www.elastic.co/guide/en/elasticsearch/reference/current/ignore-above.html
19 | ///
20 | int IgnoreAbove { get; }
21 |
22 | ///
23 | /// Helps avoid all shards failed on first request.
24 | ///
25 | int WaitForActiveShards { get; }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.Core/Implementation/VulcanCreateIndexCustomizer.cs:
--------------------------------------------------------------------------------
1 | namespace TcbInternetSolutions.Vulcan.Core.Implementation
2 | {
3 | using EPiServer.ServiceLocation;
4 | using Nest;
5 | using System;
6 |
7 | ///
8 | /// Allows for customization of index creation
9 | ///
10 | [ServiceConfiguration(typeof(IVulcanCreateIndexCustomizer), Lifecycle = ServiceInstanceScope.Singleton)]
11 | public class VulcanCreateIndexCustomizer : IVulcanCreateIndexCustomizer
12 | {
13 | ///
14 | /// Customization of create index
15 | ///
16 | public virtual Func CustomizeIndex => null;
17 |
18 | ///
19 | /// Default ignore above for stored, not analyzed strings
20 | ///
21 | public virtual int IgnoreAbove => 256;
22 |
23 | ///
24 | /// Wait for active shards
25 | ///
26 | public virtual int WaitForActiveShards => 1;
27 | }
28 | }
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.Commerce/VulcanCommerceIndexer.cs:
--------------------------------------------------------------------------------
1 | using Mediachase.Commerce.Catalog;
2 | using Mediachase.Commerce.Engine.Caching;
3 | using System.Collections.Generic;
4 | using TcbInternetSolutions.Vulcan.Core.Internal;
5 |
6 | namespace TcbInternetSolutions.Vulcan.Commerce
7 | {
8 | public class VulcanCommerceIndexer : IVulcanContentIndexerWithCacheClearing
9 | {
10 | private readonly ReferenceConverter _referenceConverter;
11 |
12 | public VulcanCommerceIndexer(ReferenceConverter referenceConverter)
13 | {
14 | _referenceConverter = referenceConverter;
15 | }
16 |
17 | public int ClearCacheItemInterval => 100;
18 |
19 | public string IndexerName => "Commerce Content";
20 |
21 | public void ClearCache()
22 | {
23 | CacheHelper.Clear(string.Empty);
24 | }
25 |
26 | public KeyValuePair GetRoot() =>
27 | new KeyValuePair(_referenceConverter.GetRootLink(), "Commerce");
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.AttachmentIndexer/IVulcanAttachmentIndexerSettings.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace TcbInternetSolutions.Vulcan.AttachmentIndexer
4 | {
5 | ///
6 | /// Settings for vulcan attachment indexing
7 | ///
8 | public interface IVulcanAttachmentIndexerSettings
9 | {
10 | ///
11 | /// If true, the Elasticsearch server must have mapper-attachments (2.x) or ingest-attachments (5.x) installed
12 | ///
13 | bool EnableAttachmentPlugins { get; }
14 |
15 | ///
16 | /// Determines supported file extensions for indexing.
17 | ///
18 | IEnumerable SupportedFileExtensions { get; }
19 |
20 | ///
21 | /// Determines if file size limits are used to determine indexing
22 | ///
23 | bool EnableFileSizeLimit { get; }
24 |
25 | ///
26 | /// Determines max file size of media to index
27 | ///
28 | long FileSizeLimit { get; }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.Commerce.GoogleProductFeed/GoogleProductFeedEntry.cs:
--------------------------------------------------------------------------------
1 | namespace TcbInternetSolutions.Vulcan.Commerce.GoogleProductFeed
2 | {
3 | public class GoogleProductFeedEntry
4 | {
5 | public string Id { get; set; }
6 |
7 | public string Title { get; set; }
8 |
9 | public string Description { get; set; }
10 |
11 | public string Link { get; set; }
12 |
13 | public string ImageLink { get; set; }
14 |
15 | public string Availability { get; set; }
16 |
17 | public string Price { get; set; }
18 |
19 | public string GoogleProductCategory { get; set; }
20 |
21 | public string Brand { get; set; }
22 |
23 | public string GTIN { get; set; }
24 |
25 | public string MPN { get; set; }
26 |
27 | public bool IdentifierExists => !string.IsNullOrWhiteSpace(GTIN) || !string.IsNullOrWhiteSpace(MPN);
28 |
29 | public string Condition { get; set; }
30 |
31 | public string Adult { get; set; }
32 |
33 | public string Shipping { get; set; }
34 |
35 | public string Tax { get; set; }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/License.txt:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2006 Daniel Matthews
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.Core/IVulcanApplicationSettings.cs:
--------------------------------------------------------------------------------
1 | namespace TcbInternetSolutions.Vulcan.Core
2 | {
3 | ///
4 | /// Settings for Vulcan connections to Elastic Search
5 | ///
6 | public interface IVulcanApplicationSettings
7 | {
8 | ///
9 | /// Enables Http Compression
10 | ///
11 | bool EnableHttpCompression { get; }
12 |
13 | ///
14 | /// Vulcan Index prefix name
15 | ///
16 | string IndexNamePrefix { get; }
17 |
18 | ///
19 | /// Is debugging enabled
20 | ///
21 | bool IsDebugMode { get; }
22 |
23 | ///
24 | /// Vulcan password form connecting to Elasticsearch
25 | ///
26 | string Password { get; }
27 |
28 | ///
29 | /// URL to Elasticsearch instance
30 | ///
31 | string Url { get; }
32 |
33 | ///
34 | /// Username to connect to Elasticsearch
35 | ///
36 | string Username { get; }
37 | }
38 | }
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.UI/Models/ViewModels/HomeViewModel.cs:
--------------------------------------------------------------------------------
1 | using Nest;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using TcbInternetSolutions.Vulcan.Core;
6 |
7 | namespace TcbInternetSolutions.Vulcan.UI.Models.ViewModels
8 | {
9 | public class HomeViewModel
10 | {
11 | public Dictionary>> ClientViewInfo { get; set; }
12 |
13 | public List IndexHealthDescriptor { get; set; } = new List();
14 |
15 | public IEnumerable PocoIndexers { get; set; }
16 |
17 | public IEnumerable VulcanClients { get; set; }
18 |
19 | public IVulcanHandler VulcanHandler { get; set; }
20 |
21 | public IEnumerable VulcanIndexModifiers { get; set; }
22 |
23 | public bool HasClients => VulcanClients?.Any() == true;
24 |
25 | public bool HasIndexModifiers => VulcanIndexModifiers?.Any() == true;
26 |
27 | public bool HasPocoIndexers => PocoIndexers?.Any() == true;
28 |
29 | public string ProtectedUiPath { get; set; }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.Core/Internal/VulcanFeatureCacheScope.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using EPiServer.ServiceLocation;
3 |
4 | namespace TcbInternetSolutions.Vulcan.Core.Internal
5 | {
6 | ///
7 | /// Default Cachescope preview functionality
8 | ///
9 | [ServiceConfiguration(typeof(IVulcanFeature), Lifecycle = ServiceInstanceScope.Singleton)]
10 | public class VulcanFeatureCacheScope : IVulcanFeatureCacheScope
11 | {
12 | ///
13 | /// Constructor
14 | ///
15 | public VulcanFeatureCacheScope()
16 | {
17 | Enabled = AppConfigurationHelper.TryGetBoolFromKey
18 | (
19 | key: nameof(VulcanFeatureCacheScope),
20 | defaultValue: false
21 | );
22 | }
23 |
24 | ///
25 | /// Default is disabled
26 | ///
27 | public virtual bool Enabled { get; }
28 |
29 | ///
30 | /// Default cache duration is 10 seconds
31 | ///
32 | public virtual TimeSpan CacheDuration { get; } = TimeSpan.FromSeconds(value: 10);
33 | }
34 | }
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.Core/IVulcanCustomizer.cs:
--------------------------------------------------------------------------------
1 | namespace TcbInternetSolutions.Vulcan.Core
2 | {
3 | using Nest;
4 | using System;
5 |
6 | ///
7 | /// Used to customize mappings and analyzers for Vulcan clients, any class that inherits must have an empty public constructor!
8 | ///
9 | public interface IVulcanCustomizer
10 | {
11 | ///
12 | /// Used to add custom mappings
13 | ///
14 | Func CustomMapper { get; }
15 |
16 | ///
17 | /// Used to create custom analyzers such as EdgeNGram for autocomplete.
18 | ///
19 | Func CustomIndexUpdater { get; }
20 |
21 | ///
22 | /// Used to create custom index templates for indexes. To override field mappings effectively set the order > 0.
23 | /// Also please note back-end UI searches required an 'analyzed' multi-field, so be mindful of custom property mapping.
24 | ///
25 | Func CustomIndexTemplate { get; }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.Core/Implementation/VulcanConditionalContentIndexInstruction.cs:
--------------------------------------------------------------------------------
1 | using EPiServer.Core;
2 | using System;
3 |
4 | namespace TcbInternetSolutions.Vulcan.Core.Implementation
5 | {
6 | ///
7 | /// Determines if content can be indexed
8 | ///
9 | ///
10 | public class VulcanConditionalContentIndexInstruction : IVulcanConditionalContentIndexInstruction where T : IContent
11 | {
12 | ///
13 | /// Func to determine indexing
14 | ///
15 | public Func Condition { get; }
16 |
17 | ///
18 | /// Constructor
19 | ///
20 | ///
21 | public VulcanConditionalContentIndexInstruction(Func condition)
22 | {
23 | Condition = condition;
24 | }
25 |
26 | ///
27 | /// Determines if content can be indexed
28 | ///
29 | ///
30 | ///
31 | public bool AllowContentIndexing(IContent objectToIndex)
32 | {
33 | return Condition?.Invoke((T)objectToIndex) ?? true;
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.Commerce/VulcanFieldHelper.cs:
--------------------------------------------------------------------------------
1 | using Mediachase.Commerce;
2 | using TcbInternetSolutions.Vulcan.Core.Implementation;
3 |
4 | namespace TcbInternetSolutions.Vulcan.Commerce
5 | {
6 | public static class VulcanFieldHelper
7 | {
8 | public static string GetPriceField(string marketId = null, string currencyCode = null) => GetPriceField("prices", marketId, currencyCode);
9 |
10 | public static string GetPriceLowField(string marketId = null, string currencyCode = null) => GetPriceField("pricesLow", marketId, currencyCode);
11 |
12 | public static string GetPriceHighField(string marketId = null, string currencyCode = null) => GetPriceField("pricesHigh", marketId, currencyCode);
13 |
14 | private static string GetPriceField(string propertyName, string marketId, string currencyCode, ICurrentMarket currentMarket = null)
15 | {
16 | currentMarket = currentMarket ?? VulcanHelper.GetService();
17 | if (marketId == null) marketId = currentMarket.GetCurrentMarket().MarketId.Value;
18 | if (currencyCode == null) currencyCode = currentMarket.GetCurrentMarket().DefaultCurrency.CurrencyCode;
19 |
20 | return "__" + propertyName + "." + marketId + "_" + currencyCode;
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.Core/Implementation/VulcanIndexingModifierArgs.cs:
--------------------------------------------------------------------------------
1 | namespace TcbInternetSolutions.Vulcan.Core.Implementation
2 | {
3 | using System.Collections.Generic;
4 | using EPiServer.Core;
5 |
6 | ///
7 | /// Arguments used to modify indexing
8 | ///
9 | public class VulcanIndexingModifierArgs : IVulcanIndexingModifierArgs
10 | {
11 | ///
12 | /// Constructor
13 | ///
14 | ///
15 | ///
16 | public VulcanIndexingModifierArgs(IContent content, string pipelineId)
17 | {
18 | Content = content;
19 | PipelineId = pipelineId;
20 | AdditionalItems = new Dictionary();
21 | }
22 |
23 | ///
24 | /// Content Instance
25 | ///
26 | public IContent Content { get; }
27 |
28 | ///
29 | /// Matched pipeline Id or null
30 | ///
31 | public string PipelineId { get; }
32 |
33 | ///
34 | /// Additional serialization items
35 | ///
36 | public IDictionary AdditionalItems { get; }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/TcbInternetSolutions.Vulcan.Core/IVulcanPocoIndexer.cs:
--------------------------------------------------------------------------------
1 | namespace TcbInternetSolutions.Vulcan.Core
2 | {
3 | using System.Collections.Generic;
4 |
5 | ///
6 | /// Vulcan POCO indexer
7 | ///
8 | public interface IVulcanPocoIndexer : IVulcanIndexer
9 | {
10 | ///
11 | /// Total items to index
12 | ///
13 | long TotalItems { get; }
14 |
15 | ///
16 | /// Determines number of items to index at a time.
17 | ///
18 | int PageSize { get; }
19 |
20 | ///
21 | /// Gets a list of items given page and pagesize.
22 | ///
23 | ///
24 | ///
25 | ///
26 | IEnumerable