16 using System.Collections.Generic;
19 using erminas.SmartAPI.CMS.Project.Workflows;
20 using erminas.SmartAPI.Utils.CachedCollections;
22 namespace erminas.SmartAPI.CMS.Project
29 internal class ProjectWorkflow : NameIndexedRDList<IWorkflow>, IProjectWorkflows
31 private readonly IProject _project;
33 internal ProjectWorkflow(IProject project,
Caching caching) : base(caching)
36 Global =
new GlobalWorkflows(project);
37 RetrieveFunc = GetWorkflows;
40 public IGlobalWorkflows Global {
get;
private set; }
42 private List<IWorkflow> GetWorkflows()
44 const string LIST_WORKFLOWS =
@"<WORKFLOWS action=""list"" listglobalworkflow=""1""/>";
45 var xmlDoc = _project.ExecuteRQL(LIST_WORKFLOWS);
46 return (from XmlElement curWorkflow in xmlDoc.GetElementsByTagName(
"WORKFLOW")
47 select (
IWorkflow) new Workflow(_project, curWorkflow)).ToList();