Skip to main content

Posts

Showing posts with the label DXA

Creating a DXA Java Module (part 2)

In my previous post Creating a DXA Java Module , I started presenting the steps for creating the Tridion items on the Content Manager needed for the new DXA module. In this current post, I present the Java code and configuration for having the DXA module run in a web-application. I wrote my code as a separate JAR using IntelliJ and then running the DXA v1.5 web-application on Tomcat as part of the standard DXA reference implementation project dxa-web-application-java  (available in GIT at https://github.com/sdl/dxa-web-application-java/tree/release/1.5 ). What follows are the steps on how to create the DXA Java module classes and configurations. 1. Create the IntelliJ Emerald Module In IntelliJ, create a new Java Module and enable Maven for it. Add the following dependencies in its pom.xml file: <dependencies> <dependency> <groupId> com.sdl.dxa </groupId> <artifactId> dxa-common-api </artifactId>...

Creating a DXA Java Module

In my previous blog post Troubleshoot a DXA Java Module , I presented a solution for a very specific issue with loading a DXA Java module. Then I had the idea for this blog post -- write a short tutorial on how to write a DXA module. What follows are the steps to create a new DXA Java module (I am using DXA v1.5). In this post, I present the Content Manager items needed for the new module. In fact, these are the minimum items and properties needed for having a new working DXA module. In next post Creating a DXA Java Module (part 2) , I present the Java code and configuration needed to run the new DXA module in a web-application. 1. Create a New Module in Tridion Content Manager I am using DXA reference implementation, and I created a new module called Emerald, next to the Core module of the reference implementation. Create the following Tridion folder structure starting from Folder Emerald : 2. Create Module Configuration Component In Folder Admin , create new Componen...

Troubleshoot a DXA Java Module

I was asked recently to troubleshoot a DXA 1.5 module that was not behaving properly. The apparent issue was that nested embedded fields in all models were not filled in with values once the Semantic Mapper would execute and create the models. This prompted me to do a little bit of digging into the Semantic Mapper and its registries of model entities, property and field maps. It turned out the models in the custom module were not being scanned and as such not registered as entities by the Semantic Mapper. The Semantic Mapper is DXA's de facto model factory that converts a Generic Page or Component into a specific page or component model, by mapping fields in the generic object to properties in the specific object. The solution was to simply call method registerEntities on the SemanticMapperRegistry singleton and pass it the base package name. The logic will then scan for entity models (i.e. classes that extend DXA's  AbstractEntityModel class) in sub-packages and regis...