Skip to content

Latest commit

 

History

History
70 lines (55 loc) · 3.26 KB

README.md

File metadata and controls

70 lines (55 loc) · 3.26 KB

AEM Go Kotlin Examples

logo

This project will help you learn Kotlin programming language. You will find examples of common AEM developer tasks all written in both Java and Kotlin.

Deploy on AEM 6.4

If you like to run it just type ./gradlew from root folder or use provided Build and Deploy build for IntelliJ IDE

Content

  1. SimpleService Java | Kotlin
    OSGi @Component and Service (all in one class) with (static final field in Java / companion object - in Kotlin).

  2. SimpleServlet Java | Kotlin
    OSGi @Component and Sling Servlet with dependency injection to another service.
    You can test both servlets on:
    http://localhost:4502/bin/java/hello
    http://localhost:4502/bin/kotlin/hello

  3. ConfigurableService Java | Kotlin
    Service interface definition.

  4. ConfigurableServiceImpl Java | Kotlin
    OSGi component that can be configured in Adobe Experience Manager Web Console Configuration.
    Use of @ObjectClassDefinition, @AttributeDefinition and service implementation.
    Compare how to transform Array to Map with Stream API in Java and Closures in Kotlin.

  5. ComponentDecoratorFilter Java | Kotlin
    OSGi component and basic implementation of javax.servlet.Filter

  6. ComponentDecoratorProcessor Java | Kotlin
    Class used by ComponentDecoratorFilter to replace markup text with some other text. Compare how final fields are defined, casting.
    Meet elvis operator and fields definition directly in constructor when writing in Kotlin.

  7. SampleModel Java | Kotlin
    Simple Sling Model with property and service injection. Learn how to inject primitive types in Kotlin.

  8. Sample Component path
    Sample Component with Touch UI config dialog. Add selector java or kotlin and switch from JSP to HTL with different model implementations.

Developed and tested on AEM 6.4
Project structure generated from gradle-aem-single with help from gradle-fork-plugin