Integrating with Box
Adding Box Platform Integration will allow project requests to be sent to the cloud. This is a great way to exchange translation files with vendors. When a translation request is made, XLIFFs will be sent to a Box folder where translation vendors can start their process. When they’ve completed the translations, mojito can import the translated files from Box.
Sign up for a free Box Developer Account
Sign up here.
In order to add Box integration, you must first have a Box Developer account. You’ll use the Box Developer account to get an API key by creating a new Application. mojito will use this API key to interact with Box on your behalf. A Free account gives access to 1 Application, 25 App Users, 50 GB Storage. This should be plenty for most usages. For more info about different plans, click here.
Create a new Application
Click here to create one. An Application is the primary way your API to identify itself. After you create the Application, you will be in the Edit Application page.
Configure the Application for Box Platform
mojito will use the App User to interact with the Box Content API. It will do things like create folders, upload translation requests, download translated content. By default, a mojito App User is created inside the enterprise, for which you have granted access to your Application.
This is done by the following steps:
- Set up 2-factor authentication for your Developer Account.
- Create a private/public key pair (See note below. Take note of the Public Key ID after adding it, you’ll need it later.
- Enable App User for your Application. It is located under OAuth2 Parameters > User Type in the Edit Application page. App User is used for the OAuth 2 of the Box Content API. You don’t need to change the Scopes.
- Choose an enterprise to grant access to your Application. Log into the Enterprise Account (ie. your Developer Account) and navigate to https://app.box.com/master/settings/openbox. Under Custom Applications, you will be able to authorize.
For more detailed info about configuring Box Platform, click here.
Note About the Public/Private Key
To authenticate the API key, you must create public/private key pair. This authentication is called App Auth (click here for more info). App Auth allows your application to request OAuth 2.0 access tokens necessary to make calls to the Box Content API. You would have created them in Step 2 above. Box will store the public key, and you will give mojito the private key.
For instructions on how to create the key pair: See here.
Note that Box documentation shows steps to create the key with the following:
openssl genrsa -aes256 -out private_key.pem 2048
.If Oracle JDK is used to run mojito, this will require JCE to be installed (for JDK7 see here). Otherwise, an exception like the folllowing will be thrown:
Caused by: java.security.InvalidKeyException: Illegal key size
.An alternative is to generate the key with the following:
openssl genrsa -aes128 -out private_key.pem 2048
To get the public key from the
pem
file:openssl rsa -aes128 -in private_key.pem -pubout > public_key
Fill in the Required Box Client Configurations in mojito
Navigate to /settings
and fill in the form.
Client Id
: This is provided in the Edit Application page on Box (https://app.box.com/developers/services/edit/<###>)Client Secret
: This is provided in the Edit Application page on Box (https://app.box.com/developers/services/edit/<###>)Enterprise Id
: This is the enterprise for which access was granted for when you were configuring the Application. You can get the Enterprise ID at https://app.box.com/master/settings/accountPublic Key Id
: This is provided after setting up App AuthPrivate Key
: This is the key that corresponds to the Public Key that was provided to Box
Bootstrapping Mojito Folder Structure
By default, mojito will create the skeleton folder structure it will use after the configurations are provided. A Mojito
folder containing the folder structure will be created in the root folder of the App User account.
Sharing the Mojito Folder with Vendors
Most of the time, the content of this folder will be used to exchange translation project requests / files with vendors. At this time, mojito does not have vendor management features.
To customize sharing of this folder to individuals, log into the Box Developer Account (or the Enterprise Admin user, for which you provided the Enterprise ID), navigate to the Admin Console (https://app.box.com/master), and follow instructions here to share with collaborators.
Configuration in Properties
By default mojito exports to the file system. To enable exporting to Box the following property needs to be set
l10n.dropExporter.type=BOX
For more information about custom configuration, see Configurations#box-platform-integration