16 using System.Collections.Generic;
19 using erminas.SmartAPI.Utils.CachedCollections;
21 namespace erminas.SmartAPI.CMS.Project
27 internal class DatabaseConnections : NameIndexedRDList<IDatabaseConnection>,
IDatabaseConnections
31 internal DatabaseConnections(
IProject project,
Caching caching) : base(caching)
34 RetrieveFunc = GetDatabaseConnections;
37 public IProject Project
39 get {
return _project; }
42 public ISession Session
44 get {
return _project.
Session; }
47 private List<IDatabaseConnection> GetDatabaseConnections()
49 const string LIST_DATABASE_CONNECTION =
@"<DATABASES action=""list""/>";
50 XmlDocument xmlDoc = _project.
ExecuteRQL(LIST_DATABASE_CONNECTION,
RqlType.SessionKeyInProject);
51 XmlNodeList xmlNodes = xmlDoc.GetElementsByTagName(
"DATABASE");
54 (from XmlElement curNode in xmlNodes
55 select (IDatabaseConnection)
new DatabaseConnection(_project, curNode)).ToList();