18 using erminas.SmartAPI.CMS.Converter;
19 using erminas.SmartAPI.CMS.Project.Folder;
20 using erminas.SmartAPI.Utils;
22 namespace erminas.SmartAPI.CMS.Project.ContentClasses.Elements
31 string AltText {
get;
set; }
33 string Border {
get;
set; }
34 string DataFieldForBinayData {
get;
set; }
35 string DataFieldName {
get;
set; }
37 string HSpace {
get;
set; }
38 bool IsListEntry {
get;
set; }
42 string Supplement {
get;
set; }
43 string TableName {
get;
set; }
44 string UserDefinedFormat {
get;
set; }
45 string VSpace {
get;
set; }
48 internal class DatabaseContent : ContentClassElement, IDatabaseContent
50 internal DatabaseContent(
IContentClass contentClass, XmlElement xmlElement) : base(contentClass, xmlElement)
53 XmlElement.SetAttributeValue(
"eltsrc", RQL.SESSIONKEY_PLACEHOLDER);
56 [RedDot(
"eltalign", ConverterType = typeof (StringEnumConverter<BasicAlignment>))]
59 get {
return GetAttributeValue<BasicAlignment>(); }
60 set { SetAttributeValue(value); }
66 get {
return GetAttributeValue<string>(); }
67 set { SetAttributeValue(value); }
73 get {
return GetAttributeValue<string>(); }
74 set { SetAttributeValue(value); }
82 [RedDot(
"eltbincolumnname")]
83 public string DataFieldForBinayData
85 get {
return GetAttributeValue<string>(); }
86 set { SetAttributeValue(value); }
89 [RedDot(
"eltcolumnname")]
90 public string DataFieldName
92 get {
return GetAttributeValue<string>(); }
93 set { SetAttributeValue(value); }
96 [RedDot(
"eltdatabasename", ConverterType = typeof (DatabaseConnectionConverter))]
97 public IDatabaseConnection DatabaseConnection
99 get {
return GetAttributeValue<IDatabaseConnection>(); }
100 set { SetAttributeValue(value); }
103 [RedDot(
"elthspace")]
106 get {
return GetAttributeValue<string>(); }
107 set { SetAttributeValue(value); }
110 [RedDot(
"eltislistentry")]
111 public bool IsListEntry
113 get {
return GetAttributeValue<bool>(); }
114 set { SetAttributeValue(value); }
117 [RedDot(
"eltlisttype", ConverterType = typeof (StringEnumConverter<ListType>))]
120 get {
return GetAttributeValue<ListType>(); }
125 throw new ArgumentException(
126 string.Format(
"It is not possible to reset the {0} to {1}, once it was set.",
127 RedDotAttributeDescription.GetDescriptionForElement(
"eltlisttype"),
ListType.None));
129 SetAttributeValue(value);
133 [RedDot(
"eltrelatedfolderguid", ConverterType = typeof (FolderConverter))]
134 public IFolder PublicationFolder
136 get {
return GetAttributeValue<IFolder>(); }
137 set { SetAttributeValue(value); }
140 [RedDot(
"eltcolumniotype", ConverterType = typeof (StringEnumConverter<SpecialDataFieldFormat>))]
143 get {
return GetAttributeValue<SpecialDataFieldFormat>(); }
146 SpecialDataFieldFormatUtils.EnsureValueIsSupportedByServerVersion(
this, value);
147 SetAttributeValue(value);
151 [RedDot(
"eltsupplement")]
152 public string Supplement
154 get {
return GetAttributeValue<string>(); }
155 set { SetAttributeValue(value); }
158 [RedDot(
"elttablename")]
159 public string TableName
161 get {
return GetAttributeValue<string>(); }
162 set { SetAttributeValue(value); }
165 [RedDot(
"eltformatting")]
166 public string UserDefinedFormat
168 get {
return GetAttributeValue<string>(); }
169 set { SetAttributeValue(value); }
172 [RedDot(
"eltvspace")]
175 get {
return GetAttributeValue<string>(); }
176 set { SetAttributeValue(value); }
179 protected override XmlElement RetrieveWholeObject()
181 var element = base.RetrieveWholeObject();
183 element.SetAttributeValue(
"eltsrc", RQL.SESSIONKEY_PLACEHOLDER);