|
1 | 1 | using System;
|
2 | 2 | using System.Collections.Generic;
|
3 | 3 | using System.Linq;
|
| 4 | +using System.Runtime.Serialization; |
4 | 5 | using SmartStore.Core.Domain.Localization;
|
| 6 | +using SmartStore.Core.Domain.Security; |
5 | 7 | using SmartStore.Core.Domain.Seo;
|
6 | 8 | using SmartStore.Core.Domain.Stores;
|
7 | 9 |
|
8 | 10 | namespace SmartStore.Core.Domain.Topics
|
9 | 11 | {
|
10 |
| - /// <summary> |
11 |
| - /// Represents a topic |
12 |
| - /// </summary> |
13 |
| - public partial class Topic : BaseEntity, ILocalizedEntity, ISlugSupported, IStoreMappingSupported |
| 12 | + /// <summary> |
| 13 | + /// Represents a topic |
| 14 | + /// </summary> |
| 15 | + [DataContract] |
| 16 | + public partial class Topic : BaseEntity, ILocalizedEntity, ISlugSupported, IStoreMappingSupported, IAclSupported |
14 | 17 | {
|
15 |
| - /// <summary> |
16 |
| - /// Gets or sets the name |
17 |
| - /// </summary> |
18 |
| - public string SystemName { get; set; } |
19 |
| - |
20 |
| - /// <summary> |
21 |
| - /// Gets or sets the value indicating whether this topic is deleteable by a user |
22 |
| - /// </summary> |
23 |
| - public bool IsSystemTopic { get; set; } |
24 |
| - |
25 |
| - /// <summary> |
26 |
| - /// Gets or sets the value indicating whether this topic should be included in sitemap |
27 |
| - /// </summary> |
28 |
| - public bool IncludeInSitemap { get; set; } |
29 |
| - |
30 |
| - /// <summary> |
31 |
| - /// Gets or sets the value indicating whether this topic is password protected |
32 |
| - /// </summary> |
33 |
| - public bool IsPasswordProtected { get; set; } |
34 |
| - |
35 |
| - /// <summary> |
36 |
| - /// Gets or sets the password |
37 |
| - /// </summary> |
38 |
| - public string Password { get; set; } |
39 |
| - |
40 |
| - /// <summary> |
41 |
| - /// Gets or sets the title |
42 |
| - /// </summary> |
43 |
| - public string Title { get; set; } |
44 |
| - |
45 |
| - /// <summary> |
46 |
| - /// Gets or sets the body |
47 |
| - /// </summary> |
48 |
| - public string Body { get; set; } |
49 |
| - |
50 |
| - /// <summary> |
51 |
| - /// Gets or sets the meta keywords |
52 |
| - /// </summary> |
53 |
| - public string MetaKeywords { get; set; } |
54 |
| - |
55 |
| - /// <summary> |
56 |
| - /// Gets or sets the meta description |
57 |
| - /// </summary> |
58 |
| - public string MetaDescription { get; set; } |
59 |
| - |
60 |
| - /// <summary> |
61 |
| - /// Gets or sets the meta title |
62 |
| - /// </summary> |
63 |
| - public string MetaTitle { get; set; } |
| 18 | + public Topic() |
| 19 | + { |
| 20 | + IsPublished = true; |
| 21 | + } |
| 22 | + |
| 23 | + /// <summary> |
| 24 | + /// Gets or sets the name |
| 25 | + /// </summary> |
| 26 | + [DataMember] |
| 27 | + public string SystemName { get; set; } |
| 28 | + |
| 29 | + /// <summary> |
| 30 | + /// Gets or sets the value indicating whether this topic is deleteable by a user |
| 31 | + /// </summary> |
| 32 | + [DataMember] |
| 33 | + public bool IsSystemTopic { get; set; } |
| 34 | + |
| 35 | + /// <summary> |
| 36 | + /// Gets or sets the value indicating whether this topic should be included in sitemap |
| 37 | + /// </summary> |
| 38 | + [DataMember] |
| 39 | + public bool IncludeInSitemap { get; set; } |
| 40 | + |
| 41 | + /// <summary> |
| 42 | + /// Gets or sets the value indicating whether this topic is password protected |
| 43 | + /// </summary> |
| 44 | + [DataMember] |
| 45 | + public bool IsPasswordProtected { get; set; } |
| 46 | + |
| 47 | + /// <summary> |
| 48 | + /// Gets or sets the password |
| 49 | + /// </summary> |
| 50 | + [DataMember] |
| 51 | + public string Password { get; set; } |
| 52 | + |
| 53 | + /// <summary> |
| 54 | + /// Gets or sets the title |
| 55 | + /// </summary> |
| 56 | + [DataMember] |
| 57 | + public string Title { get; set; } |
| 58 | + |
| 59 | + /// <summary> |
| 60 | + /// Gets or sets the short title (for links) |
| 61 | + /// </summary> |
| 62 | + [DataMember] |
| 63 | + public string ShortTitle { get; set; } |
| 64 | + |
| 65 | + /// <summary> |
| 66 | + /// Gets or sets the intro |
| 67 | + /// </summary> |
| 68 | + [DataMember] |
| 69 | + public string Intro { get; set; } |
| 70 | + |
| 71 | + /// <summary> |
| 72 | + /// Gets or sets the body |
| 73 | + /// </summary> |
| 74 | + [DataMember] |
| 75 | + public string Body { get; set; } |
| 76 | + |
| 77 | + /// <summary> |
| 78 | + /// Gets or sets the meta keywords |
| 79 | + /// </summary> |
| 80 | + [DataMember] |
| 81 | + public string MetaKeywords { get; set; } |
| 82 | + |
| 83 | + /// <summary> |
| 84 | + /// Gets or sets the meta description |
| 85 | + /// </summary> |
| 86 | + [DataMember] |
| 87 | + public string MetaDescription { get; set; } |
| 88 | + |
| 89 | + /// <summary> |
| 90 | + /// Gets or sets the meta title |
| 91 | + /// </summary> |
| 92 | + [DataMember] |
| 93 | + public string MetaTitle { get; set; } |
64 | 94 |
|
65 | 95 | /// <summary>
|
66 | 96 | /// Gets or sets a value indicating whether the entity is limited/restricted to certain stores
|
67 | 97 | /// </summary>
|
| 98 | + [DataMember] |
68 | 99 | public bool LimitedToStores { get; set; }
|
69 | 100 |
|
70 |
| - /// <summary> |
71 |
| - /// Gets or sets a value indicating whether the topic should also be rendered as a generic html widget |
72 |
| - /// </summary> |
73 |
| - public bool RenderAsWidget { get; set; } |
| 101 | + /// <summary> |
| 102 | + /// Gets or sets a value indicating whether the topic should also be rendered as a generic html widget |
| 103 | + /// </summary> |
| 104 | + [DataMember] |
| 105 | + public bool RenderAsWidget { get; set; } |
74 | 106 |
|
75 |
| - /// <summary> |
76 |
| - /// Gets or sets the widget zone name |
77 |
| - /// </summary> |
78 |
| - public string WidgetZone { get; set; } |
| 107 | + /// <summary> |
| 108 | + /// Gets or sets the widget zone name |
| 109 | + /// </summary> |
| 110 | + [DataMember] |
| 111 | + public string WidgetZone { get; set; } |
79 | 112 |
|
80 | 113 | /// <summary>
|
81 | 114 | /// Gets or sets a value indicating whether the content should be surrounded by a topic block wrapper
|
82 | 115 | /// </summary>
|
| 116 | + [DataMember] |
83 | 117 | public bool? WidgetWrapContent { get; set; }
|
84 | 118 |
|
85 |
| - /// <summary> |
86 |
| - /// Gets or sets a value indicating whether the title should be displayed in the widget block |
87 |
| - /// </summary> |
88 |
| - public bool WidgetShowTitle { get; set; } |
89 |
| - |
90 |
| - /// <summary> |
91 |
| - /// Gets or sets a value indicating whether the widget block should have borders |
92 |
| - /// </summary> |
93 |
| - public bool WidgetBordered { get; set; } |
94 |
| - |
95 |
| - /// <summary> |
96 |
| - /// Gets or sets the sort order (relevant for widgets) |
97 |
| - /// </summary> |
98 |
| - public int Priority { get; set; } |
99 |
| - |
100 |
| - /// <summary> |
101 |
| - /// Gets or sets the title tag |
102 |
| - /// </summary> |
103 |
| - public string TitleTag { get; set; } |
104 |
| - |
105 |
| - /// <summary> |
106 |
| - /// Helper function which gets the comma-separated <c>WidgetZone</c> property as list of strings |
107 |
| - /// </summary> |
108 |
| - /// <returns></returns> |
109 |
| - public IEnumerable<string> GetWidgetZones() |
| 119 | + /// <summary> |
| 120 | + /// Gets or sets a value indicating whether the title should be displayed in the widget block |
| 121 | + /// </summary> |
| 122 | + [DataMember] |
| 123 | + public bool WidgetShowTitle { get; set; } |
| 124 | + |
| 125 | + /// <summary> |
| 126 | + /// Gets or sets a value indicating whether the widget block should have borders |
| 127 | + /// </summary> |
| 128 | + [DataMember] |
| 129 | + public bool WidgetBordered { get; set; } |
| 130 | + |
| 131 | + /// <summary> |
| 132 | + /// Gets or sets the sort order (relevant for widgets) |
| 133 | + /// </summary> |
| 134 | + [DataMember] |
| 135 | + public int Priority { get; set; } |
| 136 | + |
| 137 | + /// <summary> |
| 138 | + /// Gets or sets the title tag |
| 139 | + /// </summary> |
| 140 | + [DataMember] |
| 141 | + public string TitleTag { get; set; } |
| 142 | + |
| 143 | + /// <summary> |
| 144 | + /// Gets or sets a value indicating whether the entity is subject to ACL |
| 145 | + /// </summary> |
| 146 | + [DataMember] |
| 147 | + public bool SubjectToAcl { get; set; } |
| 148 | + |
| 149 | + /// <summary> |
| 150 | + /// Gets or sets a value indicating whether the topic page is published |
| 151 | + /// </summary> |
| 152 | + [DataMember] |
| 153 | + public bool IsPublished { get; set; } |
| 154 | + |
| 155 | + /// <summary> |
| 156 | + /// Helper function which gets the comma-separated <c>WidgetZone</c> property as list of strings |
| 157 | + /// </summary> |
| 158 | + /// <returns></returns> |
| 159 | + public IEnumerable<string> GetWidgetZones() |
110 | 160 | {
|
111 | 161 | if (this.WidgetZone.IsEmpty())
|
112 | 162 | {
|
|
0 commit comments