Skip to content

Commit 1be2d90

Browse files
committed
Merge remote-tracking branch 'origin/develop' into release-3-2-1
# Conflicts: # Data/Databases/SQLite/SifFrameworkDatabase.db
2 parents f8b9fbe + c1c9661 commit 1be2d90

35 files changed

Lines changed: 746 additions & 511 deletions

Code/Sif3Framework/Sif.Framework/Consumers/Consumer.cs

Lines changed: 28 additions & 51 deletions
Large diffs are not rendered by default.

Code/Sif3Framework/Sif.Framework/Consumers/FunctionalServiceConsumer.cs

Lines changed: 91 additions & 91 deletions
Large diffs are not rendered by default.

Code/Sif3Framework/Sif.Framework/Consumers/IConsumer.cs

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -48,51 +48,51 @@ public interface IConsumer<TSingle, TMultiple, TPrimaryKey> : IPayloadSerialisab
4848
/// Retrieve the current Changes Since marker.
4949
/// <para>HEAD /StudentPersonals</para>
5050
/// </summary>
51-
/// <param name="zone">Zone associated with the request.</param>
52-
/// <param name="context">Zone context.</param>
51+
/// <param name="zoneId">Zone associated with the request.</param>
52+
/// <param name="contextId">Zone context.</param>
5353
/// <returns>Changes Since marker.</returns>
54-
string GetChangesSinceMarker(string zone = null, string context = null);
54+
string GetChangesSinceMarker(string zoneId = null, string contextId = null);
5555

5656
/// <summary>
5757
/// Create a single object.
5858
/// <para>POST /StudentPersonals/StudentPersonal</para>
5959
/// </summary>
6060
/// <param name="obj">Object to create.</param>
61-
/// <param name="zone">Zone associated with the request.</param>
62-
/// <param name="context">Zone context.</param>
61+
/// <param name="zoneId">Zone associated with the request.</param>
62+
/// <param name="contextId">Zone context.</param>
6363
/// <returns>Created object.</returns>
64-
TSingle Create(TSingle obj, string zone = null, string context = null);
64+
TSingle Create(TSingle obj, string zoneId = null, string contextId = null);
6565

6666
/// <summary>
6767
/// Create multiple objects.
6868
/// <para>POST /StudentPersonals</para>
6969
/// </summary>
7070
/// <param name="obj">Object (multiple object entity) to create.</param>
71-
/// <param name="zone">Zone associated with the request.</param>
72-
/// <param name="context">Zone context.</param>
71+
/// <param name="zoneId">Zone associated with the request.</param>
72+
/// <param name="contextId">Zone context.</param>
7373
/// <returns>Response containing status of each object created.</returns>
74-
MultipleCreateResponse Create(TMultiple obj, string zone = null, string context = null);
74+
MultipleCreateResponse Create(TMultiple obj, string zoneId = null, string contextId = null);
7575

7676
/// <summary>
7777
/// Retrieve a single object.
7878
/// <para>GET /StudentPersonals/{id}</para>
7979
/// </summary>
8080
/// <param name="refId">SIF identifier of the object.</param>
81-
/// <param name="zone">Zone associated with the request.</param>
82-
/// <param name="context">Zone context.</param>
81+
/// <param name="zoneId">Zone associated with the request.</param>
82+
/// <param name="contextId">Zone context.</param>
8383
/// <returns>Retrieved object.</returns>
84-
TSingle Query(TPrimaryKey refId, string zone = null, string context = null);
84+
TSingle Query(TPrimaryKey refId, string zoneId = null, string contextId = null);
8585

8686
/// <summary>
8787
/// Retrieve all objects.
8888
/// <para>GET /StudentPersonals</para>
8989
/// </summary>
9090
/// <param name="navigationPage">Current paging index.</param>
9191
/// <param name="navigationPageSize">Page size.</param>
92-
/// <param name="zone">Zone associated with the request.</param>
93-
/// <param name="context">Zone context.</param>
92+
/// <param name="zoneId">Zone associated with the request.</param>
93+
/// <param name="contextId">Zone context.</param>
9494
/// <returns>Retrieved objects.</returns>
95-
TMultiple Query(uint? navigationPage = null, uint? navigationPageSize = null, string zone = null, string context = null);
95+
TMultiple Query(uint? navigationPage = null, uint? navigationPageSize = null, string zoneId = null, string contextId = null);
9696

9797
/// <summary>
9898
/// Retrieve multiple objects using Query by Example.
@@ -101,10 +101,10 @@ public interface IConsumer<TSingle, TMultiple, TPrimaryKey> : IPayloadSerialisab
101101
/// <param name="obj">Example object.</param>
102102
/// <param name="navigationPage">Current paging index.</param>
103103
/// <param name="navigationPageSize">Page size.</param>
104-
/// <param name="zone">Zone associated with the request.</param>
105-
/// <param name="context">Zone context.</param>
104+
/// <param name="zoneId">Zone associated with the request.</param>
105+
/// <param name="contextId">Zone context.</param>
106106
/// <returns>Retrieved objects.</returns>
107-
TMultiple QueryByExample(TSingle obj, uint? navigationPage = null, uint? navigationPageSize = null, string zone = null, string context = null);
107+
TMultiple QueryByExample(TSingle obj, uint? navigationPage = null, uint? navigationPageSize = null, string zoneId = null, string contextId = null);
108108

109109
/// <summary>
110110
/// Retrieve multiple objects using Service Paths.
@@ -115,10 +115,10 @@ public interface IConsumer<TSingle, TMultiple, TPrimaryKey> : IPayloadSerialisab
115115
/// <param name="conditions">Service Path conditions.</param>
116116
/// <param name="navigationPage">Current paging index.</param>
117117
/// <param name="navigationPageSize">Page size.</param>
118-
/// <param name="zone">Zone associated with the request.</param>
119-
/// <param name="context">Zone context.</param>
118+
/// <param name="zoneId">Zone associated with the request.</param>
119+
/// <param name="contextId">Zone context.</param>
120120
/// <returns>Retrieved objects.</returns>
121-
TMultiple QueryByServicePath(IEnumerable<EqualCondition> conditions, uint? navigationPage = null, uint? navigationPageSize = null, string zone = null, string context = null);
121+
TMultiple QueryByServicePath(IEnumerable<EqualCondition> conditions, uint? navigationPage = null, uint? navigationPageSize = null, string zoneId = null, string contextId = null);
122122

123123
/// <summary>
124124
/// Retrieve multiple objects based on the Changes Since marker.
@@ -128,48 +128,48 @@ public interface IConsumer<TSingle, TMultiple, TPrimaryKey> : IPayloadSerialisab
128128
/// <param name="nextChangesSinceMarker">Next Changes Since marker.</param>
129129
/// <param name="navigationPage">Current paging index.</param>
130130
/// <param name="navigationPageSize">Page size.</param>
131-
/// <param name="zone">Zone associated with the request.</param>
132-
/// <param name="context">Zone context.</param>
131+
/// <param name="zoneId">Zone associated with the request.</param>
132+
/// <param name="contextId">Zone context.</param>
133133
/// <returns>Retrieved objects.</returns>
134-
TMultiple QueryChangesSince(string changesSinceMarker, out string nextChangesSinceMarker, uint? navigationPage = null, uint? navigationPageSize = null, string zone = null, string context = null);
134+
TMultiple QueryChangesSince(string changesSinceMarker, out string nextChangesSinceMarker, uint? navigationPage = null, uint? navigationPageSize = null, string zoneId = null, string contextId = null);
135135

136136
/// <summary>
137137
/// Update a single object.
138138
/// <para>PUT /StudentPersonals/{id}</para>
139139
/// </summary>
140140
/// <param name="obj">Object to update.</param>
141-
/// <param name="zone">Zone associated with the request.</param>
142-
/// <param name="context">Zone context.</param>
143-
void Update(TSingle obj, string zone = null, string context = null);
141+
/// <param name="zoneId">Zone associated with the request.</param>
142+
/// <param name="contextId">Zone context.</param>
143+
void Update(TSingle obj, string zoneId = null, string contextId = null);
144144

145145
/// <summary>
146146
/// Update multiple objects.
147147
/// <para>PUT /StudentPersonals</para>
148148
/// </summary>
149149
/// <param name="obj">Object (multiple object entity) to update.</param>
150-
/// <param name="zone">Zone associated with the request.</param>
151-
/// <param name="context">Zone context.</param>
150+
/// <param name="zoneId">Zone associated with the request.</param>
151+
/// <param name="contextId">Zone context.</param>
152152
/// <returns>Response containing status of each object updated.</returns>
153-
MultipleUpdateResponse Update(TMultiple obj, string zone = null, string context = null);
153+
MultipleUpdateResponse Update(TMultiple obj, string zoneId = null, string contextId = null);
154154

155155
/// <summary>
156156
/// Delete a single object.
157157
/// <para>DELETE /StudentPersonals/{id}</para>
158158
/// </summary>
159159
/// <param name="refId">SIF identifier of the object.</param>
160-
/// <param name="zone">Zone associated with the request.</param>
161-
/// <param name="context">Zone context.</param>
162-
void Delete(TPrimaryKey refId, string zone = null, string context = null);
160+
/// <param name="zoneId">Zone associated with the request.</param>
161+
/// <param name="contextId">Zone context.</param>
162+
void Delete(TPrimaryKey refId, string zoneId = null, string contextId = null);
163163

164164
/// <summary>
165165
/// Delete multiple objects.
166166
/// <para>PUT /StudentPersonals (methodOverride: DELETE)</para>
167167
/// </summary>
168168
/// <param name="refIds">SIF identifiers of the objects.</param>
169-
/// <param name="zone">Zone associated with the request.</param>
170-
/// <param name="context">Zone context.</param>
169+
/// <param name="zoneId">Zone associated with the request.</param>
170+
/// <param name="contextId">Zone context.</param>
171171
/// <returns>Response containing status of each object deleted.</returns>
172-
MultipleDeleteResponse Delete(IEnumerable<TPrimaryKey> refIds, string zone = null, string context = null);
172+
MultipleDeleteResponse Delete(IEnumerable<TPrimaryKey> refIds, string zoneId = null, string contextId = null);
173173

174174
}
175175

Code/Sif3Framework/Sif.Framework/Model/Settings/ConfigFileBasedFrameworkSettings.cs

Lines changed: 35 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016 Systemic Pty Ltd
2+
* Copyright 2017 Systemic Pty Ltd
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -17,6 +17,9 @@
1717
using Sif.Framework.Model.Infrastructure;
1818
using System;
1919
using System.Configuration;
20+
using System.IO;
21+
using System.Reflection;
22+
using System.Web.Hosting;
2023

2124
namespace Sif.Framework.Model.Settings
2225
{
@@ -44,11 +47,11 @@ protected bool GetBooleanSetting(string key, bool defaultValue)
4447

4548
try
4649
{
47-
value = Boolean.Parse(setting.Value);
50+
value = bool.Parse(setting.Value);
4851
}
4952
catch (FormatException)
5053
{
51-
string message = String.Format("The valid values for the {0} setting are \"true\" or \"false\". The value \"{1}\" is not valid.", setting.Key, setting.Value);
54+
string message = $"The valid values for the {setting.Key} setting are \"true\" or \"false\". The value \"{setting.Value}\" is not valid.";
5255
throw new ConfigurationErrorsException(message);
5356
}
5457

@@ -73,11 +76,11 @@ protected int GetIntegerSetting(string key, int defaultValue)
7376

7477
try
7578
{
76-
value = Int32.Parse(setting.Value);
79+
value = int.Parse(setting.Value);
7780
}
7881
catch (FormatException)
7982
{
80-
string message = String.Format("The value \"{1}\" is not a valid integer for the {0} setting.", setting.Key, setting.Value);
83+
string message = $"The value \"{setting.Value}\" is not a valid integer for the {setting.Key} setting.";
8184
throw new ConfigurationErrorsException(message);
8285
}
8386

@@ -120,7 +123,7 @@ protected string GetStringSetting(string key)
120123
/// </summary>
121124
protected ConfigFileBasedFrameworkSettings()
122125
{
123-
string configurationFilePath = System.Web.Hosting.HostingEnvironment.MapPath("~/SifFramework.config");
126+
string configurationFilePath = HostingEnvironment.MapPath("~/SifFramework.config");
124127

125128
if (configurationFilePath == null)
126129
{
@@ -133,14 +136,21 @@ protected ConfigFileBasedFrameworkSettings()
133136

134137
if (!configuration.HasFile)
135138
{
136-
string message = String.Format("Missing configuration file {0}.", configurationFilePath);
139+
string fullPath = Assembly.GetExecutingAssembly().Location;
140+
exeConfigurationFileMap.ExeConfigFilename = Path.GetDirectoryName(fullPath) + "\\SifFramework.config";
141+
configuration = ConfigurationManager.OpenMappedExeConfiguration(exeConfigurationFileMap, ConfigurationUserLevel.None);
142+
}
143+
144+
if (!configuration.HasFile)
145+
{
146+
string message = $"Missing configuration file {configurationFilePath}.";
137147
throw new ConfigurationErrorsException(message);
138148
}
139149

140150
}
141151

142152
/// <summary>
143-
/// <see cref="Sif.Framework.Model.Settings.IFrameworkSettings.ApplicationKey"/>
153+
/// <see cref="IFrameworkSettings.ApplicationKey"/>
144154
/// </summary>
145155
public string ApplicationKey
146156
{
@@ -153,7 +163,7 @@ public string ApplicationKey
153163
}
154164

155165
/// <summary>
156-
/// <see cref="Sif.Framework.Model.Settings.IFrameworkSettings.AuthenticationMethod"/>
166+
/// <see cref="IFrameworkSettings.AuthenticationMethod"/>
157167
/// </summary>
158168
public string AuthenticationMethod
159169
{
@@ -166,7 +176,7 @@ public string AuthenticationMethod
166176
}
167177

168178
/// <summary>
169-
/// <see cref="Sif.Framework.Model.Settings.IFrameworkSettings.CompressPayload"/>
179+
/// <see cref="IFrameworkSettings.CompressPayload"/>
170180
/// </summary>
171181
public bool CompressPayload
172182
{
@@ -179,7 +189,7 @@ public bool CompressPayload
179189
}
180190

181191
/// <summary>
182-
/// <see cref="Sif.Framework.Model.Settings.IFrameworkSettings.ConsumerName"/>
192+
/// <see cref="IFrameworkSettings.ConsumerName"/>
183193
/// </summary>
184194
public string ConsumerName
185195
{
@@ -192,7 +202,7 @@ public string ConsumerName
192202
}
193203

194204
/// <summary>
195-
/// <see cref="Sif.Framework.Model.Settings.IFrameworkSettings.DataModelNamespace"/>
205+
/// <see cref="IFrameworkSettings.DataModelNamespace"/>
196206
/// </summary>
197207
public string DataModelNamespace
198208
{
@@ -205,7 +215,7 @@ public string DataModelNamespace
205215
}
206216

207217
/// <summary>
208-
/// <see cref="Sif.Framework.Model.Settings.IFrameworkSettings.InfrastructureNamespace"/>
218+
/// <see cref="IFrameworkSettings.InfrastructureNamespace"/>
209219
/// </summary>
210220
public string InfrastructureNamespace
211221
{
@@ -218,7 +228,7 @@ public string InfrastructureNamespace
218228
}
219229

220230
/// <summary>
221-
/// <see cref="Sif.Framework.Model.Settings.IFrameworkSettings.DeleteOnUnregister"/>
231+
/// <see cref="IFrameworkSettings.DeleteOnUnregister"/>
222232
/// </summary>
223233
public bool DeleteOnUnregister
224234
{
@@ -231,7 +241,7 @@ public bool DeleteOnUnregister
231241
}
232242

233243
/// <summary>
234-
/// <see cref="Sif.Framework.Model.Settings.IFrameworkSettings.EnvironmentType"/>
244+
/// <see cref="IFrameworkSettings.EnvironmentType"/>
235245
/// </summary>
236246
public EnvironmentType EnvironmentType
237247
{
@@ -254,7 +264,7 @@ public EnvironmentType EnvironmentType
254264
}
255265
else
256266
{
257-
string message = String.Format("The valid values for the {0} setting are \"BROKERED\" or \"DIRECT\". The value \"{1}\" is not valid.", setting.Key, setting.Value);
267+
string message = $"The valid values for the {setting.Key} setting are \"BROKERED\" or \"DIRECT\". The value \"{setting.Value}\" is not valid.";
258268
throw new ConfigurationErrorsException(message);
259269
}
260270

@@ -266,7 +276,7 @@ public EnvironmentType EnvironmentType
266276
}
267277

268278
/// <summary>
269-
/// <see cref="Sif.Framework.Model.Settings.IFrameworkSettings.EnvironmentUrl"/>
279+
/// <see cref="IFrameworkSettings.EnvironmentUrl"/>
270280
/// </summary>
271281
public string EnvironmentUrl
272282
{
@@ -279,7 +289,7 @@ public string EnvironmentUrl
279289
}
280290

281291
/// <summary>
282-
/// <see cref="Sif.Framework.Model.Settings.IFrameworkSettings.InstanceId"/>
292+
/// <see cref="IFrameworkSettings.InstanceId"/>
283293
/// </summary>
284294
public string InstanceId
285295
{
@@ -292,7 +302,7 @@ public string InstanceId
292302
}
293303

294304
/// <summary>
295-
/// <see cref="Sif.Framework.Model.Settings.IFrameworkSettings.NavigationPageSize"/>
305+
/// <see cref="IFrameworkSettings.NavigationPageSize"/>
296306
/// </summary>
297307
public int NavigationPageSize
298308
{
@@ -305,7 +315,7 @@ public int NavigationPageSize
305315
}
306316

307317
/// <summary>
308-
/// <see cref="Sif.Framework.Model.Settings.IFrameworkSettings.SharedSecret"/>
318+
/// <see cref="IFrameworkSettings.SharedSecret"/>
309319
/// </summary>
310320
public string SharedSecret
311321
{
@@ -318,7 +328,7 @@ public string SharedSecret
318328
}
319329

320330
/// <summary>
321-
/// <see cref="Sif.Framework.Model.Settings.IFrameworkSettings.SolutionId"/>
331+
/// <see cref="IFrameworkSettings.SolutionId"/>
322332
/// </summary>
323333
public string SolutionId
324334
{
@@ -331,7 +341,7 @@ public string SolutionId
331341
}
332342

333343
/// <summary>
334-
/// <see cref="Sif.Framework.Model.Settings.IFrameworkSettings.SupportedInfrastructureVersion"/>
344+
/// <see cref="IFrameworkSettings.SupportedInfrastructureVersion"/>
335345
/// </summary>
336346
public string SupportedInfrastructureVersion
337347
{
@@ -344,7 +354,7 @@ public string SupportedInfrastructureVersion
344354
}
345355

346356
/// <summary>
347-
/// <see cref="Sif.Framework.Model.Settings.IFrameworkSettings.UserToken"/>
357+
/// <see cref="IFrameworkSettings.UserToken"/>
348358
/// </summary>
349359
public string UserToken
350360
{
@@ -390,5 +400,7 @@ public int JobTimeoutFrequency
390400
{
391401
get { return GetIntegerSetting(SettingsPrefix + ".job.timeout.frequency", 60); }
392402
}
403+
393404
}
405+
394406
}

0 commit comments

Comments
 (0)