Skip to content

Commit 39cfde6

Browse files
author
Balaji Jayaraman
committed
added workspaces examples
1 parent c47e076 commit 39cfde6

File tree

27 files changed

+822
-5
lines changed

27 files changed

+822
-5
lines changed

ExamplesAPIType.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ public enum ExamplesApiType
6767
/// </summary>")]
6868
[Description("mae")]
6969
Maestro = 9,
70+
71+
/// <summary>
72+
/// Workflows
73+
/// </summary>")]
74+
[Description("work")]
75+
Workspaces = 10,
7076
}
7177

7278
public static class ExamplesApiTypeExtensions

ExamplesApiTypeExtensions.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ public enum ExamplesApiType
7373
/// </summary>")]
7474
[Description("mae")]
7575
Maestro = 10,
76+
77+
/// <summary>
78+
/// Workflows
79+
/// </summary>")]
80+
[Description("work")]
81+
Workspaces = 11,
7682
}
7783

7884
public static class ExamplesApiTypeExtensions

JWTAuth.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,18 @@ public static OAuthToken AuthenticateWithJwt(string api, string clientId, string
5858
});
5959
}
6060

61+
if (apiType == ExamplesApiType.Workspaces)
62+
{
63+
scopes.AddRange(new List<string>
64+
{
65+
"impersonation",
66+
"dtr.company.read",
67+
"dtr.rooms.read",
68+
"dtr.rooms.write",
69+
"dtr.documents.write",
70+
});
71+
}
72+
6173
if (apiType == ExamplesApiType.Monitor)
6274
{
6375
scopes.AddRange(new List<string>

launcher-csharp/Common/IRequestItemsService.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ public interface IRequestItemsService
4242

4343
public string WorkflowId { get; set; }
4444

45+
public string WorkspaceId { get; set; }
46+
47+
public string WorkspaceDocumentId { get; set; }
48+
4549
public bool IsWorkflowPublished { get; set; }
4650

4751
public string InstanceId { get; set; }

launcher-csharp/Common/RequestItemsService.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,18 @@ public string WorkflowId
162162
set => this.cache.Set(this.GetKey("WorkflowId"), value);
163163
}
164164

165+
public string WorkspaceId
166+
{
167+
get => this.cache.Get<string>(this.GetKey("WorkspaceId"));
168+
set => this.cache.Set(this.GetKey("WorkspaceId"), value);
169+
}
170+
171+
public string WorkspaceDocumentId
172+
{
173+
get => this.cache.Get<string>(this.GetKey("WorkspaceDocumentId"));
174+
set => this.cache.Set(this.GetKey("WorkspaceDocumentId"), value);
175+
}
176+
165177
public bool IsWorkflowPublished
166178
{
167179
get => this.cache.Get<bool>(this.GetKey("WorkflowPublished"));
@@ -309,6 +321,10 @@ public string IdentifyApiOfCodeExample(string eg)
309321
{
310322
currentApiType = ExamplesApiType.Maestro.ToString();
311323
}
324+
else if (eg.Contains(ExamplesApiType.Workspaces.ToKeywordString()))
325+
{
326+
currentApiType = ExamplesApiType.Workspaces.ToString();
327+
}
312328
else
313329
{
314330
currentApiType = ExamplesApiType.ESignature.ToString();

launcher-csharp/Maestro/Views/Mae002PauseWorkflow/mae002.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
@Html.Raw(
1414
@String.Format(
1515
ViewBag.SupportingTexts.ViewSourceFile,
16-
"<a target='_blank' href=" + @ViewBag.source + ">TriggerWorkflow.cs</a>"
16+
"<a target='_blank' href=" + @ViewBag.source + ">PauseWorkflow.cs</a>"
1717
)
1818
)
1919
</p>

launcher-csharp/Maestro/Views/Mae003ResumeWorkflow/mae003.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
@Html.Raw(
1414
@String.Format(
1515
ViewBag.SupportingTexts.ViewSourceFile,
16-
"<a target='_blank' href=" + @ViewBag.source + ">TriggerWorkflow.cs</a>"
16+
"<a target='_blank' href=" + @ViewBag.source + ">ResumeWorkflow.cs</a>"
1717
)
1818
)
1919
</p>

launcher-csharp/Maestro/Views/Mae004CancelWorkflowInstance/mae004.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
@Html.Raw(
1414
@String.Format(
1515
ViewBag.SupportingTexts.ViewSourceFile,
16-
"<a target='_blank' href=" + @ViewBag.source + ">TriggerWorkflow.cs</a>"
16+
"<a target='_blank' href=" + @ViewBag.source + ">CancelWorkflowInstance.cs</a>"
1717
)
1818
)
1919
</p>

launcher-csharp/Startup.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,15 @@ public Startup(IConfiguration configuration)
5858

5959
this.apiTypes.Add(ExamplesApiType.Maestro, new List<string> { "signature", "aow_manage" });
6060

61+
this.apiTypes.Add(ExamplesApiType.Workspaces, new List<string>
62+
{
63+
"signature",
64+
"dtr.company.read",
65+
"dtr.rooms.read",
66+
"dtr.rooms.write",
67+
"dtr.documents.write",
68+
});
69+
6170
this.apiTypes.Add(ExamplesApiType.Click, new List<string>
6271
{
6372
"click.manage",
153 KB
Binary file not shown.

0 commit comments

Comments
 (0)