DXA.Java Kickstart Environment

I have just released my kickstart environment for DXA.Java, which I’ve used in a number of partner workshops and customer demos. This is a all-in-one environment including deployer service, OData preview web service, Tomcat and a ready configured DXA web application. This blog post will describe how you setup the DXA.Java kickstart environment.

The kickstart environment is a bundled “all-in-one” environment containing the following:
  • Tomcat 8.x
  • DXA.Java web application with all needed configuration
  • OData Preview web service
  • SDL Tridion Deployer service
  • Hypersonic in-memory broker database  
Note: SDL does not support Hypersonic as content delivery database, so do not use this in a production setup. It should only be used for development and test purposes. 
  
The kickstart environment is right now designed for the SDL Tridion 2013 SP1 content delivery architecture. When DXA 1.3 comes out with support for SDL Web 8 I will try to upgrade this environment to support that as well.
  
The kickstart environment is available here: https://github.com/NiclasCedermalm/dxa-kickstart 

Before you start

The following you need to have available in your environment:
  • A vanilla SDL Tridion 2013 SP1 HR1 instance (is not needed to be on the same machine)
  • Java 7/8
  • Java IDE such as IntelliJ IDEA, Eclipse, Netbeans etc
  • Maven 3.x
  • Git

Setup 

To setup the kickstart environment you need to do the below described simple steps. Each step is composed a of a serie of automatic actions such as cloning GIT repository, install JARs into local Maven repository, assembly a Tomcat instance etc. I have also recorded a short video of the steps you need to take here: https://dl.dropboxusercontent.com/u/4726100/DXA-Kickstart-Setup.mp4 

Step 1: Prepare environment

Create a DXA directory somewhere on your computer. In that directory create a 'code'-directory.  Clone the dxa-kickstart repository in your [dxa.home]/code directory by doing the following: 
dxa/code> git clone https://github.com/NiclasCedermalm/dxa-kickstart
Copy a valid content delivery license (cd_license.xml) so it is easy accessible, for example in your newly created DXA directory. Copy the env.properties.sample (found in the root of the kickstart project) to env.properties. Open the file in an editor and edit the following properties:
  • 'dxa.home' - path to your created DXA directory
  • 'dxa.licensePath' - path to your cd_license.xml file

Step 2: Install DXA code

Install all DXA source code + needed dependencies by doing the following in the dxa-kickstart directory:

dxa/code/dxa-kickstart> mvn install -Pinstall-code

Right now the build system is configured to use my forks of DXA and DXA modules (at https://github.com/NiclasCedermalm) as there a number of pending bugs. As soon R&D has included those bug corrections in the official SDL Github account, I will release an update of this build setup.

Step 3: Install DXA publications

Copy the 'dxa-dist\import\DXA Application Data Definition.xml' file and paste it to: 
%TRIDION_HOME%\config\ImportExport\ApplicationData. Run the following in PowerShell directly either in the dxa-dist/import-directory or on the SDL Tridion host (if you are using a non-Windows laptop):

dxa/dxa-dist/import>  .\import.ps1 -importType all-publications -cmsUrl http://[TRIDION_HOST]

Run the script again to install the DXA standard roles:

dxa/dxa-dist/import> .\import.ps1 –importType rights-permissions –cmsUrl http://[TRIDION_HOST]

Verify so the DXA publications have been created in Tridion. 

Step 4: Install Tomcat

Modify the env.properties file and update the publication ID property (dxa.publicationId) to match the newly created publication '400 Example Site'. Run the following command to install a complete DXA.Java distribution including Tomcat and embedded Broker DB:

dxa/code/dxa-kickstart> mvn install -Ptomcat

Start the Tomcat server by go into the 'dxa-tomcat\bin' directory and start 'startup.bat' alt. 'startup.sh'. Wait for the server start up. Verify the installation by go the following URL in a browser: http://localhost:8080/cd_upload/httpupload

Step 5: Publish DXA Example Site

Create a new publication target in Tridion & publish out the DXA example site using the following instructions:http://docs.sdl.com/LiveContent/content/en-US/SDL%20DXA-v2/GUID-267CDBBF-723A-4633-8C17-9F02EAE1EC96. Use the following data when setting up the publication target:
  • HTTP destination: http://[DXA_HOST]:8080/cd_upload/httpupload

  • Session Preview - Content Delivery Endpoint URL: 
http://[DXA_HOST]:8080/cd_preview_webservice/ws/odata.svc

  • Add 'http://[DXA_HOST]:8080' to Session Preview - Website URLs
See below for example of publication target setup:
Go to http://localhost:8080 to verify that your new DXA site is operational. If everything went ok you should see the following:
In the DXA webapp there is an admin controller (not part of the standard DXA framework) that right now does two things:

  • /admin/refresh - Refresh the DXA configuration and clears the cache
  • /admin/adf-claims - Displays all current ADF claims

Setup DXA development environment

To setup DXA development environment in an IDE such as IntelliJ IDEA or Eclipse you can do the following:

  1. Import the dxa-web-application-java (optional) & dxa-kickstart maven projects into the IDE
  2. Create a Tomcat configuration and point to the Tomcat instance in the 'dxa-tomcat'-directory. You do not need to specify any specific JVM options as they already are pre-set in the Tomcat installation (setenv.sh/setenv.bat).
  3. Add the dxa-webapp to the Tomcat configuration
  4. Run the server from within the IDE

There is an example module included in the kickstart project, which you can take a look on if you are interested. I will describe this one in more detail shortly in a next-coming blog post.

I hope you find the kickstart project useful and help you to get started on using DXA.Java.