17 using System.Collections.Generic;
18 using erminas.SmartAPI.CMS.Project.ContentClasses.Elements;
19 using erminas.SmartAPI.CMS.Project.Workflows;
21 namespace erminas.SmartAPI.CMS.Project
30 private readonly WorkflowAssignments _workflowAssignments;
32 internal GlobalWorkflows(
IProject project)
35 _workflowAssignments =
new WorkflowAssignments(
new ProjectWrapper(project));
38 public void CreateAndConnectContentWorkflow(
string workflowName, params
string[] languageVariants)
40 _workflowAssignments.CreateAndConnectContentWorkflow(workflowName, languageVariants);
43 public void CreateAndConnectContentWorkflow(
string workflowName, IEnumerable<ILanguageVariant> languageVariants)
45 _workflowAssignments.CreateAndConnectContentWorkflow(workflowName, languageVariants);
48 public void CreateAndConnectStructuralworkflow(
string workflowName)
50 _workflowAssignments.CreateAndConnectStructuralworkflow(workflowName);
53 public void DisconnectAllWorkflows()
55 _workflowAssignments.DisconnectAllWorkflows();
60 return _workflowAssignments.GetContentWorkflowFor(languageVariantId);
65 return _workflowAssignments.GetContentWorkflowFor(languageVariant);
70 return _workflowAssignments.GetContentWorkflowForCurrentLanguageVariant();
73 public void InvalidateCache()
75 _workflowAssignments.InvalidateCache();
78 public IProject Project
80 get {
return _project; }
83 public ISession Session
85 get {
return _project.
Session; }
88 public void SetContentWorkflow(
IWorkflow workflow, IEnumerable<ILanguageVariant> languageVariants)
90 _workflowAssignments.SetContentWorkflow(workflow, languageVariants);
93 public void SetContentWorkflow(
IWorkflow workflow, params
string[] languageVariantIds)
95 _workflowAssignments.SetContentWorkflow(workflow, languageVariantIds);
100 get {
return _workflowAssignments.StructuralWorkflow; }
101 set { _workflowAssignments.StructuralWorkflow = value; }
106 private readonly IProject _project;
108 internal ProjectWrapper(IProject project)
115 get {
return Project.
Guid; }
120 get {
return Project.Name; }
123 public IProject Project
125 get {
return _project; }
128 public ISession Session
130 get {
return Project.Session; }