1	JasperJPivot source code build and deployment	1
1.1	Prepare build environment	1
1.2	Unpack JasperJPivot source	2
1.3	Build JasperJPivot component	2
1.4	Build outputs	3
1.4.1	Jar files	3
1.4.2	Application Server files (e.g., Tomcat)	3
1.5	Sample build in Windows	4
1.6	Troubleshooting	4
1.6.1	Directory not found	4

1	 JasperJPivot source code build and deployment

This section describes the source code build and deployment steps of the JasperJPivot 
component for developers who want to make changes and extensions. 

JasperJPivot is adapted from the JPivot open source project. It provides the Web GUI for the 
JasperAnalysis of the JasperServer. 

The JasperJPivot component includes the following jars:

- jpivot-2.0.1.jar
- wcf-2.0.1.jar
- tbutils-2.0.1-wcf.jar

where 2.0.1 is the JasperServer version.

The JasperJPivot component is built using Ant with a number of 3rd party jars. The main steps 
are:

- Prepare build environment
- Unpack JasperJPivot source
- Build JasperJPivot component
- Deploy JasperJPivot component

1.1	 Prepare build environment

The JasperJPivot source code can be built under either Java 1.4 or Java 1.5. Like JasperServer, 
the JasperJPivot source code standard is to not use any of the new language features found in 
Java 1.5 in order to support customers who run within a Java 1.4 environment.

If you have not install java, follow the download and installation instructions found at Sun's Java 
web site:
           http://java.sum.com/

While the JasperServer is build with Maven, the JasperJPivot is build with Ant, which is derived 
from the original JPivot open source project. Information on Ant can be found on the Ant site.

           http://ant.apache.org/

Finally, make sure JasperServer source is downloaded and successfully built. 

1.2	 Unpack JasperJPivot source

The JasperJPivot source is distributed in a zip file. For version 2.0.1, as an example, the zip file is 
called jpivot-2.0.1-src.zip. As in the original JPivot project, It contains the following sub-
directories:

- jpivot
- jpivot_repository
- mondrian-schema
- wcf

Simply unpack the directory in root directory, such as c:\jaspersoft\jasperserver\jasperserver-
jpivot.

1.3	 Build JasperJPivot component

The build process consists of building two sub-components: wcf and jpivot. The results of the 
build will serve as the GUI component of JasperAnalysis in the JasperServer. First, configure the 
build environment by changing the following properties in build.properties:

- js.repo.home, e.g., c:/jaspersoft/jasperserver-repo
- js.repository.home, e.g, c:/Docume~1/jshih/.m2/repository

where js.repo.home defines the location of JasperServer repository and js.repository.home 
defines the location of Maven repository.

Then, invoke the build with Ant using the build.xml from the command line for each sub-
component, for example: 

C:\>cd c:\jaspersoft\jasperserver\jasperserver-jpivot\wcf
C:\jaspersoft\jasperserver\jasperserver-jpivot\wcf>ant clean build
C:\jaspersoft\jasperserver\jasperserver-jpivot\wcf>cd ..\jpivot
C:\jaspersoft\jasperserver\jasperserver-jpivot\jpivot>ant clean build

where c:\jaspersoft\jasperserver\jasperserver-jpivot is the root directory of the JasperJPivot 
source code.

1.4	 Build outputs

Once the build is completed successfully, the output can be found in the 
c:\jaspersoft\jasperserver\jasperserver-jpivot\jpivot\dist directory.The outputs consists of jar files 
and application server specific files. 

1.4.1	 Jar files

The following jar files should be placed in the JasperServer repository directory. For example, if 
the JasperServer repository is located at c:\jaspersoft\jasperserver-repo, the target directories 
are:

- c:\jaspersoft\jasperserver-repo\com\jaspersoft\jasperserver\jpivot-ui\jpivot\2.0.1\jpivot.jar
- c:\jaspersoft\jasperserver-repo\com\jaspersoft\jasperserver\jpivot-ui\wcf\2.0.1\wcf.jar
- c:\jaspersoft\jasperserver-repo\com\jaspersoft\jasperserver\jpivot-ui\tbutils-wcf\2.0.1\tbutils-
wcf.jar

where 2.0.1 is the JasperServer version.

1.4.2	 Application Server files (e.g., Tomcat)

Copy the following application server files to corresponding location in the JasperServer. For 
example, if the JasperJPivot build directory is c:\jaspersoft\jasperserver\jasperserver-jpivot, copy 
c:\jaspersoft\jasperserver\jasperserver-jpivot\jpivot\dist\web\jpivot\*.* to 
c:\jaspersoft\jasperserver\jasperserver-war\src\main\webapp\jpivot:

- c:\jaspersoft\jasperserver\jasperserver-jpivot\jpivot\dist\web\jpivot\*.*
- c:\jaspersoft\jasperserver\jasperserver-jpivot\jpivot\dist\web\wcf\*.*
- c:\jaspersoft\jasperserver\jasperserver-jpivot\jpivot\dist\web\WEB-INF\jpivot\*.*
- c:\jaspersoft\jasperserver\jasperserver-jpivot\jpivot\dist\web\WEB-INF\wcf\*.*

1.5	 Sample build in Windows

- Download and install java to c:\Java\jdk1.5.0_06
- set JAVA_HOME=c:\Java\jdk1.5.0_06 
- Download and install ant to c:\ant\apache-ant-1.6.5
- set ANT_HOME=c:\ant\apache-ant-1.6.5 
- Add C:\ant\apache-ant-1.6.5\bin to PATH 
- Download and unzip JasperServer source (e.g., jasperserver-2.0.1-src.zip) to c:\ 
jaspersoft\jasperserver. The target directory should contain c:\jaspersoft\jasperserver and 
c:\jaspersoft\jasperserver-repo directories (see the JasperServer build doc for building 
JasperServer)
- md c:\jaspersoft\jasperserver\jasperserver-jpivot 
- Download and unzip Jasperserver JPivot source (e.g., jasperjpivot-2.0.1-src.zip) to 
c:\jaspersoft\jasperserver\jasperserver-jpivot
- cd c:\jaspersoft\jasperserver\jasperserver-jpivot\wcf
- Configure build.properties by setting the following properties, e.g.,:
  -- js.repo.home=c:/jaspersoft/jasperserver-repo
  -- js.repository.home=c:/Docume~1/jshih/.m2/repository (This is the Maven repository used by 
JasperServer)
- ant clean build 
- cd c:\jaspersoft\jasperserver\jasperserver-jpivot\jpivot
- Configure build.properties by setting the following properties:
  -- js.repo.home=c:/jaspersoft/jasperserver-repo 
  -- js.repository.home=c:/Docume~1/jshih/.m2/repository
- ant clean build
- Check and see if the jar files are created in c:\jaspersoft\jasperserver\jasperserver-
jpivot\jpivot\dist\web\WEB-INF\lib
- Copy the jar files from c:\jaspersoft\jasperserver\jasperserver-jpivot\jpivot\dist\web\WEB-INF\lib 
to corresponding directories in c:\jaspersoft\jasperserver-repo:

1.6	 Troubleshooting

1.6.1	 Directory not found

Symptom:

compile:
    [javac] Compiling 322 source files to c:\jaspersoft\jasperserver\jasperserver-
jpivot\wcf\build\web\WEB-INF\classes

BUILD FAILED
c:\jaspersoft\jasperserver\jasperserver-jpivot\wcf\build.xml:180: 
c:\jaspersoft\jasperserver\jasperserver-jpivot\wcf\..\jpivot_repository\jakarta-tomcat-
4.1.34\common\endorsed not found.

Cause:

The c:\jaspersoft\jasperserver\jasperserver-jpivot\wcf\jpivot_repository\jakarta-tomcat-
4.1.34\common\endorsed directory does not exist or has the wrong name

Resolution:

Make sure the directory is unpacked to the specific location.
