-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update to 2.1 specification #141
base: main
Are you sure you want to change the base?
Changes from all commits
b2b3bd0
f5eddd2
d5c2b04
f01ab52
74016c7
a00d372
9e64b3e
8d7cdc7
414a9a8
639b5a0
8b6cf5a
606fc52
8cea70d
5c600df
5c95a62
d59928a
2f803ad
9985b46
905a4b5
1ec3fd9
ba7180a
483ed1f
616aa94
01dded7
da43598
084d350
5e1c370
c196708
b6331db
914ecee
ce68a38
f13c648
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,16 +28,16 @@ public class AppChannel | |
/// <summary> | ||
/// Initializes a new instance of the <see cref="AppChannel"/> class. | ||
/// </summary> | ||
/// <param name="name">The name</param> | ||
/// <exception cref="ArgumentNullException">Exception if name is null</exception> | ||
public AppChannel(string name) | ||
/// <param name="id">The ID of the App Channel</param> | ||
/// <exception cref="ArgumentNullException">Exception if ID is null</exception> | ||
public AppChannel(string id) | ||
{ | ||
Name = name ?? throw new ArgumentNullException(nameof(name)); | ||
ID = id ?? throw new ArgumentNullException(nameof(id)); | ||
} | ||
/// <summary> | ||
/// The name of the App Channel. | ||
/// The ID of the App Channel. | ||
/// </summary> | ||
public string Name { get; set; } | ||
public string ID { get; set; } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. AppChannel Name changed to ID to avoid confusion. This required changes to class and sample json used for deserialization in unit testing. |
||
|
||
/// <summary> | ||
/// A description of how the channel is used. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,10 +28,13 @@ public class Fdc3App | |
public Fdc3App(string appId, string name, AppType type, object details) | ||
{ | ||
AppId = appId ?? throw new ArgumentNullException(nameof(appId)); | ||
#pragma warning disable CS0618 // Type or member is obsolete | ||
Name = name ?? throw new ArgumentNullException( nameof(name)); | ||
#pragma warning restore CS0618 // Type or member is obsolete | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Even though Name is marked as obsolete/decomissioned we are still using it. In order to not have build errors in our own code about using obsolete member, disable the warning. |
||
Type = type; | ||
Details = details ?? throw new ArgumentNullException(nameof(details)); | ||
} | ||
|
||
/// <summary> | ||
/// The unique application identifier located within a specific application directory instance. | ||
/// </summary> | ||
|
@@ -43,7 +46,8 @@ public Fdc3App(string appId, string name, AppType type, object details) | |
/// for multiple versions of the same app. The same appName could occur in other directories. | ||
/// We are not currently specifying app name conventions in the document. | ||
/// </summary> | ||
public string Name { get; set; } | ||
[Obsolete("Use `AppId` to identify apps and `Title` for their display names.")] | ||
public string? Name { get; set; } | ||
|
||
/// <summary> | ||
/// The technology type that is used to launch and run the application. | ||
|
@@ -147,6 +151,7 @@ public Fdc3App(string appId, string name, AppType type, object details) | |
/// <summary> | ||
/// An optional set of name value pairs that can be used to deliver custom data from an App Directory to a launcher. | ||
/// </summary> | ||
[Obsolete] | ||
public Dictionary<string, string>? CustomConfig { get; set; } | ||
|
||
/// <summary> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Morgan Stanley makes this available to you under the Apache License, | ||
* Version 2.0 (the "License"). You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* See the NOTICE file distributed with this work for additional information | ||
* regarding copyright ownership. Unless required by applicable law or agreed | ||
* to in writing, software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express | ||
* or implied. See the License for the specific language governing permissions | ||
* and limitations under the License. | ||
*/ | ||
|
||
namespace Finos.Fdc3.Context | ||
{ | ||
public class Action : Context, IContext | ||
{ | ||
public Action(string title, IContext context, string? intent, IAppIdentifier? app = null, object? id = null, string? name = null) | ||
: base(ContextTypes.Action, id, name) | ||
{ | ||
this.Title = title; | ||
this.Context = context; | ||
this.Intent = intent; | ||
this.App = app; | ||
} | ||
|
||
public string Title { get; private set; } | ||
public IContext Context { get; private set; } | ||
public string? Intent { get; private set; } | ||
public IAppIdentifier? App { get; private set; } | ||
|
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,20 +16,29 @@ namespace Finos.Fdc3.Context | |
{ | ||
public class ChatInitSettings : Context, IContext | ||
{ | ||
public ChatInitSettings(ContactList? members = null, string? initMessage = null, string? chatName = null, object? options = null, object? id = null, string? name = null) | ||
public ChatInitSettings(ContactList? members = null, Message? message = null, string? chatName = null, ChatInitSettingsOptions? options = null, object? id = null, string? name = null) | ||
: base(ContextTypes.ChatInitSettings, id, name) | ||
{ | ||
this.Members = members; | ||
this.InitMessage = initMessage; | ||
this.Message = message; | ||
this.ChatName = chatName; | ||
this.Options = options; | ||
} | ||
|
||
public string? ChatName { get; set; } | ||
public string? InitMessage { get; set; } | ||
public Message? Message { get; set; } | ||
public ContactList? Members { get; set; } | ||
public object? Options { get; set; } | ||
public ChatInitSettingsOptions? Options { get; set; } | ||
|
||
object? IContext<object>.ID => base.ID; | ||
} | ||
|
||
public class ChatInitSettingsOptions | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure why I was so lazy in past implementation of just taking an object. I defined it as a custom type now. |
||
{ | ||
public bool? GroupRecipients { get; set; } | ||
public bool? IsPublic { get; set; } | ||
public bool? AllowHistoryBrowsing { get; set; } | ||
public bool? AllowMessageCopy { get; set; } | ||
public bool? AllowAddUser { get; set; } | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Morgan Stanley makes this available to you under the Apache License, | ||
* Version 2.0 (the "License"). You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* See the NOTICE file distributed with this work for additional information | ||
* regarding copyright ownership. Unless required by applicable law or agreed | ||
* to in writing, software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express | ||
* or implied. See the License for the specific language governing permissions | ||
* and limitations under the License. | ||
*/ | ||
|
||
namespace Finos.Fdc3.Context | ||
{ | ||
public class ChatMessage : Context, IContext, IRecipient | ||
{ | ||
public ChatMessage(ChatRoom chatRoom, Message message, object? id = null, string? name = null) | ||
: base(ContextTypes.ChatMessage, id, name) | ||
{ | ||
this.ChatRoom = chatRoom; | ||
this.Message = message; | ||
} | ||
|
||
public ChatRoom ChatRoom { get; set; } | ||
public Message Message { get; set; } | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Morgan Stanley makes this available to you under the Apache License, | ||
* Version 2.0 (the "License"). You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* See the NOTICE file distributed with this work for additional information | ||
* regarding copyright ownership. Unless required by applicable law or agreed | ||
* to in writing, software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express | ||
* or implied. See the License for the specific language governing permissions | ||
* and limitations under the License. | ||
*/ | ||
|
||
namespace Finos.Fdc3.Context | ||
{ | ||
public class ChatRoom : Context, IContext, IRecipient | ||
{ | ||
public ChatRoom(object id, string providerName, string? url = null, string? name = null) | ||
: base(ContextTypes.ChatRoom, id, name) | ||
{ | ||
this.ProviderName = providerName; | ||
this.Url = url; | ||
} | ||
|
||
public string ProviderName { get; set; } | ||
public string? Url { get; set; } | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Morgan Stanley makes this available to you under the Apache License, | ||
* Version 2.0 (the "License"). You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* See the NOTICE file distributed with this work for additional information | ||
* regarding copyright ownership. Unless required by applicable law or agreed | ||
* to in writing, software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express | ||
* or implied. See the License for the specific language governing permissions | ||
* and limitations under the License. | ||
*/ | ||
|
||
using System.Collections; | ||
|
||
namespace Finos.Fdc3.Context | ||
{ | ||
public class ChatSearchCriteria : Context, IContext | ||
{ | ||
public ChatSearchCriteria(IEnumerable criteria, object? id = null, string? name = null) | ||
: base(ContextTypes.ChatSearchCriteria, id, name) | ||
{ | ||
this.Criteria = criteria; | ||
} | ||
|
||
public IEnumerable Criteria { get; set; } | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,6 @@ public class ContactID | |
{ | ||
public string? Email { get; set; } | ||
|
||
public string? FdsId { get; set; } | ||
public string? FDS_ID { get; set; } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was was previously incorrect and is being fied here. |
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,38 +19,50 @@ namespace Finos.Fdc3.Context | |
{ | ||
public static class ContextTypes | ||
{ | ||
public static readonly string Action = "fdc3.action"; | ||
public static readonly string Chart = "fdc3.chart"; | ||
public static readonly string ChatInitSettings = "fdc3.chat.initSettings"; | ||
public static readonly string ChatMessage = "fdc3.chat.message"; | ||
public static readonly string ChatRoom = "fdc3.chat.room"; | ||
public static readonly string ChatSearchCriteria = "fdc3.chat.searchCriteria"; | ||
public static readonly string Contact = "fdc3.contact"; | ||
public static readonly string ContactList = "fdc3.contactList"; | ||
public static readonly string Country = "fdc3.country"; | ||
public static readonly string Currency = "fdc3.currency"; | ||
public static readonly string Email = "fdc3.email"; | ||
public static readonly string Instrument = "fdc3.instrument"; | ||
public static readonly string InstrumentList = "fdc3.instrumentList"; | ||
public static readonly string Message = "fdc3.message"; | ||
public static readonly string Nothing = "fdc3.nothing"; | ||
public static readonly string Organization = "fdc3.organization"; | ||
public static readonly string Portfolio = "fdc3.portfolio"; | ||
public static readonly string Position = "fdc3.position"; | ||
public static readonly string TimeRange = "fdc3.timerange"; | ||
public static readonly string TimeRange = "fdc3.timeRange"; | ||
public static readonly string TransactionResult = "fdc3.transactionResult"; | ||
public static readonly string Valuation = "fdc3.valuation"; | ||
|
||
public static IDictionary<string, Type> Map = new Dictionary<string, Type>() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For those wondering, this is useful for DesktopAgents to use as a mapping when doing deserialization. Based on the context type string on the message, do the lookup here to get the concrete type and then deserialize to that type. Note that this is also public so your desktopagent can add/overwrite in their implementation as they see fit such as mapping to a derived context type rather than the base default. |
||
{ | ||
{ ContextTypes.Action, typeof(Action) }, | ||
{ ContextTypes.Chart, typeof(Chart) }, | ||
{ ContextTypes.ChatInitSettings, typeof(ChatInitSettings) }, | ||
{ ContextTypes.ChatMessage, typeof(ChatMessage) }, | ||
{ ContextTypes.ChatRoom, typeof(ChatRoom) }, | ||
{ ContextTypes.ChatSearchCriteria, typeof(ChatSearchCriteria) }, | ||
{ ContextTypes.Contact, typeof(Contact) }, | ||
{ ContextTypes.ContactList, typeof(ContactList) }, | ||
{ ContextTypes.Country, typeof(Country) }, | ||
{ ContextTypes.Currency, typeof(Currency) }, | ||
{ ContextTypes.Email, typeof(Email) }, | ||
{ ContextTypes.Instrument, typeof(Instrument) }, | ||
{ ContextTypes.InstrumentList, typeof(InstrumentList) }, | ||
{ ContextTypes.Message, typeof(Message) }, | ||
{ ContextTypes.Nothing, typeof(Nothing) }, | ||
{ ContextTypes.Organization, typeof(Organization) }, | ||
{ ContextTypes.Portfolio, typeof(Portfolio) }, | ||
{ ContextTypes.Position, typeof(Position) }, | ||
{ ContextTypes.TimeRange, typeof(TimeRange) }, | ||
{ ContextTypes.TransactionResult, typeof(TransactionResult) }, | ||
{ ContextTypes.Valuation, typeof(Valuation) }, | ||
}; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a long existing build warning in the example project about possible null return value when the return is declared as non nullable