Tutorial 1: Your first Rapture Java Project
Objectives:
- Use of the RIM user interface to interact with Rapture managed data
- Use of a client-side JAVA app to highlight the Rapture API
This will cover the following steps:
- Uploading a CSV file to a blob repo in your RIM instance
- Translating raw CSV data file into document data type
- Creating a series using document created in step #2
- 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
Before beginning this demonstration of Rapture it is expected that your environment satisfies the following pre-requisites
- Java 7 or 8 JRE is installed. At a terminal run java -version to check
- If building the Java code on mac
- Follow this setup guide for git
- brew install gradle
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:
| ||
if not already added create a Blob repository again using RIM's + Add Repositories interface:
| ||
With the two repositories in place we are ready to move onto the next step in the tutorial: upload a CSV file. |
Create Repos
To Add a repo simply select "+ ADD" under REPOSITORIES.
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>
Windows users
a batch file is also provided: App.bat
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).
In this step
Run upload script to load CSV into Blob
View Blob
Windows users
A batch file is provided: App.bat
Use %RAPTURE_HOME% if needed
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.
In this step
Run translate step to create Doc
View Doc
Windows users
A batch file is provided: App.bat
Use %RAPTURE_HOME% if needed
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.
In this step
Run analyze step to create Series
View Series
Windows users
A batch file is provided: App.bat
Use %RAPTURE_HOME% if needed
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
In this step
Run report step to create PDF
View PDF and Blob
Windows users
A batch file is provided: Report.bat
Use %RAPTURE_HOME% if needed
7. Reset Data (Optional)
Reset data
Follow these steps to reset your demo environment.
- Using RIM, go to Scripts/Tutorial01/tutorialCleanup.rfx and click open.
- Execute the script using the "Run Script" button