PRODUCT : Rapture Getting Started: Java


Tutorial 1: Your first Rapture Java Project 

Objectives:

  1. Use of the RIM user interface to interact with Rapture managed data 
  2. Use of a client-side JAVA app to highlight the Rapture API 

This will cover the following steps:

  1. Uploading a CSV file to a blob repo in your RIM instance
  2. Translating raw CSV data file into document data type
  3. Creating a series using document created in step #2
  4. Running a graph based report from series data in step #3 and saving as blob pdf

For the purposes of this tutorial:

  • A Java sample app is provided to allow you to exercise code and see the output in cmd line and follow along in the RIM user interface
  • It is recommended to also look at the source code
  • In this tutorial mac conventions are used for command line work
  • Windows commands are similar and an App.bat is provided

1. Create new Repos for use in this Tutorial

 The first step in this tutorial is to login to your RIM instance and create the data repositories.

Process

  

Login to your demo environment using url and credentials provided during signup

Create a Document repository using RIM's + Add Repositories interface:
  1. Set Name to tutorialDoc
  2. Set Type to Document
  3. Set Data System to MongoDB
  4. Press the OK Button
 
if not already added create a Blob repository again using RIM's + Add Repositories interface:
  1. Set Name to tutorialBlob
  2. Set Type to Blob
  3. Set Data System to MongoDB
  4. Press the OK Button
 
With the two repositories in place we are ready to move onto the next step in the tutorial: upload a CSV file.

2. Build the project

If you git cloned the project (see main page under Set up your client environment) then please build the Java project.

From the setup process you will be in the RaptureTutorials directory already and issue the gradlew build command:

$ ./gradlew build installDist

The App.exe demo program used to run various actions against the environment using Rapture's client API uses an argument pattern like this:

$ /App -s <command> -p <RIM env password>

3. Capture Data – Load a CSV

Run the test program to upload the csv file to a blob in your Rapture instance:

$ cd $RAPTURE_HOME/Intro01/Java/App/build/install/App/bin
        $ ./App -s upload -p <your RIM env password>

 

At this point we have uploaded the CSV file into the blob://tutorialBlob repository

Look at the upload() in the RaptureTutorials project to see the API calls used.

Look at the RIM interface to see the blob you uploaded.


Next up we will run code to translate the CSV file (in the blob repo) to a document (in the document repo).


4. Translate Data – Create documents from the blob

Again in the same folder $RAPTURE_HOME/Intro01/Java/App/build/install/App/bin run the Java exe with following parameters:

$ ./App -s blobToDoc -p <your RIM env password>

 

At this point the CSV (blob) data has been converted into a document type, which is in this repository: document://tutorialDoc/introDataTranslated

Look at the blobToDoc() in the RaptureTutorials project to see the API calls used.

Look at the RIM interface to see the document you created.

Next up we will look at creating series data from the document.


5. Analyze Data – Create series data from documents

Again in the same folder $RAPTURE_HOMEIntro01/Java/App/build/install/App/bin run the Java exe with following parameters:

$ ./App -s docToSeries -p <your RIM env password>

At this point a a series has been created using data from document://tutorialDoc/introDataTranslated.

Look at the docToSeries() in the RaptureTutorials project to see the API calls used.

Your data has now been stored in Rapture Information Manager in three forms: raw CSV, JSON document, and series data.

You can view the series on the RIM web interface.

Next we will create a pdf from the series repository.


6. Distribute Data – create reports from series Data

This step will produce a pdf from the series data. The pdf is saved to your local directory and also the Rapture Instance.

 

$ cd $RAPTURE_HOME/Intro01/Java/ReportApp/build/install/ReportApp/bin
$ ./ReportApp

 

Look at the ReportApp code in RaptureTutorials project.

You can look at the pdf on the RIM interface at this url blob://tutorialBlob/output.pdf


7. Reset Data (Optional)

 

Reset data

Follow these steps to reset your demo environment.

  1. Using RIM, go to Scripts/Tutorial01/tutorialCleanup.rfx and click open.
  2. Execute the script using the "Run Script" button