From dbeed2e0567a7d43e63b100f8a71a98059cf9c9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martti=20K=C3=A4=C3=A4rik?= Date: Fri, 18 Oct 2024 10:27:52 +0300 Subject: [PATCH] Renamed Standard to TDL + updated HTTP --- .../library/predefined.tdl | 2 +- .../ui/wizard/TDLtxFileTemplateProvider.xtend | 4 ++-- .../etsi/mts/tdl/ui/wizard/TDLtxProject.xtend | 6 ++--- .../mts/tdl/ui/wizard/TDLtxProjectBase.xtend | 6 ++--- .../ui/wizard/TDLtxProjectWithOpenAPI.xtend | 8 +++---- .../templates/HTTP.tdltx | 24 +++++++++---------- .../templates/{Standard.tdltx => TDL.tdltx} | 2 +- .../templates/templates.xml | 4 ++-- .../templates/templates.xmlback | 4 ++-- 9 files changed, 29 insertions(+), 31 deletions(-) rename plugins/org.etsi.mts.tdl.tx.ui/templates/{Standard.tdltx => TDL.tdltx} (98%) diff --git a/plugins/org.etsi.mts.tdl.model/library/predefined.tdl b/plugins/org.etsi.mts.tdl.model/library/predefined.tdl index 586a3d5e..a8fbf71f 100644 --- a/plugins/org.etsi.mts.tdl.model/library/predefined.tdl +++ b/plugins/org.etsi.mts.tdl.model/library/predefined.tdl @@ -1,5 +1,5 @@ - + diff --git a/plugins/org.etsi.mts.tdl.tx.ui/src/org/etsi/mts/tdl/ui/wizard/TDLtxFileTemplateProvider.xtend b/plugins/org.etsi.mts.tdl.tx.ui/src/org/etsi/mts/tdl/ui/wizard/TDLtxFileTemplateProvider.xtend index 3c68a8f9..b2bc99e8 100644 --- a/plugins/org.etsi.mts.tdl.tx.ui/src/org/etsi/mts/tdl/ui/wizard/TDLtxFileTemplateProvider.xtend +++ b/plugins/org.etsi.mts.tdl.tx.ui/src/org/etsi/mts/tdl/ui/wizard/TDLtxFileTemplateProvider.xtend @@ -50,8 +50,8 @@ final class TDLtxFile { final class TDLtxLibrary { //TODO: make it more sensible //TODO: name should not be asked for... - val name = text("Name:", "Standard") - val packageName = combo("Library:", #["Standard", "HTTP"], "The library to be added.") + val name = text("Name:", "TDL") + val packageName = combo("Library:", #["TDL", "HTTP"], "The library to be added.") var validated = false override protected updateVariables() { diff --git a/plugins/org.etsi.mts.tdl.tx.ui/src/org/etsi/mts/tdl/ui/wizard/TDLtxProject.xtend b/plugins/org.etsi.mts.tdl.tx.ui/src/org/etsi/mts/tdl/ui/wizard/TDLtxProject.xtend index 0f446b33..755d3764 100644 --- a/plugins/org.etsi.mts.tdl.tx.ui/src/org/etsi/mts/tdl/ui/wizard/TDLtxProject.xtend +++ b/plugins/org.etsi.mts.tdl.tx.ui/src/org/etsi/mts/tdl/ui/wizard/TDLtxProject.xtend @@ -29,7 +29,7 @@ final class TDLtxProject { val name = text("Main Package Name:", "Main", "The name of the main package") val path = text("Path:", "tdl", "The package path to place the files in", advancedGroup) //TODO: add other options - val importStandard = check("Import Standard Library", true, "Import TDL standard library definitions.", advancedGroup) + val importStandard = check("Import TDL Library", true, "Import TDL standard library definitions.", advancedGroup) val importHTTP = check("Import HTTP Library", false, "Import TDL HTTP library definitions.", advancedGroup) val extendedNature = check("Add additional natures", false, "Add Eclipse Plug-in and Java natures", advancedGroup) @@ -74,8 +74,8 @@ final class TDLtxProject { //TODO: remove hardcoded import var imports = "" if (importStandard.value) { - addFile('''src/«path»/Standard.tdltx''', TemplateHelper.getLibrary("Standard")) - imports += "Import all from Standard\n" + addFile('''src/«path»/TDL.tdltx''', TemplateHelper.getLibrary("TDL")) + imports += "Import all from TDL\n" } if (importHTTP.value) { addFile('''src/«path»/HTTP.tdltx''', TemplateHelper.getLibrary("HTTP")) diff --git a/plugins/org.etsi.mts.tdl.tx.ui/src/org/etsi/mts/tdl/ui/wizard/TDLtxProjectBase.xtend b/plugins/org.etsi.mts.tdl.tx.ui/src/org/etsi/mts/tdl/ui/wizard/TDLtxProjectBase.xtend index 465b544f..4f384274 100644 --- a/plugins/org.etsi.mts.tdl.tx.ui/src/org/etsi/mts/tdl/ui/wizard/TDLtxProjectBase.xtend +++ b/plugins/org.etsi.mts.tdl.tx.ui/src/org/etsi/mts/tdl/ui/wizard/TDLtxProjectBase.xtend @@ -29,7 +29,7 @@ final class TDLtxProjectBase { val name = text("Main Package Name:", "Main", "The name of the main package") val path = text("Path:", "tdl", "The package path to place the files in", advancedGroup) //TODO: add other options - val importStandard = check("Import Standard Library", true, "Import TDL standard library definitions.", advancedGroup) + val importStandard = check("Import TDL Library", true, "Import TDL standard library definitions.", advancedGroup) val importHTTP = check("Import HTTP Library", false, "Import TDL HTTP library definitions.", advancedGroup) val extendedNature = check("Add additional natures", false, "Add Eclipse Plug-in and Java natures", advancedGroup) @@ -74,8 +74,8 @@ final class TDLtxProjectBase { //TODO: remove hardcoded import var imports = "" if (importStandard.value) { - addFile('''src/«path»/Standard.tdltx''', TemplateHelper.getLibrary("Standard")) - imports += "Import all from Standard\n" + addFile('''src/«path»/TDL.tdltx''', TemplateHelper.getLibrary("TDL")) + imports += "Import all from TDL\n" } if (importHTTP.value) { addFile('''src/«path»/HTTP.tdltx''', TemplateHelper.getLibrary("HTTP")) diff --git a/plugins/org.etsi.mts.tdl.tx.ui/src/org/etsi/mts/tdl/ui/wizard/TDLtxProjectWithOpenAPI.xtend b/plugins/org.etsi.mts.tdl.tx.ui/src/org/etsi/mts/tdl/ui/wizard/TDLtxProjectWithOpenAPI.xtend index 35fb43aa..2bc04505 100644 --- a/plugins/org.etsi.mts.tdl.tx.ui/src/org/etsi/mts/tdl/ui/wizard/TDLtxProjectWithOpenAPI.xtend +++ b/plugins/org.etsi.mts.tdl.tx.ui/src/org/etsi/mts/tdl/ui/wizard/TDLtxProjectWithOpenAPI.xtend @@ -39,7 +39,7 @@ final class TDLtxProjectWithOpenAPI { // val name = combo("Package Name:", #["Example", "Sample", "Tutorial", "Pack"], "The name of the package", advancedGroup) val name = text("Main Package Name:", "Main", "The name of the main package") //TODO: add other options - val importStandard = check("Import Standard Library", true, "Import TDL standard library definitions.", advancedGroup) + val importStandard = check("Import TDL Library", true, "Import TDL standard library definitions.", advancedGroup) val importHTTP = check("Import HTTP Library", false, "Import TDL HTTP library definitions.", advancedGroup) val extendedNature = check("Add additional natures", false, "Add Eclipse Plug-in and Java natures", advancedGroup) val path = text("Path:", "tdl", "The package path to place the files in", advancedGroup) @@ -99,8 +99,8 @@ final class TDLtxProjectWithOpenAPI { //TODO: remove hardcoded import var imports = "" if (importStandard.value) { - addFile('''src/«path»/Standard.tdltx''', TemplateHelper.getLibrary("Standard")) - imports += "Import all from Standard\n" + addFile('''src/«path»/TDL.tdltx''', TemplateHelper.getLibrary("TDL")) + imports += "Import all from TDL\n" } if (importHTTP.value) { addFile('''src/«path»/HTTP.tdltx''', TemplateHelper.getLibrary("HTTP")) @@ -120,7 +120,7 @@ final class TDLtxProjectWithOpenAPI { * This is an example package */ Package «name» { - Import all from Standard + Import all from TDL Import all from «importsName» Type simple } diff --git a/plugins/org.etsi.mts.tdl.tx.ui/templates/HTTP.tdltx b/plugins/org.etsi.mts.tdl.tx.ui/templates/HTTP.tdltx index b1a4f2f0..23faf1d0 100644 --- a/plugins/org.etsi.mts.tdl.tx.ui/templates/HTTP.tdltx +++ b/plugins/org.etsi.mts.tdl.tx.ui/templates/HTTP.tdltx @@ -12,10 +12,11 @@ Package HTTP { connect client::http to server::http } - } Note : "Message based types and instances" + } + Note : "Message based types and instances" Package MessageBased { - Import all from Standard + Import all from TDL //Generic Method type -> required for generation!!! Enumerated Method { @@ -76,22 +77,19 @@ Package HTTP { String ^name, String ^value ) - Type Location - Location path - Location query - - //may need a structure, not necessarily relevant in standardized testing - Location cookie + Enumerated Location { + Location path, + Location query, + //may need a structure, not necessarily relevant in standardized testing + Location cookie + } + + Annotation QueryParameters - //separate headers -> not necessary - //Location header; Collection Headers of Header Structure Header ( String ^name, String ^value - //not relevant in TDL? - //optional contentLength of type Integer, - //optional contentType of type String ) //Base body for extension diff --git a/plugins/org.etsi.mts.tdl.tx.ui/templates/Standard.tdltx b/plugins/org.etsi.mts.tdl.tx.ui/templates/TDL.tdltx similarity index 98% rename from plugins/org.etsi.mts.tdl.tx.ui/templates/Standard.tdltx rename to plugins/org.etsi.mts.tdl.tx.ui/templates/TDL.tdltx index 9af8d103..38829c35 100644 --- a/plugins/org.etsi.mts.tdl.tx.ui/templates/Standard.tdltx +++ b/plugins/org.etsi.mts.tdl.tx.ui/templates/TDL.tdltx @@ -1,4 +1,4 @@ -Package Standard { +Package TDL { //TODO: extract to standard library Constraint length Constraint minLength diff --git a/plugins/org.etsi.mts.tdl.tx.ui/templates/templates.xml b/plugins/org.etsi.mts.tdl.tx.ui/templates/templates.xml index 9b51117f..fa5eee19 100644 --- a/plugins/org.etsi.mts.tdl.tx.ui/templates/templates.xml +++ b/plugins/org.etsi.mts.tdl.tx.ui/templates/templates.xml @@ -128,8 +128,8 @@ with { } } -