generated from Kentico/repo-template
-
Notifications
You must be signed in to change notification settings - Fork 3
/
IncludedPathAttribute.cs
54 lines (47 loc) · 1.68 KB
/
IncludedPathAttribute.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
using System;
namespace Kentico.Xperience.Algolia.Attributes
{
/// <summary>
/// A class attribute applied to an Algolia search model indicating that the specified path, page
/// type(s), and cultures are included in the index.
/// </summary>
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
public sealed class IncludedPathAttribute : Attribute
{
/// <summary>
/// The node alias pattern that will be used to match pages in the content tree for indexing.
/// </summary>
/// <remarks>For example, "/Blogs/Products/%" will index all pages under the "Products" page.</remarks>
public string AliasPath
{
get;
}
/// <summary>
/// A list of page types under the specified <see cref="AliasPath"/> that will be indexed.
/// If empty, all page types are indexed.
/// </summary>
public string[] PageTypes
{
get;
set;
} = Array.Empty<string>();
/// <summary>
/// A list of the page culture versions to include in the index. If empty, all culture versions
/// are indexed.
/// </summary>
public string[] Cultures
{
get;
set;
} = Array.Empty<string>();
/// <summary>
/// Initializes a new instance of the <see cref="IncludedPathAttribute"/> class.
/// </summary>
/// <param name="aliasPath">The node alias pattern that will be used to match pages in the content tree
/// for indexing.</param>
public IncludedPathAttribute(string aliasPath)
{
AliasPath = aliasPath;
}
}
}