Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions HarmonyCore.sln
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Templates", "Templates", "{
Templates\ODataUnitTestEnvironment.tpl = Templates\ODataUnitTestEnvironment.tpl
Templates\ODataUnitTestHost.tpl = Templates\ODataUnitTestHost.tpl
Templates\ODataUnitTests.tpl = Templates\ODataUnitTests.tpl
Templates\PostManDevelopmentEnvironment.tpl = Templates\PostManDevelopmentEnvironment.tpl
EndProjectSection
EndProject
Project("{BBD0F5D1-1CC4-42FD-BA4C-A96779C64378}") = "Services", "Services\Services.synproj", "{24A1BBFD-2660-41E1-A4FC-90B7A13A4911}"
Expand All @@ -59,18 +60,18 @@ Project("{BBD0F5D1-1CC4-42FD-BA4C-A96779C64378}") = "Services.Test", "Services.T
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SampleData", "SampleData", "{9977F09E-C08B-4E4C-900A-B06D532469AF}"
ProjectSection(SolutionItems) = preProject
SampleData\customer_notes.txt = SampleData\customer_notes.txt
SampleData\customer_notes.xdl = SampleData\customer_notes.xdl
SampleData\customers.txt = SampleData\customers.txt
Services.Controllers\SampleData\customers.xdl = Services.Controllers\SampleData\customers.xdl
SampleData\customer_notes.txt = SampleData\customer_notes.txt
SampleData\customer_notes.xdl = SampleData\customer_notes.xdl
SampleData\items.txt = SampleData\items.txt
SampleData\items.xdl = SampleData\items.xdl
SampleData\orders.txt = SampleData\orders.txt
Services.Test\SampleData\orders.xdl = Services.Test\SampleData\orders.xdl
SampleData\order_items.txt = SampleData\order_items.txt
SampleData\order_items.xdl = SampleData\order_items.xdl
SampleData\order_items_overlay.txt = SampleData\order_items_overlay.txt
SampleData\order_items_overlay.xdl = SampleData\order_items_overlay.xdl
SampleData\orders.txt = SampleData\orders.txt
Services.Test\SampleData\orders.xdl = Services.Test\SampleData\orders.xdl
SampleData\sysparams.txt = SampleData\sysparams.txt
SampleData\test.txt = SampleData\test.txt
SampleData\test.xdl = SampleData\test.xdl
Expand All @@ -84,6 +85,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "TraditionalBridge", "Tradit
Templates\TraditionalBridge\InterfaceController.tpl = Templates\TraditionalBridge\InterfaceController.tpl
Templates\TraditionalBridge\InterfaceDispatcher.tpl = Templates\TraditionalBridge\InterfaceDispatcher.tpl
Templates\TraditionalBridge\InterfaceDispatcherCustom.tpl = Templates\TraditionalBridge\InterfaceDispatcherCustom.tpl
Templates\TraditionalBridge\InterfaceDispatcherData.tpl = Templates\TraditionalBridge\InterfaceDispatcherData.tpl
Templates\TraditionalBridge\InterfaceDocumentation.tpl = Templates\TraditionalBridge\InterfaceDocumentation.tpl
Templates\TraditionalBridge\InterfaceMethodDispatchers.tpl = Templates\TraditionalBridge\InterfaceMethodDispatchers.tpl
Templates\TraditionalBridge\InterfacePostmanTests.tpl = Templates\TraditionalBridge\InterfacePostmanTests.tpl
Templates\TraditionalBridge\InterfaceService.tpl = Templates\TraditionalBridge\InterfaceService.tpl
Expand Down Expand Up @@ -177,6 +180,13 @@ Project("{BBD0F5D1-1CC4-42FD-BA4C-A96779C64378}") = "TraditionalBridge.UnitTest"
EndProject
Project("{BBD0F5D1-1CC4-42FD-BA4C-A96779C64378}") = "Services.Test.GenerateValues", "Services.Test.GenerateValues\Services.Test.GenerateValues.synproj", "{518FA7FA-9BCD-420B-A7F5-1F02AA5DF595}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "TypeScript", "TypeScript", "{37E2756D-C2CE-4E7F-9433-8D638412FE91}"
ProjectSection(SolutionItems) = preProject
Templates\TypeScript\TypeScriptInterfaceClient.tpl = Templates\TypeScript\TypeScriptInterfaceClient.tpl
Templates\TypeScript\TypeScriptInterfaceMethods.tpl = Templates\TypeScript\TypeScriptInterfaceMethods.tpl
Templates\TypeScript\TypeScriptInterfaceStructures.tpl = Templates\TypeScript\TypeScriptInterfaceStructures.tpl
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -687,6 +697,7 @@ Global
{0C03E3B8-3A2D-4BE1-BB14-1D09B4FA1C82} = {23E9E063-53D3-4618-BD7A-FAFB67256B61}
{45C17364-7208-4729-B2F2-4866CD62F1BD} = {3A316055-4B0B-442C-9FDB-846494C58E8D}
{2D9A8574-2C5A-4D95-AAED-1266845B46ED} = {3A316055-4B0B-442C-9FDB-846494C58E8D}
{37E2756D-C2CE-4E7F-9433-8D638412FE91} = {3A316055-4B0B-442C-9FDB-846494C58E8D}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {521EC2DF-FBE1-4295-A090-66B8CB009B0B}
Expand Down
34 changes: 28 additions & 6 deletions Templates/GenerateTestValues.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,26 @@ proc
new GenerateTestValues().SerializeValues()
endmain

namespace Services.Test.GenerateValues
namespace <NAMESPACE>

public class GenerateTestValues
public partial class GenerateTestValues

<STRUCTURE_LOOP>
<IF STRUCTURE_ISAM>
.include "<STRUCTURE_NOALIAS>" repository, record="<structureNoplural>", end
</IF STRUCTURE_ISAM>
</STRUCTURE_LOOP>

<STRUCTURE_LOOP>
<IF STRUCTURE_ISAM>
private m<StructureNoplural>FileSpec, string, "<FILE_NAME>"
</IF STRUCTURE_ISAM>
</STRUCTURE_LOOP>

partial method GetCustomFileSpec, void
required inout aFileSpec, string
endmethod

public method SerializeValues, void
endparams
proc
Expand All @@ -32,15 +42,24 @@ namespace Services.Test.GenerateValues
<STRUCTURE_LOOP>
<IF STRUCTURE_ISAM>

;;------------------------------------------------------------
;;Test data for <StructureNoplural>
open(chin=0,i:i,"<FILE_NAME>")
;------------------------------------------------------------
;Test data for <StructureNoplural>

Console.WriteLine("Processing file <FILE_NAME>")

;If there is a GetCustomFileSpec method, call it
GetCustomFileSpec(m<StructureNoplural>FileSpec)

;Open the data file
Console.WriteLine(" - Opening " + m<StructureNoplural>FileSpec + "...")
open(chin=0,i:i,m<StructureNoplural>FileSpec)

;//
;// ENABLE_GET_ALL
;//
<IF DEFINED_ENABLE_GET_ALL>
;Total number of records
Console.WriteLine(" - Counting records...")
count = 0
repeat
begin
Expand All @@ -54,13 +73,15 @@ namespace Services.Test.GenerateValues
Console.WriteLine("ERROR: Failed to read record from <FILE_NAME>")
exitloop
end
;//
;//RELATION LOGIC MISSING
</IF DEFINED_ENABLE_GET_ALL>
;//
;// ENABLE_GET_ONE
;//
<IF DEFINED_ENABLE_GET_ONE>
;Get by primary key
Console.WriteLine(" - Determining parameters for read by primary key...")
repeat
begin
read(chin,<structureNoplural>,^LAST) [ERR=eof<StructureNoplural>2]
Expand Down Expand Up @@ -119,10 +140,11 @@ namespace Services.Test.GenerateValues
</IF STRUCTURE_ISAM>
</STRUCTURE_LOOP>

;Determine where to create the output file
data jsonFilePath = <UNIT_TESTS_NAMESPACE>.UnitTestEnvironment.FindRelativeFolderForAssembly("<UNIT_TESTS_NAMESPACE>")
File.WriteAllText(Path.Combine(jsonFilePath, "TestConstants.Values.json"), JsonSerializer.Serialize(TestConstants.Instance, new JsonSerializerOptions(){ WriteIndented = true }))
endmethod

endclass

endnamespace
endnamespace
4 changes: 2 additions & 2 deletions Templates/MySQL/ODataStartup.tpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<CODEGEN_FILENAME>Startup.dbl</CODEGEN_FILENAME>
<REQUIRES_CODEGEN_VERSION>5.4.6</REQUIRES_CODEGEN_VERSION>
<REQUIRES_CODEGEN_VERSION>5.8.5</REQUIRES_CODEGEN_VERSION>
<REQUIRES_USERTOKEN>API_DOCS_PATH</REQUIRES_USERTOKEN>
<REQUIRES_USERTOKEN>API_TITLE</REQUIRES_USERTOKEN>
<REQUIRES_USERTOKEN>MODELS_NAMESPACE</REQUIRES_USERTOKEN>
Expand Down Expand Up @@ -338,7 +338,7 @@ namespace <NAMESPACE>
data mvcBuilder = services.AddMvcCore(MvcCoreConfig)
& .SetCompatibilityVersion(CompatibilityVersion.Version_2_2 )
& .AddDataAnnotations() ;;Enable data annotations
& .AddNewtonsoftJson(<IF DEFINED_ENABLE_NEWTONSOFT>lambda (opts) { opts.SerializerSettings.ContractResolver = new Newtonsoft.Json.Serialization.DefaultContractResolver()}</IF>)
& .AddNewtonsoftJson(<IF DEFINED_ENABLE_NEWTONSOFT>lambda (opts) { opts.SerializerSettings.ContractResolver = new Newtonsoft.Json.Serialization.DefaultContractResolver()<IF TWEAK_SMC_CAMEL_CASE> {NamingStrategy = new Newtonsoft.Json.Serialization.CamelCaseNamingStrategy()}</IF>}</IF>)
& .AddApplicationPart(^typeof(IsolatedMethodsBase).Assembly)

<IF DEFINED_ENABLE_AUTHENTICATION>
Expand Down
8 changes: 4 additions & 4 deletions Templates/ODataClientModel.tpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<CODEGEN_FILENAME><StructureNoplural>.dbl</CODEGEN_FILENAME>
<REQUIRES_CODEGEN_VERSION>5.4.6</REQUIRES_CODEGEN_VERSION>
<REQUIRES_CODEGEN_VERSION>5.7.5</REQUIRES_CODEGEN_VERSION>
<REQUIRES_OPTION>TF</REQUIRES_OPTION>
<CODEGEN_FOLDER>Models</CODEGEN_FOLDER>
;//****************************************************************************
Expand Down Expand Up @@ -58,7 +58,7 @@ namespace <NAMESPACE>
<FIELD_LOOP>
<IF CUSTOM_NOT_HARMONY_EXCLUDE>
;;; <summary>
;;; <FIELD_DESC>
;;; <FIELD_DESC_DOUBLE>
;;; </summary>
<IF CUSTOM_HARMONY_AS_STRING>
public readwrite property <FieldSqlname>, String
Expand Down Expand Up @@ -131,7 +131,7 @@ namespace <NAMESPACE>

endclass

public class OData<StructureNoplural>
public class OData<StructureNoplural>Single

{JsonProperty("odata.metadata")}
public readwrite property Metadata, string
Expand All @@ -141,7 +141,7 @@ namespace <NAMESPACE>

endclass

public class OData<StructurePlural>
public class OData<StructurePlural>Multiple

{JsonProperty("odata.metadata")}
public readwrite property Metadata, string
Expand Down
Loading