From d1f5f297597552fb4a27538c7d0e8361be25cfa7 Mon Sep 17 00:00:00 2001 From: Alexander Edelmann Date: Sun, 2 Jul 2017 21:56:07 +0800 Subject: [PATCH] Fixes #652, Fixes #653 --- .../META-INF/MANIFEST.MF | 3 +- .../vorto/codegen/aws/AWSGenerator.xtend | 11 +- .../templates/AbstractAlexaTemplate.xtend | 4 +- .../templates/AlexaIndentSchemaTemplate.xtend | 2 +- .../templates/AlexaSkillLambdaTemplate.xtend | 29 ++- .../templates/AlexaSlotTypeTemplate.xtend | 2 +- .../templates/AlexaUtterancesTemplate.xtend | 2 +- .../alexa/AbstractAlexaTemplate.xtend | 134 ++++++------- .../alexa/AlexaIndentSchemaTemplate.xtend | 128 ++++++------- .../alexa/AlexaSkillLambdaTemplate.xtend | 158 +++++++-------- .../alexa/AlexaSlotTypeTemplate.xtend | 78 ++++---- .../alexa/AlexaUtterancesTemplate.xtend | 144 +++++++------- .../shadow/GetThingShadowLambdaTemplate.xtend | 120 ++++++------ .../shadow/ThingShadowForOperationsTask.java | 134 ++++++------- .../UpdateThingShadowLambdaTemplate.xtend | 180 +++++++++--------- .../bosch/things/BoschIoTThingsGenerator.java | 43 ++++- .../bosch/things/alexa/AlexaThingsTask.java | 57 ------ .../vorto/codegen/gateway/GatewayInit.java | 3 +- .../gateway/templates/AWSConfigTemplate.xtend | 49 +++++ .../templates/BoschThingsConfigTemplate.xtend | 26 ++- .../main/resources/generators/aws.properties | 2 +- .../generators/bosch-things.properties | 2 +- 22 files changed, 690 insertions(+), 621 deletions(-) rename generators/{org.eclipse.vorto.codegen.bosch.things/src/org/eclipse/vorto/codegen/bosch/things => org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws}/alexa/templates/AbstractAlexaTemplate.xtend (96%) rename generators/{org.eclipse.vorto.codegen.bosch.things/src/org/eclipse/vorto/codegen/bosch/things => org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws}/alexa/templates/AlexaIndentSchemaTemplate.xtend (96%) rename generators/{org.eclipse.vorto.codegen.bosch.things/src/org/eclipse/vorto/codegen/bosch/things => org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws}/alexa/templates/AlexaSkillLambdaTemplate.xtend (88%) rename generators/{org.eclipse.vorto.codegen.bosch.things/src/org/eclipse/vorto/codegen/bosch/things => org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws}/alexa/templates/AlexaSlotTypeTemplate.xtend (94%) rename generators/{org.eclipse.vorto.codegen.bosch.things/src/org/eclipse/vorto/codegen/bosch/things => org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws}/alexa/templates/AlexaUtterancesTemplate.xtend (97%) delete mode 100644 generators/org.eclipse.vorto.codegen.bosch.things/src/org/eclipse/vorto/codegen/bosch/things/alexa/AlexaThingsTask.java create mode 100644 server/generators/org.eclipse.vorto.codegen.service.gateway/src/main/java/org/eclipse/vorto/codegen/gateway/templates/AWSConfigTemplate.xtend diff --git a/generators/org.eclipse.vorto.codegen.aws/META-INF/MANIFEST.MF b/generators/org.eclipse.vorto.codegen.aws/META-INF/MANIFEST.MF index b2cd52e77c..d8215f78e2 100644 --- a/generators/org.eclipse.vorto.codegen.aws/META-INF/MANIFEST.MF +++ b/generators/org.eclipse.vorto.codegen.aws/META-INF/MANIFEST.MF @@ -8,7 +8,8 @@ Require-Bundle: org.eclipse.vorto.core, org.eclipse.xtext.xbase.lib, org.eclipse.xtend.lib, org.eclipse.xtend.lib.macro, - org.eclipse.vorto.codegen + org.eclipse.vorto.codegen, + org.apache.commons.lang3 Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy Export-Package: org.eclipse.vorto.codegen.aws diff --git a/generators/org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws/AWSGenerator.xtend b/generators/org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws/AWSGenerator.xtend index dc3f7aa2ca..d26329e11a 100644 --- a/generators/org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws/AWSGenerator.xtend +++ b/generators/org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws/AWSGenerator.xtend @@ -22,11 +22,10 @@ import org.eclipse.vorto.codegen.api.IVortoCodeGenProgressMonitor import org.eclipse.vorto.codegen.api.IVortoCodeGenerator import org.eclipse.vorto.codegen.api.InvocationContext import org.eclipse.vorto.codegen.api.VortoCodeGeneratorException -import org.eclipse.vorto.codegen.aws.templates.alexa.AlexaIndentSchemaTemplate -import org.eclipse.vorto.codegen.aws.templates.alexa.AlexaSkillLambdaTemplate -import org.eclipse.vorto.codegen.aws.templates.alexa.AlexaSlotTypeTemplate -import org.eclipse.vorto.codegen.aws.templates.alexa.AlexaUtterancesTemplate -import org.eclipse.vorto.codegen.aws.templates.shadow.ThingShadowForOperationsTask +import org.eclipse.vorto.codegen.aws.alexa.templates.AlexaIndentSchemaTemplate +import org.eclipse.vorto.codegen.aws.alexa.templates.AlexaSkillLambdaTemplate +import org.eclipse.vorto.codegen.aws.alexa.templates.AlexaSlotTypeTemplate +import org.eclipse.vorto.codegen.aws.alexa.templates.AlexaUtterancesTemplate import org.eclipse.vorto.codegen.utils.Utils import org.eclipse.vorto.core.api.model.datatype.Enum import org.eclipse.vorto.core.api.model.informationmodel.FunctionblockProperty @@ -42,7 +41,7 @@ class AWSGenerator implements IVortoCodeGenerator { var output = new GenerationResultZip(infomodel,getServiceKey()); var chainedGenerators = new ChainedCodeGeneratorTask(); - chainedGenerators.addTask(new ThingShadowForOperationsTask()); +// chainedGenerators.addTask(new ThingShadowForOperationsTask()); // Adds Generators for Speech to Command using Alexa Skill Service. // That way it is possible to update a thing shadow by various speech command variations defined as mapping rules diff --git a/generators/org.eclipse.vorto.codegen.bosch.things/src/org/eclipse/vorto/codegen/bosch/things/alexa/templates/AbstractAlexaTemplate.xtend b/generators/org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws/alexa/templates/AbstractAlexaTemplate.xtend similarity index 96% rename from generators/org.eclipse.vorto.codegen.bosch.things/src/org/eclipse/vorto/codegen/bosch/things/alexa/templates/AbstractAlexaTemplate.xtend rename to generators/org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws/alexa/templates/AbstractAlexaTemplate.xtend index 2f6d22f73b..b4f9e6f89f 100644 --- a/generators/org.eclipse.vorto.codegen.bosch.things/src/org/eclipse/vorto/codegen/bosch/things/alexa/templates/AbstractAlexaTemplate.xtend +++ b/generators/org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws/alexa/templates/AbstractAlexaTemplate.xtend @@ -12,7 +12,7 @@ * Contributors: * Bosch Software Innovations GmbH - Please refer to git log */ -package org.eclipse.vorto.codegen.bosch.things.alexa.templates +package org.eclipse.vorto.codegen.aws.alexa.templates import org.eclipse.vorto.codegen.api.IFileTemplate import org.eclipse.vorto.core.api.model.datatype.Enum @@ -27,7 +27,7 @@ abstract class AbstractAlexaTemplate implements IFileTemplate protected static final String STEREOTYPE_ALEXA = "alexa"; override getPath(InformationModel context) { - return "alexa"; + return "aws/alexa"; } protected def boolean isAlexaSupportedParamType(Param param) { diff --git a/generators/org.eclipse.vorto.codegen.bosch.things/src/org/eclipse/vorto/codegen/bosch/things/alexa/templates/AlexaIndentSchemaTemplate.xtend b/generators/org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws/alexa/templates/AlexaIndentSchemaTemplate.xtend similarity index 96% rename from generators/org.eclipse.vorto.codegen.bosch.things/src/org/eclipse/vorto/codegen/bosch/things/alexa/templates/AlexaIndentSchemaTemplate.xtend rename to generators/org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws/alexa/templates/AlexaIndentSchemaTemplate.xtend index 3406c83ead..ba91bd5144 100644 --- a/generators/org.eclipse.vorto.codegen.bosch.things/src/org/eclipse/vorto/codegen/bosch/things/alexa/templates/AlexaIndentSchemaTemplate.xtend +++ b/generators/org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws/alexa/templates/AlexaIndentSchemaTemplate.xtend @@ -12,7 +12,7 @@ * Contributors: * Bosch Software Innovations GmbH - Please refer to git log */ -package org.eclipse.vorto.codegen.bosch.things.alexa.templates +package org.eclipse.vorto.codegen.aws.alexa.templates import org.eclipse.vorto.codegen.api.InvocationContext import org.eclipse.vorto.core.api.model.informationmodel.InformationModel diff --git a/generators/org.eclipse.vorto.codegen.bosch.things/src/org/eclipse/vorto/codegen/bosch/things/alexa/templates/AlexaSkillLambdaTemplate.xtend b/generators/org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws/alexa/templates/AlexaSkillLambdaTemplate.xtend similarity index 88% rename from generators/org.eclipse.vorto.codegen.bosch.things/src/org/eclipse/vorto/codegen/bosch/things/alexa/templates/AlexaSkillLambdaTemplate.xtend rename to generators/org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws/alexa/templates/AlexaSkillLambdaTemplate.xtend index 37fb31d05a..48bd55bd00 100644 --- a/generators/org.eclipse.vorto.codegen.bosch.things/src/org/eclipse/vorto/codegen/bosch/things/alexa/templates/AlexaSkillLambdaTemplate.xtend +++ b/generators/org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws/alexa/templates/AlexaSkillLambdaTemplate.xtend @@ -12,9 +12,8 @@ * Contributors: * Bosch Software Innovations GmbH - Please refer to git log */ -package org.eclipse.vorto.codegen.bosch.things.alexa.templates +package org.eclipse.vorto.codegen.aws.alexa.templates -import org.apache.commons.lang3.StringUtils import org.eclipse.vorto.codegen.api.InvocationContext import org.eclipse.vorto.core.api.model.informationmodel.InformationModel @@ -31,6 +30,7 @@ class AlexaSkillLambdaTemplate extends AbstractAlexaTemplate { var reprompt; var welcomeOutput = "Let's ask the «element.name». What do you want to know?"; + «IF context.configurationProperties.getOrDefault("boschcloud","false").equalsIgnoreCase("true")» var thingsApiToken = "INSERT API TOKEN OF BOSCH IOT THINGS HERE"; var thingId = «context.configurationProperties.getOrDefault("thingId","\"INSERT THING ID HERE\"")»; var username= "INSERT USERNAME HERE"; @@ -38,6 +38,16 @@ class AlexaSkillLambdaTemplate extends AbstractAlexaTemplate { var http = require('http'); + «ENDIF» + «IF context.configurationProperties.getOrDefault("awsiot","false").equalsIgnoreCase("true")» + var config = { + "thingName": "", + "endpointAddress": "" + } + + var AWS = require('aws-sdk'); + var iotdata = new AWS.IotData({endpoint: config.endpointAddress}); + «ENDIF» // --------------- Helpers that build all of the responses ----------------------- @@ -109,6 +119,7 @@ class AlexaSkillLambdaTemplate extends AbstractAlexaTemplate { console.log("in fetch«fbProperty.name.toFirstUpper»«statusProperty.name.toFirstUpper»"); var sessionAttributes = {}; + «IF context.configurationProperties.getOrDefault("boschcloud","false").equalsIgnoreCase("true")» var httpRequest = { host : "things.apps.bosch-iot-cloud.com", path: "/api/1/things/"+thingId, @@ -129,6 +140,20 @@ class AlexaSkillLambdaTemplate extends AbstractAlexaTemplate { callback(sessionAttributes, buildSpeechletResponse("«fbProperty.name»", speechOutput, "", true)); }); }); + «ENDIF» + «IF context.configurationProperties.getOrDefault("awsiot","false").equalsIgnoreCase("true")» + iotdata.getThingShadow({ + thingName: config.thingName + },function(err, data) { + if (err) { + callback(err); + } else { + var jsonPayload = JSON.parse(data.payload); + speechOutput = jsonPayload.state.reported["«element.name»"]; + callback(sessionAttributes, buildSpeechletResponse("«fbProperty.name»", speechOutput, "", true)); + } + }); + «ENDIF» } «ENDFOR» «ENDIF» diff --git a/generators/org.eclipse.vorto.codegen.bosch.things/src/org/eclipse/vorto/codegen/bosch/things/alexa/templates/AlexaSlotTypeTemplate.xtend b/generators/org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws/alexa/templates/AlexaSlotTypeTemplate.xtend similarity index 94% rename from generators/org.eclipse.vorto.codegen.bosch.things/src/org/eclipse/vorto/codegen/bosch/things/alexa/templates/AlexaSlotTypeTemplate.xtend rename to generators/org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws/alexa/templates/AlexaSlotTypeTemplate.xtend index 739d69fb92..3583ca61d6 100644 --- a/generators/org.eclipse.vorto.codegen.bosch.things/src/org/eclipse/vorto/codegen/bosch/things/alexa/templates/AlexaSlotTypeTemplate.xtend +++ b/generators/org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws/alexa/templates/AlexaSlotTypeTemplate.xtend @@ -12,7 +12,7 @@ * Contributors: * Bosch Software Innovations GmbH - Please refer to git log */ -package org.eclipse.vorto.codegen.bosch.things.alexa.templates +package org.eclipse.vorto.codegen.aws.alexa.templates import org.eclipse.vorto.codegen.api.IFileTemplate import org.eclipse.vorto.core.api.model.datatype.Enum diff --git a/generators/org.eclipse.vorto.codegen.bosch.things/src/org/eclipse/vorto/codegen/bosch/things/alexa/templates/AlexaUtterancesTemplate.xtend b/generators/org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws/alexa/templates/AlexaUtterancesTemplate.xtend similarity index 97% rename from generators/org.eclipse.vorto.codegen.bosch.things/src/org/eclipse/vorto/codegen/bosch/things/alexa/templates/AlexaUtterancesTemplate.xtend rename to generators/org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws/alexa/templates/AlexaUtterancesTemplate.xtend index 4dd4eedf72..96ac0b4c47 100644 --- a/generators/org.eclipse.vorto.codegen.bosch.things/src/org/eclipse/vorto/codegen/bosch/things/alexa/templates/AlexaUtterancesTemplate.xtend +++ b/generators/org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws/alexa/templates/AlexaUtterancesTemplate.xtend @@ -12,7 +12,7 @@ * Contributors: * Bosch Software Innovations GmbH - Please refer to git log */ -package org.eclipse.vorto.codegen.bosch.things.alexa.templates +package org.eclipse.vorto.codegen.aws.alexa.templates import org.eclipse.vorto.codegen.api.InvocationContext import org.eclipse.vorto.core.api.model.datatype.Property diff --git a/generators/org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws/templates/alexa/AbstractAlexaTemplate.xtend b/generators/org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws/templates/alexa/AbstractAlexaTemplate.xtend index fc21c262dc..f7432ae6eb 100644 --- a/generators/org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws/templates/alexa/AbstractAlexaTemplate.xtend +++ b/generators/org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws/templates/alexa/AbstractAlexaTemplate.xtend @@ -1,67 +1,67 @@ -/******************************************************************************* - * Copyright (c) 2015, 2016 Bosch Software Innovations GmbH and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * and Eclipse Distribution License v1.0 which accompany this distribution. - * - * The Eclipse Public License is available at - * http://www.eclipse.org/legal/epl-v10.html - * The Eclipse Distribution License is available at - * http://www.eclipse.org/org/documents/edl-v10.php. - * - * Contributors: - * Bosch Software Innovations GmbH - Please refer to git log - *******************************************************************************/ -package org.eclipse.vorto.codegen.aws.templates.alexa - -import org.eclipse.vorto.codegen.api.IFileTemplate -import org.eclipse.vorto.core.api.model.datatype.Enum -import org.eclipse.vorto.core.api.model.datatype.PrimitiveType -import org.eclipse.vorto.core.api.model.functionblock.Param -import org.eclipse.vorto.core.api.model.functionblock.PrimitiveParam -import org.eclipse.vorto.core.api.model.functionblock.RefParam -import org.eclipse.vorto.core.api.model.informationmodel.InformationModel - -/** - * @author Alexander Edelmann (Robert Bosch (SEA) Pte. Ltd) - */ -abstract class AbstractAlexaTemplate implements IFileTemplate { - - protected static final String STEREOTYPE_ALEXA = "alexa"; - - override getPath(InformationModel context) { - return "aws/alexa"; - } - - protected def boolean isAlexaSupportedParamType(Param param) { - if (param instanceof PrimitiveParam) { - var primitiveType = (param as PrimitiveParam).type; - if (primitiveType == PrimitiveType.INT || - primitiveType == PrimitiveType.DATETIME || - primitiveType == PrimitiveType.LONG) { - return true; - } else { - return false; - } - } else if (param instanceof RefParam && (param as RefParam).type instanceof Enum ) { - return true; - } else { - return false; - } - } - - protected def String mapToAlexaSupportedType(Param param) { - if (param instanceof PrimitiveParam) { - var primitiveType = (param as PrimitiveParam).type; - if (primitiveType == PrimitiveType.INT || primitiveType == PrimitiveType.LONG) { - return "AMAZON.NUMBER"; - } else if (primitiveType == PrimitiveType.DATETIME) { - return "AMAZON.DATE"; - } - } else if(param instanceof RefParam && (param as RefParam).type instanceof Enum) { - return (param as RefParam).type.name - } - - return null; - } -} +///******************************************************************************* +// * Copyright (c) 2015, 2016 Bosch Software Innovations GmbH and others. +// * All rights reserved. This program and the accompanying materials +// * are made available under the terms of the Eclipse Public License v1.0 +// * and Eclipse Distribution License v1.0 which accompany this distribution. +// * +// * The Eclipse Public License is available at +// * http://www.eclipse.org/legal/epl-v10.html +// * The Eclipse Distribution License is available at +// * http://www.eclipse.org/org/documents/edl-v10.php. +// * +// * Contributors: +// * Bosch Software Innovations GmbH - Please refer to git log +// *******************************************************************************/ +//package org.eclipse.vorto.codegen.aws.templates.alexa +// +//import org.eclipse.vorto.codegen.api.IFileTemplate +//import org.eclipse.vorto.core.api.model.datatype.Enum +//import org.eclipse.vorto.core.api.model.datatype.PrimitiveType +//import org.eclipse.vorto.core.api.model.functionblock.Param +//import org.eclipse.vorto.core.api.model.functionblock.PrimitiveParam +//import org.eclipse.vorto.core.api.model.functionblock.RefParam +//import org.eclipse.vorto.core.api.model.informationmodel.InformationModel +// +///** +// * @author Alexander Edelmann (Robert Bosch (SEA) Pte. Ltd) +// */ +//abstract class AbstractAlexaTemplate implements IFileTemplate { +// +// protected static final String STEREOTYPE_ALEXA = "alexa"; +// +// override getPath(InformationModel context) { +// return "aws/alexa"; +// } +// +// protected def boolean isAlexaSupportedParamType(Param param) { +// if (param instanceof PrimitiveParam) { +// var primitiveType = (param as PrimitiveParam).type; +// if (primitiveType == PrimitiveType.INT || +// primitiveType == PrimitiveType.DATETIME || +// primitiveType == PrimitiveType.LONG) { +// return true; +// } else { +// return false; +// } +// } else if (param instanceof RefParam && (param as RefParam).type instanceof Enum ) { +// return true; +// } else { +// return false; +// } +// } +// +// protected def String mapToAlexaSupportedType(Param param) { +// if (param instanceof PrimitiveParam) { +// var primitiveType = (param as PrimitiveParam).type; +// if (primitiveType == PrimitiveType.INT || primitiveType == PrimitiveType.LONG) { +// return "AMAZON.NUMBER"; +// } else if (primitiveType == PrimitiveType.DATETIME) { +// return "AMAZON.DATE"; +// } +// } else if(param instanceof RefParam && (param as RefParam).type instanceof Enum) { +// return (param as RefParam).type.name +// } +// +// return null; +// } +//} diff --git a/generators/org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws/templates/alexa/AlexaIndentSchemaTemplate.xtend b/generators/org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws/templates/alexa/AlexaIndentSchemaTemplate.xtend index 88a39e4dff..35a0cde599 100644 --- a/generators/org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws/templates/alexa/AlexaIndentSchemaTemplate.xtend +++ b/generators/org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws/templates/alexa/AlexaIndentSchemaTemplate.xtend @@ -1,64 +1,64 @@ -/******************************************************************************* - * Copyright (c) 2015, 2016 Bosch Software Innovations GmbH and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * and Eclipse Distribution License v1.0 which accompany this distribution. - * - * The Eclipse Public License is available at - * http://www.eclipse.org/legal/epl-v10.html - * The Eclipse Distribution License is available at - * http://www.eclipse.org/org/documents/edl-v10.php. - * - * Contributors: - * Bosch Software Innovations GmbH - Please refer to git log - *******************************************************************************/ -package org.eclipse.vorto.codegen.aws.templates.alexa - -import org.eclipse.vorto.codegen.api.InvocationContext -import org.eclipse.vorto.core.api.model.informationmodel.InformationModel - -/** - * @author Alexander Edelmann (Robert Bosch (SEA) Pte. Ltd) - */ -class AlexaIndentSchemaTemplate extends AbstractAlexaTemplate { - - override getFileName(InformationModel context) { - return "IntendSchema.json"; - } - - override getContent(InformationModel element, InvocationContext context) { - ''' - { - "intents": [ - «FOR fbProperty : element.properties» - «FOR operation : fbProperty.type.functionblock.operations SEPARATOR ','» - { - "intent": "«operation.name»"«IF operation.params != null && operation.params.length > 0», - "slots": [ - «FOR param : operation.params SEPARATOR ','» - «IF isAlexaSupportedParamType(param)» - { - "name": "«param.name»", - "type": "«mapToAlexaSupportedType(param)»" - } - «ENDIF» - «ENDFOR» - ] - «ENDIF» - } - «ENDFOR» - «IF fbProperty.type.functionblock.status != null» - «IF fbProperty.type.functionblock.operations.length > 0»,«ENDIF» - «FOR statusProperty : fbProperty.type.functionblock.status.properties SEPARATOR ','» - { - "intent": "«statusProperty.name»Status" - } - «ENDFOR» - «ENDIF» - «ENDFOR» - ] - } - ''' - } - -} +///******************************************************************************* +// * Copyright (c) 2015, 2016 Bosch Software Innovations GmbH and others. +// * All rights reserved. This program and the accompanying materials +// * are made available under the terms of the Eclipse Public License v1.0 +// * and Eclipse Distribution License v1.0 which accompany this distribution. +// * +// * The Eclipse Public License is available at +// * http://www.eclipse.org/legal/epl-v10.html +// * The Eclipse Distribution License is available at +// * http://www.eclipse.org/org/documents/edl-v10.php. +// * +// * Contributors: +// * Bosch Software Innovations GmbH - Please refer to git log +// *******************************************************************************/ +//package org.eclipse.vorto.codegen.aws.templates.alexa +// +//import org.eclipse.vorto.codegen.api.InvocationContext +//import org.eclipse.vorto.core.api.model.informationmodel.InformationModel +// +///** +// * @author Alexander Edelmann (Robert Bosch (SEA) Pte. Ltd) +// */ +//class AlexaIndentSchemaTemplate extends AbstractAlexaTemplate { +// +// override getFileName(InformationModel context) { +// return "IntendSchema.json"; +// } +// +// override getContent(InformationModel element, InvocationContext context) { +// ''' +// { +// "intents": [ +// «FOR fbProperty : element.properties» +// «FOR operation : fbProperty.type.functionblock.operations SEPARATOR ','» +// { +// "intent": "«operation.name»"«IF operation.params != null && operation.params.length > 0», +// "slots": [ +// «FOR param : operation.params SEPARATOR ','» +// «IF isAlexaSupportedParamType(param)» +// { +// "name": "«param.name»", +// "type": "«mapToAlexaSupportedType(param)»" +// } +// «ENDIF» +// «ENDFOR» +// ] +// «ENDIF» +// } +// «ENDFOR» +// «IF fbProperty.type.functionblock.status != null» +// «IF fbProperty.type.functionblock.operations.length > 0»,«ENDIF» +// «FOR statusProperty : fbProperty.type.functionblock.status.properties SEPARATOR ','» +// { +// "intent": "«statusProperty.name»Status" +// } +// «ENDFOR» +// «ENDIF» +// «ENDFOR» +// ] +// } +// ''' +// } +// +//} diff --git a/generators/org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws/templates/alexa/AlexaSkillLambdaTemplate.xtend b/generators/org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws/templates/alexa/AlexaSkillLambdaTemplate.xtend index f8382d165d..e080408f13 100644 --- a/generators/org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws/templates/alexa/AlexaSkillLambdaTemplate.xtend +++ b/generators/org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws/templates/alexa/AlexaSkillLambdaTemplate.xtend @@ -1,79 +1,79 @@ -/******************************************************************************* - * Copyright (c) 2015, 2016 Bosch Software Innovations GmbH and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * and Eclipse Distribution License v1.0 which accompany this distribution. - * - * The Eclipse Public License is available at - * http://www.eclipse.org/legal/epl-v10.html - * The Eclipse Distribution License is available at - * http://www.eclipse.org/org/documents/edl-v10.php. - * - * Contributors: - * Bosch Software Innovations GmbH - Please refer to git log - *******************************************************************************/ -package org.eclipse.vorto.codegen.aws.templates.alexa - -import org.eclipse.vorto.codegen.api.InvocationContext -import org.eclipse.vorto.core.api.model.informationmodel.InformationModel - -/** - * @author Alexander Edelmann (Robert Bosch (SEA) Pte. Ltd) - */ -class AlexaSkillLambdaTemplate extends AbstractAlexaTemplate { - - override getFileName(InformationModel context) { - return "index.js" - } - override getContent(InformationModel element, InvocationContext context) { - ''' - «element.name».prototype.intentHandlers = { - // register custom intent handlers - «FOR fbProperty : element.properties» - «FOR operation : fbProperty.type.functionblock.operations SEPARATOR ','» - "«operation.name»": function (intent, session, response) { - var params = { - FunctionName: '', /* should be ARN */ - ClientContext: null, - InvocationType: 'RequestResponse', - LogType: 'Tail', - Payload: JSON.stringify({«FOR param : operation.params SEPARATOR ','»"«param.name»":intent.slots.«param.name».value«ENDFOR»}), - Qualifier: '$LATEST' - }; - lambda.invoke(params, function(err, data) { - if (err) console.log(err, err.stack); // an error occurred - else { - console.log(data); // successful response - response.tell("Okay I invoked «operation.name» on «element.name» for you."); - } - }); - - } - «ENDFOR» - «IF fbProperty.type.functionblock.status != null» - «FOR statusProperty : fbProperty.type.functionblock.status.properties SEPARATOR ','» - "«statusProperty.name»Status": function (intent, session, response) { - var params = { - FunctionName: '', /* should be ARN */ - ClientContext: null, - InvocationType: 'RequestResponse', - LogType: 'Tail', - Qualifier: '$LATEST' - }; - lambda.invoke(params, function(err, data) { - if (err) console.log(err, err.stack); // an error occurred - else { - console.log(data); // successful response - response.tell("The current «statusProperty.name» status of the «element.name» is "+data.«statusProperty.name»+"."); - } - }); - - } - «ENDFOR» - «ENDIF» - «ENDFOR» - }; - ''' - } - -} +///******************************************************************************* +// * Copyright (c) 2015, 2016 Bosch Software Innovations GmbH and others. +// * All rights reserved. This program and the accompanying materials +// * are made available under the terms of the Eclipse Public License v1.0 +// * and Eclipse Distribution License v1.0 which accompany this distribution. +// * +// * The Eclipse Public License is available at +// * http://www.eclipse.org/legal/epl-v10.html +// * The Eclipse Distribution License is available at +// * http://www.eclipse.org/org/documents/edl-v10.php. +// * +// * Contributors: +// * Bosch Software Innovations GmbH - Please refer to git log +// *******************************************************************************/ +//package org.eclipse.vorto.codegen.aws.templates.alexa +// +//import org.eclipse.vorto.codegen.api.InvocationContext +//import org.eclipse.vorto.core.api.model.informationmodel.InformationModel +// +///** +// * @author Alexander Edelmann (Robert Bosch (SEA) Pte. Ltd) +// */ +//class AlexaSkillLambdaTemplate extends AbstractAlexaTemplate { +// +// override getFileName(InformationModel context) { +// return "index.js" +// } +// override getContent(InformationModel element, InvocationContext context) { +// ''' +// «element.name».prototype.intentHandlers = { +// // register custom intent handlers +// «FOR fbProperty : element.properties» +// «FOR operation : fbProperty.type.functionblock.operations SEPARATOR ','» +// "«operation.name»": function (intent, session, response) { +// var params = { +// FunctionName: '', /* should be ARN */ +// ClientContext: null, +// InvocationType: 'RequestResponse', +// LogType: 'Tail', +// Payload: JSON.stringify({«FOR param : operation.params SEPARATOR ','»"«param.name»":intent.slots.«param.name».value«ENDFOR»}), +// Qualifier: '$LATEST' +// }; +// lambda.invoke(params, function(err, data) { +// if (err) console.log(err, err.stack); // an error occurred +// else { +// console.log(data); // successful response +// response.tell("Okay I invoked «operation.name» on «element.name» for you."); +// } +// }); +// +// } +// «ENDFOR» +// «IF fbProperty.type.functionblock.status != null» +// «FOR statusProperty : fbProperty.type.functionblock.status.properties SEPARATOR ','» +// "«statusProperty.name»Status": function (intent, session, response) { +// var params = { +// FunctionName: '', /* should be ARN */ +// ClientContext: null, +// InvocationType: 'RequestResponse', +// LogType: 'Tail', +// Qualifier: '$LATEST' +// }; +// lambda.invoke(params, function(err, data) { +// if (err) console.log(err, err.stack); // an error occurred +// else { +// console.log(data); // successful response +// response.tell("The current «statusProperty.name» status of the «element.name» is "+data.«statusProperty.name»+"."); +// } +// }); +// +// } +// «ENDFOR» +// «ENDIF» +// «ENDFOR» +// }; +// ''' +// } +// +//} diff --git a/generators/org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws/templates/alexa/AlexaSlotTypeTemplate.xtend b/generators/org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws/templates/alexa/AlexaSlotTypeTemplate.xtend index 680c76f39a..eebd4afa7e 100644 --- a/generators/org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws/templates/alexa/AlexaSlotTypeTemplate.xtend +++ b/generators/org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws/templates/alexa/AlexaSlotTypeTemplate.xtend @@ -1,39 +1,39 @@ -/******************************************************************************* - * Copyright (c) 2015, 2016 Bosch Software Innovations GmbH and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * and Eclipse Distribution License v1.0 which accompany this distribution. - * - * The Eclipse Public License is available at - * http://www.eclipse.org/legal/epl-v10.html - * The Eclipse Distribution License is available at - * http://www.eclipse.org/org/documents/edl-v10.php. - * - * Contributors: - * Bosch Software Innovations GmbH - Please refer to git log - *******************************************************************************/ -package org.eclipse.vorto.codegen.aws.templates.alexa - -import org.eclipse.vorto.codegen.api.IFileTemplate -import org.eclipse.vorto.core.api.model.datatype.Enum -import org.eclipse.vorto.codegen.api.InvocationContext - -class AlexaSlotTypeTemplate implements IFileTemplate { - - override getFileName(Enum context) { - return context.name+"_CustomSlotType.txt" - } - - override getPath(Enum context) { - return "aws/alexa"; - } - - override getContent(Enum element, InvocationContext context) { - ''' - «FOR literal : element.enums» - «literal.name» - «ENDFOR» - ''' - } - -} \ No newline at end of file +///******************************************************************************* +// * Copyright (c) 2015, 2016 Bosch Software Innovations GmbH and others. +// * All rights reserved. This program and the accompanying materials +// * are made available under the terms of the Eclipse Public License v1.0 +// * and Eclipse Distribution License v1.0 which accompany this distribution. +// * +// * The Eclipse Public License is available at +// * http://www.eclipse.org/legal/epl-v10.html +// * The Eclipse Distribution License is available at +// * http://www.eclipse.org/org/documents/edl-v10.php. +// * +// * Contributors: +// * Bosch Software Innovations GmbH - Please refer to git log +// *******************************************************************************/ +//package org.eclipse.vorto.codegen.aws.templates.alexa +// +//import org.eclipse.vorto.codegen.api.IFileTemplate +//import org.eclipse.vorto.core.api.model.datatype.Enum +//import org.eclipse.vorto.codegen.api.InvocationContext +// +//class AlexaSlotTypeTemplate implements IFileTemplate { +// +// override getFileName(Enum context) { +// return context.name+"_CustomSlotType.txt" +// } +// +// override getPath(Enum context) { +// return "aws/alexa"; +// } +// +// override getContent(Enum element, InvocationContext context) { +// ''' +// «FOR literal : element.enums» +// «literal.name» +// «ENDFOR» +// ''' +// } +// +//} \ No newline at end of file diff --git a/generators/org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws/templates/alexa/AlexaUtterancesTemplate.xtend b/generators/org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws/templates/alexa/AlexaUtterancesTemplate.xtend index 34a27eeef3..d066612551 100644 --- a/generators/org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws/templates/alexa/AlexaUtterancesTemplate.xtend +++ b/generators/org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws/templates/alexa/AlexaUtterancesTemplate.xtend @@ -1,72 +1,72 @@ -/******************************************************************************* - * Copyright (c) 2015, 2016 Bosch Software Innovations GmbH and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * and Eclipse Distribution License v1.0 which accompany this distribution. - * - * The Eclipse Public License is available at - * http://www.eclipse.org/legal/epl-v10.html - * The Eclipse Distribution License is available at - * http://www.eclipse.org/org/documents/edl-v10.php. - * - * Contributors: - * Bosch Software Innovations GmbH - Please refer to git log - *******************************************************************************/ -package org.eclipse.vorto.codegen.aws.templates.alexa - -import org.eclipse.vorto.codegen.api.InvocationContext -import org.eclipse.vorto.core.api.model.datatype.Property -import org.eclipse.vorto.core.api.model.functionblock.Operation -import org.eclipse.vorto.core.api.model.informationmodel.InformationModel - -/** - * @author Alexander Edelmann (Robert Bosch (SEA) Pte. Ltd) - */ -class AlexaUtterancesTemplate extends AbstractAlexaTemplate { - - override getFileName(InformationModel context) { - '''«context.name.toLowerCase»Utterances.txt''' - } - - override getContent(InformationModel element, InvocationContext context) { - ''' - «FOR fbProperty : element.properties» - «FOR operation : fbProperty.type.functionblock.operations» - «var mappedElement = context.getMappedElement(operation,STEREOTYPE_ALEXA)» - «var commands = split(mappedElement.getAttributeValue("command",getDefaultCommand(operation).toString))» - «FOR singleCmd : commands» - «operation.name» «singleCmd» - «ENDFOR» - «ENDFOR» - - «IF fbProperty.type.functionblock.status != null» - «FOR statusProperty : fbProperty.type.functionblock.status.properties» - «var mappedElement = context.getMappedElement(statusProperty,STEREOTYPE_ALEXA)» - «var commands = split(mappedElement.getAttributeValue("command",getDefaultCommand(statusProperty).toString))» - «FOR singleCmd : commands» - «statusProperty.name» «singleCmd» - «ENDFOR» - «ENDFOR» - «ENDIF» - - «ENDFOR» - ''' - } - - private def String[] split(String concatenatedValue) { - return concatenatedValue.split(";"); - } - - protected def getDefaultCommand(Operation operation) { - if (operation.params != null && operation.params.length > 0) { - '''«FOR param : operation.params BEFORE '{' SEPARATOR ' ' AFTER '}'»«IF isAlexaSupportedParamType(param)»«param.name»«ENDIF»«ENDFOR»''' - } else { - return operation.name - } - } - - protected def getDefaultCommand(Property property) { - '''get «property.name» status''' - } - -} +///******************************************************************************* +// * Copyright (c) 2015, 2016 Bosch Software Innovations GmbH and others. +// * All rights reserved. This program and the accompanying materials +// * are made available under the terms of the Eclipse Public License v1.0 +// * and Eclipse Distribution License v1.0 which accompany this distribution. +// * +// * The Eclipse Public License is available at +// * http://www.eclipse.org/legal/epl-v10.html +// * The Eclipse Distribution License is available at +// * http://www.eclipse.org/org/documents/edl-v10.php. +// * +// * Contributors: +// * Bosch Software Innovations GmbH - Please refer to git log +// *******************************************************************************/ +//package org.eclipse.vorto.codegen.aws.templates.alexa +// +//import org.eclipse.vorto.codegen.api.InvocationContext +//import org.eclipse.vorto.core.api.model.datatype.Property +//import org.eclipse.vorto.core.api.model.functionblock.Operation +//import org.eclipse.vorto.core.api.model.informationmodel.InformationModel +// +///** +// * @author Alexander Edelmann (Robert Bosch (SEA) Pte. Ltd) +// */ +//class AlexaUtterancesTemplate extends AbstractAlexaTemplate { +// +// override getFileName(InformationModel context) { +// '''«context.name.toLowerCase»Utterances.txt''' +// } +// +// override getContent(InformationModel element, InvocationContext context) { +// ''' +// «FOR fbProperty : element.properties» +// «FOR operation : fbProperty.type.functionblock.operations» +// «var mappedElement = context.getMappedElement(operation,STEREOTYPE_ALEXA)» +// «var commands = split(mappedElement.getAttributeValue("command",getDefaultCommand(operation).toString))» +// «FOR singleCmd : commands» +// «operation.name» «singleCmd» +// «ENDFOR» +// «ENDFOR» +// +// «IF fbProperty.type.functionblock.status != null» +// «FOR statusProperty : fbProperty.type.functionblock.status.properties» +// «var mappedElement = context.getMappedElement(statusProperty,STEREOTYPE_ALEXA)» +// «var commands = split(mappedElement.getAttributeValue("command",getDefaultCommand(statusProperty).toString))» +// «FOR singleCmd : commands» +// «statusProperty.name» «singleCmd» +// «ENDFOR» +// «ENDFOR» +// «ENDIF» +// +// «ENDFOR» +// ''' +// } +// +// private def String[] split(String concatenatedValue) { +// return concatenatedValue.split(";"); +// } +// +// protected def getDefaultCommand(Operation operation) { +// if (operation.params != null && operation.params.length > 0) { +// '''«FOR param : operation.params BEFORE '{' SEPARATOR ' ' AFTER '}'»«IF isAlexaSupportedParamType(param)»«param.name»«ENDIF»«ENDFOR»''' +// } else { +// return operation.name +// } +// } +// +// protected def getDefaultCommand(Property property) { +// '''get «property.name» status''' +// } +// +//} diff --git a/generators/org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws/templates/shadow/GetThingShadowLambdaTemplate.xtend b/generators/org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws/templates/shadow/GetThingShadowLambdaTemplate.xtend index 6beedc81be..7a7f88c992 100644 --- a/generators/org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws/templates/shadow/GetThingShadowLambdaTemplate.xtend +++ b/generators/org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws/templates/shadow/GetThingShadowLambdaTemplate.xtend @@ -1,60 +1,60 @@ -/******************************************************************************* - * Copyright (c) 2015, 2016 Bosch Software Innovations GmbH and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * and Eclipse Distribution License v1.0 which accompany this distribution. - * - * The Eclipse Public License is available at - * http://www.eclipse.org/legal/epl-v10.html - * The Eclipse Distribution License is available at - * http://www.eclipse.org/org/documents/edl-v10.php. - * - * Contributors: - * Bosch Software Innovations GmbH - Please refer to git log - *******************************************************************************/ -package org.eclipse.vorto.codegen.aws.templates.shadow - -import org.eclipse.vorto.codegen.api.IFileTemplate -import org.eclipse.vorto.codegen.api.InvocationContext -import org.eclipse.vorto.core.api.model.datatype.Property - -/** - * @author Alexander Edelmann (Robert Bosch (SEA) Pte. Ltd) - */ -class GetThingShadowLambdaTemplate implements IFileTemplate { - - override getFileName(Property context) { - return "GetThingShadowLambda_"+context.name+".js" - } - - override getPath(Property context) { - return "aws/shadow"; - } - - override getContent(Property element,InvocationContext context) { - ''' - var config = { - "thingName": "", - "endpointAddress": "" - } - - var AWS = require('aws-sdk'); - var iotdata = new AWS.IotData({endpoint: config.endpointAddress}); - - exports.handler = function(event, context, callback) { - iotdata.getThingShadow({ - thingName: config.thingName - },function(err, data) { - if (err) { - callback(err); - } else { - var jsonPayload = JSON.parse(data.payload); - var «element.name» = jsonPayload.state.reported["«element.name»"]; - callback(null,«element.name»); - } - }); - }; - ''' - } - -} +///******************************************************************************* +// * Copyright (c) 2015, 2016 Bosch Software Innovations GmbH and others. +// * All rights reserved. This program and the accompanying materials +// * are made available under the terms of the Eclipse Public License v1.0 +// * and Eclipse Distribution License v1.0 which accompany this distribution. +// * +// * The Eclipse Public License is available at +// * http://www.eclipse.org/legal/epl-v10.html +// * The Eclipse Distribution License is available at +// * http://www.eclipse.org/org/documents/edl-v10.php. +// * +// * Contributors: +// * Bosch Software Innovations GmbH - Please refer to git log +// *******************************************************************************/ +//package org.eclipse.vorto.codegen.aws.templates.shadow +// +//import org.eclipse.vorto.codegen.api.IFileTemplate +//import org.eclipse.vorto.codegen.api.InvocationContext +//import org.eclipse.vorto.core.api.model.datatype.Property +// +///** +// * @author Alexander Edelmann (Robert Bosch (SEA) Pte. Ltd) +// */ +//class GetThingShadowLambdaTemplate implements IFileTemplate { +// +// override getFileName(Property context) { +// return "GetThingShadowLambda_"+context.name+".js" +// } +// +// override getPath(Property context) { +// return "aws/shadow"; +// } +// +// override getContent(Property element,InvocationContext context) { +// ''' +// var config = { +// "thingName": "", +// "endpointAddress": "" +// } +// +// var AWS = require('aws-sdk'); +// var iotdata = new AWS.IotData({endpoint: config.endpointAddress}); +// +// exports.handler = function(event, context, callback) { +// iotdata.getThingShadow({ +// thingName: config.thingName +// },function(err, data) { +// if (err) { +// callback(err); +// } else { +// var jsonPayload = JSON.parse(data.payload); +// var «element.name» = jsonPayload.state.reported["«element.name»"]; +// callback(null,«element.name»); +// } +// }); +// }; +// ''' +// } +// +//} diff --git a/generators/org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws/templates/shadow/ThingShadowForOperationsTask.java b/generators/org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws/templates/shadow/ThingShadowForOperationsTask.java index 4061ba406e..17247c3d7e 100644 --- a/generators/org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws/templates/shadow/ThingShadowForOperationsTask.java +++ b/generators/org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws/templates/shadow/ThingShadowForOperationsTask.java @@ -1,67 +1,67 @@ -/** - * Copyright (c) 2015-2016 Bosch Software Innovations GmbH and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * and Eclipse Distribution License v1.0 which accompany this distribution. - * - * The Eclipse Public License is available at - * http://www.eclipse.org/legal/epl-v10.html - * The Eclipse Distribution License is available at - * http://www.eclipse.org/org/documents/edl-v10.php. - * - * Contributors: - * Bosch Software Innovations GmbH - Please refer to git log - */ -package org.eclipse.vorto.codegen.aws.templates.shadow; - -import org.eclipse.vorto.codegen.api.GeneratorTaskFromFileTemplate; -import org.eclipse.vorto.codegen.api.ICodeGeneratorTask; -import org.eclipse.vorto.codegen.api.IGeneratedWriter; -import org.eclipse.vorto.codegen.api.InvocationContext; -import org.eclipse.vorto.codegen.api.mapping.IMapped; -import org.eclipse.vorto.codegen.aws.templates.shadow.GetThingShadowLambdaTemplate; -import org.eclipse.vorto.codegen.aws.templates.shadow.UpdateThingShadowLambdaTemplate; -import org.eclipse.vorto.core.api.model.datatype.Property; -import org.eclipse.vorto.core.api.model.functionblock.Operation; -import org.eclipse.vorto.core.api.model.informationmodel.FunctionblockProperty; -import org.eclipse.vorto.core.api.model.informationmodel.InformationModel; - -/** - * @author Alexander Edelmann (Robert Bosch (SEA) Pte. Ltd.) - * - * Generates AWS Lambda functions to update the thing shadow for writable operations - * - */ -public class ThingShadowForOperationsTask implements ICodeGeneratorTask { - - private static final String STEREOTYPE_AWS_THINGSHADOW = "thingshadow"; - - @Override - public void generate(InformationModel model, InvocationContext context, IGeneratedWriter writer) { - for (FunctionblockProperty fbProperty : model.getProperties()) { - for (Operation operation : fbProperty.getType().getFunctionblock().getOperations()) { - IMapped mappedElement = context.getMappedElement(operation,STEREOTYPE_AWS_THINGSHADOW); - if (isUpdateableOperation(mappedElement)) { - ICodeGeneratorTask generator = new GeneratorTaskFromFileTemplate<>(new UpdateThingShadowLambdaTemplate(mappedElement)); - generator.generate(operation,context,writer); - } - else if (!operation.getParams().isEmpty() && !operation.getName().startsWith("get")) { - ICodeGeneratorTask generator = new GeneratorTaskFromFileTemplate<>(new UpdateThingShadowLambdaTemplate(mappedElement)); - generator.generate(operation,context,writer); - } - } - - if (fbProperty.getType().getFunctionblock().getStatus() != null) { - for (Property statusProperty : fbProperty.getType().getFunctionblock().getStatus().getProperties()) { - ICodeGeneratorTask generator = new GeneratorTaskFromFileTemplate<>(new GetThingShadowLambdaTemplate()); - generator.generate(statusProperty,context,writer); - } - } - } - - } - - private boolean isUpdateableOperation(IMapped mapped) { - return Boolean.getBoolean(mapped.getAttributeValue("updatable", "false")); - } -} +///** +// * Copyright (c) 2015-2016 Bosch Software Innovations GmbH and others. +// * All rights reserved. This program and the accompanying materials +// * are made available under the terms of the Eclipse Public License v1.0 +// * and Eclipse Distribution License v1.0 which accompany this distribution. +// * +// * The Eclipse Public License is available at +// * http://www.eclipse.org/legal/epl-v10.html +// * The Eclipse Distribution License is available at +// * http://www.eclipse.org/org/documents/edl-v10.php. +// * +// * Contributors: +// * Bosch Software Innovations GmbH - Please refer to git log +// */ +//package org.eclipse.vorto.codegen.aws.templates.shadow; +// +//import org.eclipse.vorto.codegen.api.GeneratorTaskFromFileTemplate; +//import org.eclipse.vorto.codegen.api.ICodeGeneratorTask; +//import org.eclipse.vorto.codegen.api.IGeneratedWriter; +//import org.eclipse.vorto.codegen.api.InvocationContext; +//import org.eclipse.vorto.codegen.api.mapping.IMapped; +//import org.eclipse.vorto.codegen.aws.templates.shadow.GetThingShadowLambdaTemplate; +//import org.eclipse.vorto.codegen.aws.templates.shadow.UpdateThingShadowLambdaTemplate; +//import org.eclipse.vorto.core.api.model.datatype.Property; +//import org.eclipse.vorto.core.api.model.functionblock.Operation; +//import org.eclipse.vorto.core.api.model.informationmodel.FunctionblockProperty; +//import org.eclipse.vorto.core.api.model.informationmodel.InformationModel; +// +///** +// * @author Alexander Edelmann (Robert Bosch (SEA) Pte. Ltd.) +// * +// * Generates AWS Lambda functions to update the thing shadow for writable operations +// * +// */ +//public class ThingShadowForOperationsTask implements ICodeGeneratorTask { +// +// private static final String STEREOTYPE_AWS_THINGSHADOW = "thingshadow"; +// +// @Override +// public void generate(InformationModel model, InvocationContext context, IGeneratedWriter writer) { +// for (FunctionblockProperty fbProperty : model.getProperties()) { +// for (Operation operation : fbProperty.getType().getFunctionblock().getOperations()) { +// IMapped mappedElement = context.getMappedElement(operation,STEREOTYPE_AWS_THINGSHADOW); +// if (isUpdateableOperation(mappedElement)) { +// ICodeGeneratorTask generator = new GeneratorTaskFromFileTemplate<>(new UpdateThingShadowLambdaTemplate(mappedElement)); +// generator.generate(operation,context,writer); +// } +// else if (!operation.getParams().isEmpty() && !operation.getName().startsWith("get")) { +// ICodeGeneratorTask generator = new GeneratorTaskFromFileTemplate<>(new UpdateThingShadowLambdaTemplate(mappedElement)); +// generator.generate(operation,context,writer); +// } +// } +// +// if (fbProperty.getType().getFunctionblock().getStatus() != null) { +// for (Property statusProperty : fbProperty.getType().getFunctionblock().getStatus().getProperties()) { +// ICodeGeneratorTask generator = new GeneratorTaskFromFileTemplate<>(new GetThingShadowLambdaTemplate()); +// generator.generate(statusProperty,context,writer); +// } +// } +// } +// +// } +// +// private boolean isUpdateableOperation(IMapped mapped) { +// return Boolean.getBoolean(mapped.getAttributeValue("updatable", "false")); +// } +//} diff --git a/generators/org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws/templates/shadow/UpdateThingShadowLambdaTemplate.xtend b/generators/org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws/templates/shadow/UpdateThingShadowLambdaTemplate.xtend index 6ffdbf1f8d..d387fbe6d8 100644 --- a/generators/org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws/templates/shadow/UpdateThingShadowLambdaTemplate.xtend +++ b/generators/org.eclipse.vorto.codegen.aws/src/org/eclipse/vorto/codegen/aws/templates/shadow/UpdateThingShadowLambdaTemplate.xtend @@ -1,90 +1,90 @@ -/******************************************************************************* - * Copyright (c) 2015, 2016 Bosch Software Innovations GmbH and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * and Eclipse Distribution License v1.0 which accompany this distribution. - * - * The Eclipse Public License is available at - * http://www.eclipse.org/legal/epl-v10.html - * The Eclipse Distribution License is available at - * http://www.eclipse.org/org/documents/edl-v10.php. - * - * Contributors: - * Bosch Software Innovations GmbH - Please refer to git log - *******************************************************************************/ -package org.eclipse.vorto.codegen.aws.templates.shadow - -import org.eclipse.emf.common.util.EList -import org.eclipse.vorto.codegen.api.IFileTemplate -import org.eclipse.vorto.codegen.api.mapping.IMapped -import org.eclipse.vorto.codegen.api.InvocationContext -import org.eclipse.vorto.core.api.model.functionblock.Operation -import org.eclipse.vorto.core.api.model.functionblock.Param - -/** - * @author Alexander Edelmann (Robert Bosch (SEA) Pte. Ltd) - */ -class UpdateThingShadowLambdaTemplate implements IFileTemplate { - - private IMapped mappedElement; - - new (IMapped mappedElement) { - this.mappedElement = mappedElement; - } - - override getFileName(Operation context) { - return "UpdateThingShadowLambda_"+context.name+".js" - } - - override getPath(Operation context) { - return "aws/shadow"; - } - - override getContent(Operation element, InvocationContext context) { - ''' - var config = { - "thingName": "", - "endpointAddress": "" - } - - var AWS = require('aws-sdk'); - var iotdata = new AWS.IotData({endpoint: config.endpointAddress}); - - exports.handler = function(event, context, callback) { - var update = { - "state": { - "desired" : { - «IF element.params.isEmpty» - "«mappedElement.getAttributeValue("field",element.name)»" : "true" - «ELSE» - "«mappedElement.getAttributeValue("field",element.name)»" : «operationParamsToJSON(element.params)» - «ENDIF» - } - } - }; - iotdata.updateThingShadow({ - payload: JSON.stringify(update), - thingName: config.thingName - },function(err, data) { - if (err) { - callback(err); - } else { - callback(null,"success"); - } - }); - }; - ''' - } - - def operationParamsToJSON(EList params) { - ''' - { - «FOR param : params SEPARATOR ','» - "«param.name»": event.«param.name» - «ENDFOR» - - } - ''' - } - -} +///******************************************************************************* +// * Copyright (c) 2015, 2016 Bosch Software Innovations GmbH and others. +// * All rights reserved. This program and the accompanying materials +// * are made available under the terms of the Eclipse Public License v1.0 +// * and Eclipse Distribution License v1.0 which accompany this distribution. +// * +// * The Eclipse Public License is available at +// * http://www.eclipse.org/legal/epl-v10.html +// * The Eclipse Distribution License is available at +// * http://www.eclipse.org/org/documents/edl-v10.php. +// * +// * Contributors: +// * Bosch Software Innovations GmbH - Please refer to git log +// *******************************************************************************/ +//package org.eclipse.vorto.codegen.aws.templates.shadow +// +//import org.eclipse.emf.common.util.EList +//import org.eclipse.vorto.codegen.api.IFileTemplate +//import org.eclipse.vorto.codegen.api.mapping.IMapped +//import org.eclipse.vorto.codegen.api.InvocationContext +//import org.eclipse.vorto.core.api.model.functionblock.Operation +//import org.eclipse.vorto.core.api.model.functionblock.Param +// +///** +// * @author Alexander Edelmann (Robert Bosch (SEA) Pte. Ltd) +// */ +//class UpdateThingShadowLambdaTemplate implements IFileTemplate { +// +// private IMapped mappedElement; +// +// new (IMapped mappedElement) { +// this.mappedElement = mappedElement; +// } +// +// override getFileName(Operation context) { +// return "UpdateThingShadowLambda_"+context.name+".js" +// } +// +// override getPath(Operation context) { +// return "aws/shadow"; +// } +// +// override getContent(Operation element, InvocationContext context) { +// ''' +// var config = { +// "thingName": "", +// "endpointAddress": "" +// } +// +// var AWS = require('aws-sdk'); +// var iotdata = new AWS.IotData({endpoint: config.endpointAddress}); +// +// exports.handler = function(event, context, callback) { +// var update = { +// "state": { +// "desired" : { +// «IF element.params.isEmpty» +// "«mappedElement.getAttributeValue("field",element.name)»" : "true" +// «ELSE» +// "«mappedElement.getAttributeValue("field",element.name)»" : «operationParamsToJSON(element.params)» +// «ENDIF» +// } +// } +// }; +// iotdata.updateThingShadow({ +// payload: JSON.stringify(update), +// thingName: config.thingName +// },function(err, data) { +// if (err) { +// callback(err); +// } else { +// callback(null,"success"); +// } +// }); +// }; +// ''' +// } +// +// def operationParamsToJSON(EList params) { +// ''' +// { +// «FOR param : params SEPARATOR ','» +// "«param.name»": event.«param.name» +// «ENDFOR» +// +// } +// ''' +// } +// +//} diff --git a/generators/org.eclipse.vorto.codegen.bosch.things/src/org/eclipse/vorto/codegen/bosch/things/BoschIoTThingsGenerator.java b/generators/org.eclipse.vorto.codegen.bosch.things/src/org/eclipse/vorto/codegen/bosch/things/BoschIoTThingsGenerator.java index 8bac747b73..aa36130d35 100644 --- a/generators/org.eclipse.vorto.codegen.bosch.things/src/org/eclipse/vorto/codegen/bosch/things/BoschIoTThingsGenerator.java +++ b/generators/org.eclipse.vorto.codegen.bosch.things/src/org/eclipse/vorto/codegen/bosch/things/BoschIoTThingsGenerator.java @@ -14,6 +14,9 @@ */ package org.eclipse.vorto.codegen.bosch.things; +import java.util.HashMap; +import java.util.Map; + import org.eclipse.vorto.codegen.api.ChainedCodeGeneratorTask; import org.eclipse.vorto.codegen.api.GenerationResultZip; import org.eclipse.vorto.codegen.api.IGenerationResult; @@ -21,7 +24,6 @@ import org.eclipse.vorto.codegen.api.IVortoCodeGenerator; import org.eclipse.vorto.codegen.api.InvocationContext; import org.eclipse.vorto.codegen.api.VortoCodeGeneratorException; -import org.eclipse.vorto.codegen.bosch.things.alexa.AlexaThingsTask; import org.eclipse.vorto.codegen.bosch.things.javaclient.JavaClientTask; import org.eclipse.vorto.codegen.bosch.things.schema.SchemaValidatorTask; import org.eclipse.vorto.codegen.utils.GenerationResultBuilder; @@ -33,7 +35,6 @@ public class BoschIoTThingsGenerator implements IVortoCodeGenerator { private static final String TRUE = "true"; private static final String SIMULATOR = "simulator"; private static final String SCHEMAVALIDATOR = "validation"; - private static final String ALEXA = "alexa"; public IGenerationResult generate(InformationModel infomodel, InvocationContext invocationContext, @@ -53,21 +54,47 @@ public IGenerationResult generate(InformationModel infomodel, if (invocationContext.getConfigurationProperties().getOrDefault(SCHEMAVALIDATOR, FALSE).equalsIgnoreCase(TRUE)) { generator.addTask(new SchemaValidatorTask()); } - - if (invocationContext.getConfigurationProperties().getOrDefault(ALEXA, FALSE).equalsIgnoreCase(TRUE)) { - generator.addTask(new AlexaThingsTask()); - } } generator.generate(infomodel, invocationContext, zipOutputter); - return GenerationResultBuilder.from(zipOutputter).build(); + GenerationResultBuilder result = GenerationResultBuilder.from(zipOutputter); + + if (invocationContext.getConfigurationProperties().getOrDefault("kura", FALSE).equalsIgnoreCase(TRUE)) { + Map props = new HashMap<>(); + props.put("boschcloud", "true"); + props.put("bluetooth", "true"); + IGenerationResult kuraResult = invocationContext.lookupGenerator("kura").generate(infomodel, + InvocationContext.simpleInvocationContext(props), monitor); + result.append(kuraResult); + } + + if (invocationContext.getConfigurationProperties().getOrDefault("alexa", FALSE).equalsIgnoreCase(TRUE)) { + Map props = new HashMap<>(); + props.put("boschcloud", "true"); + IGenerationResult awsResult = invocationContext.lookupGenerator("aws").generate(infomodel, + InvocationContext.simpleInvocationContext(props), monitor); + result.append(awsResult); + + } + + if (invocationContext.getConfigurationProperties().getOrDefault("webui", FALSE).equalsIgnoreCase(TRUE)) { + Map props = new HashMap<>(); + props.put("boschcloud", "true"); + props.put("swagger", "true"); + props.put("persistence", "true"); + IGenerationResult webuiResult = invocationContext.lookupGenerator("webui").generate(infomodel, + InvocationContext.simpleInvocationContext(props), monitor); + result.append(webuiResult); + } + + return result.build(); } private boolean hasNoTarget(InvocationContext invocationContext) { return (invocationContext.getConfigurationProperties().getOrDefault(SIMULATOR, FALSE).equalsIgnoreCase(FALSE) && invocationContext.getConfigurationProperties().getOrDefault(SCHEMAVALIDATOR, FALSE).equalsIgnoreCase(FALSE) && - invocationContext.getConfigurationProperties().getOrDefault(ALEXA, FALSE).equalsIgnoreCase(FALSE)); + invocationContext.getConfigurationProperties().getOrDefault("alexa", FALSE).equalsIgnoreCase(FALSE)); } @Override diff --git a/generators/org.eclipse.vorto.codegen.bosch.things/src/org/eclipse/vorto/codegen/bosch/things/alexa/AlexaThingsTask.java b/generators/org.eclipse.vorto.codegen.bosch.things/src/org/eclipse/vorto/codegen/bosch/things/alexa/AlexaThingsTask.java deleted file mode 100644 index 06c57afb90..0000000000 --- a/generators/org.eclipse.vorto.codegen.bosch.things/src/org/eclipse/vorto/codegen/bosch/things/alexa/AlexaThingsTask.java +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Copyright (c) 2015-2016 Bosch Software Innovations GmbH and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * and Eclipse Distribution License v1.0 which accompany this distribution. - * - * The Eclipse Public License is available at - * http://www.eclipse.org/legal/epl-v10.html - * The Eclipse Distribution License is available at - * http://www.eclipse.org/org/documents/edl-v10.php. - * - * Contributors: - * Bosch Software Innovations GmbH - Please refer to git log - */ -package org.eclipse.vorto.codegen.bosch.things.alexa; - -import org.eclipse.emf.common.util.EList; -import org.eclipse.vorto.codegen.api.ChainedCodeGeneratorTask; -import org.eclipse.vorto.codegen.api.GeneratorTaskFromFileTemplate; -import org.eclipse.vorto.codegen.api.ICodeGeneratorTask; -import org.eclipse.vorto.codegen.api.IGeneratedWriter; -import org.eclipse.vorto.codegen.api.InvocationContext; -import org.eclipse.vorto.codegen.bosch.things.alexa.templates.AlexaIndentSchemaTemplate; -import org.eclipse.vorto.codegen.bosch.things.alexa.templates.AlexaSkillLambdaTemplate; -import org.eclipse.vorto.codegen.bosch.things.alexa.templates.AlexaSlotTypeTemplate; -import org.eclipse.vorto.codegen.bosch.things.alexa.templates.AlexaUtterancesTemplate; -import org.eclipse.vorto.codegen.utils.Utils; -import org.eclipse.vorto.core.api.model.informationmodel.FunctionblockProperty; -import org.eclipse.vorto.core.api.model.informationmodel.InformationModel; - -public class AlexaThingsTask implements ICodeGeneratorTask { - - @Override - public void generate(InformationModel infomodel, InvocationContext context, IGeneratedWriter writer) { - ChainedCodeGeneratorTask generator = new ChainedCodeGeneratorTask(); - - generator.addTask(new GeneratorTaskFromFileTemplate(new AlexaIndentSchemaTemplate())); - generator.addTask(new GeneratorTaskFromFileTemplate(new AlexaSkillLambdaTemplate())); - generator.addTask(new GeneratorTaskFromFileTemplate(new AlexaUtterancesTemplate())); - - generateCustomSlotTypes(infomodel, context, writer); - - generator.generate(infomodel, context, writer); - } - - private void generateCustomSlotTypes(InformationModel infomodel, InvocationContext context, - IGeneratedWriter writer) { - for (FunctionblockProperty fbModel : infomodel.getProperties()) { - EList enums = Utils.getReferencedEnums(fbModel.getType().getFunctionblock()); - for (org.eclipse.vorto.core.api.model.datatype.Enum enumeration : enums) { - ICodeGeneratorTask task = new GeneratorTaskFromFileTemplate<>(new AlexaSlotTypeTemplate()); - task.generate(enumeration, context, writer); - } - } - } - -} diff --git a/server/generators/org.eclipse.vorto.codegen.service.gateway/src/main/java/org/eclipse/vorto/codegen/gateway/GatewayInit.java b/server/generators/org.eclipse.vorto.codegen.service.gateway/src/main/java/org/eclipse/vorto/codegen/gateway/GatewayInit.java index 886d6300d5..6629799960 100644 --- a/server/generators/org.eclipse.vorto.codegen.service.gateway/src/main/java/org/eclipse/vorto/codegen/gateway/GatewayInit.java +++ b/server/generators/org.eclipse.vorto.codegen.service.gateway/src/main/java/org/eclipse/vorto/codegen/gateway/GatewayInit.java @@ -22,6 +22,7 @@ import org.eclipse.vorto.codegen.gateway.model.Generator; import org.eclipse.vorto.codegen.gateway.repository.GeneratorRepository; import org.eclipse.vorto.codegen.gateway.service.VortoService; +import org.eclipse.vorto.codegen.gateway.templates.AWSConfigTemplate; import org.eclipse.vorto.codegen.gateway.templates.BoschThingsConfigTemplate; import org.eclipse.vorto.codegen.gateway.templates.KuraConfigTemplate; import org.eclipse.vorto.codegen.gateway.templates.WebUIConfigTemplate; @@ -63,7 +64,7 @@ public class GatewayInit implements ApplicationRunner, EnvironmentAware { public void run(ApplicationArguments args) throws Exception { try { - generatorRepo.add(Generator.create("/generators/aws.properties", AWSGenerator.class)); + generatorRepo.add(Generator.create("/generators/aws.properties", AWSGenerator.class, new AWSConfigTemplate())); generatorRepo.add(Generator.create("/generators/bosch-things.properties", BoschIoTThingsGenerator.class, new BoschThingsConfigTemplate())); generatorRepo.add(Generator.create("/generators/coap.properties", CoAPGenerator.class)); generatorRepo.add(Generator.create("/generators/ios.properties", IOSPlatformGenerator.class)); diff --git a/server/generators/org.eclipse.vorto.codegen.service.gateway/src/main/java/org/eclipse/vorto/codegen/gateway/templates/AWSConfigTemplate.xtend b/server/generators/org.eclipse.vorto.codegen.service.gateway/src/main/java/org/eclipse/vorto/codegen/gateway/templates/AWSConfigTemplate.xtend new file mode 100644 index 0000000000..7a1dc7c47c --- /dev/null +++ b/server/generators/org.eclipse.vorto.codegen.service.gateway/src/main/java/org/eclipse/vorto/codegen/gateway/templates/AWSConfigTemplate.xtend @@ -0,0 +1,49 @@ +/** + * Copyright (c) 2015-2016 Bosch Software Innovations GmbH and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * and Eclipse Distribution License v1.0 which accompany this distribution. + * + * The Eclipse Public License is available at + * http://www.eclipse.org/legal/epl-v10.html + * The Eclipse Distribution License is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + * + * Contributors: + * Bosch Software Innovations GmbH - Please refer to git log + */ +package org.eclipse.vorto.codegen.gateway.templates + +import java.util.Arrays +import java.util.HashSet +import java.util.Set +import org.eclipse.vorto.codegen.api.GeneratorServiceInfo +import org.eclipse.vorto.server.commons.IGeneratorConfigUITemplate + +class AWSConfigTemplate implements IGeneratorConfigUITemplate { + + private static final Set KEYS = new HashSet(Arrays.asList("boschcloud","awsiot")); + + override getContent(GeneratorServiceInfo info) { + ''' +
+
+
+
+

Choose Digital Twin backend for Alexa

+ +
+
+

 Bosch IoT Suite

+

 AWS IoT Thing Shadow

+
+
+
+
+ ''' + } + + override getKeys() { + return KEYS; + } +} \ No newline at end of file diff --git a/server/generators/org.eclipse.vorto.codegen.service.gateway/src/main/java/org/eclipse/vorto/codegen/gateway/templates/BoschThingsConfigTemplate.xtend b/server/generators/org.eclipse.vorto.codegen.service.gateway/src/main/java/org/eclipse/vorto/codegen/gateway/templates/BoschThingsConfigTemplate.xtend index 6453a5a216..c88c29f30c 100644 --- a/server/generators/org.eclipse.vorto.codegen.service.gateway/src/main/java/org/eclipse/vorto/codegen/gateway/templates/BoschThingsConfigTemplate.xtend +++ b/server/generators/org.eclipse.vorto.codegen.service.gateway/src/main/java/org/eclipse/vorto/codegen/gateway/templates/BoschThingsConfigTemplate.xtend @@ -22,7 +22,7 @@ import org.eclipse.vorto.server.commons.IGeneratorConfigUITemplate class BoschThingsConfigTemplate implements IGeneratorConfigUITemplate { - private static final Set KEYS = new HashSet(Arrays.asList("simulator","validation","alexa")); + private static final Set KEYS = new HashSet(Arrays.asList("simulator","validation","alexa", "kura", "webui")); override getContent(GeneratorServiceInfo info) { ''' @@ -63,6 +63,30 @@ class BoschThingsConfigTemplate implements IGeneratorConfigUITemplate { +
+
+
+

Device Gateway

+ +
+
+

Reads device data via BLE using Eclipse Kura and sends it to Bosch IoT Things

+  Yes, I need that +
+
+
+
+
+
+

Device Visualization

+ +
+
+

Consumes {{model.id.name}} data from Bosch IoT Things and displays it in a Web UI

+  Yes, I need that +
+
+
''' } diff --git a/server/generators/org.eclipse.vorto.codegen.service.gateway/src/main/resources/generators/aws.properties b/server/generators/org.eclipse.vorto.codegen.service.gateway/src/main/resources/generators/aws.properties index ea63a003f0..e0caa16d30 100644 --- a/server/generators/org.eclipse.vorto.codegen.service.gateway/src/main/resources/generators/aws.properties +++ b/server/generators/org.eclipse.vorto.codegen.service.gateway/src/main/resources/generators/aws.properties @@ -1,5 +1,5 @@ vorto.service.name=AWS IoT -vorto.service.description=Generates an Alexa skillset that updates and reads device data to/from the AWS IoT Thing Shadow Service. +vorto.service.description=Generates Alexa Skillset that fetches device data from either AWS IoT Shadow or Bosch IoT Suite. vorto.service.creator=Eclipse Vorto Team vorto.service.documentationUrl=https://github.com/eclipse/vorto/blob/master/generators/org.eclipse.vorto.codegen.aws/Readme.md vorto.service.image32x32=img/icon32x32.png diff --git a/server/generators/org.eclipse.vorto.codegen.service.gateway/src/main/resources/generators/bosch-things.properties b/server/generators/org.eclipse.vorto.codegen.service.gateway/src/main/resources/generators/bosch-things.properties index c3c8e38bc3..7475f4f2e3 100644 --- a/server/generators/org.eclipse.vorto.codegen.service.gateway/src/main/resources/generators/bosch-things.properties +++ b/server/generators/org.eclipse.vorto.codegen.service.gateway/src/main/resources/generators/bosch-things.properties @@ -1,5 +1,5 @@ vorto.service.name=Bosch IoT Suite -vorto.service.description=Generates Alexa skillset, validators and device simulator for Bosch IoT Things. +vorto.service.description=Creates various blueprint templates that integrate with the Bosch IoT Suite. vorto.service.creator= Eclipse Vorto Team vorto.service.documentationUrl = https://things.apps.bosch-iot-cloud.com/ vorto.service.image32x32= img/icon32x32.png