forked from siteserver/cms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNodeInfo.cs
More file actions
260 lines (222 loc) · 9.29 KB
/
NodeInfo.cs
File metadata and controls
260 lines (222 loc) · 9.29 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
using System;
using System.Collections;
using SiteServer.CMS.Model.Enumerations;
namespace SiteServer.CMS.Model
{
public class NodeAttribute
{
protected NodeAttribute()
{
}
public const string NodeId = "NodeID";
public const string NodeName = "NodeName";
public const string NodeType = "NodeType";
public const string PublishmentSystemId = "PublishmentSystemID";
public const string ContentModelId = "ContentModelID";
public const string ParentId = "ParentID";
public const string ParentsPath = "ParentsPath";
public const string ParentsCount = "ParentsCount";
public const string ChildrenCount = "ChildrenCount";
public const string IsLastNode = "IsLastNode";
public const string NodeIndexName = "NodeIndexName";
public const string NodeGroupNameCollection = "NodeGroupNameCollection";
public const string Taxis = "Taxis";
public const string AddDate = "AddDate";
public const string ImageUrl = "ImageUrl";
public const string Content = "Content";
public const string ContentNum = "ContentNum";
public const string FilePath = "FilePath";
public const string ChannelFilePathRule = "ChannelFilePathRule";
public const string ContentFilePathRule = "ContentFilePathRule";
public const string LinkUrl = "LinkUrl";
public const string LinkType = "LinkType";
public const string ChannelTemplateId = "ChannelTemplateID";
public const string ContentTemplateId = "ContentTemplateID";
public const string Keywords = "Keywords";
public const string Description = "Description";
public const string ExtendValues = "ExtendValues";
public static string Id = "ID";
public static string Title = "Title";
public static string ChannelName = "ChannelName";
public static string ChannelIndex = "ChannelIndex";
public static string ChannelGroupNameCollection = "ChannelGroupNameCollection";
public const string PageContent = "PageContent";
public const string CountOfChannels = "CountOfChannels";
public const string CountOfContents = "CountOfContents";
public const string CountOfImageContents = "CountOfImageContents";
private static ArrayList _lowerDefaultAttributes;
public static ArrayList LowerDefaultAttributes
{
get
{
if (_lowerDefaultAttributes != null) return _lowerDefaultAttributes;
_lowerDefaultAttributes = new ArrayList
{
NodeId.ToLower(),
NodeName.ToLower(),
NodeType.ToLower(),
PublishmentSystemId.ToLower(),
ParentId.ToLower(),
ParentsPath.ToLower(),
ParentsCount.ToLower(),
ChildrenCount.ToLower(),
IsLastNode.ToLower(),
NodeIndexName.ToLower(),
NodeGroupNameCollection.ToLower(),
Taxis.ToLower(),
AddDate.ToLower(),
ImageUrl.ToLower(),
Content.ToLower(),
ContentNum.ToLower(),
FilePath.ToLower(),
ChannelFilePathRule.ToLower(),
ContentFilePathRule.ToLower(),
LinkUrl.ToLower(),
LinkType.ToLower(),
ChannelTemplateId.ToLower(),
ContentTemplateId.ToLower(),
ExtendValues.ToLower()
};
return _lowerDefaultAttributes;
}
}
}
public class NodeInfo
{
private string _contentModelId;
private string _extendValues;
public NodeInfo()
{
NodeId = 0;
NodeName = string.Empty;
NodeType = ENodeType.BackgroundNormalNode;
PublishmentSystemId = 0;
_contentModelId = EContentModelTypeUtils.GetValue(EContentModelType.Content);
ParentId = 0;
ParentsPath = string.Empty;
ParentsCount = 0;
ChildrenCount = 0;
IsLastNode = false;
NodeIndexName = string.Empty;
NodeGroupNameCollection = string.Empty;
Taxis = 0;
AddDate = DateTime.Now;
ImageUrl = string.Empty;
Content = string.Empty;
ContentNum = 0;
FilePath = string.Empty;
ChannelFilePathRule = string.Empty;
ContentFilePathRule = string.Empty;
LinkUrl = string.Empty;
LinkType = ELinkType.LinkNoRelatedToChannelAndContent;
ChannelTemplateId = 0;
ContentTemplateId = 0;
Keywords = string.Empty;
Description = string.Empty;
_extendValues = string.Empty;
}
public NodeInfo(int nodeId, string nodeName, ENodeType nodeType, int publishmentSystemId, string contentModelId, int parentId, string parentsPath, int parentsCount, int childrenCount, bool isLastNode, string nodeIndexName, string nodeGroupNameCollection, int taxis, DateTime addDate, string imageUrl, string content, int contentNum, string filePath, string channelFilePathRule, string contentFilePathRule, string linkUrl, ELinkType linkType, int channelTemplateId, int contentTemplateId, string keywords, string description, string extendValues)
{
NodeId = nodeId;
NodeName = nodeName;
NodeType = nodeType;
PublishmentSystemId = publishmentSystemId;
_contentModelId = contentModelId;
ParentId = parentId;
ParentsPath = parentsPath;
ParentsCount = parentsCount;
ChildrenCount = childrenCount;
IsLastNode = isLastNode;
NodeIndexName = nodeIndexName;
NodeGroupNameCollection = nodeGroupNameCollection;
Taxis = taxis;
AddDate = addDate;
ImageUrl = imageUrl;
Content = content;
ContentNum = contentNum;
FilePath = filePath;
ChannelFilePathRule = channelFilePathRule;
ContentFilePathRule = contentFilePathRule;
LinkUrl = linkUrl;
LinkType = linkType;
ChannelTemplateId = channelTemplateId;
ContentTemplateId = contentTemplateId;
Keywords = keywords;
Description = description;
_extendValues = extendValues;
}
public NodeInfo(NodeInfo nodeInfo)
{
NodeId = nodeInfo.NodeId;
NodeName = nodeInfo.NodeName;
NodeType = nodeInfo.NodeType;
PublishmentSystemId = nodeInfo.PublishmentSystemId;
_contentModelId = nodeInfo._contentModelId;
ParentId = nodeInfo.ParentId;
ParentsPath = nodeInfo.ParentsPath;
ParentsCount = nodeInfo.ParentsCount;
ChildrenCount = nodeInfo.ChildrenCount;
IsLastNode = nodeInfo.IsLastNode;
NodeIndexName = nodeInfo.NodeIndexName;
NodeGroupNameCollection = nodeInfo.NodeGroupNameCollection;
Taxis = nodeInfo.Taxis;
AddDate = nodeInfo.AddDate;
ImageUrl = nodeInfo.ImageUrl;
Content = nodeInfo.Content;
ContentNum = nodeInfo.ContentNum;
FilePath = nodeInfo.FilePath;
ChannelFilePathRule = nodeInfo.ChannelFilePathRule;
ContentFilePathRule = nodeInfo.ContentFilePathRule;
LinkUrl = nodeInfo.LinkUrl;
LinkType = nodeInfo.LinkType;
ChannelTemplateId = nodeInfo.ChannelTemplateId;
ContentTemplateId = nodeInfo.ContentTemplateId;
Keywords = nodeInfo.Keywords;
Description = nodeInfo.Description;
_extendValues = nodeInfo._extendValues;
}
public int NodeId { get; set; }
public string NodeName { get; set; }
public ENodeType NodeType { get; set; }
public int PublishmentSystemId { get; set; }
public string ContentModelId
{
get
{
if (string.IsNullOrEmpty(_contentModelId))
{
_contentModelId = EContentModelTypeUtils.GetValue(EContentModelType.Content);
}
return _contentModelId;
}
set { _contentModelId = value; }
}
public int ParentId { get; set; }
public string ParentsPath { get; set; }
public int ParentsCount { get; set; }
public int ChildrenCount { get; set; }
public bool IsLastNode { get; set; }
public string NodeIndexName { get; set; }
public string NodeGroupNameCollection { get; set; }
public int Taxis { get; set; }
public DateTime AddDate { get; set; }
public string ImageUrl { get; set; }
public string Content { get; set; }
public int ContentNum { get; set; }
public string FilePath { get; set; }
public string ChannelFilePathRule { get; set; }
public string ContentFilePathRule { get; set; }
public string LinkUrl { get; set; }
public ELinkType LinkType { get; set; }
public int ChannelTemplateId { get; set; }
public int ContentTemplateId { get; set; }
public string Keywords { get; set; }
public string Description { get; set; }
public void SetExtendValues(string extendValues)
{
_extendValues = extendValues;
}
private NodeInfoExtend _additional;
public NodeInfoExtend Additional => _additional ?? (_additional = new NodeInfoExtend(_extendValues));
}
}