DoctorPivot Configuration

Configuring

The following files are key to the configuration of DoctorPivot:

  • Java Server file
  • Java Configuration file

Add the following DoctorPivot Web App code to your project:

<plugin>
   <groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-dependency-plugin</artifactId>
   <version>2.2</version>
   <executions>
       <execution>
           <id>unpack-doctorpivot-web-app</id>
           <phase>package</phase>
           <goals>
               <goal>unpack-dependencies</goal>
           </goals>
           <configuration>
               <includeGroupIds>com.activeviam.tools</includeGroupIds>
               <includeArtifactIds>doctorpivot-web-app</includeArtifactIds>
               <outputDirectory>generated/</outputDirectory>
           </configuration>
       </execution>
   </executions>
</plugin>
<plugin>
   <artifactId>maven-antrun-plugin</artifactId>
   <version>1.8</version>
   <executions>
       <execution>
           <phase>package</phase>
           <configuration>
               <target>
                   <echo file="generated/doctorpivot-web-app/env.js">
                       window.env = {
                       serverUrl: {YOUR_SERVER_URL_HERE},
                       javadocUrl: {YOUR_JAVADOC_URL_HERE},
                       javadocVersion: {YOUR_JAVADOC_VERSION_HERE}
                       };
                   </echo>
               </target>
           </configuration>
           <goals>
               <goal>run</goal>
           </goals>
       </execution>
   </executions>
</plugin>

Java Server file

Set the location of DoctorPivot Web App in your project, and the URL used to access it. You can change the access URL here.

public static final String DOCTORPIVOT_DIRECTORY = "./generated/doctorpivot-web-app";
public static final String DOCTORPIVOT_PATH = "/doctorpivot";
Within the createServer function, add the following block:
ResourceHandler doctorPivotResources;
if (port != DEFAULT_PORT) {
    // modify env.js file on the fly, to change the port
    doctorPivotResources = new ActiveUIResourceHandler(port);
} else {
    doctorPivotResources = new ResourceHandler();
}
doctorPivotResources.setDirectoriesListed(true);
doctorPivotResources.setResourceBase(DOCTORPIVOT_DIRECTORY);
ContextHandler doctorPivotContextHandler = new ContextHandler();
doctorPivotContextHandler.setContextPath(DOCTORPIVOT_PATH);
doctorPivotContextHandler.setHandler(doctorPivotResources);
GzipHandler doctorPivotGzipHandler = new GzipHandler();
doctorPivotGzipHandler.setHandler(staticContextHandler);
handlers.addHandler(doctorPivotContextHandler);

Java Configuration file

Set the following:

import com.activeviam.tools.doctorpivot.config.DoctorPivotConfig;

and

@Import(value = {
      ...
      DoctorPivotConfig.class
      ...
})

Running and accessing DoctorPivot

note

Ignore yourDOCTORPIVOT_DIRECTORYin version control, as this folder is generated upon installation.

To launch DoctorPivot, run mvn clean install