On this page:

9.1Starter Project


The cdr-interceptor-starterproject contains a complete example Maven-based Java project to define an interceptor that can be imported into Smile CDR. It is available for download at the following links:

9.1.1Using the Starter Project


To use the starter project:

  • Download the project using the link above, and extract the archive locally.

  • Edit the pom.xml file. The <groupId>, <artifactId>, and <name> tags all contain placeholders. You can leave the examples if you are just experimenting, but it is recommended to replace these with something more useful before committing your code to source control.

  • Open the project in your favorite IDE. This project is designed to use Apache Maven for building, so it can be imported natively as a Maven project in Eclipse and IntelliJ IDEA.

  • The project contains a number of example interceptors. Pick the one you want to start with, or create your own from scratch. You may want to move the class to a more sensible package name for your organization.

  • Build the project by executing the following command:

mvn clean install
  • Maven will create a JAR containing your interceptor classes in the target/ directory. The exact name of the JAR file will vary depending on the groupId and artifactId you picked, but by default it will be called: cdr-interceptor-starterproject-[version].jar. Copy this file to the customerlib/ directory in your Smile CDR installation and restart Smile CDR.

  • Edit the module configuration for the relevant module to add the fully qualified class name for your interceptor (e.g. com.smilecdr.demo.fhirstorage.ExampleAttributeEnhancingInterceptor) to the Interceptor Bean Types property in your module configuration, and restart the module.