Box Integration Setup

The setup of the Box integration consists of the following steps. These steps can all be performed on the server where the ExtraView web application is installed, although the generation of the auth token step can be performed on any computer with Java installed. The installation and configuration steps need to be performed only once for an ExtraView application.

Create Box Application

A Box application is required for the integration to be able to connect to the Box account from ExtraView.

Go to the Box developers site and click on the Get API Key link to login with your Box account credentials. Enter a value in the Application name field and click the Create App button to create a new Box application. The new application will have an Api Key assigned, which you will need to use in the steps below.

Download Integration Software

Download the following files from the ExtraView download site. If you are not familiar with the download site, please contact the ExtraView support group.

GetBoxAuthToken.zip
BoxIntegration.class

Install Java

If you don't already have Java installed, download the latest Java runtime and install it according to the installer and instructions provided on the Java website.

Generate the Box Auth Token

You must give the new Box app access to your Box account. Extract the GetBoxAuthToken.zip file into a new directory, which will contain the following files:

NEW_DIRECTORY/
   GetBoxAuthToken.jar
   lib/

The lib directory contains additional files necessary for the integration.

Note: You must perform these steps within 10 minutes as the URL generated is only valid for a limited amount of time.

Open a Command Prompt window on your local computer and execute the following commands, replacing the uppercase strings with appropriate values for your computer:

cd NEW_DIRECTORY
JAVA_HOME/bin/java -jar GetBoxAuthToken.jar API_KEY

where NEW_DIRECTORY is the newly created directory with the contents of the GetBoxAuthToken.zip file, JAVA_HOME is the path to your Java installation directory, API_KEY is the Api Key assigned to the new Box application you created above.

Information similar to the following will display in the Command Prompt window:

1. Go to: https://www.box.com/api/1.0/auth/fadsa3124lkj098erwopiu980
2. Enter your Box credentials.
3. Press ENTER.

Load the URL listed above in Step 1 within a web browser and follow the prompts to allow access to the Box app - this is Step 2. Once you login to the Box website, then go back to the Command Prompt window and press the Enter key as Step 3 indicates. Information similar to the following will display in the Command Prompt window:

Auth Token: vxcz8fasd9sdfa3iuore8

Save the Auth Token value for the next step in the integration setup.

Note: If you encounter an error while running the commands above in the Command Prompt, or the Auth Token is not displayed, then verify that you have performed the steps exactly as instructed and have used the appropriate Box app Api Key value. If you still receive an error, then contact ExtraView Support for assistance.

Configure ExtraView

The following settings need to be added to ExtraView's Configuration.properties file with the api and auth codes used and generated in the previous section. This file is situated in the directory WEB-INF/configuration/:

BOX_API_KEY = api_key
BOX_AUTH_TOKEN = auth_token

Log into the ExtraView web application with an account that has administrative privileges and set the following Behavior Setting to the value indicated:

USER_CUSTOM_CLASSNAME = com.extraview.usercustom.BoxIntegration

Decide where all the files (attachments, document and image fields) uploaded to ExtraView are to be stored. The ATTACHMENT_REPOSITORY_OPT behavior setting controls this behavior. If all files are to be stored in the Box account instead of the ExtraView database or on the filesystem, then set the behavior setting to the following value:

ATTACHMENT_REPOSITORY_OPT = REPOSITORY

Install Custom Code

Install the BoxIntegration.class custom code file by copying it to the following location in your ExtraView installation:

<evj>/WEB-INF/classes/com/extraview/usercustom/

where <evj> is the directory where the ExtraView application is installed. (Note: You will need to create the directory tree if it doesn't exist.) If you already have a custom code file for your installation, the source files must be merged and compiled. Contact ExtraView support for help with this step.

Next, install the following files extracted from GetBoxAuthToken.zip (into NEW_DIRECTORY/lib above), to the <evj>/WEB-INF/lib/ directory of your ExtraView installation.

commons-logging-1.1.1.jar
httpclient-4.1.3.jar
httpcore-4.1.4.jar

Lastly re-start the ExtraView web application in order for the integration to take effect.