diff options
Diffstat (limited to 'ncomp-sirius-manager-generator/src/main/groovy/org/openecomp/ncomp/sirius/manager/generator/ControllerGenerator.groovy')
-rw-r--r-- | ncomp-sirius-manager-generator/src/main/groovy/org/openecomp/ncomp/sirius/manager/generator/ControllerGenerator.groovy | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/ncomp-sirius-manager-generator/src/main/groovy/org/openecomp/ncomp/sirius/manager/generator/ControllerGenerator.groovy b/ncomp-sirius-manager-generator/src/main/groovy/org/openecomp/ncomp/sirius/manager/generator/ControllerGenerator.groovy index cf2fd59..49c909d 100644 --- a/ncomp-sirius-manager-generator/src/main/groovy/org/openecomp/ncomp/sirius/manager/generator/ControllerGenerator.groovy +++ b/ncomp-sirius-manager-generator/src/main/groovy/org/openecomp/ncomp/sirius/manager/generator/ControllerGenerator.groovy @@ -47,7 +47,8 @@ class ControllerGenerator { String subName
String clientName
String prefix
- String type = "R"
+ String type = "R" + String version = null
ControllerGenerator root; boolean enableDrools = false; boolean enableIRequestHandler = true; @@ -177,7 +178,8 @@ class ControllerGenerator { packageName : packageName(),
cName : "${m.prefix}${o.eClass().name}$n",
fName : factoryName(),
- path : root == this ? "resources" : subName,
+ path : root == this ? "resources" : subName, + version: version ? "\"$version\"" : "null"
]
switch (n) {
case "Provider": env.cName = "${m.prefix}${o.eClass().name}ProviderTemplate"; break
@@ -215,17 +217,16 @@ class ControllerGenerator { def y = [operations:[:], messages:[dummy:[:]]] EClass c = o.eClass() c.getEAllOperations().each { EOperation op -> - y.operations[op.name] = [:] - y.messages[op.name] = [ - errorCode: "$op.name-FAILED-5001W", + y.operations["$c.name@$op.name"] = [:] + y.messages["REQUEST-FAILED-$op.name"] = [ + errorCode: "4001W", messageFormat: "{0}", description: "Operation Failed with Exception" ] } c.getEAllOperations().each { EOperation op -> - y.operations["REMOTE_$op.name"] = [decription:"Remote call $op.name"] - y.messages["REMOTE_$op.name"] = [ - errorCode: "REMOTE-$op.name-FAILED-5001W", + y.messages["REMOTE-CALL-FAILED-$op.name"] = [ + errorCode: "4001W", messageFormat: "{0}", description: "Remote Operation Failed with Exception" ] @@ -245,7 +246,8 @@ class ControllerGenerator { g.subName = subpackage
g.type = "O" g.enableIRequestHandler = enableIRequestHandler - g.enableISiriusPlugin = enableISiriusPlugin
+ g.enableISiriusPlugin = enableISiriusPlugin + g.version = version
subApis += g
}
public void addApi(String name, EObject o, ControllerModel m, boolean enableIRequestHandler = false, boolean enableISiriusPlugin = false) {
@@ -254,7 +256,8 @@ class ControllerGenerator { g.subName = name
g.type = "A" g.enableIRequestHandler = enableIRequestHandler - g.enableISiriusPlugin = enableISiriusPlugin
+ g.enableISiriusPlugin = enableISiriusPlugin + g.version = version
subApis += g
}
public void addProvider(String name, EObject o, ControllerModel m) { @@ -264,6 +267,7 @@ class ControllerGenerator { g.type = "P" g.enableIRequestHandler = false g.enableISiriusPlugin = false + g.version = version subApis += g } def subClients = []
@@ -273,7 +277,8 @@ class ControllerGenerator { g.clientName = name
g.type = "C" g.enableIRequestHandler = enableIRequestHandler - g.enableISiriusPlugin = enableISiriusPlugin
+ g.enableISiriusPlugin = enableISiriusPlugin + g.version = version
subClients += g
}
List<String> aliases = new ArrayList<String>();
|