-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPublishingTarget.cs
More file actions
72 lines (64 loc) · 2.14 KB
/
PublishingTarget.cs
File metadata and controls
72 lines (64 loc) · 2.14 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
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
namespace RustyLogic.RedDotNet
{
public class PublishingTarget : RedDotObject
{
public enum TargetType { None = 0, Ftp = 6205, Directory = 6206, LiveServer = 6207, Sftp = 6208 };
private TargetType _type;
public TargetType Type
{
get { return _type; }
}
private string _name;
public string Name
{
get { return _name; }
set { _name = value; }
}
public string UrlPrefix
{
get
{
return XmlNode.Attributes.GetNamedItem("urlprefix").Value;
}
}
protected PublishingTarget(XmlNode xmlNode) : base(xmlNode) { }
protected PublishingTarget(Guid guid) : base(guid) { }
protected override void LoadBasics(XmlNode xmlNode)
{
_name = xmlNode.Attributes.GetNamedItem("name").Value;
_type = (TargetType)int.Parse(xmlNode.Attributes.GetNamedItem("type").Value);
}
protected override XmlNode LoadXml()
{
string rqlStatement =
"<IODATA>" +
"<PROJECT>" +
"<EXPORT action=\"load\" guid=\"" + GuidString + "\"/>" +
"</PROJECT>" +
"</IODATA>";
xmlDoc.LoadXml(Session.Execute(rqlStatement));
return xmlDoc.GetElementsByTagName("EXPORT")[0];
}
public static List<PublishingTarget> List()
{
List<PublishingTarget> targets = new List<PublishingTarget>();
string rqlStatement =
"<IODATA>" +
"<PROJECT>" +
"<EXPORTS action=\"list\"/>" +
"</PROJECT>" +
"</IODATA>";
xmlDoc.LoadXml(Session.Execute(rqlStatement));
XmlNodeList xmlNodes = xmlDoc.GetElementsByTagName("EXPORT");
foreach (XmlNode xmlNode in xmlNodes)
{
targets.Add(new PublishingTarget(xmlNode));
}
return targets;
}
}
}