commit f04f9ff812e0ac6a4c95dbb1da8fbcb8601faa50 Author: Simon Date: Thu Sep 3 21:38:08 2020 +0200 Initialized the project for my Alexa Skill diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..c101329 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 0000000..712ab9d --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..9d65eef --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,14 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml new file mode 100644 index 0000000..e96534f --- /dev/null +++ b/.idea/uiDesigner.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/WizardSkill.iml b/WizardSkill.iml new file mode 100644 index 0000000..78b2cc5 --- /dev/null +++ b/WizardSkill.iml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..8cce8b6 --- /dev/null +++ b/pom.xml @@ -0,0 +1,32 @@ + + + 4.0.0 + + com.github.cato447 + WizardSkill + 1.0-SNAPSHOT + + + + + org.apache.maven.plugins + maven-compiler-plugin + + 8 + 8 + + + + + + + + com.amazon.alexa + ask-sdk + 2.0.0 + + + + \ No newline at end of file diff --git a/src/main/java/com/github/cato447/handlers/CancelandStopIntentHandler.java b/src/main/java/com/github/cato447/handlers/CancelandStopIntentHandler.java new file mode 100644 index 0000000..611082d --- /dev/null +++ b/src/main/java/com/github/cato447/handlers/CancelandStopIntentHandler.java @@ -0,0 +1,25 @@ +package com.github.cato447.handlers; + +import java.util.Optional; + +import com.amazon.ask.dispatcher.request.handler.HandlerInput; +import com.amazon.ask.dispatcher.request.handler.RequestHandler; + +import static com.amazon.ask.request.Predicates.intentName; + +import com.amazon.ask.model.Response; + +public class CancelandStopIntentHandler implements RequestHandler { + + public boolean canHandle(HandlerInput input) { + return input.matches(intentName("AMAZON.StopIntent").or(intentName("AMAZON.CancelIntent"))); + } + + public Optional handle(HandlerInput input) { + String speechText = "Bye Bye"; + return input.getResponseBuilder() + .withSpeech(speechText) + .withSimpleCard("HelloWorld", speechText) + .build(); + } +} \ No newline at end of file diff --git a/src/main/java/com/github/cato447/handlers/HelloWorldIntentHandler.java b/src/main/java/com/github/cato447/handlers/HelloWorldIntentHandler.java new file mode 100644 index 0000000..62f6a23 --- /dev/null +++ b/src/main/java/com/github/cato447/handlers/HelloWorldIntentHandler.java @@ -0,0 +1,25 @@ +package com.github.cato447.handlers; + +import com.amazon.ask.dispatcher.request.handler.HandlerInput; +import com.amazon.ask.dispatcher.request.handler.RequestHandler; +import com.amazon.ask.model.Response; + +import java.util.Optional; + +import static com.amazon.ask.request.Predicates.intentName; + +public class HelloWorldIntentHandler implements RequestHandler { + + public boolean canHandle(HandlerInput input) { + return input.matches(intentName("HelloWorldIntent")); + } + + public Optional handle(HandlerInput input) { + String speechText = "I am alive Hello World!"; + return input.getResponseBuilder() + .withSpeech(speechText) + .withSimpleCard("Hello World", speechText) + .build(); + } + +} diff --git a/src/main/java/com/github/cato447/handlers/HelpIntentHandler.java b/src/main/java/com/github/cato447/handlers/HelpIntentHandler.java new file mode 100644 index 0000000..e80b361 --- /dev/null +++ b/src/main/java/com/github/cato447/handlers/HelpIntentHandler.java @@ -0,0 +1,26 @@ +package com.github.cato447.handlers; + +import java.util.Optional; + +import com.amazon.ask.dispatcher.request.handler.HandlerInput; +import com.amazon.ask.dispatcher.request.handler.RequestHandler; + +import static com.amazon.ask.request.Predicates.intentName; + +import com.amazon.ask.model.Response; + +public class HelpIntentHandler implements RequestHandler { + + public boolean canHandle(HandlerInput input) { + return input.matches(intentName("AMAZON.HelpIntent")); + } + + public Optional handle(HandlerInput input) { + String speechText = "I am here to say Hello World to You"; + return input.getResponseBuilder() + .withSpeech(speechText) + .withSimpleCard("HelloWorld", speechText) + .withReprompt(speechText) + .build(); + } +} \ No newline at end of file diff --git a/src/main/java/com/github/cato447/handlers/LaunchRequestHandler.java b/src/main/java/com/github/cato447/handlers/LaunchRequestHandler.java new file mode 100644 index 0000000..47579af --- /dev/null +++ b/src/main/java/com/github/cato447/handlers/LaunchRequestHandler.java @@ -0,0 +1,26 @@ +package com.github.cato447.handlers; + +import java.util.Optional; + +import com.amazon.ask.dispatcher.request.handler.HandlerInput; +import com.amazon.ask.dispatcher.request.handler.RequestHandler; +import com.amazon.ask.model.LaunchRequest; +import com.amazon.ask.model.Response; + +import static com.amazon.ask.request.Predicates.requestType; + +public class LaunchRequestHandler implements RequestHandler { + + public boolean canHandle(HandlerInput input) { + return input.matches(requestType(LaunchRequest.class)); + } + + public Optional handle(HandlerInput input) { + String speechText = "Welcome to Hello World, You can say Hello"; + return input.getResponseBuilder() + .withSpeech(speechText) + .withSimpleCard("HelloWorld", speechText) + .withReprompt(speechText) + .build(); + } +} \ No newline at end of file diff --git a/src/main/java/com/github/cato447/handlers/SessionEndedRequestHandler.java b/src/main/java/com/github/cato447/handlers/SessionEndedRequestHandler.java new file mode 100644 index 0000000..deb9645 --- /dev/null +++ b/src/main/java/com/github/cato447/handlers/SessionEndedRequestHandler.java @@ -0,0 +1,21 @@ +package com.github.cato447.handlers; + +import java.util.Optional; + +import com.amazon.ask.dispatcher.request.handler.HandlerInput; +import com.amazon.ask.dispatcher.request.handler.RequestHandler; +import com.amazon.ask.model.Response; +import com.amazon.ask.model.SessionEndedRequest; + +import static com.amazon.ask.request.Predicates.requestType; + +public class SessionEndedRequestHandler implements RequestHandler { + + public boolean canHandle(HandlerInput input) { + return input.matches(requestType(SessionEndedRequest.class)); + } + + public Optional handle(HandlerInput input) { + return input.getResponseBuilder().build(); + } +} \ No newline at end of file diff --git a/src/main/java/com/github/cato447/main/HelloWorldStreamHandler.java b/src/main/java/com/github/cato447/main/HelloWorldStreamHandler.java new file mode 100644 index 0000000..8ef017d --- /dev/null +++ b/src/main/java/com/github/cato447/main/HelloWorldStreamHandler.java @@ -0,0 +1,27 @@ +package com.github.cato447.main; + +import com.amazon.ask.Skill; +import com.amazon.ask.SkillStreamHandler; +import com.amazon.ask.Skills; +import com.github.cato447.handlers.*; + + +public class HelloWorldStreamHandler extends SkillStreamHandler { + + private static Skill getSkill(){ + return Skills.standard() + .addRequestHandlers( + new CancelandStopIntentHandler(), + new HelloWorldIntentHandler(), + new HelpIntentHandler(), + new LaunchRequestHandler(), + new SessionEndedRequestHandler()) + .withSkillId("Your Amazon ID") + .build(); + } + + public HelloWorldStreamHandler(Skill skill) { + super(skill); + } + +} diff --git a/target/WizardSkill-1.0-SNAPSHOT-jar-with-dependencies.jar b/target/WizardSkill-1.0-SNAPSHOT-jar-with-dependencies.jar new file mode 100644 index 0000000..0406c31 Binary files /dev/null and b/target/WizardSkill-1.0-SNAPSHOT-jar-with-dependencies.jar differ diff --git a/target/WizardSkill-1.0-SNAPSHOT.jar b/target/WizardSkill-1.0-SNAPSHOT.jar new file mode 100644 index 0000000..f81455a Binary files /dev/null and b/target/WizardSkill-1.0-SNAPSHOT.jar differ diff --git a/target/classes/com/github/cato447/handlers/CancelandStopIntentHandler.class b/target/classes/com/github/cato447/handlers/CancelandStopIntentHandler.class new file mode 100644 index 0000000..ac6e663 Binary files /dev/null and b/target/classes/com/github/cato447/handlers/CancelandStopIntentHandler.class differ diff --git a/target/classes/com/github/cato447/handlers/HelloWorldIntentHandler.class b/target/classes/com/github/cato447/handlers/HelloWorldIntentHandler.class new file mode 100644 index 0000000..a83dbf2 Binary files /dev/null and b/target/classes/com/github/cato447/handlers/HelloWorldIntentHandler.class differ diff --git a/target/classes/com/github/cato447/handlers/HelpIntentHandler.class b/target/classes/com/github/cato447/handlers/HelpIntentHandler.class new file mode 100644 index 0000000..8c1dbe4 Binary files /dev/null and b/target/classes/com/github/cato447/handlers/HelpIntentHandler.class differ diff --git a/target/classes/com/github/cato447/handlers/LaunchRequestHandler.class b/target/classes/com/github/cato447/handlers/LaunchRequestHandler.class new file mode 100644 index 0000000..24512ea Binary files /dev/null and b/target/classes/com/github/cato447/handlers/LaunchRequestHandler.class differ diff --git a/target/classes/com/github/cato447/handlers/SessionEndedRequestHandler.class b/target/classes/com/github/cato447/handlers/SessionEndedRequestHandler.class new file mode 100644 index 0000000..b6821a0 Binary files /dev/null and b/target/classes/com/github/cato447/handlers/SessionEndedRequestHandler.class differ diff --git a/target/classes/com/github/cato447/main/HelloWorldStreamHandler.class b/target/classes/com/github/cato447/main/HelloWorldStreamHandler.class new file mode 100644 index 0000000..44fa88a Binary files /dev/null and b/target/classes/com/github/cato447/main/HelloWorldStreamHandler.class differ diff --git a/target/maven-archiver/pom.properties b/target/maven-archiver/pom.properties new file mode 100644 index 0000000..1a01d08 --- /dev/null +++ b/target/maven-archiver/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Thu Sep 03 21:20:08 CEST 2020 +groupId=com.github.cato447 +artifactId=WizardSkill +version=1.0-SNAPSHOT diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..9fa95e4 --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,2 @@ +com/github/cato447/handlers/HelloWorldIntentHandler.class +com/github/cato447/main/HelloWorldStreamHandler.class diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..b08d53b --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,6 @@ +/home/bitecoding/Documents/WizardSkill/src/main/java/com/github/cato447/main/HelloWorldStreamHandler.java +/home/bitecoding/Documents/WizardSkill/src/main/java/com/github/cato447/handlers/HelloWorldIntentHandler.java +/home/bitecoding/Documents/WizardSkill/src/main/java/com/github/cato447/handlers/SessionEndedRequestHandler.java +/home/bitecoding/Documents/WizardSkill/src/main/java/com/github/cato447/handlers/HelpIntentHandler.java +/home/bitecoding/Documents/WizardSkill/src/main/java/com/github/cato447/handlers/CancelandStopIntentHandler.java +/home/bitecoding/Documents/WizardSkill/src/main/java/com/github/cato447/handlers/LaunchRequestHandler.java diff --git a/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst new file mode 100644 index 0000000..e69de29